If a language model really computes the answer to "simplify $(a+b)\cdot(b+a) - a\cdot a$", it should do equally well on every expression that means the same thing and takes the same amount of work to simplify. A model that has memorized the published benchmark item will instead do best on the exact string it saw and worse as the surface form moves away from it. We propose to measure this directly. For each benchmark item built around a symbolic expression, we generate its equivalence orbit: a set of variants that a term rewriting system proves equal to the original. A term rewriting system is a set of directed simplification rules such as $x+0 \to x$. Crucially, we use the machinery that rewriting systems use to prove termination to hold the intrinsic difficulty of each variant fixed. That machinery consists of well-founded orderings on expression trees, which guarantee that simplification always stops. With difficulty held fixed, any accuracy drop between the published form and its orbit is attributable to surface familiarity, not to the variant being harder.
This matters now because the standard tools for catching contamination stop working on modern reasoning models. Under contamination, a model has seen benchmark test items during training. The usual detectors read the model's token probabilities to tell seen items from unseen ones. On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that one epoch of clean reinforcement learning erases this signal, and that fine-tuning on chain-of-thought solutions pushes ten detectors to 50–58% AUROC, close to chance, while the inflated scores remain. A behavioral test that does not read probabilities, and whose perturbations are certified both equivalent and equally hard, is exactly what that setting lacks.
Core Claim
Our claim is that an accuracy gap between a published item and its difficulty-matched equivalence orbit is a contamination signal that survives reinforcement-learning and chain-of-thought post-training. The claim also needs a second half. Without the difficulty control, existing perturbation benchmarks cannot separate memorization from ordinary difficulty shift.
Write $R$ for a convergent rewrite system for the item's algebraic theory. "Convergent" means simplification always stops and always reaches the same final form. Write $\mathrm{nf}(s)$ for the normal form, or fully simplified expression, of an expression $s$. Write $c(s)$ for the length of the innermost reduction from $s$ to $\mathrm{nf}(s)$. The orbit of a published item $s$ at rewrite distance $d$ is the set of $t$ with $\mathrm{nf}(t)=\mathrm{nf}(s)$, $t$ reachable from $s$ in $d$ equational steps, and $c(t)=c(s)$. The per-item orbit gap is
$$G_d(s) = \mathrm{acc}(s) - \mathbb{E}_{t \in O_d(s)}\,\mathrm{acc}(t),$$
where $\mathrm{acc}$ is the model's accuracy over sampled attempts. A clean model should have $G_d \approx 0$ for all $d$. A memorizing model should show $G_d$ rising with $d$.
The cleanest special case uses permutation-only orbits, which only reorder arguments of associative-commutative operators. These leave $c$ exactly unchanged by construction.
Research Program
The generator is built from established rewriting tools, each playing a specific role. For Boolean and arithmetic theories we start from complete systems obtained by associative-commutative completion, as in Associative-Commutative Rewriting. That work built a complete, terminating Boolean-algebra system in the REVE laboratory using matching modulo associativity and commutativity. We reuse its rules and its flattening of nested associative terms. Commutativity cannot be oriented as an ordinary rule, so we use the constrained orientation of Solving Term Inequalities. There, $x\cdot y \to y\cdot x$ fires only when $x>y$ under a lexicographic path ordering, which gives each permutation class a canonical representative. This tells us which variants are pure reorderings and lets us sample them uniformly.
Expansion variants come from applying rules in reverse, such as $x \to x+0$ or distributing a product. We then re-normalize and keep a candidate only if its reduction cost matches the original's. Many candidates must be compared under the ordering, and for that we use Decomposition Ordering. Its early-exit comparison is equivalent to the recursive path ordering under a total precedence and stops after about $1+1/v$ tests on unary terms. It makes rejection sampling over large candidate pools cheap.
The novel ingredient is using the termination ordering as a difficulty meter rather than as a termination proof. Prior dynamic benchmarks generate fresh problems or mutate surface features without any such control. The work then proceeds in three parts. The first is the generator. The second is a controlled-contamination study with known ground truth. The third is an audit of public models on real benchmark subsets.
The closest existing work differs in clear ways. RE-IMAGINE mutates Python representations of GSM8K-style questions and reports about a 10% drop when only numbers change, but it neither certifies that mutations preserve difficulty nor handles algebraic laws systematically. A²RBench verifies tasks by cycle consistency $g(f(x))=x$ and finds a 17.7% drop under symbol remapping. Its check covers only bijections, so many-to-one simplification is outside its scope. DyVal generates new reasoning problems from random graphs and controls depth and width. It measures capability on fresh items, so it cannot say whether a score on an existing benchmark is inflated. Learning neuro-symbolic convergent term rewriting systems trains neural modules to execute convergent rewriting and generalizes from nesting depth 3 to depth 12. We borrow its four domains (Logic, ListOps, Arithmetic, Monomial Algebra) as a controlled testbed, but we use rewriting to probe models rather than to build one.
Baselines
The naive reference point is the published-form accuracy alone, which treats the benchmark score at face value. Every contamination question is posed relative to it.
The strongest existing probability-based method is LiRA, a likelihood-ratio membership test that compares the target model's loss on an item with its loss under reference models. On SFT contamination of a pre-reasoning base model, LiRA reaches 89.1% AUROC before reinforcement learning and drops about 14% after one epoch of clean GRPO. Under chain-of-thought contamination of DeepSeek-R1-Distill-Llama-8B, the ten detectors average 50–58% AUROC (On The Fragility of Benchmark Contamination Detection in Reasoning Models). We will rerun LiRA, Min-K%, and Loss on exactly our member and non-member splits and checkpoints, with the same reference models and the same compute. Beating it means orbit-gap AUROC of at least 75% in the chain-of-thought setting, where LiRA is near chance. It also means no significant loss after GRPO, where LiRA degrades.
The strongest behavioral competitors are surface perturbations without difficulty control. These are RE-IMAGINE-style value resampling, A²RBench-style symbol remapping, and LLM paraphrase. Each gets the same number of variants per item and the same sampling budget as our orbits. No reported result found on Lacuna for any of these as an item-level membership detector, so we report their AUROC ourselves.
The key ablation is unmatched orbits. These use the same rewrite generator with the cost filter $c(t)=c(s)$ removed. It isolates whether the termination-ordering control is what makes the gap interpretable.
Why not just…?
Why not just paraphrase items with an LLM or resample their numbers? Such variants change difficulty in uncontrolled ways. The roughly 10% drop RE-IMAGINE reports under value resampling mixes memorization with the fact that new numbers can make arithmetic harder. On clean, never-contaminated models, our unmatched-orbit ablation and the paraphrase baseline should show nonzero gaps, which are false positives. Matched orbits should not. If the paraphrase baseline matches matched-orbit AUROC on the controlled study, the difficulty control is unnecessary, and we will report that.
Why not just evaluate on fresh dynamic benchmarks like DyVal? Fresh problems tell you what a model can do. They do not tell you whether its reported score on MATH or Minerva Math is inflated, because the two distributions differ. DyVal's finding that phi-1.5 and WizardMath-13B score near zero on its tasks shows a gap but cannot localize it to particular benchmark items. Orbits are tied to the specific published items, so the gap is attributable to them.
Why not just use chronological post-cutoff analysis? That requires dated items, and it confounds contamination with drift in problem style over time. Orbits keep the problem fixed and vary only its form. Orbits face a real threat in the chain-of-thought setting, however. If chain-of-thought training genuinely transfers to the whole problem family, the gap will be small. In that case the published score is not specifically inflated, and the metric is behaving correctly. We test this directly by also measuring accuracy on fresh same-family items.
Proposed Experiments
The decisive experiment is controlled contamination on items we construct ourselves. We draw expression items from the four NRS domains and from the DyVal arithmetic and Boolean generators. Half go into a member split and half into a non-member split. Following the fragility paper's two-stage protocol, we contaminate a base model by SFT on member items with answers. We then apply one epoch of clean GRPO. Separately, we fine-tune DeepSeek-R1-Distill-Llama-8B on chain-of-thought solutions of member items. At every checkpoint we compute the per-item orbit gap at distances $d\in\{1,2,4,8\}$, using permutation-only and expansion orbits, and report member-versus-non-member AUROC against all baselines. We also compute the gap on an uncontaminated control model to estimate the false-positive rate. The prediction that would falsify the core claim is simple: matched orbit gaps stop separating members from non-members after GRPO, as LiRA does.
The second experiment audits real benchmarks. From MATH algebra, Minerva Math, and GSM8K we extract the items whose core is an explicit expression to simplify or evaluate. We parse them into terms and generate matched orbits. We then report per-benchmark gap curves $G_d$ for open models. Consistency checks are that gaps should be larger on benchmarks released earlier and should be near zero on the permutation-only orbits of generator-fresh DyVal items. The third, smaller experiment checks the difficulty meter itself. It tests whether $c(t)$ predicts clean-model accuracy on fresh items better than expression length or depth. If it does not, the matching must use a different cost, such as reduction length under the path ordering or normal-form size.
References
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- Associative-Commutative Rewriting
- Solving Term Inequalities
- Decomposition Ordering as a Tool to Prove the Termination of Rewriting Systems
- RE-IMAGINE: Symbolic Benchmark Synthesis for Reasoning Evaluation
- A²RBench: An Automatic Paradigm for Formally Verifiable Abstract Reasoning Benchmark Generation
- DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks
- Learning neuro-symbolic convergent term rewriting systems