DUET: Optimize Token-Budget Allocation for Reinforcement Learning with Verifiable Rewards

Haoyu Hu, Xuandong Zhao, Xuhai Xu, Nori Jacoby

TL;DR

Training reasoning language models requires generating hundreds of thousands of tokens per step, burning massive amounts of compute on problems the model already knows—or on rambling, dead-end chains of thought. DUET solves this by coordinating how many attempts each prompt gets and when to cut each attempt short under a single shared token budget. Using just half the compute budget, DUET trains models $2.51\times$ faster than standard recipes while actually achieving higher reasoning accuracy.

What Problem Does This Paper Address?

Behind frontier reasoning models (like DeepSeek-R1 and Qwen3) is an engine called Reinforcement Learning with Verifiable Rewards (RLVR), typically powered by an algorithm named GRPO. The standard recipe is brute-force: take a prompt, generate several candidate solutions ("rollouts"), check if the final math or code answer is right, and update the model based on which attempts beat the group average.

Because checking a math answer is cheap, the bottleneck in RLVR is almost entirely token generation. Treating every prompt and every rollout equally wastes tremendous compute: easy prompts don't need eight tries, and confused, rambling rollouts shouldn't be allowed to run for thousands of tokens. Prior work tried to fix this along one axis at a time—either skipping uninformative prompts or pruning long rollouts—while slapping fixed length limits on generation (which accidentally kills the deep, long chains of thought needed for hard problems). The authors ask: what happens if we optimize both decisions simultaneously under one shared budget?

Methods

Drawing on classical stratified Monte-Carlo statistics, the authors introduce DUET (DUal-controlled tokEn allocaTion), a lightweight control layer over standard GRPO that adds less than 1% overhead and requires no auxiliary neural networks.

Figure 2: One DUET training step. Allocate: each prompt receives an informativeness score ˆsq from previous training contributions, and the cost-weighted Neyman rule sets the per-prompt rollout count nq. Generate: a marker-gated rule terminates a rollout shortly after an answer marker fires and aborts a marker-less rollout past a quantile threshold. Update: kept rollouts feed an importance-corrected, gradient-masked backward step. The dual variable λ⋆is the budget-pressure signal that closes the shared token budget across all three phases.

DUET turns a standard training step into three coordinated phases coupled by a single "budget-pressure" signal ($\lambda^\star$):

  • Allocate (How many tries?): Using a cost-weighted Neyman allocation rule, DUET tracks how much a prompt's rollouts disagreed in previous epochs (gradient variance) divided by the square root of its average token length. Prompts with high disagreement and concise answers get up to 32 rollouts; solved or uninformative ones get as few as 1.
  • Generate (When to stop?): Instead of a hard length cap, DUET watches for a machine-verifiable answer marker (like a \boxed{} in math or a closing code fence). Once an answer appears, generation trims cleanly after a tiny grace window. If a rollout drags past an adaptive length threshold (e.g., the 80th percentile of recent lengths) without producing an answer, it is aborted as a dead end.
  • Update (Keep the math honest): Simply deleting aborted rollouts would silently blind the model to its hardest, slowest problems. To prevent bias, DUET randomly lets a tiny fraction ($\varepsilon_{\text{abort}}$, default 5%) of answer-less rollouts run to completion and scales up their weight during the gradient update (importance sampling).

Datasets

  • Training: All models are fine-tuned on the Hendrycks MATH corpus (7,500 problems).
  • Evaluation: Models are tested on MATH-500, GSM8K, and AIME-2024 (math reasoning); HumanEval (code generation); and GPQA-Diamond (out-of-distribution scientific Q&A). Robustness checks also include Minerva-Math and Olympiad-Bench. No new benchmarks are introduced.

Key Insights and Ideas

  • Efficiency usually trades off quality; DUET widens its lead when starved: Most budget-saving tricks degrade as you turn down the compute knob. DUET's accuracy gap over baselines is actually largest at a 25% token budget because tight budget pressure forces the controller to strip away noise and focus strictly on high-signal prompts.
  • Emergent curriculum learning without a teacher: Nobody tells DUET which math problems are hard. Yet at tight budgets, DUET naturally discovers a curriculum—starting with uniform rollouts, fanning out aggressively to concentrate compute on harder problems mid-training when accuracy climbs steepest, and relaxing once those problems are mastered.
  • Crisper reasoning: Standard GRPO barely changes a model's verbosity (median length shifts from 505 to 511 tokens on Qwen3-1.7B). DUET collapses the median length to ~330 tokens by rewarding concise, well-discriminated prompts and cutting off rambling tails.

Key Results

DUET accuracy and wall-clock speedup on Qwen3-1.7B trained on MATH.

DUET accuracy and wall-clock speedup on Qwen3-1.7B trained on MATH.

Tested primarily on Qwen3 (1.7B and 4B, scaling up to 14B in ablations) and Llama-3.2-3B-Instruct against GRPO and three budget-aware baselines (DAPO, ARRoL, VIP):

  • Half budget beats full budget: On Qwen3-1.7B, DUET at 50% token budget hits 62.1% on MATH-500 and 84.0% on GSM8K—beating full-budget GRPO (56.8% / 78.0%) and all full-budget efficient baselines while running $2.51\times$ faster.
  • Full-budget dominance: At 100% budget on Qwen3-1.7B, DUET scores 61.6% on MATH-500, 12.5% on AIME-24 ( nearly doubling GRPO's 6.7%), and 52.7% on HumanEval (+5.1% over GRPO) at a $1.62\times$ speedup.
  • Cross-scale & cross-family: On Qwen3-4B, 50%-budget DUET runs $2.38\times$ faster than full GRPO while beating it on MATH-500 (76.7% vs. 74.5%) and HumanEval (77.0% vs. 73.6%). Gains also hold on Llama-3.2-3B-Instruct ($2.04\times$ speedup at half budget with within-1% parity or better).

Limitations and Future Work

  • Reliance on verifiable formats: The marker-gated abort assumes answers have a clean, machine-parsable trigger (like a math box or code block). Extending DUET to open-ended, subjective tasks will require pairing the variance allocator with learned evaluators or alternative stopping signals.
  • Multi-pass training regime: Because DUET estimates prompt informativeness from past epochs, it assumes a multi-pass training setup ($E \ge 2$ epochs over a prompt pool) rather than pure single-pass streaming.
  • Synchronous execution & bounds: DUET is currently a synchronous RL method with fixed upper/lower per-prompt rollout caps (e.g., $n_{\max}=32$). Combining DUET's token control with asynchronous rollout engines to eliminate GPU idle time is a natural next step.

Summary updated

Abstract

Reinforcement learning with verifiable rewards (RLVR) generates hundreds of thousands of tokens per training step, with rollout generation dominating the computational cost. The overall token budget can be controlled along two main dimensions: (i) deciding which prompts to allocate rollouts to, and (ii) deciding how long each rollout should be. Prior work has generally controlled only one of these dimensions at a time. We show that jointly tuning both decisions under a shared compute budget improves both reasoning quality and wall-clock training time. We instantiate this view as \textbf{DU}al-controlled tok\textbf{E}n alloca\textbf{T}ion (DUET), a computationally efficient layer over GRPO that uses a lightweight pre-rollout surrogate of prompt informativeness to set how many rollouts each prompt receives, and a marker-gated abort rule with importance reweighting to set when to stop them. On Qwen3-1.7B trained on MATH, DUET outperforms full-budget GRPO and the other three budget-aware baseline methods. DUET's advantage further generalizes to other benchmarks across math and coding, and is on par with the best baseline on the scientific Q\&A domain, while also achieving a $1.62\times$ wall-clock speedup. More notably, using only 50\% of the token budget, DUET still outperforms all baseline methods at their full budget, achieving an even higher $2.51\times$ speedup over full-budget GRPO. We verify the high performance of DUET on other backbone LLMs, including Qwen3-4B to 14B and Llama-3.2-3B-Instruct. Notably, the gap between DUET and the strongest baseline \emph{widens} as the budget tightens, contrary to the usual pattern in which efficient methods trade off quality as compute decreases. More broadly, these results suggest that DUET budget-aware control strategies are valuable not only for accelerating training, but also for improving the quality of the learning signal. The code and data setup are publicly available at https://github.com/Haoyu-Hu/DUET
BibTeX
@inproceedings{hu2026duet,
  author = {Haoyu Hu and Xuandong Zhao and Xuhai Xu and Nori Jacoby},
  title = {{DUET: Optimize Token-Budget Allocation for Reinforcement Learning with Verifiable Rewards}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=N80WSnmidb},
}
Figure