GRPO (Group Relative Policy Optimization)
Definition
Group Relative Policy Optimization (DeepSeekMath, Shao et al. 2024; arXiv:2402.03300) is PPO with the value network deleted. It replaces GAE’s learned per-state baseline with a Monte-Carlo group baseline: for each prompt, sample a group of complete outputs, score them, and use the group’s mean reward as the baseline. It is the RL algorithm behind DeepSeek-R1, exploiting the fact that reasoning rewards are sparse and terminal (one scalar per whole output) — so there is no per-token reward to bootstrap a critic from anyway.
Key math
For a group with rewards , the group-relative advantage standardizes within the group and broadcasts the same scalar to every token of output :
The group mean is a valid baseline (depends on , not on which output’s gradient is taken → unbiased). Keep PPO’s clipped surrogate and add an explicit KL term (via Schulman’s unbiased, estimator):
with . KL placement differs from RLHF-PPO: it is a separate loss term, not folded into the per-token reward — and RLVR recipes often set small or zero. Variance is controlled by group size (; DeepSeekMath used ), traded against extra rollout compute.
Normalization biases (Dr. GRPO)
Both normalizers inject optimization bias (Liu et al. 2025, Dr. GRPO; arXiv:2503.20783):
- Response-length bias (from ): dilutes the per-token penalty on long wrong answers → pushes wrong answers longer (length inflation).
- Question-difficulty bias (from ): up-weights low-variance (very easy/hard) prompts, distorting the curriculum.
Dr. GRPO removes both (constant token normalizer; drop the std division, use ). Degenerate case: if all rewards are equal (all right/wrong), and the advantage vanishes → no gradient; DAPO’s dynamic sampling (arXiv:2503.14476) filters these out. DAPO also adds clip-higher (anti-entropy-collapse), token-level loss, and overlong reward shaping; GSPO (arXiv:2507.18071) moves the ratio/clipping to the sequence level (stabilizes MoE RL, used for Qwen3).
Why it matters
GRPO deletes one of PPO’s two trainable models and all of GAE’s machinery, making critic-free RLVR tractable at scale — the workhorse for reasoning RL. Combined with verifiable rewards on a base model (no SFT), it produced emergent long chain-of-thought (R1-Zero). The value-based comeback (VAPO/VC-PPO, arXiv:2504.05118) argues a well-tuned critic still wins on long CoT — so “is the critic worth it?” is mid-swing.
Taught in
- 09-rl-for-reasoning — deriving the group baseline, the full objective, Dr. GRPO/DAPO/VAPO/GSPO.
- 10-frontier-and-infra — GRPO’s -sample rollout cost as the systems bottleneck.
See also
- ppo — the algorithm GRPO strips the critic from
- rlvr — the verifiable-reward setting GRPO usually runs in
- advantage-function — what the group baseline estimates
- chain-of-thought-rl — the emergent behavior GRPO+RLVR produces
- rl-post-training-infra — the generation cost of samples/prompt
- rl-for-llms