Measuring Benchmark Contamination by Reweighting Fresh Test Items

When a large language model scores lower on a freshly written version of a benchmark than on the original, the drop mixes two causes. The model may have memorized the original questions, which is contamination. Or the fresh questions may simply be harder or formatted differently. MMLU-CF rebuilt a contamination-free version of the MMLU knowledge benchmark and reported an average accuracy drop of about 14% across more than 40 models. It also rephrased questions and added a "None of the other choices" option to half the items, so that drop cannot be read as a contamination estimate. We propose to separate the two causes. Take a panel of reference models known not to have seen the original test. Reweight the fresh items so that these clean models score, on the reweighted fresh set, exactly what they score on the original set. Any gap that remains for a model under test is then attributable to exposure, not to difficulty.

The weighting step is instance-based transfer learning: estimating one distribution's expectations by reweighting samples drawn from another. We borrow the discrepancy-minimization idea of Domain Adaptation: Learning Bounds and Algorithms, with one change. The family of "hypotheses" over which the discrepancy is measured becomes the panel of clean models, and the loss is whether each model answers an item correctly. With a 0-1 loss this becomes a small linear program. Because benchmarks like MMLU are multi-task (57 subjects), and contamination is uneven across subjects, the weights are solved per task. The output is a per-subject contamination estimate rather than one aggregate number.

Core Claim

The standard density-ratio correction assumes the relationship between inputs and outcomes is the same in both samples, the "covariate shift" assumption. Adversarial Weighting for Domain Adaptation in Regression depends on it, and it breaks when that relationship changes. Contamination is exactly such a change: memorization raises a model's probability of being correct on specific original items without changing the items. We turn this weakness into a measurement. Suppose weights make fresh items indistinguishable from original items for every clean model. Then a contaminated model's excess accuracy on the original items is, by construction, the part of its behavior the clean panel cannot explain.

Concretely, for one task let $O$ be the original items and $F$ the fresh items. Let $\mathcal{H}$ be the clean panel, and let $c_h(x)\in\{0,1\}$ mark whether model $h$ answers item $x$ correctly. We choose weights $w_j \ge 0$ over fresh items, summing to one, to solve

$$\min_{w}\ \max_{h\in\mathcal{H}}\ \Big|\tfrac{1}{|O|}\textstyle\sum_{i\in O} c_h(x_i)-\sum_{j\in F} w_j\, c_h(x_j)\Big| \quad \text{s.t.}\ \ \mathrm{ESS}(w)\ge \kappa,$$

where $\mathrm{ESS}(w)=1/\sum_j w_j^2$ is the effective number of fresh items and $\kappa$ keeps the weights from collapsing onto a handful of items. For a model $m$ under test, the estimated contamination gap is

$$\hat\Delta_m=\tfrac{1}{|O|}\textstyle\sum_{i\in O} c_m(x_i)-\sum_{j\in F} w_j\, c_m(x_j).$$

The objective is linear in each model's vector of correct answers. So the matching automatically holds for any mixture of panel models, not just the panel members themselves. It follows that $\hat\Delta_m$ is unbiased, up to the residual of the program, whenever $m$'s hypothetical clean behavior lies within the convex hull of the panel's behavior. It can fail when $m$ is more capable than every clean model, and testing that failure mode is a central part of the program.

Relation to Prior Work

Four papers motivate the gap. The Emperor's New Clothes in Benchmarking? audited 20 benchmark-side mitigations using two criteria. Fidelity asks whether a clean model scores the same on the edited benchmark. Contamination resistance asks whether a contaminated model loses its advantage. It found that surface edits keep fidelity above 0.9 with near-zero resistance, while aggressive multiple perturbations cut MMLU fidelity to 0.686.

Our method does not edit the benchmark at all. It enforces fidelity on the clean panel as a constraint and measures resistance as the residual. Confounders in Instance Variation for the Analysis of Data Contamination showed, on multi-digit addition, that accuracy drops on rephrased items partly reflect harder phrasing (a "masking effect"). It diagnosed this confound but offered no correction. Our weighting is that correction.

MMLU-CF supplies the fresh item pool through its open validation split, and Measuring Massive Multitask Language Understanding supplies the original. Neither paper separates difficulty from exposure.

Two papers constrain the design. Does Data Contamination Detection Work (Well) for LLMs? shows that per-item perplexity detectors are no better than chance (AUC about 0.50) on pre-training data, but reach an AUC of 99.4 after supervised fine-tuning. We therefore cannot rely on per-item detectors in the regime that matters most for frontier models. We must also expect them to be a strong competitor in the fine-tuning regime. DyVal generates contamination-free reasoning items at controlled difficulty levels. That gives us a second setting where the fresh pool is unlimited and difficulty is known.

On the multi-task side, Super-NaturalInstructions and The Flan Collection define the kind of multi-task instruction mixture we use to build contaminated models with known exposure. RotoGrad balances conflicting task gradients at the level of whole tasks. It is not a baseline here, but its task-level view is what we deliberately avoid: contamination is uneven within tasks as well as across them.

Research Program

The work has three parts.

Build the estimator. We implement the linear program per task, with the effective-sample-size constraint. We map MMLU's 57 subjects onto MMLU-CF's 14 disciplines where needed. We also add a coarse "format" feature so that fresh items containing the "None of the other choices" option can be matched separately.

Build a testbed with ground-truth contamination. The testbed uses open-data base models from the Pythia and OLMo families, whose training data can be searched for exact MMLU test matches. We instruction-tune each base model on a Flan-style multi-task mixture. Some variants have original MMLU test items injected into a chosen subset of disciplines, varying three factors: the number of repetitions, verbatim versus paraphrased injection, and the number of disciplines touched.

The true contamination boost for an injected model is its accuracy on the injected items minus the accuracy of the same base model tuned on the same mixture without injection. Uninjected variants, which differ in seeds, mixture weights, and model size, form the clean panel. To reach the regime where detectors fail, a smaller arm injects items at low repetition during continued pre-training of small Pythia models.

Apply the estimator to real models. We run it on open and closed models over original MMLU versus the MMLU-CF validation split. The result is corrected per-discipline contamination gaps, which we compare with the raw roughly 14% drop.

Baselines

The naive reference point is the raw difference: accuracy on original items minus unweighted accuracy on fresh items. This is the comparison that MMLU-CF's reported drop of about 14% on average, and o1's drop from 92.3% to 80.3%, implicitly invite. It uses exactly the same items and model outputs as our method. On clean held-out models it should show a spurious nonzero "gap," and that spurious gap is the error we aim to remove.

The strongest classical competitor is psychometric test equating with item response theory. This fits a two-parameter model of item difficulty and discrimination on the clean panel's answers and predicts each test model's original-set score from its fresh-set score. It is strong because it is the standard tool for comparing test forms of different difficulty. No reported result was found on Lacuna for item-response equating applied to LLM contamination. We fit it on the identical panel and item pools, and tune its regularization using the same leave-one-model-out validation as our effective-sample-size bound.

The strongest existing contamination method in the fine-tuning regime is per-item perplexity detection from Does Data Contamination Detection Work (Well) for LLMs?, which reports an AUC of 99.4 on BioMistral-NLU. We run it on the same test models and convert its scores into a gap estimate: the accuracy on flagged original items minus the accuracy on unflagged ones, rescaled by the flagged fraction.

Two ablations isolate our key ingredient. The first replaces the minimax program with simple stratification: fresh and original items are binned by the panel's average accuracy and the histograms are matched. This tests whether matching each model separately matters beyond matching a single difficulty score. The second removes the per-task solve and uses one pooled set of weights, which tests the multi-task component.

Beating the baselines means two things in the testbed. First, a lower mean absolute error between estimated and true contamination boost than every competitor. Second, estimated gaps within noise of zero on uninjected disciplines and on held-out clean models. For the second criterion, we compute fidelity and resistance scores in the sense of The Emperor's New Clothes in Benchmarking?. A clear win is fidelity comparable to surface edits (above 0.9) together with nonzero resistance, the combination that paper found no benchmark-side edit achieved.

Why not just…?

Why not just trust the drop on a fresh benchmark like MMLU-CF? Because that benchmark changes format and phrasing along with exposure. Confounders in Instance Variation shows that phrasing difficulty alone produces drops that look like decontamination. The testbed makes this measurable: clean models that never saw the injected items will still show a raw gap. The raw-difference baseline quantifies that gap directly.

Why not just fit an item response model and equate? This is the most serious threat, and it may perform comparably when contamination is mild and one ability dimension explains most answers. Our reasons to expect an advantage are specific. Item response models assume a single latent ability, but multi-task benchmarks mix knowledge areas. Contamination is also concentrated in particular items, which such models absorb into distorted item parameters. The minimax weights, by contrast, make no parametric assumption and carry an exact guarantee within the panel's convex hull. The testbed decides the question. If item response equating matches our error across injection rates and the capability-extrapolation split, we will report that and recommend it as the simpler tool.

Why not just detect contaminated items with perplexity and drop them? In the pre-training regime that governs frontier models, these detectors sit at an AUC of about 0.50 (Fu et al.). Closed models also often provide no usable token probabilities. After fine-tuning, the detector is expected to be strong, and we expect it to rival or beat us on the fine-tuning injection arm. The continued pre-training arm is where our method must show its value. We report both arms separately rather than averaging them.

Why not just rewrite the benchmark more aggressively? The Emperor's New Clothes in Benchmarking? already shows the trade-off. Rewrites strong enough to resist memorization push MMLU fidelity down to 0.686. Our method leaves every item untouched, so comparability with past results is preserved by construction.

Proposed Experiments

The first decisive check is recovery of known contamination in the testbed. We report mean absolute error of $\hat\Delta_m$ against the true boost per discipline, across repetition counts and verbatim versus paraphrased injection. We expect error to shrink as the effective sample size grows, roughly as $1/\sqrt{\mathrm{ESS}}$, since $\hat\Delta_m$ is a weighted average of Bernoulli outcomes. The paraphrased-injection arm connects to the finding in Confounders in Instance Variation that diverse phrasing reduces the contamination boost (a 61.4% jump versus 71.0% for one repeated template). We expect our estimate to track that smaller boost rather than inflate it.

The second check tests extrapolation beyond the clean panel. We build the panel only from smaller models and test on larger clean models that were held out. A nonzero spurious gap here would mean the convex-hull condition is binding. In that case we would report how much panel capability is needed before applying the method to frontier models.

The third check is a transfer test on DyVal. We treat items from its lower complexity levels as the "original" set and deliberately contaminate them. Items from mixed complexity levels serve as the fresh pool. The question is whether the weights correctly offset DyVal's known difficulty gradient, such as GPT-3.5-Turbo's 23% arithmetic drop from the easiest to the hardest level.

Finally, we apply the validated estimator to public models on MMLU versus the MMLU-CF validation split. We ask two questions. First, how much of the roughly 14% average drop survives difficulty matching? Second, which disciplines carry the residual? For open-data models, we cross-check any large residual against exact-match search of their training corpora.