Detecting Data Contamination in LLMs via In-Context Learning
Not on the map. Why?
Abstract (arXiv)
We present Contamination Detection via Context (CoDeC), a practical and accurate method to detect and quantify training data contamination in large language models. CoDeC distinguishes between data memorized during training and data outside the training distribution by measuring how in-context learning affects model performance. We find that in-context examples typically boost confidence for unseen datasets but may reduce it when the dataset was part of training, due to disrupted memorization patterns. Experiments show that CoDeC produces interpretable contamination scores that clearly separate seen and unseen datasets, and reveals strong evidence of memorization in open-weight models with undisclosed training corpora. The method is simple, automated, and both model- and dataset-agnostic, making it easy to integrate with benchmark evaluations.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 36 of its 45 references that are in the map. First posted on arXiv 30 Oct 2025.
Builds on
36 of 45 references.
References · 36
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2025Qwen3 Technical Reportcited by 8,820
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,281
- 2020Extracting Training Data from Large Language Modelscited by 2,189
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
- 2022Transformers learn in-context by gradient descentcited by 732
- 2023DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvaturecited by 726
- 2024OLMo: Accelerating the Science of Language Modelscited by 613
- 2021Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpuscited by 492
24 more
- 2024Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Researchcited by 483
- 2023Detecting Pretraining Data from Large Language Modelscited by 387
- 2023Membership Inference Attacks against Language Models via Neighbourhood Comparisoncited by 258
- 2023Proving Test Set Contamination in Black Box Language Modelscited by 230
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023Rethinking Benchmark and Contamination for Language Models with Rephrased Samplescited by 195
- 2024Do Membership Inference Attacks Work on Large Language Models?cited by 195
- 2023Time Travel in LLMs: Tracing Data Contamination in Large Language Modelscited by 177
- 2019Certified Robustness to Adversarial Word Substitutionscited by 168
- 2024Nemotron-CC: Transforming Common Crawl into a Refined Long-Horizon Pretraining Datasetcited by 160
- 2023Investigating Data Contamination in Modern Benchmarks for Large Language Modelscited by 138
- 2023Few-shot Fine-tuning vs. In-context Learning: A Fair Comparison and Evaluationcited by 136
- 2024LLM Dataset Inference: Did you train on my dataset?cited by 110
- 2024Min-K%++: Improved Baseline for Detecting Pre-Training Data from Large Language Modelscited by 103
- 2025Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Modelscited by 100
- 2023SILO Language Models: Isolating Legal Risk In a Nonparametric Datastorecited by 71
- 2024Artifacts or Abduction: How Do LLMs Answer Multiple-Choice Questions Without the Question?cited by 71
- 2020Leakage of Dataset Properties in Multi-Party Machine Learningcited by 47
- 2024Evaluation data contamination in LLMs: how do we measure it and (when) does it matter?cited by 32
- 2021Privacy Regularization: Joint Privacy-Utility Optimization in Language Modelscited by 30
- 2024Does Data Contamination Detection Work (Well) for LLMs? A Survey and Evaluation on Detection Assumptionscited by 26
- 2023Interaction-level Membership Inference Attack Against Federated Recommender Systemscited by 25
- 2025Beyond Next Token Probabilities: Learnable, Fast Detection of Hallucinations and Data Contamination on LLM Output Distributionscited by 12
- 2025MixtureVitae: Open Web-Scale Pretraining Dataset With High Quality Instruction and Reasoning Data Built from Permissive-First Text Sourcescited by 3
Built on by
Citing papers per year: 2026: 8.
8 papers.
- 2026Membership Inference Attacks against Large Audio Language Modelscited by 2
- 2026Temporal Leakage in LLM Backtesting: Measurement, Validation, and Adjusted Scorescited by 2
- 2026HIFICL: High-Fidelity In-Context Learning for Multimodal Taskscited by 1
- 2026The Reliability Gap in Benchmark Auditing: Distribution Shift and Scale as Failure Modes of Contamination Detectioncited by 1
- 2026Provable Joint Decontamination for Benchmarking Multiple Large Language Modelscited by 0
- 2026Anchored or Drifting: What Recursive Self-Generation Reveals About Training Datacited by 0
- 2026PolERo: Studying Political Evasion in Romaniancited by 0
- 2026Structural Chain-of-Thought: Reasoning with Executable Computational Graphscited by 0
- 2026Structural Chain-of-Thought: Reasoning with Executable Computational Graphs10 Oct 2026
- 2026PolERo: Studying Political Evasion in Romanian2 Sep 2026
- 2026Temporal Leakage in LLM Backtesting: Measurement, Validation, and Adjusted Scores4 Aug 2026
- 2026Anchored or Drifting: What Recursive Self-Generation Reveals About Training Data30 Jun 2026
- 2026The Reliability Gap in Benchmark Auditing: Distribution Shift and Scale as Failure Modes of Contamination Detection2 Jun 2026
- 2026Provable Joint Decontamination for Benchmarking Multiple Large Language Models20 May 2026
- 2026Membership Inference Attacks against Large Audio Language Models30 Mar 2026
- 2026HIFICL: High-Fidelity In-Context Learning for Multimodal Tasks13 Mar 2026