Rethinking Benchmark and Contamination for Language Models with Rephrased Samples

Shuo Yang, Wei-Lin Chiang, Lianmin Zheng, Joseph E. Gonzalez, Ion StoicaarXiv 2023 · DOI

Abstract

Current Large Language Model (LLM) benchmarks are increasingly compromised by "rephrased" data contamination, where test questions are paraphrased or translated in training sets to evade standard detection methods. This paper demonstrates that even a 13B parameter model can achieve GPT-4 level performance on benchmarks like MMLU by training on semantically identical but lexically distinct samples. We introduce a robust LLM-based decontamination tool that utilizes embedding similarity and strong LLM judgment to identify these leaks, revealing significant hidden contamination in popular pre-training and synthetic datasets.

Introduction

As Large Language Models (LLMs) are trained on increasingly massive swaths of the internet, the risk of "data contamination"—where test questions from benchmarks like MMLU or HumanEval leak into training sets—has become a crisis for AI evaluation. Standard decontamination techniques typically rely on simple string-matching (n-gram overlap). However, these methods fail to detect "rephrased contamination," where the substance of a test case is preserved but the wording is altered. This allows models to achieve stellar benchmark scores through memorization rather than actual reasoning, leading to an overly optimistic view of their true capabilities.

Methodology

To address this challenge, we developed a dual framework for creating and detecting rephrased contamination.

Rephrasing Framework

We utilized high-quality LLMs (such as GPT-4) to generate "rephrased samples" of popular benchmarks. This pipeline includes substituting synonyms, rearranging word order, and cross-lingual translation (e.g., English to Chinese) or cross-programming language translation (e.g., Python to C++). These samples maintain the semantic meaning and correct answer of the original test cases while significantly reducing lexical overlap.

The rephrasing pipeline and its impact on model performance, showing how a 13B model can match GPT-4 through memorization.

LLM Decontaminator

To identify these sneaky overlaps, we propose a two-step algorithm:

  1. Filtering: Use embedding similarity search to identify the "Top-K" most similar training samples for every test case.
  2. Judging: Feed these candidate pairs into a strong LLM Detector (GPT-4) with a specific prompt to judge if the training sample is a rephrased version of the test case.

Key Results

The "13B vs. GPT-4" Illusion

Our experiments prove that a Llama-2-13B model, when fine-tuned on rephrased versions of the MMLU test set, can jump from a score of ~55 to ~86—matching the performance of GPT-4. This suggests that many "state-of-the-art" open-source models may simply be better at memorizing leaks than their predecessors. This trend holds across multiple domains, including grade school math (GSM-8k) and coding (HumanEval).

Comparative performance of base models versus those trained on rephrased benchmark samples across MMLU, GSM-8k, and HumanEval.

Hidden Contamination and Synthetic Leakage

Using the LLM Decontaminator, we discovered significant previously unknown contamination:

  • Pre-training Sets: Approximately 8-18% of the HumanEval benchmark was found in popular sets like StarCoder and RedPajama.
  • Synthetic Data: 12.8% of CodeAlpaca, a dataset generated by LLMs to train other models, consists of rephrased samples from HumanEval. This indicates that synthetic data is a "double-edged sword"; because teacher models (like GPT-4) have seen the benchmarks, the data they generate often contains test answers in disguise.

Discussion and Conclusion

The failure of n-gram matching and the high accuracy of our LLM-based detector (achieving F1 scores of 0.94–1.0) highlight the need for more sophisticated evaluation protocols. As decontamination gets better, contamination may become even more subtle, such as changing only the numerical values in math problems to fool detectors while still allowing models to memorize solution templates.

We conclude that the community cannot rely on static, public benchmarks indefinitely. To ensure we are measuring genuine intelligence rather than memory, we urge a move toward "one-time exams"—dynamic, fresh evaluations that prevent models from training on the test set in any form.

Summary updated

BibTeX
@misc{yang2023rethinking,
  author = {Shuo Yang and Wei-Lin Chiang and Lianmin Zheng and Joseph E. Gonzalez and Ion Stoica},
  title = {{Rethinking Benchmark and Contamination for Language Models with Rephrased Samples}},
  year = {2023},
  eprint = {2311.04850},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.04850},
}
Figure