cs.SEJul 23, 2025

Are AI Coders Snitches? An Empirical Study of Pretraining Data Detection on Code Large Language Models

Authors: Tianlin Li, Yunxiang Wei, Zhiming Li, Aishan Liu, Qing Guo, Xianglong Liu, Dongning Sun, Yang Liu

Organizations: Nanyang Technological University Singapore · Zhejiang University China · Peng Cheng Laboratory China · Beihang University China · Nankai University China

Abstract

Recent advances in code large language models (CodeLLMs) have made them indispensable tools in modern software engineering. However, these models occasionally produce outputs that contain proprietary or sensitive code snippets, raising concerns about potential non-compliant use of training data, and posing risks to privacy and intellectual property. To ensure responsible and compliant deployment of CodeLLMs, training data detection (TDD) has become a critical task. While recent TDD methods have shown promise in natural language settings, their effectiveness on code data remains largely underexplored. This gap is particularly important given code's structured syntax and distinct similarity criteria compared to natural language. To address this, we conduct a comprehensive empirical study of seven state-of-the-art TDD methods on source code data, evaluating their performance across eight CodeLLMs. To support this evaluation, we introduce CodeSnitch, a function-level benchmark dataset comprising 9,000 code samples in three programming languages, each explicitly labeled as either included or excluded from CodeLLM training. Beyond evaluation on the original CodeSnitch, we design targeted mutation strategies to test the robustness of TDD methods under three distinct settings. These mutation strategies are grounded in the well-established Type-1 to Type-4 code clone detection taxonomy. Our study provides a systematic assessment of current TDD techniques for code and offers insights to guide the development of more effective and robust detection methods in the future.

Figures & tables

Explore similar work

CardsList
  1. SrDetection: A Self-Referential Framework for Data Leakage Detection in Code Large Language Models

    Jun 29, 2026Shuaimin Li, Liyang Fan, Zeyang Li +9Data LeakageSelf-Referential Bias

  2. LLMSniffer: Detecting LLM-Generated Code via GraphCodeBERT and Supervised Contrastive Learning

    Apr 17, 2026Mahir Labib Dihan, Abir MuhtasimCode QualityMachine-Generated Text Detection

  3. Efficient and Scalable Provenance Tracking for LLM-Generated Code Snippets

    May 27, 2026Andrea Gurioli, Davide D'Ascenzo, Federico Pennino +2Code QualityCode Generation