Pseudorandom Canaries: Contamination Tests That Survive Reasoning Training

When a language model's training data contains a benchmark's test questions, its score on that benchmark stops measuring ability. The usual way to catch this is to check whether the model finds the test text unusually likely, meaning it assigns those exact words a lower loss. That check stops working for reasoning models. A single round of reinforcement learning, or fine-tuning on worked solutions, removes the likelihood signal while leaving the inflated score in place. We propose a different kind of test. A benchmark publisher mixes in a small number of "canary" items whose official answers come from a secret-keyed pseudorandom function: a function that looks completely random to anyone without the key. By construction, no amount of reasoning can predict these answers. A model that answers them above chance must have seen them. Detection then becomes an accuracy test with an exact chance baseline, and it reads the same behavior that contamination inflates, instead of a likelihood gap that training erases.

The link to complexity theory is not decoration. The natural proofs barrier says that any efficient way to tell circuit-computable functions apart from random ones would break pseudorandom functions. Researchers in depth separation run into this barrier because it limits what they can prove. We use it as a guarantee. Because no efficient learner, including a polynomial-size transformer, can predict a secure pseudorandom function from other examples, any above-chance accuracy on canary items is memorization by definition. Generalization cannot explain it. Mixing these canaries with families of labels that are learnable but nonstandard gives a controlled way to split a contamination gain into a memorized part and a generalized part. That split is the question recent work on reasoning-model contamination leaves open.

Core Claim

Contamination detection is a distinguishing problem: did the model see these items or not? The detectors that fail on reasoning models distinguish using log-probabilities. On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that the clipping and importance weighting in PPO-style and GRPO-style training provably shrink the log-probability gap between seen and unseen items. GRPO is a reinforcement learning method that scores groups of sampled answers against each other. In the same paper, contamination still inflates accuracy, by 8.8% pass@1 after supervised fine-tuning and 11.7% after chain-of-thought contamination of DeepSeek-R1-Distill-Llama-8B.

Our claim is that a behavioral distinguisher built on unlearnable labels keeps working where likelihood-based detectors fall to 50–58% AUROC (the area under the curve trading off true and false detections, where 50% is coin-flipping). We also claim that varying how learnable the label function is separates memorization from structural generalization within one experiment. That second claim is the scientific payoff. The fragility paper argues that chain-of-thought contamination produces generalization rather than rote recall. Our design measures that directly instead of inferring it from failed detectors.

With $K$ equally likely canary answers, $n$ canary items, and observed canary accuracy $\hat a$, the test statistic under the no-contamination null is

$$z = \frac{\hat a - 1/K}{\sqrt{(1/K)(1-1/K)/n}},$$

The variance term is binomial because pseudorandom labels are independent of everything the model can compute. For numeric answers in the AIME style, $K$ is around 1000. A few dozen canaries therefore suffice even when only a small fraction of them was memorized. This makes the probe cheap enough to hide in a benchmark at a 2–5% dose.

Research Program

The first component is canary construction. Each canary is a question in the benchmark's own format, with official answer $F_s(c(q))$. Here $F_s$ is a keyed pseudorandom function with secret key $s$, and $c(q)$ is a canonical form of question $q$. Keying on the canonical form lets us generate unlimited new phrasings of a leaked canary that share its label. We can then ask whether memorization transfers across paraphrase, which a fixed random answer table cannot support for phrasings created after release. The publisher posts a hash of $s$ and reveals the key later. This makes the audit publicly verifiable without trusting the organizer, which complements P⁴Bench. That system hides answers behind zero-knowledge proofs but cannot tell whether a model has been contaminated.

We build two kinds of canaries. Ill-posed canaries look like real problems but have no true answer, for example a problem about an invented object with an unstated parameter. The keyed answer is then the only "correct" one, and no solver can flag the item as mislabeled. Structured canaries come from a DyVal-style generator (DyVal, which builds reasoning problems from randomly generated computation graphs). They are used in the decomposition study below.

The second component is the decomposition study. Using the DyVal generator through PromptBench (microsoft/promptbench), we create three item families with identical surface statistics but different label functions. The first family uses the true computed answer. The second uses a fixed but nonstandard shallow threshold rule over instance features, a majority-of-thresholds function of the kind Distributional PAC-Learning from Nisan's Natural Proofs shows to be learnable on average over a distribution. The third uses keyed pseudorandom labels. We contaminate a model with part of each family and measure accuracy on seen items and on unseen items from the same family. Seen gains in the pseudorandom family are pure memorization. Unseen gains in the threshold family are generalization of a rule the model was never told. Unseen gains in the true-answer family mix the two, and the other two families let us read off the mix.

This is where the depth-separation literature constrains the design. Neural Networks with Small Weights and Depth-Separation Barriers and Size and Depth Separation in Approximating Benign Functions with Neural Networks show that the barrier applies to small threshold circuits. These are the same circuits that bounded-depth networks resemble, and pseudorandom functions are believed computable even by them. The unlearnability we rely on therefore holds against exactly the model class we audit, not only against weak learners.

The third component is the threat model. Accidental contamination from web crawls is the main use case. A deliberate cheater who filters out canaries is a real but secondary adversary. We measure how distinguishable the canaries are by training a classifier, and prompting a strong LLM, to separate canaries from real items, and we report that AUROC. A canary set that a filter cannot separate from real items is the empirical counterpart of pseudorandomness.

Baselines

The naive reference point is chance accuracy $1/K$ on canaries, together with the accuracy of a clean model trained by the identical pipeline without the contaminated items. A detector must beat both, at a fixed 5% false-positive rate across clean seeds.

The strongest existing method is the suite of likelihood-based membership tests evaluated in On The Fragility of Benchmark Contamination Detection in Reasoning Models. The suite includes LiRA (a likelihood ratio against a reference model), Min-K% (the average of the lowest token probabilities), raw loss, and verbatim completion. It is the strongest competitor because it is what practitioners actually use and it is the only family with reported numbers in this exact setting. The paper reports LiRA at 89.1% AUROC after supervised-fine-tuning contamination of Qwen2.5-7B-Instruct, a drop of about 14% after one epoch of clean GRPO, and an average of 50–58% AUROC across all ten detectors in the chain-of-thought stage. We rerun these detectors ourselves on our checkpoints, with the same contaminated items, the same reference models, and the same compute. Beating them means canary AUROC of at least 0.9 in the stage where they average 50–58%, and no measurable degradation after GRPO.

The second competitor is the leaked-versus-fresh accuracy gap: compare the model's accuracy on released items with its accuracy on freshly generated items from the same generator, as dynamic evaluation in DyVal allows. We run it on the identical generator with matched difficulty levels. For canary detection itself there is no reported result found on Lacuna for pseudorandom-label probes.

Two ablations isolate the key ingredient. The first replaces keyed labels with correct computed labels on otherwise identical canaries, which tests whether unlearnability matters. The second replaces keyed labels with a stored table of truly random labels. This should detect equally well on exact items and fail only on post-hoc paraphrases. If it matches the pseudorandom version everywhere, we will say so: the cryptographic part then buys only commitment and paraphrase coverage, not detection power.

Why not just…?

Why not just keep the test set private behind an evaluation server? Privacy prevents some leakage but turns scoring into trust in the organizer, which is the "black box" objection raised in P⁴Bench. It also gives no way to audit models trained before the set leaked. Canaries are complementary: they are designed for public benchmarks, and the committed key lets anyone check the audit afterward.

Why not just use better likelihood detectors? The fragility paper's theory says the gap these detectors rely on is driven toward zero by the clipped policy-gradient update itself. That makes it a structural failure, not a tuning problem. Our experiment tests this directly: if any of the ten detectors recovers above 0.9 AUROC on our chain-of-thought-contaminated checkpoints, the canary approach loses its main motivation.

Why not just compare accuracy on leaked versus freshly generated items? This is the most serious alternative, and it does work when contamination produces pure memorization. Its weakness is the one the fragility paper identifies: chain-of-thought contamination generalizes, so fresh items also improve and the gap shrinks or vanishes. A small gap is then ambiguous between "clean" and "contaminated but generalizing." Temporal versions of this test have the same confound; Beyond Memorization finds that post-cutoff decay disappears once questions require multi-step reasoning. The decomposition study settles the question. If the fresh-item gap detects contamination as well as canaries do in the chain-of-thought stage, we will report that the simpler test suffices.

Why not just plant canary strings or random-answer items without cryptography? For exact-item detection, a random table is about as good, and the second ablation measures that honestly. The keyed function adds compact public commitment and correct labels for paraphrases generated after release. We expect paraphrase coverage to matter, because crawled copies are often reformatted.

Proposed Experiments

We replicate the two-stage setting of the fragility paper. In Stage I, Qwen2.5-7B-Instruct receives supervised-fine-tuning contamination on AIME, AMC, GPQA Diamond, OlympiadBench, and Minerva Math, followed by clean GRPO. In Stage II, DeepSeek-R1-Distill-Llama-8B receives chain-of-thought contamination. In both stages, ill-posed canaries are inserted at doses of 1%, 2%, and 5% of each benchmark. We report canary AUROC against the ten likelihood detectors across GRPO epochs, alongside the accuracy inflation, so we can check that our signal tracks the score gain the detectors miss.

The decomposition study runs on DyVal arithmetic, Boolean logic, and reachability at difficulty levels D1 through D4. It uses the three label families, with seen and unseen splits evaluated before and after GRPO. The filter study reports how separable canaries are from real items.

Two outcomes are decisive. If GRPO erases memorized pseudorandom answers as thoroughly as it erases log-probability gaps, the canary detector fails. That would also be informative: it would imply the residual contamination gain is entirely generalization. If pseudorandom canaries survive while the threshold family's unseen gains grow, we have the first direct measurement that reasoning-model contamination splits into a detectable memorized component and a generalized component. The canaries then give benchmark maintainers a test that keeps working after reinforcement learning, which current tools do not.