AI
Researchers Develop Methods to Detect Copyrighted Code in AI Models
A new benchmark and evaluation framework examines how well detection techniques can identify proprietary code snippets in language models trained on code.
Researchers have completed the first systematic evaluation of training data detection (TDD) techniques applied to code-generating AI models, addressing a growing concern about whether these tools inadvertently memorize and reproduce proprietary or sensitive code from their training sets.
The Problem#
Code large language models (CodeLLMs) have become widespread in software development, but they occasionally output code that closely matches proprietary or sensitive snippets from their training data. This raises questions about compliance with data usage rights and creates potential risks to privacy and intellectual property. Despite significant advances in detecting memorized training data within general-purpose language models, the effectiveness of these techniques on source code has remained largely unexplored—a critical gap given that code has fundamentally different characteristics than natural language.
The Study#
To fill this gap, a team of researchers conducted a comprehensive empirical assessment of seven state-of-the-art TDD methods across eight different CodeLLMs. They introduced CodeSnitch, a new function-level benchmark dataset containing 9,000 code samples across three programming languages, with each sample explicitly labeled as either included in or excluded from model training. This dataset enables standardized testing of detection methods in controlled conditions.
The researchers also designed several mutation strategies to stress-test how robust these methods are when code is modified in realistic ways. Their evaluation framework builds on the well-established Type-1 to Type-4 code clone detection taxonomy, allowing them to assess performance across different degrees of code transformation.
Why It Matters#
The findings provide the first systematic picture of how current detection techniques perform on code data—highlighting their strengths and limitations. As CodeLLMs become more prevalent in development workflows, understanding whether they can be reliably monitored for unauthorized training data reproduction will be essential for deploying them responsibly and maintaining trust with the software development community.

