When a language model gets a math word problem right, we usually cannot tell whether it computed the answer or recalled it from a copy of the test set seen during training. The problem is sharpest for numeric answers. Existing detectors compare answers as strings, so "0.98" and "1.01" look unrelated. And paraphrasing a leaked problem hides the leak from many detectors, even though the model still relies on the memorized solution. We propose a black-box test that asks something more direct: does the model's answer move when the numbers in the question move? And does it behave differently when a number is set to zero than when that number is simply not given?
The idea borrows a lesson from sparse-sensor vision. In that setting, a network fed placeholder zeros cannot tell "measured zero" from "no measurement," and it quietly mixes the two. We turn that confusion into a diagnostic. A model that reads its inputs should give a new, computable answer when a quantity is set to "0." When the quantity is removed ("some apples"), it should become uncertain or abstain. A model that recalls a memorized answer does neither. It keeps producing the original number in both cases, treating "zero" and "missing" identically because it never looked. We score these responses by how far, in numeric value, the answers land from the original answer versus the new correct one. We also test whether fine-tuning with numeric-distance losses weakens today's detectors.
Core Claim
Our claim is that contamination of numeric benchmarks leaves a specific trace. Under counterfactual inputs, the model's answers stay anchored, in numeric distance, to the memorized answer. The "missing" probe exposes this anchoring more reliably than simply swapping in random numbers, because a model that is actually computing has no single correct answer to anchor to when a value is withheld. A second claim concerns detection under distance-aware training, meaning fine-tuning with losses that reward numerically close answers. Such training spreads probability onto neighboring numbers, and this should partly hide the "peaked output" signal that current detectors rely on. A value-space anchoring score should not be fooled in the same way.
Relation to Prior Work
The motivating evidence comes from the contamination literature. Generalization or Memorization introduces CDD, a detector that flags contaminated items when repeated samples from the model collapse to near-zero token edit distance. Our work keeps its black-box, sample-based spirit but replaces string distance with numeric distance and adds counterfactual inputs. Test of Time shows that paraphrasing or renaming variables erases the drop in performance on post-training-cutoff data, while influence tracing still finds the source documents. This constrains us: any probe must survive such "laundered" contamination, which is why our probes change the values a correct solution depends on rather than the surface wording. DyVal generates problems from computation graphs and finds that models scoring well on static benchmarks score near zero on fresh ones. We reuse its generator because it gives exact counterfactual answers for free. Both Text and Images Leaked! uses option shuffling and slot guessing to expose leaks in vision-language models, and it notes that logits are increasingly unavailable through APIs. Our probe needs only sampled answers.
The mechanism comes from work on zero-value ambiguity. Sparsity Invariant CNNs shows that networks fed placeholder zeros smear real signal into missing regions. It also shows that simply appending a missingness mask only partly fixes this: KITTI depth error is 2.69m for a plain CNN, 1.94m with a mask channel, and 1.81m with sparsity-aware convolution. In Defense of Zero Imputation shows the opposite can hold for tabular MLPs, where filling missing entries with zero is harmless. Together these tell us that whether "zero" and "missing" are confused depends on the model. That is exactly why the contrast is informative: it measures whether the model is conditioning on the input at all.
The distance-aware losses supply both the scoring geometry and a threat model. SMMD aligns the probability over number tokens with a kernel that treats nearby numbers as similar, and reports that it raises Qwen2.5-1.5B on GSM8K from 54.99% to 57.77%. RAFT trains the expected numeric value under the model's distribution against the target with squared error. NTIL uses an earth-mover penalty over number tokens. SMMD evaluates on SVAMP to argue that its gains are not memorization, but none of these papers measures contamination. We ask the reverse question: do such losses make leaked items harder to detect?
Research Program
For each benchmark item with original answer $y_0$, we build two counterfactual arms. In the zero arm, one input quantity is set to 0 and the new answer $y_z$ is recomputed. For GSM8K, the recomputation re-executes the calculator annotations in the reference solution. For DyVal, it re-evaluates the computation graph. Items where zero makes the problem degenerate, such as division by zero or a nonsensical premise, are dropped. In the missing arm, the same quantity is removed from the text ("some apples"), so no single correct answer exists. We sample $k$ answers per arm, parse them to numbers, and form an empirical answer distribution $p$.
For the zero arm, the anchoring score is
$$A_z = \frac{W(p_z, \delta_{y_z}) - W(p_z, \delta_{y_0})}{d(y_z, y_0)},$$
where $W$ is the one-dimensional earth-mover distance between the answer distribution and a point mass, $\delta_y$ is a point mass at $y$, and $d$ is a log-scaled numeric distance so that errors are comparable across magnitudes. $A_z$ lies between $-1$ and $+1$. A value near $+1$ means the answers sit on the memorized answer, and a value near $-1$ means they track the correct counterfactual.
For the missing arm, the score is
$$A_m = p_m\big(d(y, y_0) < \epsilon\big) - p_{\text{orig}}\big(d(y, y_0) < \epsilon\big)\cdot \rho,$$
that is, the probability mass within $\epsilon$ of the original answer after the value is withheld, compared with the mass on the unmodified item, where $\rho$ is a calibration constant fitted on known-clean items. A reading model loses mass at $y_0$. A memorizing model keeps it. The final item score combines $A_z$, $A_m$, and a zero-versus-missing indistinguishability term: the earth-mover distance between $p_z$ and $p_m$, where near-zero distance is suspicious. The combination is a logistic model fitted on a small labeled split.
Ground truth comes from controlled contamination. We continue training open models, including Qwen2.5-1.5B to match the SMMD setting and one other small open model, on a mixture that inserts a random half of held-out GSM8K test items and of DyVal items. Insertion is done verbatim or laundered (paraphrased with renamed entities, following Test of Time), at repetition counts of 1, 4, and 16. Each contamination run is repeated under three fine-tuning objectives: cross-entropy, SMMD at its reported defaults (λ=3.0, σ=2.0), and a RAFT-style expected-value loss. This yields item-level labels for the detection experiments and a direct test of whether distance-aware training changes the contamination fingerprint.
Baselines
The naive reference point is the accuracy gap between the original items and simple rewordings: flag an item if the model is right on the original and wrong on the rewording. It costs nothing, and Test of Time predicts it will fail under laundering, so it sets the floor.
The strongest existing detector is CDD from Generalization or Memorization, which flags items whose sampled outputs collapse to near-identical strings. Its authors report 21.8% to 30.2% relative improvement in accuracy and AUC over earlier detectors on their code and contamination suites. There is no reported result on Lacuna for CDD on GSM8K. We therefore run CDD ourselves with the same sampled outputs from the original arm and the same number of samples $k$ that our method uses in total across all arms, so the query budget is matched. Beating it means a higher item-level AUC on the laundered, low-repetition conditions, where it should be weakest, without losing on verbatim contamination. For estimating clean accuracy, we compare against TED's filtered accuracy, which the same paper reports reduces inflation by up to 66.9%. The target is a smaller error against the true accuracy on uncontaminated items.
The most dangerous baseline is random-number perturbation: replace a quantity with a random nonzero value, recompute the answer, and flag the item if the model returns the old answer. We give it the same number of perturbed variants and samples. Two ablations isolate our key ingredients. The first removes the missing arm, so only value-change probes remain. The second replaces earth-mover scoring with exact-match "did the answer change" scoring. If neither ablation loses AUC, the zero-versus-missing idea and the numeric-distance scoring are not pulling their weight.
Why not just…?
Why not just perturb the numbers randomly and check whether the answer changes? This is a real threat, because it already captures much of the anchoring intuition. We expect it to fall short in two places. First, when the new answer is numerically close to the old one, exact-match scoring cannot separate "anchored" from "computed approximately," which is why distance scoring matters. Second, a partly memorizing model can sometimes rescale a remembered answer. The missing arm removes any valid target, so anchoring there is harder to explain away. The ablation with only value-change probes settles this directly. If it matches the full method, we will report the detector as numeric-distance-scored perturbation and drop the zero-versus-missing claim.
Why not just use CDD, since it already needs only samples? CDD measures peakedness in string space. Distance-aware losses such as SMMD are designed to put probability on numerically neighboring tokens, which should blur exactly that peak on leaked items. Our three-objective contamination runs test this. If CDD's AUC under SMMD training stays within noise of its AUC under cross-entropy, this motivation fails, and the contribution narrows to laundered contamination.
Why not just rely on temporal cutoffs or fresh benchmarks like LiveBench or DyVal? Test of Time shows that the performance drop after the training cutoff vanishes under paraphrase: the reported change is +2.19 points on transformed post-cutoff physics questions versus −3.83 points for the cloze version. Fresh benchmarks also say nothing about which items of an existing static benchmark are compromised. We use DyVal as a clean control, not as a substitute.
Proposed Experiments and Decisive Checks
The main experiment reports item-level AUC for every detector in every cell defined by contamination type (verbatim or laundered), repetition count, and fine-tuning objective, on GSM8K and DyVal arithmetic. It also reports the error of the corrected-accuracy estimate against true clean accuracy. The false-positive check applies all detectors to never-inserted DyVal items that the models answer correctly, where any flag is an error. SVAMP serves as a transfer check, following SMMD's use of it.
Three outcomes would be decisive. First, the full method must beat CDD on laundered items at low repetition. Second, removing the missing arm must measurably reduce AUC. Third, CDD's performance must drop from cross-entropy to SMMD or RAFT fine-tuning while ours does not. Failure on the second check reduces the proposal to distance-scored perturbation. Failure on the third removes the distance-aware-training motivation.
As a descriptive follow-up, we will run the probes on public models over the GSM8K test set and report the fraction of items with high anchoring scores. These results will be clearly labeled as unverified estimates, since no ground truth exists for those models.
References
- Generalization or Memorization: Data Contamination and Trustworthy Evaluation for Large Language Models
- Test of Time: Rethinking Temporal Signal of Benchmark Contamination
- DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks
- Both Text and Images Leaked! A Systematic Analysis of Multimodal LLM Data Contamination
- Sparsity Invariant CNNs
- In Defense of Zero Imputation for Tabular Deep Learning
- Enhancing Numerical Prediction in LLMs via Smooth MMD Alignment
- Better autoregressive regression with LLMs via regression-aware fine-tuning
- Advancing Sequential Numerical Prediction in Autoregressive Models