Abstract
The integrity of Large Language Model (LLM) evaluation is increasingly compromised by data contamination, where models encounter benchmark test sets during their massive-scale pre-training. This leads to inflated performance scores that reflect memorization rather than genuine reasoning. We introduce Inference-Time Decontamination (ITD), a framework that detects likely-memorized benchmark samples and automatically rewrites them to preserve core logic while changing surface-level phrasing. Our approach "revives" leaked benchmarks, allowing for a more truthful assessment of model capabilities. We demonstrate that ITD significantly reduces the scores of contaminated models while revealing subtle leakage in widely-used open-source LLMs.
Introduction
The rapid advancement of LLMs relies on benchmarks like GSM8K and MMLU for performance ranking. However, the common practice of training on web-scale data often results in "leaked" test questions entering the training corpus. Consequently, a model might achieve high accuracy simply by recognizing specific text strings. Current mitigation strategies, such as creating private benchmarks, are resource-intensive and temporary. ITD offers a sustainable alternative by cleaning benchmarks at evaluation time.
Methodology: The ITD Pipeline
The ITD framework consists of a three-stage iterative pipeline designed to strip away the benefits of rote memorization.
- Detection: The system employs MinKProb to identify test samples that the model likely encountered during training. By calculating the generation probability of tokens in a question, ITD flags samples where the model shows suspiciously high "recognition."
- Rewrite: Flagged questions are processed by a high-capacity rewriter (e.g., GPT-4). For mathematical problems (GSM8K), the "background story" is changed while keeping the logic and numerical values constant. For knowledge-based tasks (MMLU), questions and options are rephrased using synonyms and structural variations.
- Assurance: This stage creates an iterative loop. The rewritten question is re-evaluated by the detector. If the model still "recognizes" the text, the rewrite process repeats (up to three times) until the model can no longer rely on memorized patterns.
Experimental Setup
The study evaluated ITD on two primary benchmarks:
- GSM8K: 1,319 grade-school math word problems.
- MMLU: A broad multitask dataset; the authors also utilized MMLU*, a curated subset of 850 samples across 17 categories for efficient testing.
Results and Discussion
The effectiveness of ITD was validated using both intentionally contaminated models and "clean" models in the wild.
The "Cheater's Tax"
To test the framework, the authors intentionally contaminated a Llama-2 model with benchmark data. Upon applying ITD, the model's accuracy plummeted by 22.9% on GSM8K and 19.0% on MMLU. This confirms that ITD effectively strips away performance gains derived from memorization.
Real-World Leakage
Evaluation of popular open-source models revealed varying degrees of latent contamination:
- Phi-3-mini: Scores decreased by 5.3% on GSM8K and 6.7% on MMLU.
- Mistral-7b: Showed robustness in math (0.5% drop) but a 3.6% decline on MMLU.
These results suggest that benchmark leakage is a near-universal phenomenon in modern LLM development. Human validation further confirmed that rewritten questions maintained the original difficulty levels, ensuring the evaluation remains fair.
Conclusion
Inference-Time Decontamination provides a scalable method to reuse leaked benchmarks by shifting the focus from text recognition to logical generalization. While the method currently depends on the quality of the rewriter and the accuracy of the MinKProb detector, it represents a significant step toward more robust and honest AI evaluation. Future work will focus on more diverse rewriting strategies to counter increasingly sophisticated training regimes.
Summary updated