Group Relative Policy Optimization
A groupwise alignment training regime that samples multiple candidate answers for the same prompt and updates the model from how those answers rank relative to one another.
Group Relative Policy Optimization, usually shortened to GRPO, is a post-training alignment method that samples several candidate answers for the same prompt, scores them as a group, and nudges the model toward answers that rank higher relative to the other samples in that group.
At a glance
Released
February 2024
Authors
Zhihong Shao, Peiyi Wang, Qihao Zhu, et al.
Regime type
Training Alignment
Related modules
No related modules listed yet.
What It Is
Group Relative Policy Optimization is a post-training alignment regime for language models. For each prompt, the current model samples a small group of candidate answers, compares them against one another, and uses that within-group ranking as the training signal instead of learning from one fixed preferred-versus-rejected pair.Why It Exists
During post-training, teams often need updates that react to freshly sampled model behavior instead of only to comparisons frozen in a dataset. A single prompt can produce several candidate answers with different strengths, and the useful signal is often how those answers rank relative to one another in the same group. Group Relative Policy Optimization exists so post-training can learn from those grouped relative rankings rather than from one static preference pair at a time.How It Works
For each training prompt, the current model samples several candidate answers from the same policy. A reward or preference signal scores every answer in that group. Group Relative Policy Optimization then compares those scores relative to one another: answers that beat the group average receive a positive training signal, while weaker answers are pushed down. The policy update follows that within-group ranking instead of a single fixed preferred-versus-rejected pair.Group Relative Policy Optimization training flow
Prompt +
sampled answersWithin-group
relative advantagePolicy-updated
modelPrompt +
sampled answers to Within-group
relative advantageWithin-group
relative advantage to Policy-updated
model
Request and weight flow
Ai
- relative advantage for sample i
ri
- reward or preference score for sample i
- rG
- mean score across the prompt group
σG
- standard deviation of scores in the group
- ε
- small stabilizer constant