ResearchResearch paperLarge Language Models · Safety & Alignment1 source · Oct 20, 2026

From Tokens to Files: Multi-Granularity Detection and Localization of AI-Involved Code

We propose a framework that models AI authorship at the token level and predicts at the line, block, and file levels.

Key points

  • The increasing use of large language models for code generation calls for methods that distinguish purely human-written code from AI-involved code: files in which any part, however small, was generated or substantially modified by a model.
  • Beyond flagging such files, we aim to localize the lines or blocks attributable to AI.
  • Existing approaches compress a file into a single score, from surface stylistic features or a global code representation, which averages away the evidence when only a few blocks are AI-involved.
  • A frozen code language model is equipped with two low-rank adapters, trained separately on machine-written and human-written files; their per-token log-likelihood ratio provides local evidence of AI authorship.

Sources (1)

  • [1]From Tokens to Files: Multi-Granularity Detection and Localization of AI-Involved Code
    arXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 20, 08:45 AM
    We propose a framework that models AI authorship at the token level and predicts at the line, block, and file levels.
    The increasing use of large language models for code generation calls for methods that distinguish purely human-written code from AI-involved code: files in which any part, however small, was generated or substantially modified by a model.

Extractive summary: sentences quoted from the sources.

Before this

  1. Oct 20, 2026TeCoP: Accelerating Diffusion Large Language Model Decoding via Tentative Context Pipelining
  2. Oct 20, 2026Large Flow Language Models
  3. Oct 19, 2026Profile-DP: Differential Privacy for User-Controlled Profile Release in Personalized LLM Inference
  4. Oct 19, 2026Push-based KV transfer to improve TTFT and TPOT for disaggregated inference in vLLM
  5. Oct 19, 2026NVIDIA Cosmos3-H-Dreams: Bringing Clinical Surgery to Life Through Generative Simulation
  6. Oct 18, 2026GPT-2 KV cache from scratch: correctness, latency, and memory measurements [P]

Related