DL0210 Benchmark Contamination and Eval Integrity

The new checkpoint posts state-of-the-art on every public benchmark, but your internal suite says it got worse. How does benchmark contamination happen, and how do you detect it?

A three-panel question card. The first panel is a small table of public benchmark scores where checkpoint v7 beats v6 on all three boards: 48 to 71 percent on a 500-issue coding benchmark, 82 to 93 percent on grade-school math, and 70 to 79 percent on knowledge QA. The second panel shows the private 1,200-task internal suite, where v6 scores 61 percent and v7 scores 57 percent. The third panel lists two training changes, a web crawl refreshed up to the new cutoff and 40k instruction pairs bought from a data vendor, and asks whether the gain is real or whether v7 saw the exam.

The Problem: Checkpoint v7 jumps from 48% to 71% on a public 500-issue coding benchmark and sets records on math and knowledge QA, yet it scores 57% against v6’s 61% on a private 1,200-task internal suite. Its training changed in two ways, a web crawl refreshed to a new cutoff and 40k instruction pairs from an outside vendor, and Friday’s release review needs to know whether the gain is real.

Answer

Benchmark contamination means that test items, their answers, or close paraphrases reached the model during training, so the score measures recall of the exam rather than the skill the exam was built to sample. Pretraining crawls leak it when they ingest benchmark repos, GitHub issues with merged fixes, and solution write-ups, and near-duplicate rewrites such as paraphrases or translations then slip past exact-match filters. Instruction-tuning and vendor data built from the eval set inject it into the last and most influential training stage. Detection pairs data-side scans for n-gram overlap and canary strings with model-side probes such as Min-K% Prob and a comparison of items published before versus after the training cutoff. The deciding evidence is a score gap, because a model whose accuracy collapses on rewritten variants or a private held-out set while the public number soars has learned the test, not the task. The same mechanism explains why pass@k can rise while real transfer falls, since memorized items are solved at every k and checkpoint selection on a leaked metric rewards the data mix that crowded out general skill.

(1) Pretraining Leakage: Benchmark files, public issues with their merged patches, and solution blogs sit on the open web, so a crawl refresh that moves the cutoff forward can ingest test items with answers attached.
(2) Near-Duplicate Rewrites: Paraphrases, translations, and reformatted copies keep the answer while breaking exact-match filters, so 13-gram decontamination alone can certify a mix that is not clean.
(3) Eval-Derived Fine-Tuning Data: Synthetic or contracted SFT pairs generated by prompting with benchmark items, or filtered by benchmark score, inject the eval distribution straight into the stage that shapes outputs most.
(4) Data-Side Detection: Scan every training source for n-gram overlap with each eval item and grep for the canary strings that benchmark authors embed so leaked copies can be found.
(5) Model-Side Detection: Min-K% Prob averages the log-probabilities of the least likely tokens, and a time split compares accuracy on items published before and after the cutoff; both work without the training corpus.
(6) Gap Tests Decide: Re-scoring on rewritten variants and a private held-out set measures score inflation directly, whatever path the leak took.
(7) Mitigate And Report: Decontaminate mixes before training, keep a rotated private eval that never leaves access control, and publish a contamination report with flagged and clean scores per benchmark.

Mathematical Formulation:
c_n(x) = \frac{|G_n(x) \cap G_n(\mathcal{D})|}{|G_n(x)|}
x \in \mathcal{C} \iff c_n(x) \geq \tau
\mathrm{MinK}(x) = \frac{1}{|S|}\sum_{i \in S} \log p_\theta(x_i \mid x_{1:i-1})
\Delta = \mathrm{Acc}(B) - \mathrm{Acc}(B')
\mathrm{pass@}k = 1 - (1 - p)^k

Where:

  • c_n(x) is the overlap fraction of eval item x, the share of its word n-grams G_n(x) that also occur in the training corpus \mathcal{D}; n is typically 8 to 13 words, and GPT-3 used 13.
  • \mathcal{C} is the flagged (contaminated) subset and \tau the flag threshold, which ranges from a single shared n-gram to a majority of the item’s n-grams.
  • \mathrm{MinK}(x) is the Min-K% Prob score: S holds the indices of the lowest-probability tokens of x (commonly the bottom 20%), p_\theta is the model, x_i the token at position i, and x_{1:i-1} its prefix. A score close to zero means even the rarest tokens were predictable.
  • \Delta is the contamination gap: accuracy on the original items B minus accuracy on B', a set of rewritten variants or private twins matched in difficulty.
  • p is the per-sample success probability on one item and k the number of sampled attempts, so a memorized item with p \approx 1 counts as solved at every k. This k is a sample count and is unrelated to the token fraction in Min-K%.

Worked Example (v7 on the 500-issue benchmark after a 13-gram audit):
\mathrm{Acc}_{v7}(\mathrm{flag}) = 209/220 = 95.0\%
\mathrm{Acc}_{v7}(\mathrm{clean}) = 146/280 = 52.1\%
209 + 146 = 355 = 0.71 \times 500
\Delta_{\mathrm{flag}} = 95.0 - 47.7 = 47.3\ \mathrm{pts}
\Delta_{\mathrm{clean}} = 52.1 - 48.2 = 3.9\ \mathrm{pts}

Suppose the audit flags 220 of the 500 issues. v6 solved 105 of those (47.7%) and 135 of the 280 unflagged ones (48.2%), which reproduces its 240 total, or 48%. Almost the entire 23-point headline gain lives on the flagged subset. On the clean subset v7 gains 3.9 points, while one standard error on 280 items is about 3 points, so the clean gain is statistically indistinguishable from zero. The clean split is also an upper bound, because paraphrased leaks pass the n-gram filter and stay in it. Real incidents follow these paths. OpenAI’s GPT-4 technical report disclosed that portions of BIG-bench had been inadvertently mixed into the training set and excluded those results. SWE-bench Verified, the 500-issue human-validated subset OpenAI released in 2024 and a headline number in reports from labs such as Zhipu for its GLM coding models, is built from public GitHub issues whose merged fixes have been crawlable for years.

No single detector is sufficient, because each sees a different slice of the leak. N-gram overlap needs the training corpus and misses paraphrases. Canary strings only catch benchmarks that ship one, and only when the file was copied with its header intact. Min-K% Prob needs token log-probabilities and a control set from the same distribution. Duan et al. found that membership signals on large, deduplicated pretraining corpora barely beat chance once the temporal shift between members and non-members is removed, so treat it as evidence about a batch of items, not a verdict on one. The time split is the cleanest model-side test. If the pass rate falls off a cliff exactly at the training cutoff, the model’s skill did not change on that date, but its exposure did.

Two-panel chart. Left: histograms of Min-K% Prob scores at k equals 20 percent; post-cutoff control items form one mode near minus 5, while public benchmark items show the same mode plus a second high-score mode near minus 2 that lies past a dashed flag threshold at minus 3.3. Right: pass@1 against problem release month relative to v7's training cutoff; v7 holds about 76 percent on problems released before month 0 and drops to about 50 percent after it, while v6 shows a smaller drop from 56 to 48 percent at its own earlier cutoff at month minus 9.

Figure 1: Two model-side signals. Left: benchmark items show a second high-score Min-K% mode that post-cutoff control items lack, marking a batch the model has probably seen. Right: v7’s pass@1 falls from about 76% to 50% exactly at its training cutoff, and v6 shows its own smaller drop at its earlier cutoff, the signature of exposure rather than skill. Data are schematic.

The pass@k paradox has three compounding causes. First, a memorized item has p \approx 1, so under 1-(1-p)^k it is solved at every k, and a 40% leaked fraction can add tens of points with no new skill. Second, choosing checkpoints and data mixes by a leaked metric is Goodhart’s law in action. The run that wins the leaderboard is the one whose mix is most saturated with benchmark-shaped text, and that text displaces the diverse data that drives transfer. Third, fine-tuning on a narrow, benchmark-shaped distribution sharpens the output distribution, so the model produces fewer distinct attempts on unfamiliar tasks and its pass@k grows more slowly with k on the internal suite.

Two-panel chart of pass@k against the number of samples k from 1 to 64 on a log scale. Left, the public 500-issue benchmark: v7 starts at 0.71 and approaches 1.0 while v6 starts at 0.48 and plateaus near 0.8, so v7 leads at every k. Right, the internal 1,200-task suite: v6 starts at 0.61 and approaches 1.0 while v7 starts at 0.57 and plateaus near 0.8, so v7 trails at every k and the gap widens as k grows.

Figure 2: pass@k from 1 to 64 samples. On the public 500-issue benchmark v7 leads at every k, but on the internal 1,200-task suite it trails at every k and plateaus near 80%, because tuning on benchmark-shaped data narrowed its sampling distribution. Curves are schematic.

Mitigation runs on both sides of the pipeline. Before training, decontaminate the pretraining and SFT mixes against every eval you plan to report, vendor data included, and require provenance for synthetic pairs. After training, keep a private held-out suite that never leaves access control, rotate a slice of it each quarter, and maintain rewritten variants that change surface form while preserving difficulty. Then publish a per-benchmark report listing the detector, n and \tau, the flagged fraction, and scores on flagged versus clean items, as the GPT-3 and Llama-series reports did. The detectors complement each other:

DetectorNeedsCatchesBlind spot
N-gram overlapFull access to pretraining and SFT corporaVerbatim and lightly edited copiesParaphrases, translations, short items, boilerplate false positives
Canary stringCorpus grep, or a probe asking the model to complete the GUIDWhole benchmark files copied intactBenchmarks without canaries, copies with the header stripped
Min-K% ProbToken log-probs plus a matched control setBatches of memorized items, no corpus neededWeak per item, confounded by temporal shift in the controls
Time splitDated items and the known training cutoffExposure, visible as a cliff at the cutoffNeeds a steady supply of fresh items; difficulty can drift over time
Rewrites and private held-outAuthoring effort and strict access controlScore inflation itself, whatever the leak pathRewrites can shift difficulty; private sets leak once sent to vendors or APIs

Login to view more content
Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *