TL;DR
Group Relative Policy Optimization (GRPO) does not require a large group of rollouts per prompt to estimate stable baselines—it is fundamentally an online form of contrastive learning akin to Direct Preference Optimization (DPO). By cutting the group size down to the absolute minimum of two rollouts per prompt ($G = 2$), 2-GRPO matches the reasoning performance of standard 16-GRPO on math benchmarks while slashing rollout volume by 87.5% and total wall-clock training time by over 70%.
What Problem Does This Paper Address?
Reinforcement Learning with Verifiable Rewards (RLVR) has become central to eliciting reasoning capabilities in large language models (LLMs). GRPO eliminates the need for a separate value network by sampling a group of $G$ rollouts per prompt and computing intra-group normalized rewards.
Conventionally, researchers believe $G$ must be relatively large (typically 8 to 16) to reliably estimate reward mean and standard deviation. However, rollout generation constitutes the primary computational bottleneck in RL post-training (accounting for up to 70% of total training time). The authors ask: Can we shrink group size to improve training efficiency without sacrificing reasoning gains?
Methods
- Reframing GRPO as Contrastive Learning: The authors mathematically reframe GRPO as dynamic $N$-vs-$M$ sequence-level contrastive learning (with $N$ correct and $M$ incorrect rollouts). Under this view, DPO is simply a static 1-vs-1 sequence contrastive loss.
- The Minimal Case (2-GRPO): When group size $G = 2$, reward normalization reduces to a simple discrete assignment:
- If one rollout is correct and the other incorrect: $A^+ = 1$ and $A^- = -1$.
- If both receive identical rewards (both correct or both incorrect): $A^+ = A^- = 0$ (zero gradient).
- Mini-Batch Variance Compensation: To counteract increased per-prompt gradient variance when moving from $G=16$ to $G=2$, the authors increase the number of prompts per mini-batch ($Q = 256$ with $G = 2$ vs. $Q = 32$ with $G = 16$). Both maintain a batch size of 512 total rollouts ($B = Q \times G$). Following standard linear scaling rules, they adjust the learning rate upward (from $1 \times 10^{-6}$ to $8 \times 10^{-6}$).
Datasets
- Training Datasets:
- MATH (Hendrycks et al., 2021)
- DAPO-Math-Sub (a 7.5k prompt subset sampled from DAPO-Math-17k)
- Evaluation Benchmarks (Out-of-Distribution Math Reasoning):
- MATH-500, AMC 2023, Minerva Math, AIME 2025, and OlympiadBench.
- Note: No new datasets were introduced; evaluation focuses on standard, verifiable mathematical problem-solving benchmarks.
Key Insights and Ideas
- Normalization is not the core driver: Group-relative advantage estimation does not fundamentally rely on precise intra-group sample statistics. Instead, the contrastive pairing of positive versus negative trajectories drives optimization.
- Credit assignment is preserved in expectation: Proposition 4.1 proves that amortized over stochastic gradient updates, 2-GRPO's expected advantage matches standard GRPO's advantage up to a scalar factor ($1/\sqrt{p(1-p)}$).
- Exploration on hard problems does not stall: While sampling only two attempts per prompt per epoch seems risky for hard problems, the model updates between epochs. Sampling 2 rollouts across $m$ sequential policy checkpoints yields a cumulative probability of finding at least one correct answer that is greater than or equal to sampling $2m$ rollouts all at once from the initial policy ($\pi_0$).
Key Results
The authors evaluated 2-GRPO across Qwen-2.5-Math-1.5B, Qwen-2.5-Math-7B, and DeepSeek-R1-Distill-Qwen-1.5B:
- Massive Speedups: 2-GRPO requires 73.8% to 84.1% less wall-clock training time compared to 16-GRPO. For example, DeepSeek-R1-Distill-1.5B training dropped from 38.40 hours to 7.07 hours (-81.6%).
- Rollout Reduction: 2-GRPO executes only 0.15 million rollouts over 10 epochs versus 1.2 million rollouts for 16-GRPO (an 87.5% reduction).
- Parity in Accuracy: On out-of-distribution math benchmarks, 2-GRPO matches 16-GRPO's accuracy:
- Qwen-2.5-Math-7B (MATH training): MATH-500 Mean@32 was 75.23% (2-GRPO) vs. 75.90% (16-GRPO); AMC 2023 was 64.60% vs. 61.79%; OlympiadBench was 26.39% vs. 25.99%.
- In-distribution reward and validation curves over training time demonstrate that 2-GRPO converges to comparable performance significantly faster in wall-clock time.
Limitations and Future Work
- Data Inefficiency from Zero Advantages: When both sampled rollouts are either correct or incorrect, both are assigned zero advantage and discarded. On tasks where the policy is already highly capable (or near zero capability), many sampled rollouts yield zero gradient.
- Unrealized Compute Savings in Backward Pass: The current implementation still processes rollouts before filtering. A more specialized training pipeline could avoid computing activations or gradients altogether for pairs with identical rewards.
- Replay Buffers: Future iterations could incorporate experience replay (e.g., maintaining buffered negative responses) to pair with lone positives, mitigating data wastage.
Summary updated