AI
Study challenges assumption that training data leaks always inflate code AI model performance
A systematic examination of how data contamination affects pretrained and large language models on code tasks reveals the relationship is more nuanced than previously believed.
The field of software engineering has come to rely heavily on machine learning models for tasks like code generation and translation. However, a growing concern looms over how these systems are evaluated: when training data accidentally includes test samples, does that artificially inflate reported performance gains?
A new empirical study from arXiv challenges the prevailing wisdom that data contamination automatically leads to inflated benchmark results. Researchers examined both traditional pretrained models (like RoBERTa and GPT-2) and modern large language models (LLaMA and StarCoder) across major code intelligence tasks including translation, generation, and summarization.
Contamination scenarios matter#
The researchers categorized data leakage into four distinct types reflecting real-world conditions:
- Input-only contamination: test inputs appear in training data but outputs do not
- Output-only contamination: test outputs are in training data but inputs are not
- Unpaired contamination: test data exists in training data but in different pairings
- Paired contamination: exact test samples appear unchanged in training data
Mixed findings across model types#
The results diverge sharply depending on which models are studied. For traditional pretrained language models operating under a full pipeline (pre-training, fine-tuning, and inference), even deliberately injected paired contamination produces no significant performance inflation. However, this protection vanishes when using only direct inference or applying minimal fine-tuning to smaller datasets.
Large language models tell a different story. These models prove substantially vulnerable to paired contamination when evaluated under pre-training and inference workflows. Other contamination patterns—input-only, output-only, and unpaired scenarios—showed no meaningful impact on either model category.
Implications for evaluation#
These findings suggest that the relationship between data leakage and benchmark validity is more complex than assumed. Researchers stress that contamination assessment must account for deployment paradigms and model architecture, rather than treating all leakage scenarios uniformly. The work offers practical guidance for designing fair evaluation frameworks as code intelligence systems become more central to software development pipelines.

