When a language model has seen a benchmark question and its worked solution during training, later reinforcement learning can hide that fact. The usual detectors look for memorization in the model's token probabilities. They flag test items the model finds unusually unsurprising. After even one epoch of clean reinforcement learning, their signal fades toward chance. This note proposes a different place to look: not how confident the model is, but which wrong numbers it writes down when a memorized problem is subtly changed. Take a benchmark problem built as a computation graph, where each intermediate quantity depends on earlier ones. Change a single input and recompute. Only the intermediate values downstream of that input change. A model that is actually computing will get those downstream values right or wrong in ordinary ways. A model that is replaying a memorized solution should leak the old values, the correct values for the problem it saw in training, into exactly the nodes that should have changed. It should still get the untouched branches right.
The core idea fits in two sentences. Perturb one leaf of a graph-structured problem and read back every intermediate value in the model's written reasoning. Then measure how often the affected nodes carry the stale, pre-perturbation value, weighted by where in the graph the deviation occurs. We expect this "stale-value intrusion" to separate trained-on items from fresh ones even after the probability-based signal has been erased. The reason is that reinforcement learning's clipping compresses likelihood gaps but has no obvious reason to overwrite memorized intermediate content.
Core Claim
The claim is that the provenance of errors in a reasoning graph is a contamination signal. We define provenance as which ancestor node first went wrong, and whether the wrong value matches a value from a memorized twin problem. We claim this signal survives the two regimes where existing detectors fail. The first is supervised contamination followed by clean GRPO, the group-relative policy optimization used to train current reasoning models. The second is direct chain-of-thought contamination of distilled reasoning models.
The claim borrows its scoring logic from hierarchical error weighting, the line of work that grades a wrong answer by how far it sits from the truth in a tree of categories rather than scoring it 0/1. It applies that logic to the execution graph of a synthetic problem rather than to a label taxonomy. It borrows its setting from hierarchical error propagation: early mistakes in a dependency graph cascade upward, so an error's origin, not just its presence, carries information.
Where this sits in prior work
Three papers motivate the gap. On The Fragility of Benchmark Contamination Detection in Reasoning Models contaminates Qwen2.5-7B-Instruct during supervised fine-tuning, which inflates pass@1 by 8.8%. It then shows that one epoch of GRPO cuts LiRA's AUROC (area under the ROC curve) from 89.1% by about 14 points. It also shows that chain-of-thought contamination of DeepSeek-R1-Distill-Llama-8B inflates accuracy by 11.7% while all ten detectors fall to 50–58% AUROC. The authors trace this to ratio clipping compressing log-probability gaps. Their detectors read only probabilities and final answers. We read intermediate content, which their mechanism does not obviously touch.
CAP: Data Contamination Detection via Consistency Amplification detects contamination through the accuracy consistency ratio under meaning-preserving perturbations, and caught a 21-question overlap on FinEval. It works on multiple-choice and single-turn items and scores only whether the answer stayed correct. The fragility paper's finding that contaminated reasoning models generalize to similar problems is in direct tension with CAP's premise that memorization is brittle. Our proposal speaks to that tension. A model may keep much of its accuracy on perturbed twins, which defeats CAP, yet still leak stale values in the cases where it fails or partially fails.
Two dynamic-benchmark papers supply the method. DyVal generates arithmetic, logic and reachability problems as directed acyclic graphs, meaning dependency graphs with no cycles, of controllable depth. This gives us named intermediate nodes with known values. It scores only the terminal node, and it reports that depth, not width, drives failure. BeyondBench supplies solver-verifiable algorithmic tasks, such as Tower of Hanoi, whose intermediate states are checkable. It also scores end-to-end exact match only.
Two papers constrain the design. From the hierarchical-weighting side, No Cost Likelihood Manipulation at Test Time for Making Better Mistakes in Deep Networks shows that reweighting by a distance matrix is only as good as the probabilities it operates on. So our signal deliberately uses no probabilities. Taxonomy-Aware Evaluation of Vision-Language Models shows that mapping free-form text onto a structure is the fragile step: its best mapper reaches 47.1% exact node match. We avoid that fragility by using synthetic problems whose intermediate nodes carry explicit names the model is asked to report.
GeoBench found that models barely beat chance at localizing a faulty proof branch: o1 scores 27.89% against a 25.71% random baseline. We do not ask the model to localize its own errors. We localize them externally, which that result suggests is necessary.
Research Program
The first component is a controlled contamination testbed. Using the DyVal generator in the PromptBench codebase (PromptBench), we freeze a "public benchmark" of a few thousand arithmetic and logic DAG problems at depths D2–D4. We freeze a second set from BeyondBench-style algorithmic tasks with verifiable intermediate states. Each problem gets a chain-of-thought solution that names every intermediate node and its value. Half the items are designated members, half non-members.
We then reproduce the two regimes of the fragility paper. In Stage I, we fine-tune Qwen2.5-7B-Instruct on member solutions mixed into ordinary instruction data, then run one epoch of GRPO on clean, non-benchmark problems. In Stage II, we fine-tune DeepSeek-R1-Distill-Llama-8B directly on member chain-of-thought.
We add a crucial third condition: a task-family control. This model is fine-tuned on an equal volume of different DAG problems from the same generator. It lets us check that the signal reflects membership rather than mere exposure to the task format.
The second component is the twin-perturbation probe. For each item $x$ we create twins $x'$ by changing one leaf value at a chosen depth. This defines an affected set $A$: the leaf's ancestors, whose true values change from the original value $o_v$ to a new value $t_v$. The unaffected set $U$ contains all other nodes. We prompt the model on $x'$ and parse the value $m_v$ it reports for each node $v$. The stale-value intrusion score is
$$S(x') = \frac{1}{|A|}\sum_{v \in A} w_v \, \mathbf{1}[m_v = o_v \neq t_v],$$
where $w_v$ is a depth weight. Following the depth-sensitive weighting of hierarchical metrics, $w_v$ up-weights intrusions at nodes close to the perturbed leaf. Those intrusions are harder to explain by an ordinary downstream cascade.
Next to $S$ we record the node where the model's values first diverge from both truth and the original. This is the error-origin depth, the reasoning-graph analogue of lowest-common-ancestor distance in a taxonomy. We also record accuracy on $U$, which separates "replaying the old solution" from "just failing."
The instance-level detector averages $S$ over several twins per item. It needs only sampled text, so it applies to closed models.
The third component tests transfer beyond fully synthetic items. We template a small set of GSM8K-style word problems into explicit dependency graphs and repeat the probe on models that the fragility paper's AIME/GPQA setup suggests are contaminated. This last step is exploratory. The main evidence comes from the controlled testbed, where membership is known.
Baselines
The naive reference point is the do-nothing detector: final-answer accuracy on the original item, used as a membership score. Contamination inflates it, but so does skill. We run it on the same members and non-members and report its AUROC as the floor.
The strongest existing method on this question is LiRA as run in On The Fragility of Benchmark Contamination Detection in Reasoning Models, together with Loss and Min-K% from the same suite. That paper reports LiRA AUROC of 89.1% before RL, about 14 points lower after one GRPO epoch, and 50–58% AUROC for all detectors in the chain-of-thought regime. It is the strongest competitor because it is the best-documented detector on exactly this threat model. We run it on our own checkpoints with the same reference-model budget as the original paper, so the comparison uses identical data and models. Beating it means exceeding the post-GRPO LiRA AUROC we measure ourselves, which we expect to land in the mid-70s given the reported drop. In Stage II, beating it means clearly exceeding the 58% ceiling. A detector that only matches LiRA before RL but holds its AUROC after RL would already count as a positive result.
CAP (CAP) is the closest perturbation-based competitor. We implement its performance consistency ratio on our twins, so it sees exactly the perturbations our method sees and differs only in reading final-answer correctness rather than intermediate provenance. We found no reported CAP AUROC on Lacuna; its paper reports a detection case study, not an AUROC. We will therefore compare against our own run.
Two ablations isolate the key ingredient. The first is final-answer echo: the rate at which the twin's final answer equals the original item's final answer. This is the provenance idea with the graph structure removed. The second is our score with uniform weights $w_v = 1$, which isolates the contribution of depth weighting.
Why not just…?
Why not just use CAP's consistency ratio? This is a real threat. If contaminated models collapse on twins, the accuracy drop alone may detect them as well as our score does. The fragility paper's evidence that chain-of-thought contamination generalizes to similar problems suggests the accuracy gap shrinks in Stage II. That is where we expect CAP to fail and stale-value intrusion to survive. We are wagering that partial replay produces wrong intermediate values of a specific kind without always flipping the final answer's correctness. The head-to-head on identical twins settles it. If CAP matches us in both regimes, the graph machinery is unnecessary, and we would report that honestly.
Why not just check whether the model repeats the original final answer on the twin? This is the cheapest version of our idea and is run as an ablation. It detects only whole-solution replay. It misses the case we think is common after RL: the model recomputes the unaffected branches correctly and carries stale values up the perturbed path. That case produces a final answer that is neither the old answer nor the new one. If echo recovers most of the AUROC, we will adopt it as the recommended detector and drop the node parsing.
Why not just rely on likelihood detectors run before RL? Deployed models arrive already post-trained, and auditors rarely get the pre-RL checkpoint. The fragility paper shows the signal degrades with a single epoch of GRPO, and it traces that degradation to clipping. That mechanism acts on probability ratios, not on the content of generated intermediate values. Our Stage I comparison directly measures whether that asymmetry holds.
Why not just evaluate on dynamic benchmarks and ignore detection? DyVal and BeyondBench make fresh evaluation possible, and we endorse them. But the community still needs to audit scores on the static benchmarks everyone reports. Dynamic generation also remains hard in knowledge-rich domains, as the BeyondBench and DyVal limitations note. Detection and fresh evaluation are complements.
Proposed Experiments
The decisive experiment is the Stage I and Stage II detection AUROC of the intrusion score versus LiRA, Loss, Min-K%, CAP and echo, all on the same checkpoints. We report it separately by twin depth, since depth-of-perturbation should modulate the signal.
The task-family control is the second decisive check. If the control model shows intrusion rates as high as the contaminated model's non-members show, the signal reflects membership. If the control model's intrusion rates rise to match the contaminated model's members, the signal only reflects familiarity with the format, and the claim fails.
A dose-response check varies how many times member solutions appear in training (one, three, ten epochs). It asks whether intrusion scales with exposure while final accuracy on originals saturates.
A robustness check varies the GRPO duration, from one to several epochs. It tests whether RL eventually erases intermediate content too, and it would tell us how long this signal lasts.
We also report the distribution of error-origin depth for members versus non-members. We expect member errors to originate at or near the perturbed leaf and fresh-item errors to originate at the deep nodes where DyVal says failures concentrate.
Finally, the templated GSM8K-style transfer study tests whether the probe works when intermediate values must be parsed from less controlled text. Here the parsing accuracy of our node extractor is itself reported, since Taxonomy-Aware Evaluation of Vision-Language Models warns that this mapping step is where structured evaluation usually breaks.
References
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- CAP: Data Contamination Detection via Consistency Amplification
- DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks
- BeyondBench: Contamination-Resistant Evaluation of Reasoning in Language Models
- No Cost Likelihood Manipulation at Test Time for Making Better Mistakes in Deep Networks
- Taxonomy-Aware Evaluation of Vision-Language Models
- GeoBench: Rethinking Multimodal Geometric Problem-Solving via Hierarchical Evaluation