Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Models and algorithms

GRPO Group Relative Policy Optimization

About 3840 characters Updated Nov 30, 2026 17 views AI wiki

GRPO (Group Relative Policy Optimization) is a reinforcement learning algorithm proposed by DeepSeek that replaces value-network advantage estimation with the within-group relative performance of multiple samples drawn for the same question. In large model reasoning training it achieves near or even better results at significantly lower memory cost.

Core Principles

Traditional PPO needs a value network the same size as the policy to estimate a baseline that reduces the variance of the advantage. This value network is extremely hard to train on language models, taking memory and being unstable. GRPO's idea is direct: sample a group of answers for the same prompt, say eight or sixteen, score each of them, then use the group mean as the baseline, subtracting the mean from each answer's score and dividing by the standard deviation to obtain a standardized advantage.

This advantage directly serves as the weight of every token in that answer and is plugged into the clipped policy-gradient objective, while the KL penalty relative to the reference model is retained. Because the baseline comes naturally from the samples in the group, the value network is removed entirely, saving considerable training memory, and within-group comparison naturally cancels the score-scale differences caused by problem difficulty. For tasks whose correctness can be verified by rules, such as math problems, the reward is a 0-1 signal, which after within-group standardization becomes exactly the relative advantage of "how much better than peers", a clean signal that needs no reward model.

Key Points

First, group size is the core hyperparameter. Too small a group makes the baseline noisy, too large a group makes sampling costly, with common values between eight and sixty-four. Second, samples within a group must differ; if all are correct or all are wrong, the standard deviation is zero, the advantage vanishes and the group produces no gradient, so questions that are all-correct or all-wrong should be filtered out or handled with a difficulty curriculum. Third, reward design often combines rule-based rewards with format rewards: rule-based rewards judge answer correctness, while format rewards encourage putting the reasoning process inside designated tags. Fourth, clipping and the KL coefficient are still kept, with a larger coefficient early in training to prevent drift from the base model. Fifth, the sampling temperature should be moderate; too low makes the group homogeneous, too high generally lowers answer quality.

Common Misconceptions

Misconception one: thinking GRPO needs no reward signal. It only does away with the value network; a reward model or rule-based judgment is still needed to give scores. Misconception two: thinking within-group standardization can be done arbitrarily; failing to handle zero-variance groups produces many invalid samples. Misconception three: conflating GRPO with self-consistency voting; the former is used for training, the latter only for aggregating answers at inference time.

Application Scenarios

Reinforced training of mathematical reasoning, training of code generation with unit-test feedback, reinforcement fine-tuning of verifiable tasks, alignment of multimodal reasoning, and low-cost reproduction of reinforcement learning.

The practical experience DeepSeek reported in its public reasoning model training is worth consulting: first use a small amount of long chain-of-thought samples for cold-start supervised fine-tuning so that the model has a basic reasoning format; then enter the reinforcement learning stage, mainly with rule-based rewards, namely correct answers plus format compliance; during training the answer length was observed to grow naturally and reasoning ability to improve with it, a "self-evolution" typical of pure reinforcement learning. Afterwards a small amount of rejection-sampling data is mixed in for a second fine-tuning, yielding the deployable version.

From a comparative view, GRPO's main benefit over PPO is memory and engineering simplification, at the cost of the compute of within-group sampling. If the group size is sixteen, each prompt must generate sixteen complete answers, significantly raising time cost; but on reasoning tasks this cost buys a dense relative signal that is worth it. For open-ended writing tasks, rule-based rewards are hard to define and a reward model is still needed, and the value of within-group standardization is discounted because the reward model itself carries noise.