When a language model has seen a benchmark question during training, it can "solve" that question by recalling the answer instead of reasoning toward it. Existing detectors mostly look at how confident the model is in its output text. They measure whether leaked items get unusually low loss or high token probability. Recent work shows that a round of reinforcement-learning fine-tuning (the policy-gradient training now standard for reasoning models) wipes out that signal. After it, loss-based detectors perform close to coin flips. We propose looking inside the model instead. The measurement is how rigidly the model's internal representation of the question is tied to its internal representation of its own answer, across all layers at once.
The core idea fits in two sentences. For each benchmark item, we stack the cross-correlations between question-token states and answer-token states across layers into a three-way array, a tensor, and measure how much of that tensor is explained by a few rank-one components. We predict that memorized items produce a coupling that is sharply concentrated in a few components and that this concentration persists after reinforcement learning, because that training reshapes output probabilities far more than it reshapes the internal pathway from question to recalled answer.
Core Claim
Two lines of evidence motivate this. A Narrowing Geometry in Contaminated Reasoning runs spectral analysis on single MLP projection matrices in Qwen2.5 and Llama3.1. It finds that on leaked GSM8K and MSCalc items, activations collapse into a few dominant directions and the linear coupling between activations and gradients weakens. The authors confine this to mlp.up_proj and say the non-linear interactions in attention heads "may require even more sophisticated geometric tools." On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that GRPO clipping compresses the log-probability gap between seen and unseen items, so LiRA falls from 89.1% AUROC toward chance. The authors examine only output-level statistics.
Our claim sits between the two. The contamination signature is multiplicative. It lives in the interaction between what the model encodes about the question and what it encodes while producing the answer, not in either representation alone. The tool comes from the tensor-interaction literature. Bilinear layers of the form $h_k = x^\top W_k y$ exist precisely to capture cross-dimensional products that additive concatenation misses. Learning to Re-rank for Interactive Problem Resolution and Query Refinement uses such outer products to let a query reweight candidate features. Molding CNNs for text uses low-rank tensor products to capture non-adjacent word interactions. We reuse this machinery as a measurement instrument rather than as a model component.
The Measurement
For an item with question hidden states $Q_l \in \mathbb{R}^{n_q \times d}$ and answer hidden states $A_l \in \mathbb{R}^{n_a \times d}$ at layer $l$, we first project both onto a shared $k$-dimensional basis. The basis comes from principal components of a clean reference pool, with $k \approx 64$, so each projection is $P \in \mathbb{R}^{d \times k}$. We then form the coupling tensor
$$\mathcal{T}_{l,i,j} = \frac{1}{n_q n_a}\left[(Q_l P)^\top (A_l P)\right]_{ij}, \qquad \mathcal{T} \in \mathbb{R}^{L \times k \times k},$$
where $L$ is the number of layers probed. Each slice is the averaged outer product of question and answer features at one depth. We fit a canonical polyadic (CP) decomposition, which writes the tensor as a sum of rank-one layer-by-feature-by-feature terms. The concentration score $\kappa_R$ is the fraction of the tensor's squared norm captured by the top $R$ components. A memorized item should route question to answer through a few layer-consistent channels, which would give high $\kappa_R$.
The obvious confound is difficulty. Easy or highly structured items may also couple tightly. That is exactly the tension the file flags against Implicit Regularization in Tensor Factorization, which proves gradient descent favors low tensor rank as a healthy inductive bias. We therefore never use $\kappa_R$ raw. The detection statistic is the paired difference $\Delta\kappa = \kappa_R(\text{original}) - \kappa_R(\text{rephrased})$, computed on the same model with a meaning-preserving rephrasing of the item. A genuinely easy problem stays easy when reworded. A memorized string loses its recall channel. This borrows the pairing logic of PaCoST, which runs a paired t-test on P(True) confidence between original and rephrased items. We apply that logic to internal coupling rather than to output confidence, which is the quantity reinforcement learning compresses.
Research Program
The first stage builds controlled contamination. We follow the two-stage protocol of the fragility paper. Stage I is supervised fine-tuning with a held-out half of AIME, AMC, GPQA Diamond, OlympiadBench and Minerva Math items leaked into the training data, followed by GRPO. Stage II fine-tunes an already-distilled reasoning model, DeepSeek-R1-Distill-Llama-8B, on leaked chain-of-thought data. We also use the RL-MIA benchmark of AIME and Knights-and-Knaves items from Detecting Data Contamination from Reinforcement Learning Post-training. The uncloaked regime uses GSM8K and the synthetic MSCalc setup of the narrowing-geometry paper on Qwen2.5-1.5B/7B and Llama3.1-8B. MSCalc's controlled chain-of-thought length lets us hold difficulty fixed exactly.
The second stage computes $\Delta\kappa$ at two sites: attention-block outputs and residual-stream states. It sweeps rank $R$ and layer range. It tracks $\Delta\kappa$ at checkpoints across GRPO, so we can see whether the internal signal decays more slowly than loss AUROC.
The third stage is interventional. It asks whether the top CP components are causal rather than merely correlated. We project the dominant components out of attention outputs on flagged items and measure whether the model's reasoning recovers. This mirrors Top-Subspace Suppression (TSS) from the narrowing-geometry paper, which recovered about half of leaked MSCalc samples, but targets attention rather than MLP projections.
Baselines
The naive reference points are a random detector (0.5 AUROC) and plain perplexity/Min-K% on the same checkpoints. On RL-MIA, the RL post-training paper reports that these "hovered around 0.42–0.53 AUC." The strongest existing method in the reinforcement-learning regime is Self-Critique, from Detecting Data Contamination from Reinforcement Learning Post-training. It prompts the model for alternative solutions and measures how rigid its token-entropy sequence is. The paper reports an average AUC of 0.70 on Qwen2.5-7B-Instruct and 0.64 on DeepSeek-Math-7B-Instruct on RL-MIA. We run it on identical checkpoints and items, give it the same number of forward passes our method uses for rephrasings, and count $\Delta\kappa$ as beating it only if item-level AUC exceeds it on both models with non-overlapping bootstrap intervals.
On the fragility testbed, the reported numbers are LiRA at 89.1% AUROC before GRPO, and detectors at 50–58% AUROC in Stage II. We reproduce LiRA and loss with the paper's reference-model setup. Success means holding clearly above that band after GRPO.
The in-context probe CoDeC, from Detecting Data Contamination in LLMs via In-Context Learning, reports 99.9% dataset-level AUC on pretraining corpora. It is included at dataset level. We found no reported result on Lacuna for CoDeC under RL cloaking.
The key ablation replaces the three-way CP analysis with the narrowing-geometry paper's Eigenspectrum Concentration Index. That index is computed on the same attention and residual states, both flattened per layer and on the concatenated question-and-answer states, and it uses the same rephrasing pairing. We found no reported result on Lacuna for that index as an item-level detector AUROC. This ablation isolates whether the multiplicative, cross-layer structure matters. A second ablation replaces the coupling with the question-only and answer-only spectra.
The last baseline is a supervised probe given the same labeled split. We train a linear probe on concatenated question and answer mean states and compare it with a low-rank bilinear probe $x^\top W y$. This tests whether interaction terms carry signal a linear readout misses.
Why not just…?
Why not just check n-gram overlap with the training corpus? It requires the corpus. Proprietary models do not release theirs. ConStat and CoDeC both document that rephrased "shadow" contamination defeats string matching. We still report overlap on FineWeb-derived data as a sanity check on our open-model splits.
Why not just run the existing spectral index on attention outputs? This is a real threat. If flattened-matrix concentration with rephrasing pairing matches $\Delta\kappa$, then the tensor structure adds nothing. In that case we would report that the narrowing-geometry finding extends to attention and drop the multi-way claim. The ablation above settles this directly.
Why not just train a linear probe on hidden states? A probe needs contamination labels the auditor rarely has, and it may learn the leaked subset's topic rather than memorization. Still, if a linear probe trained on one benchmark transfers to another as well as the label-free $\Delta\kappa$, that weakens our case. We test cross-benchmark transfer explicitly, training on GSM8K and testing on AIME, and compare the linear probe against the bilinear probe to see whether interaction terms matter.
Why not just use Self-Critique or PaCoST? Both are behavioral. PaCoST's output confidence is the quantity GRPO compresses. Self-Critique's 0.64–0.70 AUC leaves much room. Neither says where in the network recall happens, and the intervention stage requires that.
Decisive Checks
The idea fails if any of three things happens. The first failure is $\Delta\kappa$ decaying across GRPO checkpoints as fast as loss AUROC. The second is flattened spectral concentration with the same pairing matching it within noise. The third is $\Delta\kappa$ tracking base-model accuracy on MSCalc items of controlled length even when the items are clean, which would mean it measures difficulty rather than recall.
The idea succeeds if three things hold. $\Delta\kappa$ must stay well above the 50–58% band after Stage II. It must exceed Self-Critique on RL-MIA. And suppressing its top components in attention must recover reasoning on leaked items that MLP-only TSS left unrecovered, while costing little accuracy on clean data.
References
- A Narrowing Geometry in Contaminated Reasoning
- On The Fragility of Benchmark Contamination Detection in Reasoning Models
- Learning to Re-rank for Interactive Problem Resolution and Query Refinement
- Molding CNNs for text: non-linear, non-consecutive convolutions
- Implicit Regularization in Tensor Factorization
- PaCoST: Paired Confidence Significance Testing for Benchmark Contamination Detection in Large Language Models
- Detecting Data Contamination from Reinforcement Learning Post-training for Large Language Models
- Detecting Data Contamination in LLMs via In-Context Learning