Thinking by Subtraction: Confidence-Driven Contrastive Decoding for LLM Reasoning

Lexiang Tang, Weihao Gao, Bingchen Zhao, Lu Ma, Qiao jin, Bang Yang, Yuexian ZouarXiv 2026

TL;DR

Thinking by Subtraction introduces Confidence-Driven Contrastive Decoding (CCD), a training-free inference technique that fixes LLM reasoning errors by intervening only at critical, low-confidence tokens. By subtracting a "deliberately confused" reference distribution—created by masking high-confidence tokens with neutral placeholders—CCD boosts accuracy and dramatically reduces reasoning bloat with minimal computational overhead.

What Problem Does This Paper Address?

Recent breakthroughs in LLM reasoning (like o1-style models) rely heavily on test-time scaling—allocating more compute during inference by letting the model generate long chains of thought (CoT) or multiple reasoning paths. However, uniformly scaling compute across an entire generation is highly inefficient.

Prior research shows that reasoning uncertainty is highly localized: a small handful of low-confidence tokens are disproportionately responsible for downstream errors and massive, repetitive output bloat ("overthinking"). Standard contrastive decoding methods apply penalties uniformly across all tokens, which dilutes their impact on these critical decision points and wastes compute on tokens the model is already sure about. The authors set out to design a method that intervenes only when and where the model experiences localized uncertainty.

Methods

CCD introduces a dynamic, token-level intervention framework consisting of four main components:

  1. Online Confidence Estimation: At each decoding step $t$, the model calculates its predictive confidence based on the average log-probabilities of the top-$k$ candidate tokens. A sliding window tracks recent confidence dynamics.
  2. Confidence-Driven Token Selection: CoT tokens are partitioned into two categories using adaptive quantile thresholds derived from the sliding window: Low-Confidence tokens (LC-tokens), which mark localized uncertainty, and High-Confidence tokens (HC-tokens), which represent stable reasoning steps.
  3. Contrastive Distribution Construction: When the model hits an LC-token, CCD triggers an intervention. It creates a "confused" contrastive context by replacing the previously generated HC-tokens with semantically neutral placeholders (e.g., <endoftext>). Because HC-tokens act as "semantic anchors," masking them drastically flattens the model's predictive distribution, creating a high-entropy reference.
  4. Logit Subtraction: CCD refines the final token probabilities by subtracting the logits of this confused reference distribution from the main model's logits: $$\ell^{\text{final}}_t = (1 + \alpha)\ell^{\text{main}}_t - \alpha\ell^{\text{cd}}_t$$ This sharpens the main model's distribution, pushing it away from uncertain paths.

To implement this efficiently without breaking standard autoregressive decoding, CCD maintains a Dual KV Cache system: one for the main generation path and one for the contrastive path.

Figure 2. Overview of Confidence-Driven Contrastive Decoding (CCD). The decoding process consists of four key components: (1) online estimation of token-level confidence; (2) confidence-driven token selection that partitions chain-of-thought tokens into low-confidence (LC) and high-confidence (HC) sets; (3) contrastive decoding triggered at LC-CoT tokens to refine uncertain predictions; and (4) dual key–value (KV) cache maintenance to support selective intervention without disrupting standard autoregressive decoding.

Datasets

The authors evaluated CCD across four highly demanding, Olympiad-style mathematical reasoning benchmarks:

  • AIME 2024 & AIME 2025 (American Invitational Mathematics Examination)
  • BRUMO 2025 (Brown University Math Olympiad)
  • HMMT 2025 (Harvard-MIT Mathematics Tournament)

These datasets test multi-step symbolic manipulation and complex logical transitions, making them ideal for evaluating localized reasoning failures.

Key Insights and Ideas

  • High-Confidence Tokens as Semantic Anchors: The core theoretical insight is that tokens generated with high confidence strongly constrain the transformer's attention mechanism in future steps. Masking them effectively removes these anchors, reducing mutual information and forcing the model into a state of high uncertainty.
  • Sharpening by Subtraction: Rather than trying to explicitly guide the model toward the right answer, CCD works by identifying what a "confused" version of the model would do and subtracting those probabilities.
  • Curbing Overthinking: Interestingly, subtracting the confused distribution doesn't just improve accuracy—it also acts as a natural brake on overthinking. By stabilizing the model at shaky decision points, CCD prevents the model from spiraling into long, redundant loops of self-correction.

Key Results

CCD was tested across various model scales using the Qwen3 family and a distilled DeepSeek model, yielding impressive gains without any additional training:

  • Accuracy Boosts: On dense Qwen3 models (4B to 14B parameters), CCD improved Mean@8 accuracy by 3% to 5% over standard decoding, outperforming other test-time intervention baselines.
  • Architecture Agnostic: The method generalized well to Mixture-of-Experts (MoE) and distilled reasoning models. For instance, it boosted Qwen3-30B-A3B-Thinking by +2.92% and DeepSeek-R1-Distill-Qwen-1.5B by +2.49% on AIME 2025.
  • Concise Reasoning Chains: On AIME benchmarks, CCD significantly shortened response lengths and reduced the frequency of explicit thinking tokens (like "wait", "however", "let me double-check"), proving that targeted interventions lead to cleaner, more direct reasoning paths.
Figure 4. Token-level confidence improvement at low-confidence decoding positions.

Limitations and Future Work

While highly effective, the authors note a few limitations:

  • Domain Specificity: The evaluation focused strictly on structured mathematical reasoning benchmarks. How well CCD translates to open-ended, general-domain text generation remains an open question.
  • Modality Constraints: The current framework is strictly text-based. The authors point out that extending CCD to multimodal models (text + vision) is a promising frontier, as token-level confidence might interact with visual representations in unique, complex ways.

Summary updated

BibTeX
@misc{tang2026thinking,
  author = {Lexiang Tang and Weihao Gao and Bingchen Zhao and Lu Ma and Qiao jin and Bang Yang and Yuexian Zou},
  title = {{Thinking by Subtraction: Confidence-Driven Contrastive Decoding for LLM Reasoning}},
  year = {2026},
  eprint = {2602.18232},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.18232},
}
Figure