When a language model answers a benchmark question it saw during training, it can produce the right answer without reading the question carefully. This proposal tests for that directly. We make a small, fluent edit to a benchmark item that changes its correct answer, for example changing "12 apples" to "15 apples" in a math word problem. We then watch, inside the model, whether the numbers it writes down are copied from the edited text in front of it or pulled from memory of the original item. The original value no longer appears anywhere in the prompt. Any probability the model puts on it therefore cannot come from reading the context and must come from stored weights. That gives a clean, per-item contamination signal that does not depend on the model being more confident on seen items, which is the signal reinforcement-learning post-training is known to erase.
The opportunity matters because the standard tools are failing. Text-overlap filters miss paraphrased leaks, and a Llama-2-13B fine-tuned on rephrased MMLU test questions jumped from about 55 to about 86 (Rethinking Benchmark and Contamination for Language Models with Rephrased Samples). Confidence-based detectors such as Loss, Min-K% and LiRA collapse to 50–58% AUROC on contaminated reasoning models after RL post-training (On The Fragility of Benchmark Contamination Detection in Reasoning Models). What is still missing is a test that asks where an answer's content comes from, not how confident the model is.
Core Claim
A pointer-generator is a decoder that mixes two sources at each step: copying a token from the input through attention, or generating one from its fixed vocabulary. LargePiG: Your Large Language Model is Secretly a Pointer Generator shows that any off-the-shelf decoder LLM already contains this split. Attention from the last token to the context acts as a copy distribution. The divergence between intermediate-layer and final-layer predictions marks the steps where the model is resolving a content token rather than a function word. LargePiG uses this split to suppress hallucination in query generation and assumes the context is trustworthy. We use the same split for auditing: we deliberately make the context disagree with what the model may have memorized.
Our claim is that a contamination score built from this disagreement will separate contaminated from clean items under RL "cloaking," where confidence-based detectors do not. The score is the probability mass the model places on the original, now-absent value at the steps where it should be copying the edited value. We also expect the signal to be strongest in middle layers, read out with the logit lens (projecting an intermediate hidden state through the output layer). The reason is that Demystifying Verbatim Memorization in Large Language Models finds memorized recall is carried by distributed middle-layer states. RL clipping flattens the final-layer log-probability gap, but nothing about clipping requires those middle-layer states to disappear.
Concretely, let $S$ be the context positions holding the edited value $v_{new}$, and let $v_{orig}$ be the original value, which is absent from the context. At each content step $t$ flagged by the LargePiG divergence gate, we take the layer-$\ell$ logit-lens distribution $P_\ell$ and the copy mass $c_t=\sum_{i\in S}a_{t,i}$. Here $a_{t,i}$ is the attention-derived pointer weight from step $t$ to position $i$. The item score is
$$ s_\ell = \max_t \Big[\log P_\ell(v_{orig}\mid x_{<t}) - \log P_\ell(v_{new}\mid x_{<t})\Big] \quad\text{restricted to steps with } c_t>\tau, $$
where $\tau$ is a threshold that keeps only steps at which the model is visibly pointing at the edited span. The restriction to pointing steps is the pointer-generator ingredient. It locates the operand-emission moments without hand alignment, and it discards steps where the original value could legitimately appear.
Why Fluency Is a Constraint, Not Decoration
The edit must not announce itself. A crude edit, such as a typo or an implausible number, pushes the item off the distribution of benchmark text. A model might then fail or behave strangely for reasons unrelated to memory. This is the undersensitivity confound documented in Undersensitivity in Neural Reading Comprehension. We therefore borrow the adversarial-fluency recipe from RAFT: Realistic Attacks to Fool Text Detectors. RAFT ranks influential words with a proxy model, generates context-aware replacements, filters them by part of speech, keeps edits to at most 10% of tokens, and preserves human-level perplexity; humans could not tell its outputs from human text (p = 0.917).
Our goal is the opposite of RAFT's. We want edits that change the ground truth while leaving the surface form maximally familiar. That way, a contaminated model's memory is triggered as strongly as on the original item. This also separates us from Dynamic Evaluation of Large Language Models by Meta Probing Agents and from rephrasing pipelines. Those works transform items heavily to escape memory. We transform them minimally to provoke memory and then catch it inside the model.
Research Program
The edit generator works on benchmarks whose answers can be recomputed exactly after the edit. GSM8K numbers are altered and answers recomputed from a programmatic re-solution, with items rejected if the edit changes the solution structure. Competition math (AIME, AMC, OlympiadBench, Minerva Math) uses the same procedure on problems with explicit constants. HumanEval is a secondary setting: we change constants or literals in docstrings and regenerate test cases accordingly. Every edited item passes a perplexity filter and a part-of-speech filter. A human sample additionally checks fluency and answer validity.
Contamination is controlled, not guessed, because only then do we have ground-truth labels. Following the protocol of On The Fragility of Benchmark Contamination Detection in Reasoning Models, we contaminate a random half of each benchmark by supervised fine-tuning, then apply clean GRPO. We do this both before and after reasoning post-training, including DeepSeek-R1-Distill-Llama-8B as that paper did. A third arm replicates rephrased contamination in the style of Rethinking Benchmark and Contamination for Language Models with Rephrased Samples. The model never sees the verbatim item, only a paraphrase carrying the original numbers. This arm tests whether the method catches leaks that defeat surface matching.
The analysis then asks three questions in order. First, does $s_\ell$ separate contaminated from clean items before RL? Second, does it survive RL? Third, at which layers does it survive? Language Models "Grok" to Copy shows that copying circuits form late and move across layers during training. We therefore also check whether RL changes the attention-copy mass $c_t$ itself, or only the vocabulary-side pull toward $v_{orig}$. That question is the open tension between RL cloaking and circuit-level accounts of memory.
Baselines
The naive reference point is no audit. We report raw benchmark accuracy on the contaminated and clean halves. The gap gives the inflation any detector should explain; the Fragility paper reports an 11.7% pass@1 boost from contaminating DeepSeek-R1-Distill-Llama-8B.
The strongest existing detectors are the confidence-based family evaluated in the Fragility paper: Loss, Min-K%, LiRA and verbatim probing. LiRA is the main competitor because it is the best reported. The paper reports LiRA at 89.1% AUROC before RL, falling to about 75% after one epoch of clean GRPO, and all ten detector baselines collapsing to 50–58% AUROC in the post-reasoning-training stage. We rerun these detectors ourselves on the same models, items and contamination splits, with LiRA given the same reference-model budget we allow ourselves. Beating them means per-item AUROC clearly above 58% in the post-RL stage and no worse than LiRA before RL.
The strongest behavioral competitor is the counterfactual edit used without any internals. It comes in two forms. The first is the accuracy drop on edited versus original items, which is what MPA-style probing and EvoEval report; MPA reports GPT-4-Turbo dropping 15.7% on MMLU. The second is the stale-answer rate: the fraction of edited items on which the model outputs, or writes as an intermediate operand, the original value. This competitor runs on exactly our edited items, so the only difference is whether we look inside the model. Beating it requires higher per-item AUROC. The decisive subset is contaminated items the model answers correctly after editing, where no behavioral signal exists by construction.
Three ablations isolate the key ingredients. The first drops the pointing-step restriction and scores every step. The second uses final-layer probabilities only, testing whether middle-layer readout matters under RL. The third replaces fluent edits with unconstrained random number substitutions, testing whether the fluency constraint is what keeps memory triggered and confounds out. For rephrased contamination we additionally run the text-overlap filter. Where the training corpus is available, we also run the embedding-plus-LLM decontaminator from the Rethinking paper, which audits data rather than models and serves as an upper reference.
Why not just…?
Why not just run text-overlap decontamination on the training data? It cannot see paraphrased leaks. The Rethinking paper's rephrased MMLU result is the direct evidence, and our rephrased-contamination arm reproduces that failure condition. Overlap filtering also needs the training corpus, which most audited models do not release.
Why not just threshold loss or Min-K% on benchmark items? The Fragility paper shows these detectors fall to near chance once RL post-training compresses the gap between seen and unseen items. Our post-RL comparison is designed exactly around their reported collapse.
Why not just measure the accuracy drop on edited items? An accuracy drop mixes contamination with genuine difficulty changes from the edit, and it is a benchmark-level statistic, not a per-item one. Because we edit clean and contaminated items identically, difficulty effects cancel in the comparison, and we report the drop as a baseline.
Why not just count stale answers and skip the internals? This is the real threat. If a contaminated model reliably writes the original number, a simple output check may detect it as well as our score does. We treat it as a first-class baseline. If it matches the internal score across all settings, we will report that the contribution is the fluent counterfactual-edit protocol and drop the mechanistic claim. The internal score has to earn its place on contaminated items answered correctly after editing, where a stale-answer check sees nothing. It also has to show it needs fewer items to flag a model.
Why not just use logit lens or DoLa-style layer contrast without the pointer machinery? Layer contrast alone cannot tell legitimate mentions of a value from memory-driven ones. Our "no pointing restriction" ablation measures exactly this. LargePiG also reports beating DoLa on truthfulness, which suggests the copy decomposition carries information beyond layer contrast. We still test this here rather than assume it.
Decisive Checks
The proposal stands or falls on three results. The first is whether middle-layer $s_\ell$ keeps per-item AUROC well above the 50–58% range after GRPO on the Fragility paper's math benchmarks. The second is whether it beats the stale-answer rate on contaminated items that remain correct after editing. The third is whether it detects rephrased contamination that text-overlap filters miss. A secondary check concerns mechanism. If RL leaves the vocabulary-side pull toward $v_{orig}$ intact but reduces the copy mass $c_t$, that would be direct evidence that cloaking hides memory in output confidence and not in the internal states that produce it. The reverse pattern would tell us cloaking actually rewires how the model reads its context.
References
- Rethinking Benchmark and Contamination for Language Models with Rephrased Samples
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- LargePiG: Your Large Language Model is Secretly a Pointer Generator
- Demystifying Verbatim Memorization in Large Language Models
- Undersensitivity in Neural Reading Comprehension
- RAFT: Realistic Attacks to Fool Text Detectors
- Dynamic Evaluation of Large Language Models by Meta Probing Agents
- Language Models "Grok" to Copy