GRPO trains a model by sampling several answers to the same question, scoring them, and pushing probability toward the answers that scored above their own group's average
GRPO is a reinforcement-learning step, usually run after pretraining and supervised fine-tuning (DeepSeek-R1-Zero skips the fine-tuning stage). For one prompt q, the current policy samples a group of G completions o1..oG. (The sampling policy is written πold; on a single-update step it is the same model as πθ, the one being updated. Study D covers when they differ.) Each completion gets a reward ri. Here it is 1 if the final answer is correct and 0 otherwise: a rule-based accuracy reward of the kind DeepSeek-R1 uses ("evaluates whether the response is correct", with answers "in a specified format (e.g., within a box), enabling reliable rule-based verification"). Each completion then gets an advantage Âi, how much better or worse it did than expected, and the update raises the probability of completions with positive advantage and lowers it for negative ones.
The "expected" part is the baseline. Subtracting a baseline from the reward leaves the expected direction of the update unchanged and changes only its noise (derivation under Go deeper); DeepSeekMath describes PPO's value baseline as being there "for variance reduction". PPO learns the baseline with a separate value model (its critic), "typically another model of comparable size as the policy model". GRPO "foregoes the critic model, instead estimating the baseline from group scores". Study B (Figure 3) shows what that group baseline does to each answer; Study C (Figure 4) follows it over a training run.
Go deeper: why any baseline is allowed
For a policy πθ and any constant b, the baseline term contributes nothing to the expected gradient:
Eo~π[ b · ∇θ log πθ(o) ] = b · ∇θ Σo πθ(o) = b · ∇θ 1 = 0
so E[(r - b) ∇ log π] = E[r ∇ log π] for every constant b, while the variance of the estimate depends on b. GRPO's baseline is not a constant: the group mean contains the sample's own reward ri, so the expected gradient is scaled by (G - 1)/G (same direction, smaller magnitude; RLOO's leave-one-out mean of the other G - 1 samples avoids this), and the division by the group std is a further sample-dependent rescaling (Study C and Dr. GRPO). In DeepSeekMath's words, the value function in PPO "is treated as a baseline in the calculation of the advantage", and GRPO "uses the average reward of multiple sampled outputs, produced in response to the same question, as the baseline". With outcome supervision DeepSeekMath "sets the advantages ... of all tokens in the output as the normalized reward" (section 4.1.2).