OS-Pruner: Pruning Chains-of-Thought of Reasoning Models via Optimal Stopping

Mohammed Ehab, Aymane El Gadarri, Vivek Farias, Adam Daniel Jozefiak, Ciamac C. MoallemiNeurIPS 2026

TL;DR

Reasoning-heavy LLMs love to "overthink"—burning through thousands of extra tokens to verify answers they already figured out paragraphs ago. Instead of retraining the entire model or guessing a static token budget, OS-Pruner frames reasoning termination as an optimal stopping problem. By snapping a tiny, lightweight policy head onto a frozen LLM, it cuts generation length by 20–60% with virtually zero loss in accuracy, dynamically weighing whether the next paragraph of thought is actually worth the compute.

What Problem Does This Paper Address?

If you’ve ever watched a modern reasoning model (like DeepSeek-R1) tackle a math problem, you’ve seen it mutter to itself: solving the equation, second-guessing its arithmetic, restating the premise, and running side-quests long after it hit the right answer. This "computational overthinking" drives up latency and server bills without making the final answer any better—and occasionally even talks the model out of a right answer.

Existing fixes generally fall into three flawed camps:

  1. Static budgets: Forcing the model to stop after $X$ tokens, ignoring the fact that easy problems need 50 tokens and olympiad problems need 5,000.
  2. Model-side retraining: Fine-tuning the base LLM to be concise, which is expensive and risks degrading the model's general capabilities.
  3. Confidence thresholds: Training a classifier to ask, "Am I 85% sure I'm right?" after each step.

The authors point out a subtle flaw in that third approach: knowing your current confidence isn't enough to know if you should stop. Imagine two partial solutions, both with a 50% chance of being right. One is at a dead end; continuing wastes tokens. The other is one simple algebraic step away from 100% certainty. A fixed confidence threshold treats them identically, whereas what you actually care about is whether the expected accuracy boost of the next step outweighs its token cost.

Methods

OS-Pruner treats Chain-of-Thought (CoT) pruning as a sequential decision-making game—specifically, optimal stopping.

After every reasoning step (defined cleanly as a paragraph), the system chooses: stop now and output a final answer, or pay for another paragraph of tokens in hopes of a better answer. This is governed by an explicit reward function: $$\text{Reward} = \text{Accuracy} - \lambda \times (\text{Token Length})$$

Here, $\lambda$ is a user-tunable knob representing how much accuracy gain you demand per extra token.

  • What’s novel (and clever) in training: Because the base LLM is kept completely frozen, the authors don't need slow, on-policy reinforcement learning rollouts. Instead, they generate full reasoning traces once, branch off at the end of every paragraph, force the model to box a final answer right then and there, and grade it. This creates an exact, precomputed map of rewards at every step.
  • Lightweight Architecture: OS-Pruner adds a simple linear policy head on top of the LLM's hidden states and fine-tunes only the last two transformer layers. Because causal hidden states don't depend on future tokens, an entire trace can be trained in a single parallel forward pass, and at inference time, the policy only wakes up at paragraph boundaries.
  • Progressive Annealing: Training with a tiny token penalty ($\lambda$) from scratch causes the model to lazily read to the end every time. The authors start with a harsh penalty and step it down periodically during training.
Figure 1: Training dynamics for DeepSeek-R1-Distill-Qwen-7B. Blue and orange curves show stopped-answer accuracy and stopping length, respectively, each averaged over the policy’s stopping- time distribution and 500 held-out validation trajectories. The horizontal dashed line is full-trace accuracy (56.4%); vertical dashed lines mark λ annealing. Baseline length is 5182 tokens.

Datasets

No new datasets were introduced; the authors used established benchmarks spanning a wide difficulty spectrum:

  • Training: DeepScaleR-Preview-Dataset (~40,000 math problems from historical AIME, AMC, Omni-MATH, and Still, with 500 held out for validation).
  • Math Evaluation: GSM8K (easy grade-school math), MATH-500 (medium competition math), and AIME 24/25 (hard olympiad math).
  • Out-of-Domain Transfer: GPQA (graduate-level science) and LiveCodeBench (coding).

Key Insights and Ideas

  • Classification is provably suboptimal: Using Bellman equations, the authors prove mathematically (Theorem 1) that any fixed-threshold correctness classifier can suffer an arbitrarily large performance gap compared to an optimal stopping policy, even if the classifier knows the current answer's probability of correctness with 100% precision.
  • Even "concise" models overthink: When the authors slapped OS-Pruner onto DRPO-7B—a model already aggressively fine-tuned via reinforcement learning to eliminate overthinking—OS-Pruner still shaved off substantial length while improving or maintaining accuracy. Model-side compression and dynamic early stopping are complementary!
  • Math-trained stopping transfers to code and science: Without retraining a single weight, the stopping policy trained purely on math recognized when to stop thinking on coding (LiveCodeBench) and science (GPQA) tasks, suggesting "reasoning sufficiency" leaves a domain-general signature in hidden states.

Key Results

Tested across three base models (DeepSeek-R1-Distill-Qwen-7B, GPT-OSS-20B, and DRPO-7B), OS-Pruner consistently dominates classification-probe and LLM-verifier baselines on the accuracy-vs.-length Pareto frontier.

  • Massive savings on easy/medium tasks: On DeepSeek-R1-Distill-Qwen-7B, OS-Pruner cuts token length by 59.3% on GSM8K (with just a 0.7% accuracy dip) and 60.8% on MATH-500 (while increasing accuracy by 0.7% by preventing overthinking).
  • Smart conservatism on hard tasks: On AIME, where extra computation genuinely helps, the best-scoring policy automatically holds back, trimming only 6.9% of tokens on DeepSeek-7B to protect accuracy.
  • Stacking gains on compressed models: On DRPO-7B for MATH-500, OS-Pruner cuts another 26.4% of tokens (from 1,096 down to 807) while nudging accuracy slightly up from 85.6% to 85.7%.
OS-Pruner outperforms baseline early-exit methods on MATH-500 even when applied to DRPO-7B, a model already trained for brevity.
  • Zero-shot domain transfer: Math-trained policies cut generation length by 27.4–35.5% on GPQA and 21.2–49.9% on LiveCodeBench, costing less than 2 percentage points of accuracy.

Limitations and Future Work

  • Model scale: Experiments top out at 20B parameters; testing whether frontier-scale models exhibit the same hidden-state stopping dynamics remains open.
  • Simple features and architecture: To keep baseline comparisons fair, the authors used a basic linear head on the last two layers. Feeding handcrafted training-free signals (like answer entropy) directly into the policy head—or exploring richer policy architectures—could push the efficiency frontier even further.

Summary updated

Abstract

Large Language Models (LLMs) have achieved remarkable success in complex reasoning tasks through Chain-of-Thought (CoT) prompting. However, these models often exhibit "computational overthinking," generating redundant reasoning steps that increase latency and cost without improving accuracy. Recent studies suggest that CoT trajectories can be significantly pruned, yet existing methods often rely on forcing a static thinking budget, heuristic filtering, sub-optimal early exit via classification, or expensive re-training. In this paper, we introduce OS-Pruner, a lightweight plug-in framework that formulates chain-of-thought pruning as an optimal stopping problem. Given a reasoning prefix, OS-Pruner learns whether further reasoning is worth its token cost by optimizing an explicit utility that trades off final-answer accuracy against generated length. Our novel formulation enables the model to dynamically assess the sufficient point of termination for a reasoning chain. OS-Pruner is designed to be lightweight during both training and inference, and to provide users with fine-grained control over the reasoning-effort vs. accuracy trade-off. On diverse reasoning benchmarks and base models, OS-Pruner achieves 20-60\% reduction in generation length with minimal accuracy sacrifice.
BibTeX
@inproceedings{ehab2026os,
  author = {Mohammed Ehab and Aymane El Gadarri and Vivek Farias and Adam Daniel Jozefiak and Ciamac C. Moallemi},
  title = {{OS-Pruner: Pruning Chains-of-Thought of Reasoning Models via Optimal Stopping}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=cB7emUeNVr},
}

Loading related content...

Figure