TL;DR
When training Large Language Models (LLMs) to reason using Group Relative Policy Optimization (GRPO)—the secret sauce behind DeepSeek-R1—engineers have to guess a crucial hyperparameter: how many responses to generate per prompt. By recognizing that GRPO’s gradient is actually a classical mathematical object called a U-statistic, the authors turn hyperparameter tuning into a principled variance-estimation problem. Even better, they show why standard bias-correction blows up in practice and introduce a "pessimistic" estimator that stabilizes training and boosts reasoning accuracy at minimal extra cost.
What Problem Does This Paper Address?
To teach an LLM to reason step-by-step via reinforcement learning (RL), the model needs to know if a generated Chain-of-Thought is better or worse than average. Older methods like PPO use a separate, memory-heavy neural network (a "value network") to predict this baseline. GRPO ditches that extra network. Instead, for every prompt, it samples a group of $G$ completions and scores each response relative to the group's average reward.
Because generating long reasoning chains is computationally expensive, you usually have a fixed budget of total completions ($N = B \times G$) per training step. This creates a tug-of-war:
- Large group size ($G$): Great baseline estimates per prompt, but you only see a tiny batch of prompts ($B$), hurting prompt diversity.
- Small group size ($G$): High prompt diversity, but noisy baselines.
Picking the wrong $G$ spikes the Mean Squared Error (MSE) of your policy gradient, leading to sluggish learning or outright policy collapse. Until now, choosing $G$ was pure trial and error—and worse, the optimal $G$ shifts dynamically as training progresses!
Methods
The authors look under the hood of GRPO (specifically its unbiased leave-one-out variant) and notice two nested layers of averaging: an outer average over $G$ completions, and an inner average over the other $G-1$ completions. In statistics, this makes the prompt-level gradient a second-order U-statistic.
Using a classical tool called the Hoeffding decomposition, they derive an exact "GRPO scaling law" for the gradient MSE and find a clean closed-form for the optimal group size: $$G^* = 1 + \sqrt{c_3 / c_1}$$ Here, $c_3$ captures within-prompt variance (how much completions vary for the same prompt) and $c_1$ captures between-prompt variance (how much true gradients vary across different prompts).
To adaptively pick $G$ during training, the algorithm periodically runs a small "pilot study" (generating $g$ completions for $b$ prompts, e.g., every 50 steps) using only the last four Transformer blocks to cheaply estimate $c_3$ and $c_1$. They explore three ways to estimate this ratio:
- Biased plug-in estimator: Naive sample variances, which carry finite-sample bias because $g$ is small.
- Debiased plug-in estimator: Mathematically subtracts out the finite-sample bias.
- Pessimistic estimator (Novel): Treats each candidate $G$ like an arm in a multi-armed bandit problem. Instead of minimizing the raw debiased MSE estimate, it minimizes an upper confidence bound—penalizing candidate group sizes by their estimation uncertainty (computed via a grouped jackknife) and clipping negative variance estimates.
Datasets
No new benchmarks are introduced; the authors evaluate on existing synthetic and real-world datasets:
- Synthetic Reasoning: Six tasks from Reasoning Gym (base conversion, prime factorisation, decimal arithmetic, equation solving, fraction arithmetic, and knights-and-knaves puzzles).
- Mathematical Reasoning: GSM8K and DAPO (DAPO-Math-17k) for training; evaluated on 10 math competition benchmarks including MATH-500, Minerva, OlympiadBench, AIME 2024/2025, AMC 2023, HMMT 2024/2025, BRUMO 2025, and CMIMC 2025.
- Code Generation: AceCode for training; evaluated on HumanEval+, MBPP+, and the AceCode test split.
Key Insights and Ideas
- Debiasing can backfire spectacularly: In statistics, removing bias is usually a good reflex. Here, because between-prompt variance ($c_1$) is tiny compared to within-prompt variance ($c_3$ is often 300x–500x larger!), $c_1$ lives in a "weak signal" regime. Naive finite-sample bias happens to be positive, accidentally acting like a stabilizer (regularization) on the denominator. Subtracting that bias frequently makes the estimated denominator $\tilde{c}_1$ near-zero or negative, causing the ratio $c_3/c_1$ to explode to the maximum allowable group size!
- Pessimism gets the best of both worlds: By adding a standard-error penalty to the loss of each candidate $G$, the pessimistic estimator naturally shrinks wild ratio estimates when the denominator is uncertain, while matching the fast convergence of the debiased estimator when sample sizes are large.
Key Results
- More Accurate Gradients: Across 30 pilot sample-size configurations on Qwen2.5-1.5B-Instruct checkpoints, the clipped pessimistic estimator achieved lower average relative excess gradient MSE than both biased and debiased baselines in 27 out of 30 settings (and adding a small standard-error floor improved 23 of 30 further).
- Better Reasoning Models: Training
Qwen3-8Bon DAPO with pessimistic adaptive group sizes beat all fixed group sizes ($G \in \{4, 8, 16, 32, 64\}$) on 6 of 10 math benchmarks, hitting the highest overall average accuracy of 45.14% (including 92.20% on MATH-500 and 84.38% on AMC 2023). Similar wins held on Reasoning Gym, GSM8K, and code generation (DeepSeek-Coder-1.3B-Base). - Low Overhead: Running periodic pilot studies increased total wall-clock training time by only 7.03%–10.33%.
Limitations and Future Work
- Simplified GRPO: The theoretical analysis studies clean stochastic gradient ascent without Adam, KL-divergence regularization, reward-variance normalization, or PPO-style minibatch clipping.
- Fixed Pilot Design: While $G$ is chosen adaptively, the pilot study's own group size $g$ is fixed; Theory suggests $g \asymp c_1^{-1/2}$ is optimal, pointing toward adaptive experimental design for the pilot itself.
- Uniform Allocation: Every prompt in a step gets the same group size $G$ and every iteration gets the same budget $N$. Future work could allocate more rollouts to medium-difficulty prompts (where reward variance is highest) and dynamically shift budgets across training iterations.
Summary updated