LLM Benchmark Contamination: Rebuilding Trust When Test Sets Are Memorized

    Public benchmark scores are often treated as direct evidence of model capability, but that assumption depends on test samples not entering training or tuning in ways that affect evaluation results. This article examines how public test sets can become memorized during pretraining, post-training, and evaluation development; what verbatim reproduction can and cannot prove; why simply subtracting suspected contaminated items is not enough; and how to build a more credible evaluation chain using precise and near-duplicate detection, perturbation tests, fresh private test sets, and business-scenario validation. The goal is not to abandon benchmarks but to upgrade them with transparent protocols, contamination checks, and clearer uncertainty.

    1. Answering a Question Correctly Is Not the Same as Solving a Problem

    When evaluating large models, people often look first at leaderboards: math accuracy, code pass rates, and knowledge QA accuracy all seem to translate directly into judgments about model capability.

    But these numbers depend on an important precondition: test samples must not have entered the model’s training or tuning process in a form capable of influencing evaluation results.

    The original material describes a concerning phenomenon: after an evaluator provides a model with a public programming problem, the model not only completes the current problem but continues to generate the statements, examples, and reference answers for subsequent problems, even preserving spelling errors from the original text. The material further claims that in a programming test set containing 164 problems, the model could reproduce 158 of them, about 96%.

    These figures should be read as observations reported by the original material, not as conclusions independently verified in this article. Without complete experiment scripts, prompt templates, sampling configurations, and output records, it is not possible to directly confirm the training-data source of a specific model, nor should the reproduction ratio be equated with the proportion of inflated capability.

    However, the phenomenon itself reveals a key issue:

    When a model can reproduce test content with high consistency even though that content was not provided in the current input, scores on a public test set can no longer by themselves prove generalization ability.

    This does not mean scores are worthless. It means scores need to be accompanied by their source, evaluation protocol, and contamination-risk disclosures.

    2. Why Test Sets Enter Model “Memory”

    2.1 Pretraining: Public Does Not Mean Independent

    Large models typically learn language patterns, knowledge associations, and code structure from large-scale text. Public test sets may also appear in that text, for example in problem statements, educational articles, code examples, discussion records, reference answers, and curated documentation.

    Even if the training data did not directly include the original test files, it may include paraphrases, translations, solution tutorials, or mirrored copies.

    Therefore, the traditional machine-learning practice of storing training and test sets separately is not sufficient in a large-corpus environment. What really needs to be isolated is the test content and its identifiable derivative versions, not just a particular file.

    2.2 Post-Training: Solution Data Can Also Bring in Test Answers

    After pretraining, models may go through instruction tuning, preference optimization, and other post-training processes. If these stages use question-answer pairs, analyses, or reference code for public problems, evaluation independence may also be compromised.

    There is a more subtle path: first use a model to generate educational data, then filter high-quality answers for training. If the generation process calls on public problems, or if the generated content reproduces existing test samples, contamination can re-enter the training pipeline through synthetic data.

    Contamination audits therefore cannot focus only on pretraining corpora. They should also cover post-training data, synthetic data, and data-filtering stages.

    2.3 Evaluation Development: Repeated Optimization Can Also Leak Information

    Even if a test set never directly enters the training corpus, if a team repeatedly adjusts prompts, selects checkpoints, and modifies inference workflows based on the same test set over time, that test set may gradually become an effective development set.

    This problem does not necessarily appear as word-for-word memorization, but it can still cause final results to deviate from true generalization performance.

    The value of a test set comes not only from the questions themselves but also from the condition that it has not been used to guide optimization. Once that condition is broken, a new independent test set should be used for re-acceptance.

    3. What Verbatim Reproduction Means and Does Not Prove

    3.1 Consistent Reproduction of Rare Details Is a Strong Exposure Signal

    Ordinary programming problems may have similar structures, and reference solutions may naturally converge. Therefore, “the code looks very similar to the standard answer” is usually not enough to determine contamination.

    But if a model simultaneously reproduces the following features, the evidence deserves more attention:

    • A complete problem statement that was not provided;
    • Example ordering consistent with the original text;
    • A fixed sequence across multiple problems;
    • Rare spelling errors or special comments;
    • Accurate correspondence between problems and reference answers.

    A combination of these details is harder to explain through general reasoning than correctly answering a single problem.

    3.2 Content Already Provided in the Input Cannot Count as Reproduction Evidence

    Detection must clearly distinguish information already present in the prompt from information the model supplies on its own.

    If the prompt contains half of a problem statement and the model completes the rest, that is different in strength from giving only a problem number and having the model output the full problem. If the previous problem is provided and the model is asked to continue with the next one, it is also necessary to confirm that the prompt did not contain hidden test-bank content, retrieval results, or tool-returned information.

    Rigorous detection should save the complete input and output, mark which fragments never appeared in the input, and explain the matching rules.

    3.3 Failure to Reproduce Does Not Mean There Is No Contamination

    Memory does not necessarily manifest as verbatim output. A model may remember answers, solution paths, or key boundary conditions without being able to fully reconstruct the problem statement. It may also fail to show memory in a particular test because of prompt style, sampling settings, or output behavior.

    Reproduction detection is therefore better suited to identifying “observable evidence of exposure” than to proving that data is completely clean.

    Similarly, observing exposure does not directly prove intentional cheating. Public content entering training data may result from insufficient data governance or from other paths, and further auditing is needed for attribution.

    4. Why “Subtracting Contaminated Questions” Still Requires Caution

    The original material mentions that a programming score dropped from full marks to 3.66 after reproducible questions were deducted. This change is striking, but accurate interpretation requires first clarifying how the “deduction” is calculated.

    Suppose the test set has (N) problems, (K) problems are marked as suspected contaminated, and (C) of the remaining problems are answered correctly.

    If the original denominator is kept and all suspected contaminated problems are scored as zero, the result is:

    Conservative score = C ÷ N

    If suspected contaminated problems are removed and accuracy is calculated only on the remaining problems, the result is:

    Unmarked-subset accuracy = C ÷ (N − K)

    These two figures answer different questions.

    The former expresses how much of the original score remains when the contribution of suspected contaminated samples is not accepted.

    The latter expresses how the model performs on samples not flagged by the detection method.

    Neither metric can be directly called a “true capability score.” Unmarked samples may still contain missed detections, and removed samples may include problems the model could originally solve independently.

    In addition, when the remaining sample is small, results can be highly unstable. The distribution of problem difficulty, task type, and boundary conditions may also differ significantly from the original test set. When publishing corrected results, at minimum the following should be reported together:

    • The original score;
    • The number and proportion of suspected contaminated samples;
    • The conservative score;
    • The unmarked-subset accuracy and sample size;
    • The matching threshold and decision rules;
    • Uncertainty and applicable boundaries.

    Compared with presenting a “post-deduction ranking,” this information better supports reliable judgment.

    5. Trustworthy Evaluation Requires a Complete Evidence Chain

    5.1 Define the Evaluation Target and Operating Conditions

    Before evaluation, record the model version, access time, prompt template, sampling settings, maximum output length, and whether retrieval, tool calls, and multi-turn interaction are enabled.

    For programming tasks, also specify the execution environment, test cases, timeout conditions, failure criteria, and the number of attempts allowed per problem. A pass rate for a single generation and a success rate after multiple attempts cannot be conflated.

    If a task allows the model to query reference materials, it should be evaluated as “system capability with retrieval,” not attributed without qualification to the model’s own knowledge or reasoning ability.

    5.2 Combine Exact Matching with Near-Duplicate Detection

    Exact matching is suitable for finding direct copying, but it easily misses paraphrasing, translation, variable renaming, and formatting changes.

    A more complete investigation can be layered:

    • Normalize whitespace, punctuation, and formatting in a reasonable way;
    • Check overlap in long fragments and continuous word order;
    • Compare code structure to reduce the impact of variable-name differences;
    • Use semantic similarity to recall suspicious samples;
    • Manually review high-risk results.

    Semantic similarity does not equal contamination. Two independently written problems may test the same algorithm, so automated detection should provide candidate evidence rather than make a final judgment.

    5.3 Use Perturbation Tests to Distinguish Memory from Transfer

    Changing conditions based on the original problem is one way to observe whether a model truly understands the problem.

    For example, for a sequence-processing problem, you can modify boundary conditions, add empty input, change the output structure, or make the natural-language constraints in the problem statement no longer fully consistent with the common solution.

    If the model still mechanically applies the old answer, it reveals insensitivity to task changes. If it can re-analyze the constraints and pass newly added tests, that provides supporting evidence of transfer ability.

    However, perturbation problems must be reviewed. Modifying conditions may unintentionally change problem difficulty or even introduce ambiguity. A more reasonable comparison should use grouped variants rather than drawing conclusions from a single rewritten sample.

    5.4 Add Fresh, Private, and Verifiable Problems

    Public benchmarks can be used for historical comparison but should not become the only acceptance standard.

    Enterprises can build undisclosed business test sets covering real inputs, internal terminology, abnormal cases, and task constraints, and protect test assets with access control, access records, and version management.

    For math and programming tasks, parameterized problems can be designed, with instances generated by programs and answers automatically verified. But merely replacing numbers or variable names may not escape template memory; structure, condition combinations, and boundary distributions should also be changed.

    Once a private test set is used for repeated tuning, it will also gradually lose independence. Development sets, diagnostic sets, and final acceptance sets still need to be maintained separately.

    6. Enterprise Model Selection: Put Benchmark Scores Back into Business Context

    For developers and enterprise users, whether a model ranks first on a leaderboard is often less important than the following questions:

    • Can it correctly execute business rules it has never seen before?
    • Can it identify risks in incomplete, contradictory, or ambiguous inputs?
    • Can generated code pass hidden tests and meet security and maintenance requirements?
    • Does it maintain consistent constraints across multi-turn tasks?
    • Does it fabricate answers when facing facts it cannot confirm?
    • Are latency, cost, and failure rates acceptable under real invocation conditions?

    In practice, a three-layer evaluation system can be established.

    The first layer uses public test sets to quickly understand the model’s basic capability range, while clearly labeling contamination risk.

    The second layer uses independent new problems and task variants, focusing on transfer, robustness, and constraint adherence.

    The third layer uses real business samples for controlled acceptance, evaluating correctness, risk, cost, and human-takeover requirements at the same time.

    In final decisions, priority should be given to critical failure types rather than average scores alone. For high-risk workflows, even if average accuracy is high, a single serious permission error or unexecutable code may matter more than several ordinary QA errors.

    7. Conclusion: Do Not Abandon Benchmarks—Upgrade Them

    Test-set contamination does not mean all public evaluations should be discarded, nor should every high-scoring model be dismissed as “only memorizing questions.”

    What really needs to change is the evaluation approach: from publishing only a single number to disclosing the evaluation protocol, data-independence statement, contamination detection results, sample coverage, and uncertainty.

    Public benchmarks remain valuable, but they are better suited to serving as comparable reference points than as final proof of model capability on their own.

    When test questions can be memorized, trustworthy evaluation must answer a further question: can the model continue to produce correct, verifiable, and risk-controllable results under new conditions, new tasks, and new business constraints?