SrDetection: A Self-Referential Framework for Data Leakage Detection in Code Large Language Models
Shuaimin Li, Liyang Fan, Zeyang li, Zhuoyue Wan, Yufang Lin, Shiwen Ni, Feiteng Fang, Hamid Alinejad-Rokny, Yuanfeng Song, Kun Jing, Chen Jason Zhang, Min Yang
Abstract
Evaluating code large language models (Code LLMs) requires reliable detection of data leakage, where benchmark performance is artificially inflated by exposure to benchmark data during pre-training. Existing approaches either assume access to proprietary training corpora, rely on brittle heuristics such as timestamp filtering, or use external reference sets with manually tuned, non-generalizable thresholds. To address these limitations, we introduce SrDetection, a unified self-referential leakage detection framework for both gray-box (access to model logits) and black-box (access to model outputs) settings. SrDetection generates semantically equivalent variants of a benchmark sample and detects leakage by contrasting the model’s behavior on the original versus its variants, flagging cases where the original is disproportionately easier for the model. We further design a controlled leakage detection testbed and evaluate SrDetection in this environment. Across different models and training stages, SrDetection improves average F1 by 21.52 points in the gray-box setting and 14.46 points in the black-box setting over strong baselines, demonstrating robust, threshold-independent leakage detection. Finally, a gray-box study of 15 widely used Code LLMs on four popular benchmarks reveals benchmark-specific leakage patterns beyond prior overlap-based analyses[Source code and data are available at <https://github.com/SMinL/SrDetectionCode>].- Anthology ID:
- 2026.findings-acl.252
- Volume:
- Findings of the Association for Computational Linguistics: ACL 2026
- Month:
- July
- Year:
- 2026
- Address:
- San Diego, California, United States
- Editors:
- Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
- Venue:
- Findings
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 5117–5129
- Language:
- URL:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.252/
- DOI:
- Cite (ACL):
- Shuaimin Li, Liyang Fan, Zeyang li, Zhuoyue Wan, Yufang Lin, Shiwen Ni, Feiteng Fang, Hamid Alinejad-Rokny, Yuanfeng Song, Kun Jing, Chen Jason Zhang, and Min Yang. 2026. SrDetection: A Self-Referential Framework for Data Leakage Detection in Code Large Language Models. In Findings of the Association for Computational Linguistics: ACL 2026, pages 5117–5129, San Diego, California, United States. Association for Computational Linguistics.
- Cite (Informal):
- SrDetection: A Self-Referential Framework for Data Leakage Detection in Code Large Language Models (Li et al., Findings 2026)
- PDF:
- https://preview.aclanthology.org/ingest-acl/2026.findings-acl.252.pdf