Syntax-Aware Detection of Training Data Contamination in Code LLMs

Despite rapid advances in Code LLMs, their training datasets are often opaque due to proprietary and competitive concerns. Since many evaluation benchmarks are open-source and widely available online, models may unintentionally train on them, leading to data contamination that compromises evaluation validity. Reliable techniques for detecting whether a code snippet appears in a model’s training data are therefore essential. Compared with natural language, code contamination detection presents two unique challenges. First, code tokens from different syntactic categories contribute unequally to contamination signals, making uniform token treatment ineffective. Second, models trained on semantically equivalent code variants can evade detectors based solely on text matching. To address these challenges, we propose a syntax-aware framework that explicitly models token-type contributions. With a lightweight supervised detector trained on few labels, it captures contamination signals efficiently. Experiments across 8 Code LLMs, 2 languages, and 4 code transformations show absolute AUC gains of 8–10% for pretraining data detection and 15–20% for fine-tuning data detection, with AUC exceeding 90% on most fine-tuned tasks. Our work demonstrates that syntax-aware modeling is essential for trustworthy Code LLM evaluation.

Link
https://doi.org/10.48448/mp3z-0t25
Found by
DataCite
Authors
Association for Computational Linguistics 2026, Long Cheng, Huawei Li, Xiaowei Li, Cheng Liu, Jiazheng Zhang
Organizations
North China Electric Power University, Institute of Computing Technology, Chinese Academy of Sciences
Categories
benchmark, evaluation, dataset, data_quality
Published
2026-11-20
Last seen by the radar
2026-11-21
Citations
0
Downloads
0
Views
0
Radar score
61.85 / 100 (how it is scored)
Why it scored so
Matched: benchmark, data contamination, dataset, evaluat, training data; Primary record: DataCite
Related links
https://underline.io/lecture/162874-syntax-aware-detection-of-training-data-contamination-in-code-llms
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by DataCite