Group-Based Policy Optimization › Summary
Michael BrenndoerferNovember 29, 20262 min read
Language AI HandbookAll chapters - GRPO uses rewards from completions of the same prompt to replace the learned critic used in common actor-critic PPO implementations.
- In the original outcome-supervised objective, for a prompt group with positive reward dispersion. Each token of response receives that same advantage.
- GRPO borrows the clipped surrogate from PPO, uses relative rewards in place of a learned critic, and can penalize divergence from a reference policy.
- The toy sets the advantages to zero when all rewards tie. The reward-surrogate gradient is then zero, although a reference penalty or existing optimizer state can still affect the update. DAPO fills batches with groups of mixed correctness when eligible groups can be sampled.
- Dr. GRPO drops reward standard-deviation scaling and divides each response’s token sum by a fixed budget. DAPO pools the token terms across the responses to one prompt before taking their mean.
- Related recipes can change advantage scaling, clipping, token weighting, sampling, or the granularity of the likelihood ratio. The DeepSeek-R1 paper shows a whole-output ratio, while GSPO clips a length-normalized sequence ratio.
- The toy implementation in this chapter reproduces the mechanics (sampling, within-group advantages, clipped loss, KL to a reference, saturation into zero-variance groups) at a scale where you can inspect every piece. It does not reproduce the scale, the tokenizer, the variable-length responses, or the emergent reasoning behavior of real models, and it cannot show the length bias that Dr. GRPO identifies because its responses have fixed length.
- When comparing variants, keep track of the reward source, grouping, weighting, clipping, and rollout budget.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!