When a language model has seen a test question during training, its score on that question mixes two things: recall of the item and genuine ability. Recent work separated these after the fact for one case. Recall Residualisation asks a model for the exact historical value of a time series and regresses that recall out of its "forecast." Apparent forecasting skill largely vanished: correlations up to 0.93 collapsed to 0.17 or lower. The trick only works when a benchmark item has a single lookup answer that can be queried directly. It operates on output numbers, and its authors concede that a linear output-space regression cannot catch non-linear contamination. For math and science reasoning benchmarks there is no date to query, and the output-level signals that other detectors rely on are erased by a short phase of reinforcement learning. On The Fragility of Benchmark Contamination Detection in Reasoning Models shows LiRA, a loss-based membership test, falling from 89.1% AUROC toward chance after clean GRPO training, while the inflated accuracy remains.
We propose to perform the residualization inside the model. For each benchmark item we record hidden activations on its canonical text and on a rewritten variant. We do the same for freshly written control items that cannot have been seen. We then factor the activation space into three mutually orthogonal subspaces. The first holds content shared across a problem's wordings. The second holds the generic effect of rewording, learned from the control items. The third holds the extra signal that appears only when the model reads the canonical text of a benchmark item, which we call the recall subspace. Projecting the recall subspace out at inference and re-scoring the exact original items gives a contamination-adjusted score. The size of the score drop estimates inflation per item. The orthogonality constraint is what makes this work: it keeps "this text was reworded" from being mistaken for "this text was memorized."
Core Claim
The claim is that item-specific recall leaves a low-dimensional, linearly separable trace in intermediate activations. Once the generic rewording direction is factored out, removing that trace lowers accuracy on contaminated items by roughly the true inflation. It should leave a never-contaminated twin model's accuracy essentially unchanged. We further claim this trace survives clean reinforcement learning. The cloaking documented by the Fragility paper acts on the spread of output losses through PPO/GRPO clipping, and need not erase the internal representation of familiarity. That hope is supported by RADAR, which finds recall and reasoning use different internal pathways: focused attention and fast layer-wise confidence convergence for recall, distributed and gradual for reasoning. RADAR, however, only classifies; it does not localize or remove anything.
The method makes a narrower promise than "decontamination." It targets recall of specific items. It does not target the procedural generalization that the Fragility paper finds after chain-of-thought contamination, where the model becomes more confident on unseen questions too. We will measure how much of the inflation falls in each category rather than claim both.
Method
The geometry comes from the shared/private factorization of Factorized Orthogonal Latent Spaces and its "difference loss" descendants such as MISA. Both split multi-view data into a subspace common to all views and private subspaces orthogonal to it. Here the "views" are wordings of the same problem.
At a chosen layer, let $h_i^c$ and $h_i^v$ be mean-pooled activations for benchmark item $i$ in canonical and variant form. Let $g_j^c, g_j^v$ be the same for fresh control item $j$. We learn an orthonormal basis $U = [U_s, U_w, U_r]$ with shared, rewording, and recall blocks. It is parameterized by a Cayley transform as in the OSP layer, so orthogonality holds exactly rather than through a soft penalty. We fit it by minimizing
$$ \sum_i \big\| h_i^c - h_i^v - U_w w_i - U_r r_i \big\|^2 + \sum_j \big\| g_j^c - g_j^v - U_w w_j \big\|^2 + \lambda \sum_k \log\big(\sigma_k(R) + \epsilon\big) $$
The terms are defined as follows. $w$ are rewording coefficients. $r_i$ are recall coefficients, allowed only for benchmark items. $R$ stacks the $r_i$, and $\sigma_k(R)$ are its singular values. $\lambda$ trades fit against rank, and $\epsilon$ is a small constant. The control items force $U_w$ to absorb generic rewording effects, so $U_r$ can only explain canonical-versus-variant differences that are specific to benchmark items. The log-singular-value penalty, borrowed from Factorized Orthogonal Latent Spaces, chooses the recall dimensionality automatically instead of fixing it by hand. The shared block $U_s$ spans what remains of the content and does not enter the edit.
At evaluation time we apply $h \leftarrow (I - U_r U_r^\top) h$ at every token position in a small band of layers. We then regenerate answers to the original items. Contamination-adjusted accuracy is the edited model's accuracy. The per-item inflation estimate is the change in correctness probability, measured over multiple samples.
This differs from three neighboring lines of work. MemSinks isolates memorization into a fixed set of neurons during pretraining using known sequence IDs. That requires metadata and access to pretraining, and it cannot audit an existing model. We work post hoc and without IDs, in a rotated basis rather than on individual neurons. LUNAR moves forget-set activations along one difference-of-means direction toward a refusal region. We remove a learned multi-dimensional subspace and require that the model keep answering, because the goal is a clean score, not a refusal. OSP splits layers into orthogonal subspaces without telling any subspace what to hold, and was tested only on ImageNet, GLUE and detection. We reuse its parameterization but attach meaning to each block through the paired-view data.
Research Program
The work runs in three stages, each with ground truth.
The first stage builds controlled contamination with clean twins. At small scale we follow the design of Causally Quantifying the Effect of Test Set Contamination on Generative Benchmarks: pretrain 34M and 93M parameter models on FineWeb-Edu, with and without inserted copies of half of the MATH test set, at several duplication counts. At reasoning-model scale we follow the Fragility paper. We fine-tune DeepSeek-R1-Distill-Llama-8B on half of the items from AIME, AMC, GPQA Diamond, OlympiadBench and Minerva Math, either as plain answers or as chain-of-thought solutions, and train a clean twin without those items. We then apply one epoch of clean GRPO to both. Because we control which half was leaked, every item has a known membership label and a known true inflation: contaminated-model accuracy minus clean-twin accuracy on that item.
The second stage covers variants and controls. Variants are produced by paraphrasing and, for math, by changing numerical constants with recomputed answers. Control items are newly written problems in the same topics, each with its own variant. A held-out portion of items is used to check that variants and canonical items are equally hard for the clean twin. If they are not, that difficulty gap becomes a measured confound for the variant-gap baseline below.
The third stage is analysis. We map where in depth the recall subspace lives, how its rank grows with duplication count, and whether a subspace fit on one benchmark transfers to another. Transfer would mean a model can be audited on a new benchmark using only control items and a few calibration benchmarks. Last, we apply the fitted procedure to open-weight models on MMLU, ARC and GSM8K. There we compare its flags against independent evidence: the Sharded Rank Comparison Test reported a significant signal for Mistral-7B on AI2-ARC at $p=0.001$ and p-values around 0.01 on MMLU for LLaMA2 and Mistral.
Baselines
The naive reference point is the raw benchmark score with no adjustment. It implies an inflation estimate of zero and an item-level detector no better than chance. Any method has to beat it on estimating inflation, which is trivial when contamination is present. On the clean twin, the naive point is exactly right, so it sets the standard for false positives.
The strongest output-level detector is LiRA as configured in the Fragility paper. Before reinforcement learning it reached 89.1% AUROC on Stage I contamination. After one epoch of GRPO it lost about 14 points, and across ten detectors under chain-of-thought contamination AUROC averaged 50–58%. We run it on our exact checkpoints with the reference models that paper describes. Beating it means matching it before reinforcement learning (within a few AUROC points of 89.1%) and holding at least 75% AUROC after GRPO, where LiRA drops to roughly 75% or below.
The strongest internal-state competitor is a supervised linear probe on the same activations. It is trained on member/non-member labels from a calibration benchmark, in the spirit of RADAR, whose classifier over 37 surface and mechanistic features reported 93.0% accuracy on its own 130-example set. We also train RADAR-style hand-crafted features where feasible. The probe gets the same layers, the same calibration data and the same tuning budget as our factorization. Our method must match its detection AUROC. It must also deliver what a probe cannot: an edited model whose accuracy matches the clean twin's.
The strongest paired-wording baseline is the accuracy gap between canonical and variant forms, together with PaCoST's paired confidence t-test. These use the same variants we use.
Two ablations isolate the key ingredient. The first is a rank-1 difference-of-means direction between canonical and variant activations, removed by projection in LUNAR's style. It tests whether multi-dimensional factorization matters. The second is our full method without the control-item rewording block. It tests whether orthogonality to generic rewording is what prevents false positives on the clean twin.
At the 93M scale we additionally train MemSinks with true sequence IDs as an oracle reference. It shows how much recall a method with privileged training metadata can remove.
Why not just…?
Why not just score the model on rewritten variants and report the gap? This is the most serious threat, and it uses the same inputs we do. It has two weaknesses. The gap is biased by any change in difficulty between canonical and variant forms, which our clean-twin difficulty check measures directly. It also yields an adjusted score on different questions than the benchmark asks. Our method re-scores the original items, which matters for per-item inflation. If the variant gap estimates true inflation as accurately as our edit does, both in aggregate and per item, then the latent machinery is not justified for scoring. In that case we will report it as such and keep only the cross-benchmark transfer result, if it holds.
Why not just train a linear probe on activations? A probe flags membership but leaves the score untouched. It also needs member/non-member labels, which do not exist in real audits. The factorization needs only canonical/variant pairs and fresh controls. If a probe trained on one benchmark transfers to another as well as our recall subspace does, the remaining distinction is the edit. The clean-twin comparison settles whether that edit is accurate.
Why not just ablate one difference-of-means direction? A single direction mixes recall with generic rewording. The rank-1 ablation will show whether it also lowers the clean twin's accuracy, which would be a false positive. It may also miss recall that spreads over several dimensions as duplication count grows. PolySAE finds that compositional features are not captured by linear decoding, which is a warning that even our linear subspace may miss some recall. A residual inflation gap after editing would reveal this.
Why not just apply output-space recall residualization? It requires a directly queryable recall target, such as a value at a date. Math and science items do not provide one. We still replicate it on its own FRED and GISTEMP series with an open model, to check that the latent edit agrees where both apply. GISTEMP, where a +0.17 residual correlation survived, is a natural test of whether the latent version removes more.
Decisive Checks
Four results decide whether the idea works. The first is the clean-twin test: projecting out the recall subspace fitted on the contaminated model, and refitting on the twin, must change the twin's accuracy on the leaked items by less than the sampling noise. The second is inflation recovery. Across duplication counts, the drop on the contaminated model should track true inflation. The Fragility paper reports an average of 8.8% pass@1 inflation for answer-only (Stage I) contamination and 11.7% for chain-of-thought (Stage II) contamination on R1-Distill-Llama-8B, so the scale of the target is known. We measure absolute error and per-item rank correlation. The third is survival under GRPO: item-level AUROC from recall-subspace coefficients should stay well above LiRA after cloaking. The fourth is collateral cost, checked as accuracy on uncontaminated items, MMLU accuracy, and held-out perplexity under the edit.
The chain-of-thought condition is where we expect partial failure. If the edit recovers answer-only inflation but only part of chain-of-thought inflation, that is itself a finding. It would mean some of what is called contamination there is learned procedure rather than item recall, and that no recall-removal method should claim to undo it.
References
- Recall Residualisation: Decontaminating Foundation-Model Evaluation on Public Time-Series Benchmarks
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- RADAR: Mechanistic Pathways for Detecting Data Contamination in LLM Evaluation
- Factorized Orthogonal Latent Spaces
- MISA: Modality-Invariant and -Specific Representations for Multimodal Sentiment Analysis
- Layer-Centric Factors of Variation Disentanglement for Task- and Model-Agnostic Generalization
- Memorization Sinks: Isolating Memorization during LLM Training
- LLM Unlearning via Neural Activation Redirection
- Causally Quantifying the Effect of Test Set Contamination on Generative Benchmarks
- Measuring Mathematical Problem Solving With the MATH Dataset
- Proving Test Set Contamination in Black-Box Language Models
- PaCoST: Paired Confidence Significance Testing for Benchmark Contamination Detection in Large Language Models
- PolySAE: Modeling Feature Interactions in Sparse Autoencoders via Polynomial Decoding