CODA: Difficulty-Aware Compute Allocation for Adaptive Reasoning

Siye Wu, Jian Xie, Yikai Zhang, Yanghua XiaoarXiv 2026

TL;DR

Large reasoning models achieve impressive performance by scaling test-time compute through long Chain-of-Thought (CoT) generation, but they often "overthink" simple problems, wasting massive amounts of tokens. CODA (Compute Allocation by Difficulty Awareness) solves this by dynamically adjusting reasoning length based on problem difficulty estimated directly from training rollouts. It slashes token costs by over 60% on easy tasks while preserving or enhancing deep deliberation on hard ones—all without requiring external difficulty annotations or user-defined budgets.

What Problem Does This Paper Address?

Recent breakthroughs in large language models (LLMs) highlight the power of test-time scaling: giving a model more tokens to "think" via long Chain-of-Thought (CoT) processing significantly boosts accuracy on complex tasks. However, this creates a major inefficiency. When applied uniformly, models tend to overthink simple problems, generating verbose, repetitive rationales for trivial questions (like "2+3=?") where extra compute yields zero accuracy gains.

Existing remedies fall short. Applying a blanket length penalty during reinforcement learning (RL) reins in verbosity but severely degrades performance on hard problems that genuinely require deep reasoning. Alternatively, forcing users to manually specify a token budget at inference time is brittle and impractical at scale. The authors of CODA tackle this bottleneck by formalizing adaptive reasoning as a utility maximization problem: a model should allocate tokens until the marginal accuracy gain no longer justifies the incremental token cost.

Methods

CODA operationalizes this principle by introducing a dual-gated reward shaping mechanism built on top of group-based reinforcement learning (specifically, Group Relative Policy Optimization, or GRPO).

Instead of relying on human labels for problem difficulty, CODA uses a lightweight, policy-internal proxy: the group success rate ($s_q$) across sampled rollouts for a given question. If most rollouts get the answer right, the problem is deemed easy; if few succeed, it is hard.

This difficulty signal dynamically modulates two non-negative gates that scale a length-dependent shaping term added to the binary base reward:

  1. The Easy-Side Gate ($w_q^{easy}$): Activates when a problem is easy ($s_q$ is high), penalizing lengthy outputs to trim redundant steps and discourage overthinking.
  2. The Hard-Side Gate ($w_q^{hard}$): Activates when a problem is challenging ($s_q$ is low), providing a bonus for more deliberative, extended rollouts.

Crucially, the entire difficulty factor multiplies the binary base reward ($r_i^{base}$). This means incorrect rollouts receive a reward of zero regardless of length, preventing the model from developing a degenerate "length-seeking" behavior where it babbles endlessly without finding the correct answer.

Datasets

The authors trained their models on DeepScaleR, a mathematics dataset containing 40,000 problems spanning a wide range of difficulties drawn from AIME, AMC, Omni-Math, and STILL. For robustness experiments, they also constructed specialized subsets using GSM8K and MATH (level-1).

Evaluation was conducted across a diverse suite of benchmarks:

  • Mathematical Reasoning: SVAMP, GSM8K, MATH, AMC23, AIME24, and AIME25.
  • General/Commonsense Reasoning: CSQA and GPQA.

Key Insights and Ideas

  • Difficulty-Conditioned Token Pricing: Rather than treating token costs as a global constant, CODA effectively varies the "price" of tokens based on instance difficulty. Tokens are made "expensive" on easy tasks to encourage early stopping, and "cheap" (or incentivized) on hard tasks to encourage exploration.
  • Correctness Alignment is Mandatory: Simply rewarding length on hard problems causes models to generate longer, incorrect answers. Gating the length bonus by correctness ensures that extra compute is only incentivized when it actively leads to the right solution.
  • Selective Regularization vs. Blunt Truncation: Ablation studies showed that a moderate easy-side penalty acts as a selective regularizer that trims fluff without harming accuracy. If the penalty is too aggressive, it suppresses the model's exploratory capacity during training.

Key Results

CODA was evaluated across multiple model scales using Qwen3-4B, 8B, and 14B base backbones.

Figure 1: Adaptive compute allocation across difficulty levels on Qwen3-8B-Base. (a) Compared to GRPO, CODA dynamically allocates reasoning tokens by question difficulty, consuming substantially fewer tokens on easier problems while increasing compute for harder ones. (b) On easy tasks (GSM8K, MATH), extra tokens yield marginal gains, and CODA achieves optimal accuracy at minimal cost by avoiding unnecessary reasoning. On hard tasks (AIME24&25), additional tokens substantially improve performance, and CODA encourages deeper reasoning to maximize accuracy.
  • Massive Token Savings on Easy Tasks: On the SVAMP benchmark (using the 8B model), CODA cut the average token cost from 812 to 203 tokens—a 75% reduction compared to standard GRPO—while maintaining identical accuracy.
  • Preserved Performance on Hard Tasks: On competition-level benchmarks like AIME24 and AIME25, CODA maintained or slightly improved accuracy while matching the token budget of standard GRPO. It significantly outperformed standard length-penalty baselines (VLP and ASRR), which suffered severe accuracy drops on hard tasks due to indiscriminate truncation.
  • Robustness to Distribution Shifts: Even when trained on extremely skewed datasets (e.g., only easy or only hard problems), CODA's gating mechanism adapted online to track difficulty, maintaining stable downstream evaluation performance.

Limitations and Future Work

  • Noisy Difficulty Estimation: Relying on the group success rate ($s_q$) can become noisy if the rollout group size ($G$) is small or if the reward signals are highly sparse. Developing more robust, uncertainty-aware difficulty estimators is an open direction.
  • Context Length Constraints: Due to hardware constraints, the maximum generation length was capped at 16K tokens. On extremely difficult problems, this caused a 5% clipping ratio, meaning some productive, ultra-long reasoning paths were prematurely cut off.
  • Scaling Limits: The method has yet to be systematically tested on ultra-large model architectures (e.g., >70B parameters) or scaled to much longer context windows.

Summary updated

BibTeX
@misc{wu2026coda,
  author = {Siye Wu and Jian Xie and Yikai Zhang and Yanghua Xiao},
  title = {{CODA: Difficulty-Aware Compute Allocation for Adaptive Reasoning}},
  year = {2026},
  eprint = {2603.08659},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.08659},
}
Figure