GRPO & Critic-Free Policy Optimization
Group-relative advantages, RLOO, and the biases hidden in normalization.
GRPO looks like PPO with the critic deleted, but each of its normalizations changes the objective it optimizes. Dividing by the group's standard deviation reweights prompts by difficulty; dividing by response length favors short answers when right and long ones when wrong; and differentiating its KL estimate follows the gradient of a different divergence. This lesson derives each effect exactly and shows how RLOO, Dr. GRPO, DAPO and VinePPO respond.
What you’ll learn
- Write the GRPO objective term by term, prove that the k3 estimator is unbiased and non-negative, and derive what its gradient estimates when it is used as a loss.
- Derive the leave-one-out identity linking RLOO and mean-centered group advantages, and the effective objective of standard-deviation normalization in the large-group limit.
- Derive the length bias of per-response normalization, and compare sample-level, token-level and constant normalizers.
- Explain DAPO's four changes and VinePPO's Monte Carlo credit assignment: what each fixes and what it costs.
The objective, term by term
With a single gradient step per batch, as in DeepSeekMath, when the gradient is taken, every ratio equals 1 and the clip never acts: GRPO is then REINFORCE with the group baseline, plus a KL term. Clipping matters only when the same samples are reused for several updates.
by definition. For , add a control variate with mean zero:
Since for every , with equality only at , each sample of is non-negative, while a single is negative whenever . Schulman (2020) compares these and other estimators; typically has lower variance when and are close.
In code, the sampled estimate is differentiated with respect to while the sample is held fixed. For the score has mean zero, so
A loss adds zero-mean noise and no regularization at all. For ,
In expectation the first term vanishes again, and the second reweights the score by :
So the loss, an unbiased estimate of in value, follows the gradient of , the divergence with its arguments swapped, which penalizes the policy for losing mass where the reference has it (Tang & Munos, 2025). The gradient of itself is , the log-ratio acting as a negative reward, which is what putting the penalty into the reward, as in PPO-based RLHF, computes.
A further subtlety: applied token by token, these losses ignore how a token changes the KL contributions of the tokens after it, so they give at best a partial derivative of the sequence-level divergence.
A team adds , averaged over sampled tokens, to its loss, believing that it penalizes . What does its expected gradient actually descend?
- , exactly as intended
- Nothing: its expected gradient is zero
- The entropy of
Show the answer
B.
Holding the sample fixed and differentiating gives , whose expectation under is . The two divergences agree to second order when the policies are close, so the difference matters most when the policy has moved far from the reference.
Leave-one-out, the mean, and the standard deviation
Sample independently given , with success probability under 0/1 rewards. RLOO's baseline for does not depend on , so its estimator is unbiased:
Because , centering on the full mean gives exactly : biased only by a constant factor, which does not change the direction.
Dividing by the group's standard deviation is different: depends on and varies across prompts. As , and , and since , the per-prompt update tends to
In the large-group limit, ignoring clipping and length normalization, GRPO therefore ascends instead of pass@1, . The weight is 2 at , 3.33 at or , and 10.05 at or : prompts the policy almost always or almost never solves get the largest steps per unit of improvement. Liu et al. (2025) call this the question-level difficulty bias.
Whether the reweighting helps is an empirical question. It amplifies a rare success on a hard prompt, which can speed learning there, and a rare failure on an easy prompt, which can amplify noise in the verifier. Dr. GRPO drops it and so ascends pass@1 directly. For 0/1 rewards , so the division also at least doubles every step: part of its effect is simply a larger step size.
A prompt is solved with probability . With groups of , what percentage of its groups carry no signal at all, because every reward in the group is equal?
Show the answer
19 %
All 16 correct with probability , all 16 wrong with probability , which is negligible: about 19% in total. At it is 43%. In general the fraction is , so prompts near or waste most of their samples unless the group is large, precisely the prompts that the standard-deviation normalization weights most when they do give signal.
Length normalization and its bias
At ratio 1, response 's token terms sum to , and GRPO divides this by . Treat the baseline as the fixed number (exact as , where ). Since does not depend on , the expected update is the gradient of a different objective:
A correct response contributes , larger when the response is short. An incorrect one contributes , which is larger, that is, less negative, when the response is long. Among correct answers brevity is rewarded; among wrong answers, length softens the penalty.
Liu et al. (2025) call this the response-level length bias and argue that it inflates the length of incorrect responses over training; they found the same per-response normalization in several widely used open-source implementations. Dr. GRPO replaces by a constant, such as the generation budget, which makes the update an unbiased policy gradient up to scale.
| Normalizer | Weight of each token of response | Length preference | Unbiased up to scale? |
|---|---|---|---|
| per response, (GRPO) | short when right, long when wrong | no | |
| per batch of tokens, (DAPO) | , the same for every token in the batch | none within a batch; batches of long responses take smaller steps | approximately, for large batches: the normalizer depends on the samples |
| constant, (Dr. GRPO) | for a fixed budget | none | yes |
Think first Under GRPO's per-response normalization, two incorrect responses to the same prompt get the same negative advantage; one is 200 tokens long and the other 2,000. How do their per-token penalties compare?
Each token's gradient is scaled by , so the long response spreads the same total penalty over ten times as many tokens: each of its tokens is pushed down one tenth as hard. Nothing in the update discourages long wrong answers in particular, which is the bias Dr. GRPO removes. With a constant normalizer, each of the long response's tokens would be penalized as hard as the short one's, ten times the total.
DAPO: repairs for long chains of thought
Yu et al. (2025) trained a 32-billion-parameter base model with an open recipe, DAPO, and reported a higher AIME 2024 score than DeepSeek's own RL run from the same base model (50 against 47 points) with half as many training steps. Its four changes target failure modes of plain GRPO on long chains of thought:
- Clip-Higher. PPO's symmetric clip lets a token's probability grow by at most a factor per round of updates. From 0.9 that allows anything (the bound 1.08 exceeds 1), but from 0.01 only 0.012. Rare tokens, which carry exploration, are the ones held back, and the policy's entropy collapses. DAPO decouples the bounds, with and , so a token at 0.01 can grow to 0.0128.
- Dynamic sampling. All-equal groups contribute nothing. DAPO over-samples and keeps only prompts whose group accuracy is strictly between 0 and 1, so every batch is full of informative groups.
- Token-level loss. Averaging over all tokens in the batch, as in the table above, so that long responses are not under-weighted.
- Overlong reward shaping. Responses cut off at the length limit are either excluded from the loss (overlong filtering) or penalized linearly within a buffer zone just below the limit (soft overlong punishment), instead of being scored like ordinary wrong answers.
DAPO also drops the KL term, arguing that a reasoning policy should be free to move far from its initialization, and uses rewards of and . Each change's contribution was measured in one setting; the changes interact, and their individual effects may differ elsewhere. The common thread is that clipping, sampling and normalization, details of PPO-style code, decide how fast the policy's entropy falls and which samples carry signal.
Credit assignment without a critic
Every method so far gives all tokens of a response the same advantage. In a 5,000-token solution where one step was a decisive idea and another a careless slip, both get identical credit, and only averaging over many samples sorts them out. PPO's learned value network was meant to solve this, but Kazemnejad et al. (2025) found that on reasoning tasks its estimates were poor, barely better than chance at ranking candidate next steps.
A language-model environment can be reset to any prefix for free: feed the prefix back in. So instead of learning , estimate it by sampling completions from the intermediate state with the current policy and averaging their rewards:
This is an unbiased estimate of , with variance at most for 0/1 rewards. With no intermediate rewards and , the advantage of the step from to is estimated by
Over a response these telescope to , the outcome minus the prompt's estimated success rate: the same total credit as a group baseline gives, now distributed to the steps that changed the odds. The price is extra completions per step boundary. Kazemnejad et al. reported that, despite slower iterations, the method beat PPO and other baselines on MATH and GSM8K, and in less wall-clock time.
Key takeaways
- With one gradient step per batch, GRPO's clip is inactive and the method is REINFORCE with a group baseline plus a KL loss; clipping matters only when samples are reused.
- The k3 estimator is unbiased and non-negative in value, but as a loss its gradient follows , and the k1 loss has zero expected gradient. Putting the log-ratio into the reward gives the gradient of .
- Mean-centering is RLOO times . Dividing by the group's standard deviation makes GRPO ascend in the large-group limit, weighting prompts near or most.
- Per-response length normalization rewards brevity in correct answers and leniency toward long wrong ones; Dr. GRPO uses a constant normalizer, DAPO a token-level average.
- DAPO widens the upper clip, filters all-equal groups, averages over tokens and shapes overlong responses; VinePPO replaces the critic with Monte Carlo values at step boundaries, giving each step its own credit.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
DeepSeekMath made a single gradient update per batch of samples. What did PPO-style clipping do in that setting?
- It limited every update to a ratio change of
- Nothing: when the gradient is taken, , every ratio is 1 and the clip is inactive
- It replaced the KL penalty
- It removed the length normalization
Show the answer
B. Nothing: when the gradient is taken, , every ratio is 1 and the clip is inactive
At both terms of the minimum agree and the gradient is . Clipping only bites after the policy has moved away from the one that sampled the data, that is, on the second and later updates using the same samples.
In the large-group limit, with 0/1 rewards and no length normalization, which objective does GRPO's standard-deviation normalization ascend?
Show the answer
C.
The update per prompt tends to , and . This concave-then-convex transform has infinite slope at and , which is the difficulty weighting.
Why does DAPO's dynamic sampling over-sample prompts and keep only those whose group accuracy is strictly between 0 and 1?
- Because all-equal groups have zero advantages and contribute no gradient, which shrinks the effective batch and makes updates noisier
- To make the KL penalty unnecessary
- To remove overlong responses
- To guarantee that every prompt is eventually solved
Show the answer
A. Because all-equal groups have zero advantages and contribute no gradient, which shrinks the effective batch and makes updates noisier
As training improves the policy, more prompts are always solved and their groups carry no signal. Filtering keeps each batch full of informative groups, at the cost of extra sampling.
VinePPO estimates the value of an intermediate reasoning state by averaging the rewards of fresh completions from it. Why is this practical for language models but rarely for robots?
- Language models never need value estimates
- Language-model rewards are deterministic
- Robots have no intermediate states
- A text prefix can be restored exactly, so the environment can be reset to any intermediate state for the cost of a forward pass, while a physical system cannot be returned to an earlier state
Show the answer
D. A text prefix can be restored exactly, so the environment can be reset to any intermediate state for the cost of a forward pass, while a physical system cannot be returned to an earlier state
Monte Carlo value estimation needs restarts from arbitrary states. For text generation the state is the prefix, so restarting is free; for a robot it would require resetting the world, which is possible only in simulation.
Further reading
- Z. Shao et al., "DeepSeekMath: Pushing the limits of mathematical reasoning in open language models," arXiv:2402.03300 (2024).
- Z. Liu, C. Chen, W. Li, P. Qi, T. Pang, C. Du, W. S. Lee & M. Lin, "Understanding R1-Zero-like training: A critical perspective," COLM (2025); arXiv:2503.20783.
- Q. Yu et al., "DAPO: An open-source LLM reinforcement learning system at scale," NeurIPS (2025); arXiv:2503.14476.
- A. Kazemnejad, M. Aghajohari, E. Portelance, A. Sordoni, S. Reddy, A. Courville & N. Le Roux, "VinePPO: Refining credit assignment in RL training of LLMs," ICML (2025).
- Y. Tang & R. Munos, "On a few pitfalls in KL divergence gradient estimation for RL," arXiv:2506.09477 (2025).