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?

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:
Where:
is the overlap fraction of eval item
, the share of its word n-grams
that also occur in the training corpus
;
is typically 8 to 13 words, and GPT-3 used 13.
is the flagged (contaminated) subset and
the flag threshold, which ranges from a single shared n-gram to a majority of the item’s n-grams.
is the Min-K% Prob score:
holds the indices of the lowest-probability tokens of
(commonly the bottom 20%),
is the model,
the token at position
, and
its prefix. A score close to zero means even the rarest tokens were predictable.
is the contamination gap: accuracy on the original items
minus accuracy on
, a set of rewritten variants or private twins matched in difficulty.
is the per-sample success probability on one item and
the number of sampled attempts, so a memorized item with
counts as solved at every
. This
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):
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.

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 , so under
it is solved at every
, 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
on the internal suite.

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, and
, the flagged fraction, and scores on flagged versus clean items, as the GPT-3 and Llama-series reports did. The detectors complement each other:
| Detector | Needs | Catches | Blind spot |
|---|---|---|---|
| N-gram overlap | Full access to pretraining and SFT corpora | Verbatim and lightly edited copies | Paraphrases, translations, short items, boilerplate false positives |
| Canary string | Corpus grep, or a probe asking the model to complete the GUID | Whole benchmark files copied intact | Benchmarks without canaries, copies with the header stripped |
| Min-K% Prob | Token log-probs plus a matched control set | Batches of memorized items, no corpus needed | Weak per item, confounded by temporal shift in the controls |
| Time split | Dated items and the known training cutoff | Exposure, visible as a cliff at the cutoff | Needs a steady supply of fresh items; difficulty can drift over time |
| Rewrites and private held-out | Authoring effort and strict access control | Score inflation itself, whatever the leak path | Rewrites can shift difficulty; private sets leak once sent to vendors or APIs |
Leave a Reply