When a language model has seen a benchmark question during training, it can answer from memory instead of reasoning. Recent mechanistic work found that such memorized answers travel through a narrow internal channel: on leaked math problems, a few directions dominate the model's hidden activations. Removing those directions knocks out the memorized shortcut and often restores genuine reasoning. We propose to treat the number of removed directions as a dial and to read contamination from the whole response curve. For each test item, we project out the top 1, 2, 4, … directions of a cheaply estimated activation subspace and record when the model's answer changes. A memorized answer should break almost immediately. An answer produced by reasoning should survive until much more of the representation is removed.
This turns a known accuracy-versus-dimensionality trade-off into a per-item measurement. That matters for two reasons. Existing corrections to benchmark scores are either corpus-wide scalar discounts, or behavioral tests that need many clean reference models or paraphrase pipelines. A per-item rank-sweep score needs only forward passes through the model being audited. It yields both a contamination estimate for each question and a recommended amount of projection for repairing the answer. It also lets us test, outside of math, whether the "narrowing geometry" is a general signature of memorization or a quirk of arithmetic.
Core Claim
The paper A Narrowing Geometry in Contaminated Reasoning is the closest prior work and the main motivation. On Qwen2.5 and Llama3.1 models evaluated on GSM8K and MSCalc, it shows three things:
- Concentrated activations. Leaked inputs concentrate activations in
mlp.up_projinto a few dominant directions, as measured by an eigenspectrum concentration index. - A working repair. Its intervention, Top-Subspace Suppression (TSS), projects out those directions. TSS restores reasoning on roughly half of leaked samples and drops clean accuracy by less than 6%.
- An advantage over output-level blocking. TSS beats the decoding-time token-blocking baseline by 11.03% absolute in consistency with the uncontaminated model.
TSS uses a single, fixed amount of suppression, chosen post hoc. It relies on gradients and white-box access, and it was tested only on math.
Our claim is that the item-level curve of answer stability against removed rank separates memorized from reasoned answers more reliably than any single-rank statistic. We define this curve as follows. Let $P_k^{(\ell)}$ project out the top-$k$ directions of a sketched activation covariance at layer $\ell$. Let $c_k(x)\in\{0,1\}$ indicate whether the answer to item $x$ under $P_k^{(\ell)}$ agrees with the unprojected answer. The contamination score is the normalized area under that agreement curve on a log-spaced grid $k\in\{1,2,4,\dots,K\}$:
$$s(x) = 1 - \frac{1}{|\mathcal{K}|}\sum_{k\in\mathcal{K}} c_k(x).$$
Here $\mathcal{K}$ is the grid of ranks. A high $s(x)$ means the answer breaks early. A second quantity is the flip rank $k^\ast(x)$, the smallest $k$ at which the answer changes. It serves as the per-item repair setting.
This differs from TSS in three ways. It is a detector and a calibrator, not only a fixed intervention. It uses only forward activations, with no output gradients. It is evaluated across task types, not just arithmetic.
Research Program
Estimating the subspace cheaply. We estimate the top subspace per layer from a streaming randomized sketch of activations, not a dense eigendecomposition. This is a secondary engineering choice, but it has principled footing. Sketching Algorithms and Lower Bounds for Ridge Regression shows that a weaker approximate-matrix-multiplication guarantee can replace full subspace embeddings with much smaller sketches. Our use, recovering dominant covariance directions, needs only that weaker property. Exploiting the structure via sketched gradient algorithms frames sketch size as a dial between noise and throughput. We sweep it rather than assume it.
We deliberately do not borrow the low-coherence label-embedding theory of Label Embedding via Low-Coherence Matrices. Its lossless guarantees rest on a Massart noise condition that we have no reason to believe holds for transformer activations. We use that paper only as an analogy, as its coherence-and-dimension story suggests why small models may lack room for a separate memorization channel.
Which subspace to remove. We compare three sources for the directions:
- a subspace computed on the benchmark pool itself;
- one computed on generic text;
- the item's own activation trajectory.
Only the first two avoid circularity at audit time.
We extend the analysis beyond mlp.up_proj to attention output projections and the residual stream. This addresses an explicit limitation of the narrowing-geometry paper.
From items to scores. The corpus-level output is a contamination-adjusted accuracy. Each item contributes its correctness after projection at its own flip-rank-calibrated setting. The comparison point is DCR, which multiplies raw accuracy by a single fuzzy-inference factor. If contamination is item-specific, as ConStat and the narrowing-geometry paper both suggest, item-level adjustment should beat a uniform discount on benchmarks where only a subset leaked.
Baselines
Do nothing, and perplexity. The naive reference is raw benchmark accuracy for score estimation. For detection, it is the model's per-item perplexity on the question.
The second matters because the likeliest failure of our method is that $s(x)$ merely tracks confidence. Every rank-sweep result will be reported both raw and after matching contaminated and clean items on perplexity and answer-token probability.
Output-probability detectors. These are the token-level membership-inference methods AECA and PAC. AECA high-pass filters calibrated token self-information. PAC measures a polarized distance between the most and least confident tokens on perturbed neighbors. Min-K% is run alongside them, as it is in the AECA evaluation. They are the strongest competitors for detection because they need no internals.
The reported numbers are relative gains, not absolute AUCs:
- AECA improves average AUC by 1.3–1.5% on WikiMIA and beats perplexity by 4.5% at 256 tokens.
- PAC improves AUC by 4.5% on WikiMIA and 5.9% on StackMIA.
No reported absolute AUC for these methods was found on Lacuna, so we will rerun them on our models and splits with their published defaults (λ=5 for AECA). Beating them means higher AUC at matched false-positive rate, especially on 32-token inputs, where AECA is known to degrade.
Reference-model behavioral detection. This is ConStat, the strongest existing detector. It reports detecting 98.4% of sample-specific contamination in controlled experiments, against 71% for the best baseline it compared.
We run it with a reduced reference family under the same total GPU budget we spend on rank sweeps. We also report it at its full 20-model configuration where feasible, so the cost asymmetry is visible.
Paraphrase consistency. CAP measures consistency across option shuffling, distractor edits and paraphrases. It is run with identical perturbation sets.
Mitigation baselines. For repair, the baselines are TSS at its single published suppression setting, and LNE-Blocking, which blocks the top-1 token when length-normalized entropy is low.
The bar is set by the narrowing-geometry paper: TSS's 11.03% absolute consistency gain over LNE-Blocking, with under 6% clean-accuracy loss. Beating it means higher agreement with the uncontaminated model at equal or lower clean loss, achieved by choosing $k^\ast$ per item rather than globally.
Score adjustment baseline. For corpus-level scores, the baseline is DCR, whose adjusted accuracies were within 4% of uncontaminated baselines on SST-2, LIAR2 and GSM8K.
Ablations isolating the key ingredients. Two ablations test whether our specific choices matter:
- Random directions. Remove random directions of matched energy. If this yields similar curves, the "memorization subspace" is not doing the work.
- Single static number. Score each item by the static concentration index alone, with no sweep, to test whether the curve adds anything beyond a single spectral statistic.
Why not just…?
Why not just use perplexity or Min-K%, which also flag memorized items? This is the most serious threat. A memorized answer is both low-perplexity and, plausibly, fragile under projection, so the two signals may be redundant.
The decisive test is the confidence-matched evaluation described above. We take clean items the model answers with equally low perplexity, for example trivially easy arithmetic. We then ask whether their answers survive projection longer than memorized items do. If the gap vanishes after matching, the proposal reduces to an expensive perplexity proxy, and we will report it as such.
Why not just paraphrase the items, as CAP and ConStat do? Behavioral perturbation works well; ConStat's 98.4% figure shows this. But it requires building reliable paraphrases, and ConStat also requires clean reference models. Paraphrase sets also fail when contamination itself was at the paraphrase level, which DCR calls semantic-level (L1) exposure.
Rank sweeps need neither paraphrases nor references. We will measure directly whether they hold up on L1-contaminated splits where paraphrase checks should be blind.
Why not just apply TSS with a tuned global rank? If one global $k$ works across items and tasks, per-item flip ranks add complexity for nothing. The experiment answers this directly. We compare the best single $k$, tuned on a validation split, against per-item $k^\ast$ on clean-accuracy loss and repair rate. If the distribution of $k^\ast$ is tight across tasks, we will adopt the simpler global version.
Why not just use fresh benchmarks like LiveBench? Dynamic benchmarks such as LiveBench avoid future leakage. They do not re-score the hundreds of models already ranked on GSM8K or MMLU, which is the audit problem we target. We use post-cutoff items only as an additional clean control.
Proposed Experiments
Controlled contamination. We inject subsets of benchmark items into Qwen2.5-1.5B, Qwen2.5-7B and Llama3.1-8B, the models used in the narrowing-geometry paper. The benchmarks span task types: GSM8K, MMLU, HumanEval, SST-2, LIAR2, and ECTSum. Held-out halves of each benchmark serve as clean items.
Injection varies along three axes:
- Exposure level: inputs only, inputs with labels, or paraphrases (DCR's L3, L4 and L1).
- Training method: LoRA versus full-parameter continued pretraining. This addresses LNE-Blocking's untested assumption that LoRA contamination resembles pretraining contamination.
- Number of exposures.
Detection and short-text evaluation. Detection AUC is measured against the known injection labels. We additionally run WikiMIA at 32 and 256 tokens to compare with AECA and PAC in their own setting.
Mitigation. We report two measures: agreement with the uncontaminated model, and clean-accuracy loss.
Score correction. We report the absolute error between adjusted accuracy and the uncontaminated model's accuracy, against DCR. We also evaluate on GSM8K with Mistral-7b-v0.1, where ConStat reports about 8.3% inflation. This gives an uncontrolled real-world point of agreement.
Three decisive checks.
- Signal beyond confidence. Contaminated items must show lower flip ranks than perplexity-matched clean items.
- Signal beyond random removal. The top-subspace curve must separate the two groups clearly better than the random-direction control.
- Generality beyond math. The separation must persist on at least the non-math classification and code tasks.
Scale. The 1.5B-versus-7B comparison tests DCR's observation that small models are memorization-limited. If small models show no early-flip population even when they score above chance on leaked items, that is evidence they memorize without a dedicated narrow channel. In that case the method's reach is bounded by scale, and we will say so.
References
- A Narrowing Geometry in Contaminated Reasoning
- Sketching Algorithms and Lower Bounds for Ridge Regression
- Exploiting the structure via sketched gradient algorithms
- Label Embedding via Low-Coherence Matrices
- DCR: Quantifying Data Contamination in LLMs Evaluation
- ConStat: Performance-Based Contamination Detection in Large Language Models
- Rethinking Pretraining Data Detection for LLMs: From Local to Global
- Data Contamination Calibration for Black-box LLMs
- CAP: Data Contamination Detection via Consistency Amplification
- LNE-Blocking: An Efficient Framework for Contamination Mitigation Evaluation on Large Language Models
- LiveBench: A Challenging, Contamination-Limited LLM Benchmark