Does Memorization Fake Confidence? Calibrating Reasoning Models with Problem Twins

When a language model gives the same answer to a math problem across many independent samples, we usually treat that agreement as evidence it is right. This is the idea behind sampling-based calibration, which makes a model's stated confidence track how often it is actually correct. It is currently the best-performing way to do this for multi-step reasoning. Agreement, however, has two possible causes. The model may have worked the problem out, or it may have seen the problem and its answer during training and be reciting them. Benchmark contamination, meaning test problems leaking into training data, is widespread in exactly the benchmarks where these calibration methods were validated. Contamination is also getting harder to detect once models go through reinforcement learning. Pressure from data scarcity pushes the field further toward repeated data, distilled teacher reasoning, and reward-based post-training on small problem sets. If memorized answers produce agreement as tight as genuine reasoning does, then calibration numbers measured on GSM8K are partly an artifact. A model that "knows when it knows" on a leaked benchmark may be confidently wrong on fresh problems of the same kind.

We propose to test this directly and to fix it with a cheap change to how confidence is computed. Instead of resampling the same prompt, we query the model on problem twins, which are rewrites of the original problem. Some twins should leave the answer unchanged: premises reordered, entities renamed, irrelevant sentences added. Others should change it: different numbers. A model that reasons will agree across the first kind and move its answer across the second. A model that recites will often fail the first kind. Its tell-tale sign is the second kind: it returns the original answer to a problem whose numbers have changed, which we call an "echo." Confidence then combines agreement on invariant twins with a penalty for echoes, at the same number of model calls as standard self-consistency.

Core Claim

The claim has two parts. The diagnostic part is that, on a mixed pool of seen and unseen problems from the same distribution, agreement-based confidence is nearly identical across the two groups while accuracy on fresh near-duplicates is much lower for the seen group. When that happens, no global recalibration, however well fitted, can repair it. Temperature scaling or isotonic regression maps equal confidence scores to equal outputs, so it cannot separate items that score the same but differ in true reliability. The constructive part is that twin-based confidence does separate them, because memorization leaves a behavioral trace that resampling cannot expose. That trace is insensitivity to answer-relevant edits combined with sensitivity to answer-irrelevant ones.

The signal is behavioral rather than log-probability based. This matters because On The Fragility of Benchmark Contamination Detection in Reasoning Models shows that GRPO-style reinforcement learning compresses the log-probability gap between seen and unseen questions. After that compression, ten membership detectors fall to roughly 50–58% AUROC. Our signal does not depend on that gap.

Where This Sits

Two papers supply the baseline method we stress-test. Self-Consistency Boosts Calibration for Math Reasoning derives confidence from how many sampled answers cluster together. Mirror-Consistency refines this by reflecting on the minority answers that disagree with the majority. Both were validated only on static benchmarks, GSM8K, SVAMP, and MathQA, and both resample one fixed prompt. We keep their budget and change what is varied.

Three lines of evidence motivate the suspicion that agreement is inflated:

  • Contaminated data rewards memory. Reasoning or Memorization? finds that Qwen2.5 reconstructs MATH-500 answers from 80% problem prefixes at 65.8% exact match. It also finds that reinforcement learning with random rewards still improves scores on contaminated sets, while it collapses on the clean RandomCalculation set.
  • Shallow paths to correct answers. Evaluating Intermediate Reasoning of Code-Assisted LLMs shows correct answers often come from unsound or brute-force logic.
  • Collapse on fresh problems. BeyondBench and DyVal show accuracy falling sharply on freshly generated problems. DyVal additionally shows that simply flipping premise order costs GPT-4 13.6% on reachability.

None of these papers measures calibration. That missing measurement is the gap we fill.

The idea of perturbing inputs is not new, and two prior works are its closest neighbors.

Our contribution is to use answer-controlled twins as the confidence estimator itself, and to show where and why it beats resampling.

Two other works constrain the design. Probabilistic Chain-of-Thought models step-level correctness, but its parameters are estimated from human step labels (PRM800K). Those labels are exactly what data scarcity makes unavailable. Fill In The Gaps fixes calibration by generating synthetic training data, but it assumes the generator is not itself contaminated. We therefore avoid both step annotations and retraining, and treat the model as a black box that we can only query.

Research Program

Building the twins. For procedurally generated domains (DyVal problem graphs, RandomCalculation expression trees, BeyondBench tasks), twins are exact. We regenerate the instance with reordered premises or renamed variables, which leaves the answer unchanged, or with new numeric leaves, where the generator recomputes the answer. For natural word problems such as GSM8K, an LLM rewriter produces invariant rewrites and number-changed rewrites. Each rewrite is accepted only if a separate model, writing a short program, confirms the original answer for invariant twins and a different answer for numeric twins. This is cheap filtering, not annotation.

Scoring confidence. For a budget of $k$ calls, we spend $k_1$ on invariant twins and $k_2 = k - k_1$ on numeric twins. Let $a$ be the fraction of invariant-twin answers matching the modal answer. Let $e$ be the fraction of numeric-twin answers equal to the original modal answer, which is the echo rate. Raw confidence is

$$c = a \cdot (1 - e)^{\lambda},$$

where $\lambda \ge 0$ sets how hard echoes are penalized. The score $c$ is then mapped to a probability with isotonic regression, fitted on fresh generated problems only. Every competing method receives the same fitted map.

Controlled contamination study. Natural contamination is unobservable, so we induce it, following the staged design of the fragility paper. We start from open 7–8B models (Qwen2.5-Math-7B and a Llama-3-8B-Instruct variant) and create four arms:

  1. Answer-only fine-tuning on a random half of a fixed GSM8K-plus-DyVal pool.
  2. Fine-tuning on chain-of-thought solutions for that half.
  3. Arm 2 followed by one epoch of GRPO on clean, unrelated problems. This is the contamination-cloaking condition.
  4. Distillation of chain-of-thought solutions from a teacher model on the seen half. This mirrors the data-scarcity pipelines of Thinking Augmented Pre-training and CHIMERA, in which contamination enters through the teacher.

The unseen half serves as an in-distribution control. Because membership is known by construction, we can measure calibration separately on seen and unseen items, and on fresh twins of seen items.

Natural setting. Off-the-shelf models are compared on two contrasts. The first is MATH-500 against LiveMathBench, the pair whose contamination asymmetry is documented in the reasoning-or-memorization paper. The second is GSM8K against verified twins of GSM8K. We also plot calibration against DyVal depth levels D1–D4, to test whether confidence stays high as accuracy falls off the depth cliff.

Baselines

Naive references. The simplest reference is the final-answer token probability. Self-Consistency Boosts Calibration reports an ECE (expected calibration error, the average gap between stated confidence and observed accuracy) of 0.394 for this signal with Mistral-7B on GSM8K. We also include verbalized confidence, meaning a prompt asking the model to state its confidence from 0 to 100. Both are run with identical prompts across all arms.

Self-consistency. The primary competitor uses self-consistency cluster metrics. The same paper reports ECE 0.092 with Mistral-7B on GSM8K using its cluster-count variant ($F_{CN}$). We run all of its cluster variants with exactly $k$ samples, matching our call budget. It is the strongest competitor because it is the best-documented black-box calibrator for math reasoning at this scale.

Mirror-Consistency. The second competitor is Mirror-Consistency, which reports ECE falling from 0.081 to 0.039 for GPT-3.5 on GSM8K. Its reflection calls count against the same budget $k$.

Step-level calibration. We report Probabilistic Chain-of-Thought where it can be run. The file gives only a relative ECE reduction (74% versus the best heuristic baseline), with no absolute ECE on our benchmarks. We include it only in the natural-math setting, where its PRM800K parameters apply.

Fair recalibration. Every method gets the same isotonic map fitted on the same clean generated problems. This removes "better post-hoc fitting" as an explanation for any difference.

Ablations. Three ablations isolate the key ingredient:

  1. Invariant twins only ($\lambda = 0$).
  2. Echo penalty only.
  3. Generic paraphrases that are not answer-controlled, replacing the structured twins at the same budget.

What counts as beating the baselines. At equal $k$, twin confidence must show two things. First, it must achieve lower ECE on the mixed seen/unseen pool and on fresh twins of seen items. Second, and decisively, it must achieve higher AUROC for distinguishing correct from incorrect answers within the mixed pool, with the advantage concentrated on seen items. Matching self-consistency on clean data while not exceeding it on contaminated data would count as a failure.

Why not just…?

Why not just sample more paths with self-consistency? More samples from the same prompt draw from the same peaked distribution. If memorization concentrates that distribution, more samples sharpen a wrong consensus rather than revealing it. BeyondBench's performance cliffs show a related failure, in which no sampled path solves deep instances. The concern is not hypothetical, but it is testable. We sweep self-consistency to $4k$ samples against twins at $k$. If self-consistency closes the gap on seen items as samples grow, our mechanism is wrong and we will report that.

Why not just recalibrate self-consistency on clean, freshly generated data? This is the real threat, and the design addresses it head-on. Every method already gets that recalibration. Recalibration fixes global miscalibration, such as a model that is uniformly overconfident on new problems. It cannot fix the case where seen and unseen items receive the same raw score but differ in reliability. The decisive measurement is whether self-consistency scores on seen versus unseen items in arm 3 are statistically indistinguishable while their twin accuracies differ. If self-consistency scores already differ by membership, recalibration may suffice, and the proposal reduces to an evaluation finding.

Why not just detect and remove contaminated items, then use ordinary calibration? The fragility paper shows that detectors drop to near-chance AUROC after GRPO and after chain-of-thought contamination. The PAC method from the black-box contamination paper needs logit-bias tricks and gains only 4.5–5.9% AUC on WikiMIA and StackMIA. Detection also yields a membership guess, not a per-answer confidence. We nonetheless run PAC and Min-K% as item filters in arm 3. If filtering followed by self-consistency matches twin confidence, the simpler pipeline wins.

Why not just ask the model to judge itself? DyVal reports that 33.8% of GPT-4's failures were answers given with no supporting reasoning. Beyond Code shows that self-generated plans can underperform direct answering. Verbalized confidence is included as a baseline, so this question is answered empirically rather than assumed.

Decisive Checks

The study succeeds or fails on three measurements:

  1. Inflation exists. In arms 2–4, self-consistency must assign seen items confidence comparable to or higher than unseen items, while accuracy on those items' fresh twins is lower. If not, the premise fails and the result is a useful negative finding about contamination robustness.
  2. Echoes carry the signal. Echo rate must predict membership better than near-chance log-probability detectors after GRPO (arm 3). Membership is known by construction, so this is directly measurable.
  3. The advantage transfers. At equal budget, twin confidence must reduce within-pool ECE and raise AUROC relative to self-consistency and Mirror-Consistency. The same direction must hold on the natural MATH-500 versus LiveMathBench contrast and across DyVal depth levels.

A positive result would mean that published calibration gains on static math benchmarks partly measure memory. It would also give practitioners using small-data reinforcement learning or distilled data a confidence signal that holds up when contamination cannot be detected.