Which Test Questions Leaked? Contamination Auditing as Multiple-Instance Learning

When a language model scores well on a benchmark, auditors want to know two things: did some of the test questions leak into its training data, and which ones? Answering the second question directly has largely failed. Detectors that score each question on its own, by asking whether the model finds the text suspiciously likely, perform at chance on pretraining data (Does Data Contamination Detection Work (Well) for LLMs?). The labels auditors can actually trust are coarse. Questions written after a model's training cutoff are certainly clean. Some collections are known or strongly suspected to be partly leaked: a benchmark split that a model reproduces verbatim (Time Travel in LLMs), a test set with an audited overlap (CAP), or a controlled injection. That is exactly the supervision structure of multiple-instance learning (MIL). In MIL, labels are given to groups ("bags") rather than items. A negative bag contains only negatives, and a positive bag contains at least one positive whose identity is hidden.

This note proposes to train a per-question leakage scorer using only bag-level labels of this kind. Each question is described by features that compare the model's likelihood of the canonical wording against meaning-preserving rewrites of the same question. This comparison cancels out how hard the question is and how well the model knows the domain. Question scores are combined with a pooling rule that is provably able to recover item-level labels. From one trained model the audit produces four outputs: a verdict for the whole collection, an estimate of the fraction of questions that leaked, a ranked list of suspect questions, and a benchmark score recomputed without them. The prediction that separates this from existing work is that the ranked list and the leaked-fraction estimate stay accurate in the sparse regime where only a few percent of a benchmark leaked. In that regime, collection-level averaging tests lose power and per-question detectors are near chance.

Core Claim

Contamination is one-sided in the same way MIL labels are. Post-cutoff items give clean negatives, and pre-cutoff or suspected collections contain an unknown minority of true positives. Blum et al. showed that standard MIL reduces to learning under one-sided random noise. The practical consequence is that the right weak-label model for a pre-cutoff collection is "some of these leaked," not "all of these are members." Temporal membership benchmarks such as WikiMIA encode the second, stronger assumption.

We claim three things. First, a scorer trained under the correct one-sided assumption, with pooling that preserves item identity, localizes leaked questions better than per-item detectors. Second, it estimates the leaked fraction better than set-level tests. Third, most of the gain at low leak rates comes from the within-question rewrite contrast, and MIL training supplies calibration and the combination of features. The last claim is falsifiable, and one ablation below is designed to break it.

Research Program

The instance representation. For question $x_i$ with rewrites $x_{i1},\dots,x_{iK}$ (paraphrased stems, permuted options, alternate templates), let $s(\cdot)$ be the calibrated token score of Min-K%++. That method normalizes each token's log-probability by the mean and spread over the vocabulary. The core feature is a within-question contrast:

$$z_i = \frac{s(x_i) - \operatorname{mean}_k s(x_{ik})}{\operatorname{sd}_k s(x_{ik})}.$$

It asks whether the model prefers this exact wording over equally meaningful alternatives. It does not ask whether the model likes the text in absolute terms.

This design addresses two known failures. The first is the "goodness of fit" trap from Does Data Contamination Detection Work (Well)?: a proficient model finds all domain text likely, so absolute scores flag clean data. The second is the difficulty confounder from Confounders in Instance Variation, which showed that accuracy drops under rephrasing often reflect harder phrasing rather than memorization. Our contrast lives in likelihood space and is normalized by the question's own rewrites, so neither domain skill nor the difficulty of a particular template shifts it systematically. $z_i$ is joined by a small vector of related signals: the answer-conditioned version of $z_i$, a verbatim-completion overlap score, and the answer-option order effect. Together these form the instance features.

The pooling rule. Are MIL Algorithms Learnable for Instances? proved that attention applied to features entangles bag context with item identity, so it cannot learn item labels in the PAC sense (provably correct learning from finite samples). Their experiments show attention pooling at about 0.95 bag AUROC collapsing to about 0.71 at the instance level. Conjunctive pooling, which weights predictions rather than features, keeps item-level learnability. We therefore use a per-question classifier $p_i = f_\theta(\text{features}_i)$ and a bag score

$$P(\text{bag leaked}) = \sum_i a_i\, p_i, \qquad \hat{\rho} = \tfrac{1}{n}\sum_i p_i,$$

where $a_i$ are softmax weights computed from the same per-question features and $\hat\rho$ is the estimated leaked fraction. Negative bags push every $p_i$ toward zero. Positive bags require only that some $p_i$ be high.

Training alternates in the spirit of EM-DD (Zhang et al.), which selects likely "witness" instances in positive bags and then refits the concept away from negatives. Our version replaces hard witness selection with the soft conjunctive objective. EM-MIA also runs an EM loop for membership, but it does so over individual snippets and has no bag structure or clean-negative anchor. The distinction matters in its reported failure mode: it degrades to chance on OLMoMIA-Hard, where members and non-members are drawn from nearly the same distribution.

Where bag labels come from. Supervision comes from three sources. The first is controlled injection. We continue pretraining open Pythia and OLMo checkpoints on a FineWeb mixture into which a known subset of benchmark questions is inserted, at leak rates from 0.5% to 20% and at 1 to 5 exposures. This gives item-level ground truth for evaluation only; training sees bag labels alone. The second source is temporal. Items written after a model's cutoff form negative bags, and pre-cutoff items from the same benchmark family form positive-candidate bags. The third source is audited real cases, which serve for transfer tests only. Throughout, the scorer is trained and evaluated per target model, because leakage is a property of a specific model.

Scope. The method targets data-level and label-level contamination, meaning exposure to the question wording or the answer wording. Semantic-level exposure, in which the model learned the facts but not the text, deliberately produces $z_i \approx 0$. We treat that as the correct answer rather than a miss.

Baselines

The naive reference point is document-level perplexity averaged over the collection and compared against a clean reference collection. It is the obvious first thing an auditor would compute. Does Data Contamination Detection Work (Well)? reports that per-instance perplexity sits at an AUC of roughly 0.50 on Pythia and OLMo pretraining data, against 99.4 AUC in the fine-tuning setting on BioMistral-NLU. We therefore expect the naive baseline to pass only when exposures are heavily repeated. Beating it means clear gains at one to two exposures.

The strongest per-question competitor is Min-K%++, which outperformed Min-K% by 6.2 to 10.5 AUROC points on WikiMIA (Min-K%++). Alongside it we run EM-MIA, which reports over 96% AUC-ROC on WikiMIA for Mamba, Pythia and Llama and 99% on OPT-66B, but near-chance performance on OLMoMIA-Hard (EM-MIA). Both are run on the same target models and the same item pools. Each receives the same held-out clean items for threshold calibration that our method's negative bags use. Hyperparameters, such as the k fraction for Min-K%++ and the prefix pool and iteration count for EM-MIA, get the same number of tuning trials as ours. Beating them means higher item-level AUROC and higher precision in the top 5% of flagged items at leak rates of 5% or below, on the injected Pythia and OLMo testbeds and on OLMoMIA-Hard. No numeric AUC for intermediate OLMoMIA splits was found on Lacuna, so we will measure those ourselves.

The strongest collection-level competitor is a two-sample test on per-question Min-K%++ scores between the suspect collection and a clean post-cutoff collection. We also run the Guided-Instruction heuristic of Time Travel in LLMs, whose GPT-4 few-shot classifier reached 92% to 100% accuracy on its partitions but was evaluated on only 10 instances per partition. Both use identical clean references and identical query budgets. Beating them means higher detection power at a fixed 5% false-alarm rate on collections with 1% to 2% leakage, together with an estimated leaked fraction $\hat\rho$ within a few points of the injected rate. The two-sample test does not produce such an estimate.

The ablations isolate each ingredient. Replacing conjunctive pooling with attention pooling tests the learnability argument: bag scores should be similar while item AUROC falls. Replacing $z_i$ with the raw Min-K%++ score tests the rewrite contrast. Using $z_i$ alone, thresholded at the 95th percentile of clean items with no MIL training, tests whether the learning step earns its place. Swapping the MIL objective for positive-unlabeled learning with an estimated class prior tests whether the bag structure matters beyond "unlabeled with some positives."

Why not just…?

Why not just average detector scores over the benchmark and run a two-sample test? This is the real threat for the yes/no verdict. With thousands of MMLU items and a moderate leak rate, a mean-shift test may match any learned model. We concede that case in advance and report it. Our claim rests on two regimes. The first is sparse leakage, where a mean shift carried by 1% of items is swamped by variance from clean items. The second is the item-level and leaked-fraction outputs, which a set-level test does not produce at all. If the two-sample test on $z_i$ equals our method at 1% leakage, the bag-verdict contribution collapses to the feature, and we will say so.

Why not just threshold the rewrite contrast directly, with no MIL? This is the ablation most likely to hurt us. It tests whether the value lies entirely in comparing the canonical wording with its rewrites. MIL training can add three things: a learned combination of several weak features, a decision threshold fitted to the target model from its own clean-negative bags, and consistent estimates of $\hat\rho$. If the thresholded $z_i$ matches our item AUROC and gives a comparably accurate leaked fraction, the honest conclusion is that the contrast feature is the contribution. The MIL machinery would then be unnecessary, and the note would be rewritten around it.

Why not just measure accuracy drops under paraphrase, as CAP does? CAP computes a consistency ratio of task performance across perturbations. Confounders in Instance Variation showed that such drops confound memorization with template difficulty: accuracy varied widely by template alone, and diverse-template training produced a 61.4% jump versus 71.0% for single-template training. We compare against CAP's ratio on its FinEval setting and on the multi-digit addition set, where template difficulty is known. The test is whether our likelihood-space contrast stays flat on clean items under hard templates while CAP's ratio moves.

Why not just use fresh benchmarks like LiveBench or DyVal? They avoid contamination going forward, but they do not audit existing models on legacy benchmarks. DyVal is limited to formal reasoning (DyVal), and LiveBench requires script-verifiable answers and monthly refreshes (LiveBench). We use them as a source of guaranteed-clean negative bags, which makes them complementary to this work rather than an alternative.

Proposed Experiments

The main testbed is controlled injection. MMLU test questions (Measuring Massive Multitask Language Understanding) are injected into continued pretraining of Pythia (1.4B to 6.9B) and OLMo checkpoints across the full grid of leak rate and exposure count. Bags are formed at the level of MMLU subjects, and fresh DyVal and LiveBench items serve as extra negatives. We report item AUROC, precision in the top 5% of flagged items, bag detection power at a 5% false-alarm rate, and the absolute error of $\hat\rho$. We also report the contamination-adjusted score, meaning accuracy on items with $p_i<0.1$, against the true clean-item accuracy.

We additionally run on WikiMIA and OLMoMIA-Hard. For these, bags are built from each benchmark's temporal and member splits, and the instance-level labels are never used in training.

Three decisive checks are planned. The first is the known-overlap test. We train on temporal bags for the open-weight Baichuan-13B and ask whether the top of our ranking recovers the 21 FinEval questions whose overlap CAP confirmed by audit, measured as recall at the top 21 against Min-K%++ and CAP. The second is the partition test. Using the Time Travel partitions (AG News, WNLI, XSum, RTE) on open models, we check whether our bag verdicts agree with guided-instruction evidence when that method is scaled from 10 items per partition to the full splits. The third is the pooling test. On the injection testbed, conjunctive and attention pooling should give similar bag AUROC, but attention pooling should lose substantially at the item level, reproducing the pattern of roughly 0.95 bag versus 0.71 instance AUROC from the MIL learnability paper in a language setting.

The proposal fails if, at leak rates of 5% or below, thresholded $z_i$ or the two-sample test matches us on item recovery and on leaked-fraction error. It also fails if the injected-contamination gains do not carry over to the FinEval recovery test.