Inference-Time Decontamination: Reusing Leaked Benchmarks for Large Language Model Evaluation

Qin Zhu, Qinyuan Cheng, Runyu Peng, Xiaonan Li, Tengxiao Liu, Xipeng Qiu, Xuanjing Huang

Abstract: The training process of large language models (LLMs) often involves varying degrees of test data contamination. Although current LLMs are achieving increasingly better performance on various benchmarks, their performance in practical applications does not always match their benchmark results. Leakage of benchmarks can prevent the accurate assessment of LLMs' true performance. However, constructing new benchmarks is costly, labor-intensive and still carries the risk of leakage. Therefore, in this paper, we ask the question, Can we reuse these leaked benchmarks for LLM evaluation? We propose Inference-Time Decontamination (ITD) to address this issue by detecting and rewriting leaked samples without altering their difficulties. ITD can mitigate performance inflation caused by memorizing leaked benchmarks. Our proof-of-concept experiments demonstrate that ITD reduces inflated accuracy by 22.9% on GSM8K and 19.0% on MMLU. On MMLU, using Inference-time Decontamination can lead to a decrease in the results of Phi3 and Mistral by 6.7% and 3.6% respectively. We hope that ITD can provide more truthful evaluation results for large language models.

Introduction: The "Open Secret" of Data Contamination

Data contamination is a pervasive issue in the development of Large Language Models (LLMs). Because popular benchmarks like GSM8K and MMLU are publicly available, they frequently end up in the massive web-crawl datasets used to train models. When a model performs exceptionally well on these tests, it is often unclear if the model is actually "smart" or if it simply saw the answers during training.

Conceptual illustration of benchmark leakage and rewriting. A model that memorized a specific sprint problem fails when the context is changed to swimming, despite identical logic.

The standard solution—building entirely new benchmarks—is a grueling, expensive process that only works until the new benchmark is eventually leaked. This paper proposes a provocative alternative: Inference-Time Decontamination (ITD). Instead of discarding leaked benchmarks, ITD detects if a model has memorized a test sample and "rewrites" that sample on the fly, allowing researchers to reuse existing benchmarks for a more honest assessment.

Methodology: The ITD Pipeline

The authors introduce ITD as a three-stage pipeline designed to "revive" contaminated benchmarks by distinguishing between true reasoning and rote memorization.

The Inference-Time Decontamination (ITD) pipeline, showing the iterative process of detection, rewriting, and assurance.
  1. Detection: The system uses a method called MinKProb to determine if a specific test question was likely part of the model's training data. It looks for sequences of tokens that the model predicts with suspiciously high confidence (low perplexity), which is a hallmark of memorization.
  2. Rewrite: If a sample is flagged as "leaked," an automated rewriter (in this study, GPT-4) transforms the question. For math (GSM8K), it changes the scenario (e.g., swapping "eggs" for "candies") but keeps the numbers and logic identical. For knowledge (MMLU), it uses synonymous phrasing and reorders options without changing the core facts.
  3. Assurance: The system re-runs the detection step on the rewritten question. If the model still seems to recognize it, the system iterates the rewrite until the question passes as "unseen" or hits a maximum number of attempts.

Experimental Setup and Datasets

The study evaluates ITD on two pillars of LLM benchmarking:

  • GSM8K: A dataset of grade-school math word problems requiring multi-step reasoning.
  • MMLU (Massive Multitask Language Understanding): A broad knowledge benchmark covering 57 subjects. The authors used a sampled version called MMLU* (850 samples).
  • Llama2-contaminated: To prove the concept, the authors intentionally "leaked" half of the test data into a Llama2-7b-base model to create a known "cheater" for testing.

Key Insights: Generalization vs. Memorization

The core insight of ITD is that if a model truly understands a concept, it should be able to solve the problem regardless of superficial context changes. If it fails after a simple context swap, it was merely "cheating" via memory.

The authors also tested an "All" detector upper bound, where every question is rewritten regardless of leakage. This serves as a theoretical limit for how much "hype" can be deflated from a model's score. When applied to popular models like Phi-3 and Mistral, the scores dropped, suggesting that even highly-regarded open-source models may have some degree of benchmark memorization baked into them.

Results

Proof-of-concept experiments demonstrated that ITD successfully mitigates performance inflation:

  • Contaminated Models: On the intentionally leaked Llama2 model, ITD reduced inflated accuracy by 22.9% on GSM8K and 19.0% on MMLU.
  • Real-World Impact: Phi-3-mini saw its MMLU score drop by 6.7% and its GSM8K score drop by 5.3%. Mistral-7b was more robust on math (0.5% drop) but saw a 3.6% drop on MMLU.
  • Quality Control: Human evaluations confirmed that the rewritten questions maintained the same difficulty level as the originals, ensuring the decontaminated test remained fair.

Limitations and Future Work

While effective, ITD has limitations. MinKProb is a heuristic that can occasionally miss partial memorization or flag rare legitimate sequences. Furthermore, rewriting complexity varies; while math and multiple-choice tasks are straightforward, nuanced linguistic tasks may be harder to decouple from their context. Future work will explore using smaller, specialized models for the rewriting phase to reduce the cost and latency associated with high-end models like GPT-4.

Summary updated

BibTeX
@inproceedings{zhu2024inference,
  author = {Qin Zhu and Qinyuan Cheng and Runyu Peng and Xiaonan Li and Tengxiao Liu and Ru Peng and Xipeng Qiu and Xuanjing Huang},
  title = {{Inference-Time Decontamination: Reusing Leaked Benchmarks for Large Language Model Evaluation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.532},
}
Figure