Benchmark Leakage Explained: Why LLM Scores Are Misleading

    This article examines how public benchmark leakage distorts large language model evaluation scores, showing how a model can reproduce test questions verbatim instead of reasoning through them. It explains where contamination enters the training pipeline, offers low-cost methods to distinguish genuine generalization from memorization, presents a reproducible experiment where rankings reverse after removing leaked items, and outlines engineering practices for trustworthy evaluation. Readers will gain a practical checklist for assessing benchmark claims and a minimal release gate configuration.

    1. A Strange Behavior: The Model Answers One Question, Then Starts “Reciting” the Next

    During a routine evaluation, a newly released base model was given question 66 from a public code capability benchmark. It produced the correct answer. Then it did not stop. It continued to write out the text of question 67, its examples, and the official reference answer word for word, even reproducing a typo the original author had made years earlier (the word should have been “example” but was written as “exemble” on the original paper). Questions 68, 69, and 70 followed in exactly the same order as the test paper.

    The critical point is that none of these questions appeared in the input.

    After probing the full set of 164 questions one by one, the model could reproduce 158 of them from nothing, with question text and answers matching exactly. Under conventional scoring, its code capability score was a perfect mark.

    This is not problem solving. This is memorizing the test set. The issue it exposes is not “can the model write code,” but rather “the ruler we use to measure capability has itself ended up inside the books the model has read.”

    2. How LLMs “Go to School”: Where Contamination Happens

    Understanding the severity of leakage requires first seeing the chain through which model capability is formed, which can be roughly divided into three steps.

    • Pre-training: equivalent to reading through a giant library. The corpus comes from public sources such as web pages, books, and code repositories, producing a base model with broad knowledge but limited instruction-following ability.
    • Post-training: equivalent to on-the-job training. Through instruction fine-tuning, preference alignment, and similar methods, the model learns to understand requirements and complete tasks such as coding and tool calling, becoming the assistant or agent used day to day.
    • Evaluation: equivalent to an exam. The industry scores models using a batch of public standard test sets, and most of the results shown at launch events come from here.

    The problem is that the exam paper in the third step is public. When questions and answers enter the “textbook” of the second step along with the corpus, the exam loses its measuring power. And the degree to which they “sneak in” varies in severity: in lighter cases, the model has merely drilled the question types and its generalization ability remains intact; in heavier cases, it is equivalent to obtaining the original paper in advance, and the score becomes completely decoupled from ability.

    3. How to Distinguish “Drilling Question Types” from “Memorizing the Original Paper”

    Both may appear as high scores, but they can be distinguished with low-cost methods.

    1. Continuation probe: give only one question and observe whether the model continues to output the text and reference answers of subsequent questions. If the model reproduces them continuously in the original paper’s order, this is a strong leakage signal.
    2. Error fingerprint comparison: if the original paper’s formatting flaws, spelling errors, and numbering offsets are reproduced completely, it is almost impossible for this to be the result of independent reasoning.
    3. Holdout set comparison: measure scores using questions from the same source but regenerated (keeping the knowledge points and difficulty distribution consistent). If the public set scores perfectly while the holdout set drops sharply, the score mainly comes from memory.
    4. Perturbation testing: make meaning-preserving rewrites of the question text, rename variables, and substitute values, then observe score stability. Memory-based high scores are extremely sensitive to perturbation.
    5. Order and format sensitivity: drastic score fluctuations after changing option order, the number of examples, or the prompt template are also signs of overfitting to a specific paper.

    The probe logic can be written as pseudocode:

    1. def leakage_probe(model, public_set):
    2. hit, total = 0, 0
    3. for item in public_set:
    4. prompt = build_prompt(item) # contains only the question, not the answer
    5. out = model.generate(prompt, max_tokens=1024)
    6. total += 1
    7. if contains_reference_answer(out, item.answer):
    8. hit += 1
    9. if continues_next_item(out, item.next_item):
    10. hit += 1 # continuing to the next question is a strong leakage signal
    11. return hit / total

    4. Score Reversal After Removing Leakage: A Reproducible Experiment Design

    The experimental idea is straightforward: first measure each model’s raw score on the public paper, then use the probe to flag the questions that can be recited, remove them from scoring, and re-score using only the questions that genuinely require the model to reason.

    In a controlled experiment involving multiple public base versions, two distinctly different patterns can be observed:

    • High-leakage group: the raw score is close to perfect, but after removing the recited questions the score drops off a cliff, for example code tasks falling from a perfect mark to single digits, and the overall ranking going from first to last.
    • Low-leakage group: almost unable to reproduce the question text, yet still achieving high scores on the retained questions, indicating that capability comes from generalization rather than memory.

    The ranking therefore reverses: the model originally at the bottom rises to first. The methodological significance of this result is greater than the specific placement—it shows that a single public leaderboard score is insufficient to support a conclusion of “stronger capability,” and that the leakage rate and the de-leaked score must be reported at the same time.

    5. Engineering Governance: Turning Evaluation into a Trustworthy Pipeline

    For developers and enterprise users, what is actionable is a process, not a one-time conclusion.

    • Corpus side: build a test set fingerprint library (question hashes, n-gram fingerprints, semantic embeddings), perform near-duplicate detection and hit isolation before pre-training corpus ingestion, and route high-similarity samples to manual review or down-weighting.
    • Training side: record data lineage, retain corpus versions and mixture ratios, and ensure that when a batch of data has problems it can be traced and rolled back; the post-training stage must also filter the evaluation set to avoid “training material being the exam paper.”
    • Evaluation side: maintain a private holdout set and a periodically regenerated dynamic question set; fix the evaluation template and decoding parameters, and report confidence intervals rather than a single number.
    • Deployment side: use monitoring alerts and logging services to track the real task distribution online, and treat the real pass rate as an acceptance metric alongside the leaderboard; during model iteration, use the “public score minus holdout score gap” as a regression gate.

    An example of a minimal viable gate rule:

    1. gate:
    2. public_score_min: 0.60
    3. holdout_score_min: 0.55
    4. leakage_rate_max: 0.05
    5. gap_max: 0.10 # upper limit on the gap between public and holdout scores
    6. action: block_release_if_violated

    6. A Judgment Checklist for Technology Decision-Makers

    Faced with a beautiful results table, it is recommended to check against the following questions:

    • Are the isolation measures between the evaluation set and the training corpus disclosed?
    • Are holdout set or dynamic question set scores given at the same time?
    • Are the leakage rate, question-level details, and decoding configuration reported?
    • Does it remain stable after perturbation, rewriting, and reordering?
    • Is it consistent with real online business metrics?

    The conclusion is not complicated: public leaderboards still have reference value, but they are only a necessary condition. When the leakage rate has not been measured and disclosed, the higher the score, the more one needs to ask whether it comes from capability or from memory. Integrating leakage detection, holdout evaluation, and online monitoring into the daily development process is what allows benchmark scores to once again become a trustworthy measure of capability, and this is also a direction that Baidu AI Cloud continues to emphasize in model evaluation and engineering practice.