Can We Trust LLM Benchmarks with 96% Test Set Leakage?

    As large language models (LLMs) increasingly memorize public benchmark datasets, their high scores may reflect data leakage rather than true capability. This article explores real-world cases of test set contamination, categorizes leakage severity, analyzes the causes across the data and training pipeline, and proposes actionable detection methods. It concludes by advocating for a "contamination-aware evaluation" framework to separate memorized scores from genuine reasoning abilities.

    1. From Answering to Reciting: A Warning Sign

    Give a newly released base model a coding problem. It answers correctly. Then, instead of stopping, it continues to output the next problem’s text, examples, reference answers, and even replicates non-standard spelling errors from the original. If we continue, the sequence of subsequent questions matches the exam paper. The problem is, we only gave it one question; the subsequent content never appeared in the prompt.

    This isn’t problem-solving; it’s closer to reciting the test set.

    In a recent public case, a base model released by Baidu could reproduce a large portion of a coding exam’s questions and answers in order without being provided the subsequent questions. Out of 164 questions in the full paper, 158 could be reproduced verbatim. Under standard evaluation methods, this version scored a perfect 100. This is not an isolated incident: across 20 public exam papers and 4 public base models, one model reproduced 96% of coding questions, 85% of science questions, and 80% of math word problems, outputting them alongside standard answers without seeing them. After removing the reproducible questions, its coding score dropped from 100 to 3.66. Its average ranking among the four models fell from first to last, while another model that could barely memorize questions took first place. Interestingly, two other models achieved relatively high scores with almost no verbatim reproduction, proving that high scores don’t have to come from memorization.

    These phenomena bring a critical issue to the forefront: when public exam papers enter the training corpus, benchmark scores might measure memory rather than capability.

    2. How LLMs Learn and How Tests Leak In

    The development of large models generally involves three steps:

    1. Pre-training: Like reading an entire library. The model ingests massive amounts of web pages, books, code, and Q&A data to form a base model. It has broad knowledge but isn’t necessarily good at following instructions.
    2. Post-training: Like on-the-job training. Using instruction data, preference data, coding tasks, and tool-use data, the model learns to answer, write code, or operate software as required.
    3. Benchmarking: Like taking an exam. The industry uses public standard test papers to score models, and scores in releases and leaderboards mostly come from here.

    The trouble is: the tests are public. Original questions, examples, answers, solutions, discussion threads, tutorials, and code repository mirrors can spread widely on the internet. Once this content mixes into pre-training corpora or post-training materials, the exam is no longer an exam.

    Leakage varies in severity:

    • L0: Format Familiarity. The model has seen similar question types and knows the solving patterns, but still needs to reason on the spot.
    • L1: Near-Duplicate Contamination. Training data includes highly similar question texts or solutions, allowing the model to transfer knowledge.
    • L2: Answer Fragment Contamination. The model has seen partial answers, examples, or key steps.
    • L3: Verbatim Test Set Contamination. The model can reproduce question text, examples, answers, sequence, and even spelling errors. This is the most severe memory-based high score.

    Verbatim recitation falls under L3. It distorts leaderboards and causes developers and enterprises to misjudge a model’s true capabilities.

    3. Why Does Verbatim Memorization Happen?

    The cause is rarely a single point but rather a combination of data, training, and evaluation pipelines:

    • Widespread Public Benchmarks. Questions, answers, solutions, and discussions appear across multiple web pages, code snippets, and tutorials, making them extremely difficult to completely exclude during data collection.
    • Insufficient Deduplication Granularity. Relying solely on document-level exact deduplication easily misses templated question texts, code snippets, Q&A pairs, and paraphrased answers.
    • Post-training Data Re-injection. Synthetic or instruction data might treat “question-answer” pairs as training samples, reinforcing memory.
    • Loose Time Slicing. The model’s training time extends beyond the public benchmark’s release date, resulting in “time travel.”
    • Long-tail Fingerprints Remembered. Details like variable names, comments, sample data, and non-standard spellings become fingerprints that the model uses to reproduce the original test paper.

    Therefore, when seeing a high score, you should at least ask: does this score come from on-the-spot reasoning, format transfer, or verbatim memorization?

    4. How to Detect Test Set Leakage

    Trustworthy evaluation must look beyond total scores and include contamination audits. Common methods include:

    1. Continuation Probing: Provide only a question or a question ID prefix, and observe if the model continues to write subsequent question texts and answers in order.
    2. Perturbation Testing: Re-evaluate after synonym replacement, variable renaming, data substitution, or constraint modification.
    3. Answer Masking and Counterfactual Answers: Hide standard answers or provide wrong answers to see if the model blindly follows its memory.
    4. Order Probing: Shuffle question order or insert irrelevant questions to check if the model still reproduces the original sequence.
    5. Fingerprint Detection: Detect n-gram overlap, longest common substring, and embedding similarity between candidate outputs and public benchmark texts.
    6. Time Slicing: Use new questions created after the model’s training cutoff date, or construct a private holdout set.
    7. Dynamic Benchmark Generation: Generate new questions, data, and constraints for each evaluation to reduce the payoff of memorization.
    8. Execution-based Evaluation: Score coding questions using hidden unit tests and sandbox execution results; check math processes and counterexamples; verify evidence consistency for Q&A.

    Pseudocode for indicative contamination fingerprint detection is as follows:

    1. function leakage_score(bench_text, output_text, n):
    2. bench_tokens = tokenize(normalize(bench_text))
    3. out_tokens = tokenize(normalize(output_text))
    4. bench_ngrams = set(ngrams(bench_tokens, n))
    5. out_ngrams = set(ngrams(out_tokens, n))
    6. overlap = size(intersection(bench_ngrams, out_ngrams))
    7. / max(1, size(bench_ngrams))
    8. lcs = longest_common_substring(normalize(bench_text),
    9. normalize(output_text))
    10. return {
    11. ngram_overlap: overlap,
    12. lcs_ratio: length(lcs) / max(1, length(bench_text)),
    13. risk: overlap > 0.5 or lcs_ratio > 0.6 ? "high" : "low"
    14. }

    Thresholds need to be calibrated based on text length, question type, and false positive rate. Detection results shouldn’t just be used to “catch models” but should feed back into data cleaning and evaluation design.

    5. Can Benchmarks Be Trusted? Moving to Contamination-Aware Evaluation

    The conclusion isn’t that all benchmarks are untrustworthy, but that public benchmarks must be accompanied by contamination audits. A more reasonable evaluation system should include:

    • Public Sets + Private Holdout Sets + Dynamic Generation Sets: Public sets for regression comparison, private sets for capability assessment, and dynamic sets to resist memorization.
    • Raw Scores + Post-Contamination-Deduction Scores: Leaderboards should simultaneously report standard scores, contamination detection results, and scores after removing reproducible questions.
    • Execution Results Over Text Matching: Evaluate code via hidden test case pass rates, math via process and counterexamples, and Q&A via evidence consistency.
    • Reporting Disclosure: Model cards should explain training cutoff dates, deduplication methods, contamination audit methods, and limitations.
    • Business-Specific Mini Benchmarks: Developers should build small, hidden evaluation sets close to real business needs, covering long-tail inputs, anomalous inputs, and boundary conditions.

    For developers: don’t just look at launch event scores when selecting models. For enterprises: purchasing decisions should require reproducible private evaluations and online A/B results. For evaluators: treating “whether the model has seen the test” as a metric equally important to accuracy.

    The 96% leakage reminds us that LLM benchmarks still hold value, but their credibility depends on whether the evaluation is contamination-aware, dynamic, backed by hidden holdout sets, and verified through execution results. Only by separating “memory-based high scores” from “capability-based high scores” can benchmark scores truly be trusted.