Efficiently Scaling LLM Reasoning Programs with Certaindex

Yichao Fu, Junda Chen, Siqi Zhu, Zheyu Fu, Zhongdongming Dai, Yonghao Zhuang, Yian Ma, Aurick Qiao, Tajana Rosing, Ion Stoica, Hao Zhang

The current era of Large Language Models (LLMs) has seen massive leaps in problem-solving capabilities, largely driven by "test-time scaling"—giving models more time and tokens to "think" before providing an answer. However, this approach introduces a critical bottleneck: massive computational waste generated by models that overthink relatively simple problems.

To address this, researchers have introduced Certaindex, a novel metric that detects when a model’s answer has stabilized, and Dynasor, a reasoning-aware serving system that leverages this metric to save up to 50% on compute and triple throughput without sacrificing accuracy.

The Problem: The "Self-Doubt" Tax

Recent breakthroughs in LLM reasoning, such as OpenAI’s o1 or DeepSeek-R1, rely heavily on generating long "Chain-of-Thought" (CoT) sequences. While this boosts accuracy on complex problems, it is incredibly inefficient for many queries.

The authors identify a widespread phenomenon they call "self-doubt." A model might arrive at the correct answer within the first few hundred tokens but continue to generate thousands more tokens—re-verifying, checking for completeness, or simply rambling—before finally committing to the answer.

An example of an LLM exhibiting "self-doubt," arriving at the correct answer early but continuing to generate tokens for verification.

For instance, in models like DeepSeek-R1, the median number of tokens produced for a problem might be around 2,700, even though the correct answer is often formulated by token 830. Users and system providers are effectively paying a 3x "tax" for the model to double-check itself. Because current serving systems treat reasoning as a black box, they cannot detect these diminishing returns and stop the inference early.

Methods: Certaindex and Dynasor

To combat this inefficiency, the authors propose a two-part solution: a stabilization metric and a specialized serving system.

1. Certaindex: Measuring Answer Stabilization

Certaindex is a lightweight, algorithm-agnostic metric (scaled from 0 to 1) that measures how "stable" a model's intermediate answer is. It does not care how the model reasons, only whether the resulting answer has stopped changing.

  • For Long Chain-of-Thought (CoT): The system uses a technique called "Probe-In-The-Middle." Every 64 tokens, the model is briefly interrupted with a hidden prompt (e.g., "Oh, I suddenly got the answer...") to force it to output a candidate final answer. If this candidate answer remains consistent across several consecutive probes, the Certaindex score rises, indicating high confidence.
  • For Multi-path Reasoning (Self-Consistency, MCTS): The system uses Semantic Entropy. If multiple different reasoning branches start converging on the same semantic answer, the Certaindex score increases.
Accuracy versus token usage and pressure testing heatmaps, demonstrating that reasoning models often use significantly more tokens than necessary to achieve high accuracy.

2. Dynasor: A Reasoning-Aware Serving System

Built on top of SGLang, Dynasor uses the Certaindex metric to optimize how reasoning programs are executed in real-time:

  • Early Exit: The system stops a query the moment it hits a predefined certainty threshold, pruning unnecessary verification tokens.
  • Dynamic Token Allocation: It allocates more token budget to "uncertain" hard problems and fewer to "stabilized" easy ones.
  • Gang Scheduling: It prioritizes related sub-queries within a reasoning program to maximize KV-cache reuse and turnover.

Key Results and Insights

The researchers evaluated Dynasor across a wide range of challenging reasoning benchmarks, including MATH500, AMC23, AIME24, GSM8K, and LiveCodeBench, using models like DeepSeek-R1 (distilled Qwen 7B, 14B, 32B), Qwen2.5, and Llama 3.1.

  • Compute Savings: In batch processing, Dynasor achieved up to 50% compute savings while maintaining the exact same accuracy as the baseline.
  • Throughput Gains: In online serving scenarios, the system sustained 3.3x higher throughput (queries per second).
  • Latency Improvements: Dynasor achieved 4.7x tighter latency SLOs (Service Level Objectives), meaning users receive their answers much faster and more reliably.
  • Zero Accuracy Drop: Because the system only exits when the answer has mathematically or semantically stabilized, there is no statistically significant drop in problem-solving performance.

Interestingly, the authors also found linguistic markers of uncertainty. Words like "wait" or "hmm" in the reasoning chain are strong indicators of low Certaindex, which can be used to further refine the metric's accuracy.

Limitations and Future Work

While highly effective, the approach has a few limitations. Occasionally, a model might stabilize on a wrong answer with high confidence. While strict Certaindex thresholds minimize this, it remains a challenge for extremely deceptive problems. Additionally, "early exit" patterns could potentially be exploited in side-channel attacks to leak information about query difficulty in multi-tenant environments.

Future work will look into integrating Certaindex directly into the training process (e.g., via Reinforcement Learning) to teach models to be more concise from the start, and exploring integration with advanced serving techniques like chunked prefill.

Summary updated

BibTeX
@inproceedings{fu2025efficiently,
  author = {Yichao Fu and Junda Chen and Siqi Zhu and Zheyu Fu and Zhongdongming Dai and Yonghao Zhuang and Yian Ma and Aurick Qiao and Tajana Rosing and Ion Stoica and Hao Zhang},
  title = {{Efficiently Scaling LLM Reasoning Programs with Certaindex}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=nn51ewu5k2},
}
Figure