Are LLM Benchmark Scores Still Credible? Understanding Test Set Leakage and How to Address It

    Public benchmark scores have become the common language for comparing large language models, but test set leakage can quietly inflate results and mislead model selection. This article explains how leakage occurs during pretraining and post-training, how to detect verbatim memorization using prefix continuation and error reproduction tests, and why simply deleting contaminated questions is not enough. It also outlines practical steps for developers and enterprises to build private evaluation sets, use variant-based testing, and track task-level metrics, along with recommendations for benchmark maintainers to improve transparency and reliability.

    Why Benchmarks Became the Industry Standard

    Most LLM capability evaluations rely on public standardized test sets covering programming, mathematical reasoning, scientific Q&A, and other domains. Each question comes with a reference answer, which makes it convenient to compare different models side by side. The scorecards shown at product launches and the comparison charts in technical reports are largely drawn from these test sets.

    The problem is that public questions and answers are themselves text on the internet. During training, models ingest massive amounts of web pages, books, forum discussions, and code repositories. As long as a test set has been crawled into the training corpus, the model has a chance of having “seen” the original questions during training. In that case, the score reflects memorization rather than problem-solving ability.

    How Models “Go to School” and Where Leakage Happens

    To understand leakage, it helps to look at the three main stages of model training:

    1. Pretraining: The model learns language patterns and knowledge from vast amounts of general text. This stage is the most likely to absorb public benchmark content.
    2. Post-training: The model is tuned with instruction data, preference data, and task examples to follow directions, write code, and use tools. If this data is adapted from public question banks, leakage can also be introduced here.
    3. Evaluation: The model is scored on a test set. If the evaluation questions overlap with training data, the scores lose their discriminative power.

    Leakage can be divided into two levels. The first level is “pattern saturation”: the model has seen many similar questions, learned the common problem-solving routines, but has not seen the exact original questions. The second level is full memorization: the model can reproduce the question text, example answers, and even typos from the original test verbatim. The second level is far more harmful because it directly distorts the scores.

    How to Detect Verbatim Memorization

    There are two practical approaches to determine whether a model has memorized a specific question.

    First, the prefix continuation test. Feed the first half of a question into the model and check whether the continuation matches the original text. If the model can output multiple consecutive segments that were not present in the input—especially segments containing unusual wording—memorization is likely.

    Second, the error reproduction test. Many test questions contain formatting errors or typos originally present in the source. If a model reproduces these errors exactly as they appeared, it is almost certainly relying on memorization, because reasoning would not “invent” a typo out of thin air.

    The following illustrative pseudocode shows a word-level n-gram overlap detection approach:

    1. function ngram_set(text, n = 8):
    2. tokens = split_by_whitespace(text)
    3. return set { join(tokens[i : i+n]) for all i }
    4. function overlap_ratio(sample_text, corpus_ngram_set, n = 8):
    5. sample_set = ngram_set(sample_text, n)
    6. if sample_set is empty:
    7. return 0.0
    8. hits = count of elements in sample_set that exist in corpus_ngram_set
    9. return hits / size of sample_set

    A few caveats when using this method. Chinese text has no natural whitespace-based tokenization, so character-level n-grams or word segmentation should be used in practice. The threshold needs to be calibrated based on data scale and deduplication strategy—there is no universal fixed value. Overlap detection only reveals textual similarity between training data and the test set; it cannot replace manual verification of model outputs.

    Re-Evaluating After Decontamination

    Simply deleting a few questions is not enough once leakage has been found. A more complete re-evaluation process includes the following steps:

    1. Mark contaminated samples: Run corpus-overlap and prefix-continuation detection on every question, and assign contamination labels.
    2. Split subsets: Divide the test set into a clean subset and a contaminated subset, and compute scores separately.
    3. Compare rankings: Compare the full-set scores with the clean-subset scores. If a model’s score on the contaminated subset is significantly higher than on the clean subset, its ranking is largely driven by memorization.
    4. Report coverage: Publish the proportion of questions on which each model shows potential leakage, so readers can judge the credibility of the scores.

    In one publicly reported evaluation, a model from a domestic vendor was able to reproduce the wording and answers of most programming questions verbatim. After these questions were removed, the model’s programming score dropped sharply, and its ranking among four evaluated models fell from first to last. This case illustrates that comparisons on heavily contaminated test sets can lead to completely reversed conclusions.

    Practical Recommendations for Developers and Enterprises

    Leaderboard scores can serve as a reference, but they should not be used directly as the sole basis for model selection. A more reliable approach includes the following practices:

    1. Build a private evaluation set: Collect real tasks from your own business, such as code fixing, API documentation generation, and ticket classification. Keep the questions private and update them regularly.
    2. Use variant testing: For each question, keep the core logic but rewrite the surface text, change variable names and values, and adjust equivalent wording. If a model performs significantly worse on variants than on the original questions, it is relying on memorization rather than generalization.
    3. Measure task-level metrics: Track indicators such as unit test pass rate, human acceptance rate, number of revision rounds, and average handling time. These metrics are closer to real business value than a single score.
    4. Run small-scale traffic validation before launch: Compare candidate models on a small percentage of real traffic, observe business metric changes, and then decide whether to roll out a full switch.
    5. Maintain version control: Record the evaluation set version, evaluation script version, and model version to ensure reproducibility and prevent scores from different versions being mixed together.

    Recommendations for Evaluation Maintainers

    Benchmark maintainers also face significant challenges. The following improvements can help:

    1. Publish contamination detection methods and results, so users can verify the credibility of reported scores.
    2. Adopt dynamic question banks, replacing part of the test set periodically while holding out a portion of unpublished questions.
    3. Report both original-question scores and variant scores, using the gap between them to indicate the degree of memorization.
    4. Report confidence intervals and sample sizes, avoiding ranking decisions based on minuscule score differences.

    Conclusion

    LLM benchmark scores still have reference value, but they are a signal that needs to be validated—not a final conclusion. Test set leakage can inflate scores, and verbatim reproduction is the most direct evidence of it. Developers and enterprises should build their own evaluation systems based on private test sets, variant testing, and business-relevant metrics, so they can make more reliable decisions on model selection and deployment.