Group Relative Policy Optimization (GRPO) is a reinforcement learning algorithm for language models that drops PPO's learned value network. For each prompt it samples a group of responses and uses each response's reward relative to the group mean, scaled by the group standard deviation, as its advantage.
The group-relative advantage
For a prompt , sample responses with rewards . Each response gets
and, with outcome rewards, every token in shares that advantage. The group mean plays the role of a baseline, so no critic needs to be trained.
The objective
GRPO then maximises a clipped surrogate averaged over the group, with a KL penalty added directly to the loss instead of to the reward:
where is the per-token importance ratio, is the clip range and the KL weight.
Worked example
A group of four answers to a math problem gets verifier rewards . The mean is 0.25 and the population standard deviation is about 0.433, so the correct answer's advantage is and each wrong answer's is . If all four were correct, every advantage would be zero and the prompt would teach nothing. Implementations differ on sample versus population standard deviation (here 0.5 versus 0.433), which changes the scale.
Trade-offs
- Saves the memory and tuning of a value model, which matters at large scale.
- Needs several samples per prompt, and fails to learn from prompts that are always or never solved.
- The per-group standard deviation and per-length averaging introduce biases (for example towards length on hard prompts) that later variants remove.
Why it matters
Introduced by Shao et al. (2024), GRPO became a default for RLVR on reasoning tasks. For evaluation and safety, group-normalised advantages amplify any small reward difference, so a slightly exploitable verifier can be exploited quickly; watch for reward hacking on held-out checks.
Related terms
- PPO (Proximal Policy Optimization)
- RLVR (reinforcement learning with verifiable rewards)
- Advantage function
- Baseline (policy gradient)
- KL penalty
- Verifier
Sources
- Zhihong Shao, Peiyi Wang, Qihao Zhu, et al.. DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models, 2024. arxiv.org