Language models are often trained, by accident or on purpose, on the benchmark questions later used to grade them. This is called contamination, and it inflates scores. The usual way to detect it is to check whether the model assigns unusually high probability to a benchmark item. That check has stopped working for reasoning models. Reinforcement learning (RL) post-training, meaning fine-tuning that rewards correct final answers rather than likely text, shrinks the probability gap between items the model has seen and items it has not. After this training, standard detectors score near chance. We propose a different test that looks at sensitivity rather than confidence. We take a benchmark problem and make a small edit that changes the correct answer, for example altering one number or flipping one logical statement. We then measure how much the model's full next-token distribution moves while it re-reads its own original solution. A model that reasons should change its predictions at the steps that depend on the edit. A model that has memorized the item should stay attached to the old solution. We measure that movement with the Jensen–Shannon divergence, a symmetric and bounded way of comparing two probability distributions. We argue below that its boundedness matters in this setting specifically and is not a cosmetic choice.
The stakes are concrete. On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that contamination raises reasoning-model accuracy by 8.8 to 11.7 points. In the same paper, ten detectors fall to 50–58% AUROC (area under the ROC curve, where 50% is chance). The best published fix, Detecting Data Contamination from Reinforcement Learning Post-training for Large Language Models, reaches only 0.70 AUC. A detector that separates "confident because memorized" from "confident because it generalizes" would restore one of the few checks we have on reported reasoning gains.
Core Claim
Two failure modes defeat existing detectors, and both concern confidence. RL clipping compresses the log-probability gap between members (items in the training data) and non-members, and the fragility paper proves this for PPO-style objectives. Chain-of-thought training also makes the model confident on unseen items. Any score built on how much the model likes a given text inherits both problems. Our claim is that memorization leaves a different trace: the model's predictions under-react to edits of the question that change the answer, relative to edits that preserve the meaning.
Let $y$ be the model's own greedy solution to item $x$. Let $x'$ be an answer-changing edit and $x''$ a meaning-preserving paraphrase. Let $p_t(\cdot \mid c)$ be the model's next-token distribution at step $t$ when $y_{<t}$ is fed in after context $c$. We define
$$A(x) = \frac{1}{T}\sum_{t=1}^{T} \mathrm{JS}\big(p_t(\cdot\mid x),\, p_t(\cdot\mid x')\big), \qquad N(x) = \frac{1}{T}\sum_{t=1}^{T} \mathrm{JS}\big(p_t(\cdot\mid x),\, p_t(\cdot\mid x'')\big),$$
where $T$ is the length of $y$ and JS is the base-2 Jensen–Shannon divergence, which lies in $[0,1]$. The contamination score is $s(x) = A(x) - N(x)$. Lower values mean the model reacts to an edit that changes the answer about as little as it reacts to a harmless rewording. We predict that members score lower than non-members, and that this holds after RL, where likelihood scores have collapsed.
The divergence choice is tied to the mechanism. The RL detection paper describes policy collapse: on rewarded items, the model converges to a narrow, nearly deterministic path. Comparing two nearly one-hot distributions with KL divergence makes the result depend on tail tokens with almost no probability. The value spikes or becomes infinite as soon as the edit moves mass onto a token the other condition assigns near zero. The problem gets worse with top-k log-probability APIs, where the leftover mass has to be lumped into one bucket. Jensen–Shannon compares each distribution to their average, so it stays finite and well scaled exactly in the collapsed regime. Attributing Response to Context made the same move for retrieval attribution, replacing KL with JS between full-context and sentence-ablated output distributions to avoid near-zero blowups. That paper names pre-training membership inference as an open extension. We supply the method it lacks for that extension. Our contrast is not context ablation. It pairs an answer-changing edit with a paraphrase control, and that pairing is what separates memorization from generalization.
Relation to Prior Work
Three papers motivate the problem. The fragility paper identifies the failure without proposing a fix. The RL detection paper's Self-Critique method asks the model for an alternative reasoning path and compares the scalar entropy sequences of the two answers using length-penalized cosine similarity. It measures how much the model's uncertainty changes when it is asked to be different. We instead measure how much its full distribution changes when the problem itself is different. That is a direct probe of whether the solution depends on the question. PaCoST compares $P(\text{True})$ on original and paraphrased items with a paired t-test at the benchmark level. Our paraphrase term $N(x)$ plays the role of PaCoST's comparison. We add the answer-changing arm, and we score each sample individually.
Several papers constrain the design. The fragility paper reports that chain-of-thought training lets models generalize to paraphrases. If that holds, any paraphrase-only test fails, which is why the counterfactual arm carries the signal in our method. The likelihood detectors MIN-K% PROB and Min-K%++ score each token in isolation. They are known to drop to 0.42–0.53 AUC on RL-contaminated models, so we use them as references rather than building on them. Kernel Divergence Score compares embedding Gram matrices before and after LoRA fine-tuning. It reaches a 0.99 Spearman correlation with contamination ratios on pre-training mixtures. However, it needs weights and fine-tuning, it estimates contamination for a whole dataset, its cost grows quadratically with the number of items, and it was not tested after RL. Our method needs only forward passes with log-probabilities and scores single items. SurpMark shows that generalized JS divergence over surprisal dynamics works as a detector, but for machine-generated text rather than membership. We do not reuse it.
Research Program
We first build the edit pairs, because the method is only as good as its counterfactuals. On Knights & Knaves and SAT, which are part of RL-MIA, edits can be generated and checked automatically. We flip one speaker's statement or one clause, run a solver, and keep only edits whose answer actually changes. Each paraphrase is checked to have the same solver answer. On AIME 2024/2025 and the fragility paper's math suite, we restrict ourselves to numeric edits whose new answer can be recomputed by a verifier we write per problem. Problems we cannot verify are dropped, and we report the resulting coverage. Edits are kept small in tokens so that the edit size does not differ systematically between members and non-members. We check this by matching edit-distance distributions across the two groups.
Second, we compute $A$ and $N$ under teacher forcing of $y$. That requires three forward passes per item and no sampling. We also report an answer-span variant that averages only over the final-answer tokens and the steps that reference the edited quantity, to localize where any signal comes from. Third, we analyze the clipping argument. The fragility paper's proof concerns variance in the log-probability of realized tokens. We test empirically whether the full-distribution divergence keeps a member–non-member gap across GRPO epochs while that log-probability gap closes.
Baselines
The naive reference point is a random scorer at 0.50 AUC, together with perplexity and plain loss. The RL detection paper reports that perplexity and Min-K% fall to 0.42–0.53 AUC on RL-MIA. We rerun these on our exact splits, with Min-K%++ added, using the same models and the same items. For Min-K% and Min-K%++, $k$ is tuned on a held-out split with the same budget we allow ourselves.
The strongest existing competitor is Self-Critique. On RL-MIA it reports an average AUC of 0.70 on Qwen2.5-7B-Instruct and 0.64 on DeepSeek-Math-7B-Instruct, according to Detecting Data Contamination from Reinforcement Learning Post-training. It is the strongest competitor because it is the only method in the file designed for RL contamination and evaluated on it. We rerun it on the subset of items where valid edits exist, since our coverage restriction could otherwise make the comparison unfair. We count our method as beating it only if it shows a higher AUC on that same subset for both models, with a bootstrap confidence interval that excludes Self-Critique's score.
On the fragility paper's Stage I setup, LiRA is the strongest pre-RL method at 89.1% AUROC, as reported in On The Fragility of Benchmark Contamination Detection, and it drops by about 14 points after one GRPO epoch. LiRA uses reference models; we give it the same reference models the fragility paper used. Beating it here means retaining most of our pre-RL AUC after GRPO, where LiRA loses its own. We also include a PaCoST-style sample-level score, the drop in $P(\text{True})$ from original to paraphrase, and a solve-the-variant baseline, both described in the next section.
The ablations isolate the two ingredients. The paraphrase-only score, $-N(x)$, removes the counterfactual arm. The counterfactual-only score, $A(x)$, removes the paraphrase normalization. The realized-token score, the drop in $\log p(y_t)$ from $x$ to $x'$, removes the full-distribution comparison. KL and total-variation versions of $s$ test whether symmetry and boundedness matter. We run each ablation both with full log-probabilities and with top-20 log-probabilities.
Why not just…?
Why not just use the entropy of the greedy answer, since policy collapse means low entropy? The fragility paper's Stage II results suggest that chain-of-thought-trained models are confident on unseen items as well. Confidence alone therefore cannot separate the two groups, and that is the failure we target. Self-Critique already improves on raw entropy, so we include mean token entropy as a baseline. If entropy alone matches $s$, the counterfactual design adds nothing, and we will report that.
Why not just check whether the model solves the edited variant correctly? This is the most serious alternative. Failing a variant can reflect memorization, but it can also reflect a variant that is harder. At the level of single items, the result is one noisy bit, and most AIME-level items are failed by 7B models even without contamination. Our graded divergence uses the model's predictions at every step, and it does not require the model to solve anything. We run solve-the-variant as a baseline on identical edits. If it matches $s$ in AUC, the divergence machinery is unjustified, and the simpler test should be recommended instead.
Why not just use the log-probability of the old answer under the edit, with no divergence at all? This is the realized-token ablation. Our reason for expecting it to underperform is the fragility paper's proof: clipping compresses exactly this kind of realized-token log-probability statistic. The full distribution also carries how probability mass moves onto alternatives. That reason is a hypothesis, not established, and the post-GRPO comparison settles it directly. If the two scores tie, our claim reduces to the counterfactual-contrast design, and the Jensen–Shannon component becomes a numerical convenience.
Why not just use KL divergence? Attributing Response to Context found KL unstable near zero probabilities in a related ablation setting. The collapsed post-RL distributions are an extreme instance of that condition. We nonetheless run KL, clipped KL, and Jeffreys divergence, and we report their AUC and the variance of their scores, especially in the top-20 log-probability setting.
Proposed Experiments
The primary test uses RL-MIA on Qwen2.5-7B-Instruct and DeepSeek-Math-7B-Instruct, with AUC reported separately for Knights & Knaves, SAT, and the verifiable AIME subset. The second test reproduces the fragility paper's Stage I pipeline: SFT contamination followed by clean GRPO. We track AUC for $s$, LiRA, and the realized-token score after each GRPO epoch. The decisive pattern is that the realized-token score and LiRA decay toward 50% while $s$ does not. The third test is the fragility paper's Stage II, which applies chain-of-thought contamination to DeepSeek-R1-Distill-Llama-8B. There, the paraphrase-only ablation should fail as the paper predicts, and the full score should not. As a sanity check, we contaminate a model released before WMDP existed by fine-tuning on part of WMDP. We then confirm that $s$ ranks the fine-tuned items lower, on multiple-choice items edited by swapping which option is correct.
The proposal is falsified if $s$ does not beat Self-Critique on matched items. It is also falsified if its advantage disappears once members and non-members are matched for difficulty, using baseline-model solve rate as the difficulty measure. Finally, it is falsified if solve-the-variant performs as well. Any of these outcomes would tell us that sensitivity to answer-changing edits is not a usable memorization signal beyond what simpler checks already provide.
References
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- Detecting Data Contamination from Reinforcement Learning Post-training for Large Language Models
- Attributing Response to Context: A Jensen–Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generation
- PaCoST: Paired Confidence Significance Testing for Benchmark Contamination Detection in Large Language Models
- Detecting Pretraining Data from Large Language Models
- Min-K%++: Improved Baseline for Pre-Training Data Detection from Large Language Models
- How Contaminated Is Your Benchmark? Measuring Dataset Leakage in Large Language Models with Kernel Divergence
- Black-Box Detection of LLM-Generated Text Using Generalized Jensen Shannon Divergence