Large language models are increasingly used for code generation, creating a need for methods that distinguish purely human-written code from AI-involved code. A new arXiv preprint (arXiv:2610.27863) addresses this with a multi-granularity approach to detecting and localising AI involvement.
The paper, titled "From Tokens to Files", defines an AI-involved file as one in which any part, however small, was generated or substantially modified by an AI. Rather than classifying only at the file level, the proposed method spans granularities from individual tokens up to whole files, aiming to locate AI-written portions within otherwise human code.
The work couples detection — identifying that AI involvement exists — with localisation across these granularities, in response to the growing reliance on LLMs for writing and editing code. The abstract presents this as a necessary step toward handling mixed human/AI authorship in codebases.