Paraphrase-Anchored Geometry for Detecting Benchmark Contamination After RL

When a language model has seen a benchmark question during training, its answers to that question stop measuring reasoning and start measuring memory. Most tools for catching this rely on the model's output probabilities: memorized text gets unusually confident predictions. A recent study shows these signals are fragile. One epoch of reinforcement-learning post-training flattens the confidence gap between seen and unseen questions, and once that happens, standard detectors perform close to coin-flipping. We propose looking one level deeper, at the model's internal activations. For each benchmark item we build a small "cloud" of paraphrases. We then ask whether the model's internal representation of the original wording sits abnormally far from the representations of its own paraphrases. The distance is measured in a space learned by contrastive training, which here means training a small network to place paraphrases of the same item close together and different items far apart.

The intuition comes from contrastive representation learning theory. Information shared across all views of an input is "signal," and information tied to one particular view is "noise." Contamination is exactly view-specific information: the model has learned something about the canonical wording that it has not learned about rewordings. That kind of trace could survive an RL procedure that mostly reshapes the output distribution. The resulting detector works on single items rather than whole benchmarks. It needs no labeled examples of contamination and no output probabilities. It does need open weights.

Core Claim

Our central claim is a testable hypothesis about where contamination signatures live. Clean RL post-training with clipped importance weights shrinks log-probability gaps. This has been shown for GRPO, the group-relative policy optimization method, in On The Fragility of Benchmark Contamination Detection in Reasoning Models, where LiRA, Loss, and Min-K% lose roughly 14–16 AUROC points after a single epoch. We claim this clipping does not erase the extra, wording-specific structure that supervised contamination leaves in intermediate hidden states. That structure can be read out as an outlier score relative to each item's own paraphrase cloud.

Concretely, let $h(x)$ be the mean-pooled hidden state of the audited model on input $x$ at a chosen layer. Let $g$ be a small contrastive projection head. Let $v_1,\dots,v_n$ be paraphrases of item $x$, and let $\mu_x$ be the mean of $g(h(v_j))$ over those paraphrases. The contamination score is

$$s(x) = \big(g(h(x)) - \mu_x\big)^\top \Sigma^{-1} \big(g(h(x)) - \mu_x\big),$$

where $\Sigma$ is the covariance of paraphrase-to-centroid residuals pooled across all items. Whitening by $\Sigma$ follows the finding of SSD: A Unified Framework for Self-Supervised Outlier Detection. That paper scores outliers by Mahalanobis distance on SimCLR features and reports that high-variance directions are the least informative for detecting shifts. Here the high-variance directions are the paraphraser's stylistic quirks.

What is new relative to the closest work is the combination of three things. The first is per-item anchoring to the item's own views rather than to a global in-distribution set. The second is that scoring happens in hidden-state geometry rather than in scalar confidence or accuracy. The third is that we evaluate explicitly against the RL-cloaking regime in which existing detectors fail.

Research Program

The method has three pieces.

The first piece is view generation. A fixed helper model produces 16 paraphrases per benchmark item that preserve the answer. We use the same perturbation families as CAP: Data Contamination Detection via Consistency Amplification, namely rewording, option shuffling for multiple choice, and distractor edits, plus the rephrasing used by PaCoST: Paired Confidence Significance Testing for Benchmark Contamination Detection in Large Language Models. Both of those papers reduce each view to a scalar: accuracy in CAP, the probability of "Yes" in PaCoST. We instead keep the full activation vector for every view.

The second piece is the contrastive head $g$. It is trained on the audited model's own activations, with positives drawn only from pairs of paraphrases of the same item and never from the original wording. Negatives are paraphrases of other items. Because the head never sees canonical text, it cannot learn to absorb whatever is special about the original.

Two design choices follow Your Contrastive Learning Is Secretly Doing Stochastic Neighbor Embedding. That paper recasts the InfoNCE contrastive loss as neighbor embedding. It shows that unit-sphere normalization distorts distances under mean shifts, where SimCLR falls to 48.4% versus 100% for a Euclidean variant on a synthetic test. It also shows that a heavy-tailed Student-t kernel (t-SimCLR) keeps clusters separable in very low dimensions, reaching 81.7% on CIFAR-10 with 8 dimensions. A contaminated original is exactly a mean shift away from its cloud, so we use an unnormalized Euclidean head with the t-kernel and a 16–32 dimensional output.

The theoretical lens comes from two papers. Contrastive learning, multi-view redundancy, and linear models shows that contrastive objectives capture information shared across views. Toward Understanding the Feature Learning Process of Self-supervised Contrastive Learning shows that augmentations "decouple" view-specific noise from shared sparse signal. Both analyses use simple architectures, so for deep transformers they motivate the design rather than guarantee it. Our reading is that contamination behaves like a view-specific feature attached to one privileged view.

The third piece is scoring and calibration. We sweep layers, because RL may reshape late layers more than middle ones. We also report the distribution of $s(x)$ on items known to be clean, to separate "originals are human-written while paraphrases are model-written" from genuine memorization.

That confound is the main validity threat. Clean originals will also sit somewhat apart from their paraphrases. The detector therefore only works if contaminated originals sit measurably further apart. The controlled experiments are built to measure exactly this.

Baselines

The naive reference point is chance (50% AUROC), together with raw cosine distance between $h(x)$ and the paraphrase centroid, with no head and no whitening. This tells us whether any geometric signal exists at all.

The strongest existing competitors depend on the regime.

In the RL regime the strongest is LiRA, a reference-model likelihood-ratio membership test. The Fragility paper reports 89.1% AUROC for LiRA on SFT-contaminated Qwen2.5-7B-Instruct before RL, a drop of about 14 points after one epoch of clean GRPO, and reference-free methods near 50% AUROC. In the reasoning-model regime with chain-of-thought contamination of DeepSeek-R1-Distill-Llama-8B, the same paper reports its 10 detectors averaging 50–58% AUROC.

For pretraining-membership sanity checks the strongest reference-free baseline is Min-K%++ (Min-K%++: Improved Baseline for Pre-Training Data Detection from Large Language Models). It reports gains of 6.2–10.5 AUROC points over Min-K% (Detecting Pretraining Data from Large Language Models) on WikiMIA. The file gives no absolute WikiMIA AUROC, so we will rerun it ourselves.

The strongest learned detector is LOS-Net (Beyond Next Token Probabilities: Learnable, Fast Detection of Hallucinations and Data Contamination on LLM Output Distributions). It reports 0.95 AUC on BookMIA for Llama3-30b, but it is supervised and operates on output distributions.

We also include two further competitors. One is PaCoST, run per item and aggregated. The other is a supervised linear probe on the same hidden states, trained on injected-contamination labels. The probe serves as an oracle upper bound in the spirit of RADAR: Mechanistic Pathways for Detecting Data Contamination in LLM Evaluation, which classifies recall versus reasoning from 37 internal features at 93.0% accuracy.

To keep comparisons fair, every method sees the same contaminated checkpoints, the same item splits, and the same paraphrase sets where a method uses views. Reference-model methods get the same base model as their reference. Hyperparameters are tuned on a shared held-out validation split with equal search budgets.

Two ablations isolate the key ingredient. The first removes the head and computes a whitened residual on raw hidden states. The second keeps the head but drops whitening.

We count the proposal as beating the field if it does both of the following after GRPO. It must reach at least 75% AUROC, which is well above the near-chance reference-free methods. It must also be within reach of, or above, post-RL LiRA, without needing a reference model.

Why not just…?

Why not just check n-gram overlap with the training corpus? Third-party audits rarely have corpus access, as the Min-K% and perplexity-gap papers note. The survey Benchmark Data Contamination of Large Language Models: A Survey documents how paraphrased leakage evades string matching. In our controlled setting we do have the corpus, so we report n-gram overlap as a ceiling for verbatim leakage. Our method only needs to matter where that ceiling is unreachable.

Why not just use Min-K%++ or LiRA, which need one forward pass? They are exactly what the Fragility paper shows collapsing after GRPO. Whether our score collapses too is the central experiment, not an assumption. If our post-GRPO AUROC falls as far as theirs, the hypothesis is wrong and we will say so.

Why not just whiten raw hidden-state residuals and skip contrastive training? This is a real threat. Subtracting each item's own paraphrase centroid already removes cross-item semantic variation, so raw residuals with pooled Mahalanobis might be enough. The ablation decides it. If raw whitening matches the head within two AUROC points across regimes, we drop the head and report the paraphrase-anchored geometric test as the contribution. The head earns its place only if paraphraser style artifacts dominate raw residuals, which is the SSD observation about uninformative high-variance directions carried over to text.

Why not just train a supervised probe on hidden states with injected contamination, as RADAR does? In a controlled study this probe will likely win, which is why it serves as our oracle. Its weakness is transfer. A probe fit on one model's injected contamination may not carry over to another model or another training recipe, and real audits have no labels. We test that transfer directly by training the probe on Qwen and applying it to R1-Distill-Llama, and by training it before RL and applying it after.

Proposed Experiments

The first and decisive experiment replicates the Fragility setup.

In Stage I, Qwen2.5-7B-Instruct is fine-tuned on half of the items from AIME, AMC, GPQA Diamond, OlympiadBench, and Minerva Math, and then given one epoch of clean GRPO. We score all items before and after RL and report AUROC and true-positive rate at 5% false positives, per layer.

In Stage II, DeepSeek-R1-Distill-Llama-8B is contaminated with chain-of-thought solutions. This stage carries an honest risk. The Fragility paper finds that such models generalize memorized reasoning to similar unseen questions, so paraphrases may also become "familiar" and the gap may close. A failure here would mark the scope of the method rather than a bug.

A second experiment targets the hardest variant: contaminating with paraphrased benchmark items and testing on the originals. Here the canonical wording was never seen, and we predict the method weakens. Measuring how much it weakens tells us whether the signal is about wording or about the item.

A third set of experiments checks generality. We run WikiMIA and MIMIR on Pythia-family open models against Min-K%++. We also run an in-the-wild audit of MMLU on open models. There, WMDP, released in May 2024, serves as a clean control for models trained earlier, and we compare item-level flags against PaCoST's dataset-level verdicts.

We will treat the idea as failed under either of two outcomes. One is that post-GRPO AUROC falls below 60% at every layer. The other is that clean originals and contaminated originals produce overlapping score distributions once paraphraser style is controlled.