SDPO
GRPO
https://hlfshell.ai/posts/grpo/
GRPO (Group Relative Policy Optimization) comes from the DeepSeekMath paper. Its whole reason for existing is to get rid of the value/critic network that PPO needs. Instead of learning a separate model to estimate the baseline for the advantage, GRPO estimates that baseline empirically from a group of sampled responses to the same prompt. Let me walk through it piece by piece.
The setup
For a single prompt (question) , you sample a group of completions from the current policy (in practice the "old" policy that generated the rollouts):
Each completion gets a scalar reward from your reward model (or a rule-based verifier, e.g. "is the math answer correct").
Step 1 — Group-relative advantages
This is the heart of it. Rather than a critic predicting a baseline, you just normalize each reward against the group's own statistics:
So an output's advantage is just its z-score within the group. Outputs better than the group average get positive advantage, worse ones get negative. In the original "outcome supervision" formulation, every token in completion shares this same scalar . (There's also a "process supervision" variant where rewards are assigned to intermediate steps and the advantage at a token is the sum of normalized rewards from that step onward, but the outcome version is what people usually mean.)
Notice this gives you a "free" baseline: the mean reward of the group plays the role PPO's value function would have played, and the std normalizes the scale.
Step 2 — The clipped surrogate objective
This part is borrowed straight from PPO. Define the per-token importance ratio between the policy being optimized and the policy that generated the samples:
Then the clipped term, exactly PPO-style:
The clipping prevents any single update from moving the policy too far from , which is what keeps the optimization stable.
Step 3 — The KL penalty
GRPO adds an explicit KL term to keep the policy close to a frozen reference model (typically the SFT model). Two things are worth flagging here, because they differ from "textbook" PPO.
First, in PPO the KL to the reference is usually folded into the reward as a per-token shaping term. GRPO instead adds the KL directly to the loss as a separate term, which keeps the advantage computation clean.
Second, GRPO uses an unbiased low-variance estimator of the KL (the "k3" estimator from Schulman), which is always non-negative:
Putting it together
The full objective, averaging over the group and over tokens:
You maximize (equivalently minimize ), with controlling KL strength and the clip width.
The one-line intuition
PPO: "How much better was this action than my critic predicted?" GRPO: "How much better was this whole response than its siblings drawn from the same prompt?"
By sampling a group and using its mean as the baseline, you trade a learned critic (extra model, extra memory, its own training instability) for more samples per prompt. That's a great deal when you have a cheap/verifiable reward signal — which is exactly why it took off for math and reasoning RL.
A couple of wrinkles worth knowing
Since you're close to the RL literature, two things that have generated discussion:
The token-level averaging introduces a length bias — it weights each response equally regardless of length, which can systematically favor or penalize longer completions depending on the sign of the advantage. The DAPO paper and others proposed normalizing by total token count across the group instead.
Also, when a group's rewards are all identical (e.g. all completions wrong, or all right), and the advantage is undefined / zero — that prompt contributes no learning signal, which has implications for how you construct batches.
References
[1] Hübotter et al. “Reinforcement Learning via Self-Distillation” arXiv preprint arXiv:2601.20802 2026