Start with how feedback enters training
In one lineAll three answer the same question. They differ in where feedback comes from, how many answers you sample and how the gradient is computed.
PPO, GRPO and DPO all change how likely answers are, but they don't take the same training data. Keep the answers fixed and look at what each method can actually learn from them.
Four answers to the same question
Ask for $17\times24$. Suppose we get four answers: A says “408,” B says “388,” C shows its work ($17\times(20+4)=340+68=408$), and D says “428.” A checker that reads only the final number gives them $[1,0,1,0]$. Treat a whole answer as one action and leave out KL for now, so we can follow the feedback.
| Method | What does it do with these answers? | What do we get this time? |
|---|---|---|
| PPO | Treat all four as fresh samples. Before seeing an answer, the critic predicts a reward of 0.6 for this prompt. | Subtract that prediction from each score: $R-V=[0.4,-0.6,0.4,-0.6]$. B has a negative advantage not because “388” earned a penalty, but because zero was worse than expected. |
| GRPO | Use the same fresh samples, but compare scores within the group rather than against a critic. | The mean and population standard deviation are both 0.5. Centering and scaling gives $[1,-1,1,-1]$, ignoring the tiny stabilizer. If all four tied, this reward term could not distinguish them. |
| Offline DPO | Keep one labeled pair from the set: A is preferred to B for this prompt. The update reads that record; it needs neither fresh samples nor the four scores. | Compare the policy's A-to-B probability ratio with the reference model's ratio. When the models match, the loss for this pair is $-\log(1/2)=\log 2$. The objective favors A relative to B; A's own probability need not rise. |
What about C? It shows the arithmetic; A just gives the number. The checker awards them the same score, and the A-vs-B label says nothing about C. If showing the steps matters, none of this feedback tells the model so.
An advantage isn't the size of a probability change. Token-level PPO also estimates values for individual prefixes, computes returns and GAE, and clips the policy update. For the DPO probability ratios, work through the numerical example.
What else changes besides the score?
| Decision | Possible choices | Important distinction |
|---|---|---|
| Where feedback comes from | Human preferences, a Reward Model, program checks, environment outcomes | RLVR primarily addresses this axis |
| How to construct an update signal | Critic-based advantages, within-group rewards, preference pairs | GRPO and DPO construct different signals |
| How training obtains data | Fresh policy samples, reused rollouts, a fixed preference dataset | An algorithm name does not specify the entire data pipeline |
01 How does the model learn?
Generate → score → update
- The comparison
- Returns against value estimates.
- Typical setup
- A trained value model (Critic) helps estimate advantages.
Several answers to one prompt
- The comparison
- Each answer against the rest of its group.
- What it removes
- No separately trained Critic. Generation and scoring still cost compute.
Answer pairs with a preference
- The comparison
- Changes in the two answers’ probabilities relative to a reference model.
- The data
- A fixed preference dataset, not fresh rollouts at each update.
02 Who decides what is good?
A reward model can score answers, or a verifier can check results, such as passing tests. RLVR uses the latter; it does not require a particular update rule.
Preference labels say which answer is better. People or other judges can provide them; their quality still needs checking.
Model counts alone do not determine memory use. Weight sharing, caching, and offloading matter too.
For example, “GRPO with verifiable rewards” is a valid combination. RLVR can also use a Critic-based method; it does not inherently mean “only two models.” Weight sharing, caching, and offloading further change the actual memory footprint.
In PPO, which models learn and which ones score?
In one lineFour roles, two of them trained: the Policy and the Critic. The Reward model and the Reference stay frozen.
A classic PPO-RLHF diagram has four conceptual roles, two of which are trained:
| Model | Training? | Job |
|---|---|---|
| Policy | yes | the model you're trying to produce |
| Critic | yes | estimates state value, the baseline for the advantage |
| Reward | frozen | scores responses |
| Reference | frozen | KL anchor, keeps the policy from drifting |
The Critic needs training too: forward and backward passes, plus optimizer state. It may be a separate value model or share an Actor backbone with an added value head. These are four responsibilities, not necessarily four complete models resident in memory. Could we obtain a useful comparison without training a Critic?
Where does the baseline come from without a Critic?
In one lineUse statistics of several answers to the same prompt as the baseline: GRPO subtracts the group mean, RLOO the mean of the others. No Critic, more sampling.
The Critic estimates state value, providing a variance-reducing baseline and participating in TD / GAE bootstrapping. For suitable whole-response outcome tasks, sampling statistics can construct a relative signal instead. Multi-step, delayed-reward tasks require another look at credit assignment.
| Algorithm | How it constructs the comparison | Cost and checks |
|---|---|---|
| GRPO | sample a group per prompt; subtract the mean reward and divide by its standard deviation | multiple samples per prompt, so sampling cost goes up |
| RLOO | leave-one-out: one sample's baseline is the mean reward of the others | multiple samples; a common form uses a whole-response advantage rather than learned prefix values |
| REINFORCE++ | construct advantages from KL-shaped returns, then normalize across the batch | no trained value model; inspect returns, KL, and the normalization scope |
These methods avoid an independently trained value model, but estimation error remains. Compare saved training state against extra sampling, signal variance, and task structure. The REINFORCE++ row refers to v1 §3. Batch normalization of advantages is not another learned baseline, nor a guarantee of unbiased gradients or stable training.
As of October 2026, the latest arXiv version is v9 (2025-11-10), retitled “…with Global Advantage Normalization”. It adds a “REINFORCE++ w/ baseline” variant: sample several responses per prompt, subtract the group's mean reward, then normalize across the whole batch, with KL moved into a separate loss term (v9 §3.2).
RLOO's baseline, with $k$ samples per prompt:
$$\hat A_i = r_i - \frac{1}{k-1}\sum_{j \neq i} r_j$$
RLOO §2.2–2.3 treats a completion as one action, but its tokens still receive gradients. Sequence log-probability is the sum of conditional token log-probabilities, all weighted by the same advantage. It does not separately estimate which step beat expectations. The leave-one-out baseline's unbiasedness also needs conditions such as independent samples for the same prompt; arbitrary correlated samples do not qualify.
The paper tests these simplifications on particular pretrained models and preference tasks. It does not establish that every task can dispense with a Critic or GAE.
For a worked baseline calculation, continue with RLOO: use the other answers as a baseline. It uses three responses to explain self-exclusion, derives the relationship to subtracting the group mean, and separates the baseline from standard-deviation normalization and clipping.
GRPO's group-relative advantage
Sample $G$ responses for one prompt and score them $R_1,\ldots,R_G$. A common response-level advantage is $\hat A_i=(R_i-\mu_R)/(\sigma_R+\varepsilon)$, where $\mu_R$ is the group mean, $\sigma_R$ the group's population standard deviation (divide by $G$), and $\varepsilon$ prevents division by zero. The formula written out term by term, with a full worked example for [0, 1, 0, 0], follows in four answers, one correct. For the opening rewards $[1,0,1,0]$, $\mu_R$ and $\sigma_R$ are both 0.5, giving advantages approximately $[1,-1,1,-1]$ when the small $\varepsilon$ is ignored. A sample-standard-deviation convention changes the scale. Rewards may come from a Reward Model, humans, a math verifier, unit tests, code execution, or a format checker.
The group contains several responses sampled from one policy for one prompt, not a team of different models. The comparison updates that same policy; it does not aim to make every response in the group more likely.
A common GRPO implementation broadcasts one sequence-level advantage to the tokens in that response and then uses a PPO-style clipped objective:
$$ \rho_{i,t}(\theta)= \frac{\pi_\theta(o_{i,t}\mid q,o_{i,<t})} {\pi_{\mathrm{old}}(o_{i,t}\mid q,o_{i,<t})}, $$
$$ \begin{aligned} c_{i,t}&=\operatorname{clip}(\rho_{i,t},1-\epsilon,1+\epsilon),\\ s_{i,t}&=\min(\rho_{i,t}\hat A_i,\;c_{i,t}\hat A_i),\\ J_{\mathrm{GRPO}}&=\frac{1}{G}\sum_i\frac{1}{|o_i|}\sum_t s_{i,t}. \end{aligned} $$
Here $G$ counts responses to one prompt, and $|o_i|$ counts valid tokens in response $i$. Training maximizes $J$, or minimizes $-J$ in code. DeepSeekMath §4.1 also includes a Reference KL term; some recipes drop it, for example DAPO. As of October 2026, the TRL v1.16.0 GRPOTrainer defaults to beta=0.0 (no Reference loaded) and loss_type="dapo" (normalized by the number of valid tokens in the global batch, not the per-response average above), and when generating with vLLM it turns on importance-sampling correction by default (vllm_importance_sampling_correction=True). The main saving is the learned value baseline, not rollout, reward, or policy ratios. Check loss reduction, KL weight, and update count separately rather than inferring them from the algorithm's name.
| PPO baseline | GRPO baseline | |
|---|---|---|
| Source | $V_\phi(s_t)$ learned by a Critic | within-prompt reward statistics |
| Granularity | can vary with each prefix/token state | commonly one relative advantage for a whole response |
| Main cost | train a value function | multiple rollouts per prompt |
| Typical failure | Critic is inaccurate or unstable | no reward variation within the group, hence no learning signal |
Four answers, one correct
For example, a model writes four implementations for the same coding problem, and only the second passes the current test suite. Assigning 1 for a pass and 0 otherwise gives [0, 1, 0, 0]. This is a teaching example, not an experimental result; passing those tests does not prove correctness on every input.
Using the population standard deviation within a group of size $G$, and temporarily ignoring the stabilizer $\epsilon$:
$$ \begin{aligned} \bar r &= \frac{1}{G}\sum_i r_i,\\ s &= \sqrt{\frac{1}{G}\sum_i(r_i-\bar r)^2},\\ \hat A_i &= \frac{r_i-\bar r}{s+\epsilon}. \end{aligned} $$
The mean is $0.25$ and the standard deviation is about $0.433$. The implementation that passes receives an advantage of about $1.732$; each other answer receives $-0.577$. This does not identify useful lines of code. It says which result was better than the group average under the current scoring rule.
import math
rewards = [0.0, 1.0, 0.0, 0.0]
mean_reward = sum(rewards) / len(rewards)
variance = sum((reward - mean_reward) ** 2 for reward in rewards) / len(rewards)
deviation = math.sqrt(variance)
advantages = [(reward - mean_reward) / deviation for reward in rewards]
assert math.isclose(advantages[1], math.sqrt(3))
assert math.isclose(sum(advantages), 0, abs_tol=1e-12)
print([round(advantage, 3) for advantage in advantages])
If all four rewards are zero, or all four are one, centering produces zeros. That group provides no distinguishing policy-gradient signal. The total gradient need not vanish if other terms, such as KL, remain active. For how common such groups are in a batch, and how to resample them, see DAPO's dynamic sampling.
Reward, advantage, and loss are different numbers
The passing answer earned a reward of 1. Why did 1.732 then appear? The first number records a test result; the second compares that answer with its group. Updating the model also involves how its probability of producing the answer has changed.
- 1 · Test resultReward = 1A pass earns one point. No comparison with other answers has happened yet.
- 2 · Group comparisonAdvantage ≈ 1.732Above average in [0, 1, 0, 0]. A different group can give the same answer a different advantage.
- 3 · Policy updateInclude the probability ratioCompare the current policy with the policy that sampled the answer, then apply clipping and the rest of the objective.
Take one token from that passing response. Given the same prompt and response prefix, suppose the old policy assigned probability 0.20 and the current policy assigns 0.26. The ratio is 1.3. Its denominator is neither the reward nor a probability from the Reference model.
With a clipping interval of [0.8, 1.2] and this positive advantage, the clipped objective takes the smaller of 1.3 × 1.732 and 1.2 × 1.732, approximately 2.078. That is a single-token policy objective to maximize; a loss to minimize uses its negative. It is not the whole batch loss and does not include KL or other terms. DeepSeekMath §4.1.1–4.1.2
Check the calculation, then increase the probability ratio
import math
def clipped_policy_term(ratio, advantage, epsilon=0.2):
clipped_ratio = min(max(ratio, 1 - epsilon), 1 + epsilon)
return min(ratio * advantage, clipped_ratio * advantage)
advantage = math.sqrt(3)
old_probability, current_probability = 0.20, 0.26
ratio = current_probability / old_probability
objective = clipped_policy_term(ratio, advantage)
loss_term = -objective
assert math.isclose(objective, 1.2 * math.sqrt(3))
assert math.isclose(clipped_policy_term(1.6, advantage), objective)
print(round(objective, 3), round(loss_term, 3))
Increasing the ratio from 1.3 to 1.6 does not increase this positive-advantage term. Clipping is not a hard limit on the whole model's change: other tokens, shared parameters, and other loss terms still affect the update. Negative advantages need their own sign analysis; see PPO clipping.
Two roles are easy to confuse here. The old policy generated the batch, and its saved log-probabilities supply the ratio denominator. The Reference supplies a baseline for a KL constraint when one is enabled. Their weights may coincide at some point, but their jobs differ. With log-probabilities, compute the ratio as exp(current_logp - old_logp), not by dividing them. If sampling settings change the generation distribution, check which distribution those probabilities describe.
The Reference is neither the training dataset nor a gold answer. Given the same prompt and response prefix, the current policy might assign [0.8, 0.2] to two candidate tokens while the Reference assigns [0.5, 0.5]. KL compares those conditional distributions, not generated text directly against a dataset. See the two-token KL example for exact sums and sampled estimates. The Reference stays fixed during an optimization phase; if an algorithm refreshes it between outer iterations, record that schedule rather than assuming it stays unchanged throughout training.
Returning to that one-point reward: it records a pass on the current tests. The advantage gives a relative signal, and the probability ratio and clipping determine its contribution to the objective. None guarantees that the next answer will be correct. That still needs evaluation on new problems not used for training.
How can a zero loss still train the policy?
In one lineWhat cancels is the loss value, not the gradient. The denominator must be a detached copy of the old probability.
A group contains both good and bad answers, yet the logged policy loss is zero. That need not be a bug: the values can cancel without their parameter gradients canceling.
Consider two one-token answers, A and B. Each had probability 0.5 when sampled; their rewards are 1 and 0. Use advantages [1,-1] for clean arithmetic. A single parameter sets $p(A)=\sigma(\theta)$ and $p(B)=1-p(A)$, while both old probabilities stay fixed at 0.5.
At $\theta=0$, both ratios equal 1 and neither term is on a clipping plateau. The policy loss to minimize is:
$$\begin{aligned} \mathcal L(\theta)&=-\tfrac12\big[2p(A)-2(1-p(A))\big]\\ &=1-2\sigma(\theta),\\ \mathcal L(0)&=0,\qquad \mathcal L'(0)=-0.5. \end{aligned}$$
The value is zero, but the slope is not. One gradient-descent step with learning rate 0.2 moves $\theta$ to 0.1 and raises A's probability to about 0.525. This is a constructed two-action check, not a language-model training experiment.
The denominator is an easy place to lose that gradient. logp - old_logp.detach() can be numerically zero just after sampling while its numerator remains differentiable. logp - logp instead subtracts the same computational path and cancels the gradient. A detached copy of the current value works for a single fresh update; when reusing the batch, retain the original copy rather than refreshing it on every pass.
Check the zero loss in a few lines of PyTorch
import torch
theta = torch.tensor(0.0, dtype=torch.float64, requires_grad=True)
logits = torch.stack((theta, torch.zeros_like(theta)))
logp = logits.log_softmax(dim=-1)
old_logp = logp.detach().clone()
advantages = torch.tensor([1.0, -1.0], dtype=torch.float64)
loss = -((logp - old_logp).exp() * advantages).mean()
loss.backward()
assert abs(loss.item()) < 1e-12
assert abs(theta.grad.item() + 0.5) < 1e-12
This checks the first update, omitting clipping before it takes effect. The accompanying CPU script verifies the same result with the full min + clamp objective and tests gradients, masking, and reductions. It does not call a model, sampling service, or GPU.
When might the initial loss not be zero?
The cancellation depends on a complete group, centered advantages, matching ratios, and the chosen reduction. It is not a universal GRPO assertion:
| Situation | Consequence |
|---|---|
| Every response has the same reward | Every advantage is zero, so this policy-gradient term really has no signal; that differs from positive and negative values canceling |
| A group is split across minibatches or ranks | A local logged mean need not be zero |
Response lengths are 1 and 3, with advantages [1,-1] |
At unit ratios, averaging within responses then across responses gives loss 0; averaging over all four valid tokens gives 0.5 |
| The current policy matches old but not Reference | The policy term may vanish while the KL term does not; refreshing old does not also reset Reference |
| Sampling temperature, inference backend, or asynchronous trajectory age differs | Identical weight files alone do not guarantee matching saved and recomputed log-probabilities; investigate ratios that differ from 1 |
The length example represents two different objectives, not a logging discrepancy to patch away. Dr. GRPO studies weighting from length and within-group standard deviation; TRL's loss types distinguish several reductions. Inspecting loss_type and the actual mask is more useful than guessing what the initial scalar should be.
Log policy loss, KL, valid-token count, group reward variance, and gradient norm separately. A near-zero loss proves neither stalled learning nor convergence. For the next question—whether a clipped token can still change—see the gradient example. For why the denominator is called old, follow the response-group lifecycle.
What can go wrong with group-relative rewards?
In one lineTied rewards give no group-relative reward gradient; KL can still contribute. Standardization and length normalization affect sample weights.
Removing a model does not remove the need to judge an answer against something. The comparison now comes from the sampled group, so its weaknesses matter.
One: when a group's rewards don't differ, the baseline carries no information. If every response is right or every one is wrong—for example, $R=[0,0,0,0]$—subtracting the mean leaves every advantage at zero. An $\varepsilon$ in the denominator prevents division by zero but cannot create a relative signal. The group contributes no useful policy-gradient signal. For how common such groups are, and how much extra sampling filtering them costs, see DAPO's dynamic sampling.
Two: normalization introduces bias. Dividing by within-group standard deviation changes prompt weights; averaging within responses changes token weights across lengths. Dr. GRPO analyzes these biases. Whether removing a normalization helps your task still requires matched sampling and evaluation budgets; it is not a universally correct repair.
Three: what does the same ratio ceiling mean for a rare token? PPO flattens surrogate gains on selected branches rather than hard-constraining actual ratios. The same multiplicative ceiling corresponds to a smaller absolute change for a low-probability token. Raising it may affect exploration, but entropy decline has multiple causes; one curve does not establish which one applies.
Four: sequence-level loss dilutes long answers. Averaging within each response and then across responses gives a 1000-token answer the same total weight as a 50-token answer. Each token in the longer answer gets 1/20 the weight of a token in the shorter one; actual gradients also depend on advantages and the model. This deserves inspection if important reasoning steps occur in longer answers, but length alone does not make reasoning better.
Five: tokens in one answer share one advantage. Terminal feedback enters a token-level loss this way, but a correct final answer does not imply that every intermediate step was correct. Applying a sequence reward to its tokens is a training estimator, not stepwise causal attribution. The TRL GRPO documentation exposes choices for reward scaling, KL, and loss aggregation; implementations called GRPO may differ in group standard deviation, length normalization, and KL handling, so record those settings when reading code.
DAPO combines changes to sampling, clipping, token weighting, and overlong responses. Soft length penalties do not remove the generation cap or within-group standardization. Work through DAPO's sampling, length, and clipping examples.
DPO: train directly on preference pairs
In one lineOffline DPO favors the chosen answer over the rejected one relative to a reference model. No separate reward model or online sampling is required.
DPO takes a different approach: its standard offline training phase needs no explicit Reward Model, Critic, or online rollout loop.
Ask, for example, “Explain overfitting in one sentence.” One answer says, “The model learns incidental details in the training examples and performs worse on new data”; another says, “The model has not learned the training data yet.” An annotator prefers the first. DPO learns directly from that relative preference, without first asking a reward model to score each sentence separately. Learning this pair does not guarantee correct choices on every new question.
Each record is $(x,y_w,y_l)$: a prompt, chosen response, and rejected response. Define how each response's log probability changes relative to a frozen Reference:
$$ \Delta_w=\log\frac{\pi_\theta(y_w\mid x)}{\pi_{\mathrm{ref}}(y_w\mid x)}, $$
$$ \Delta_l=\log\frac{\pi_\theta(y_l\mid x)}{\pi_{\mathrm{ref}}(y_l\mid x)}. $$
DPO minimizes
$$ \mathcal L_{\mathrm{DPO}} =-\log\sigma\!\left(\beta[\Delta_w-\Delta_l]\right). $$
Do not memorize the expansion. It says only:
Relative to the Reference, chosen should improve more than rejected.
The Reference is a frozen model, not a reference answer. It assigns probabilities to both responses in the dataset, giving us a starting point for comparison. It does not need to generate another answer to imitate. The preference label—not the Reference—says which response is better.
For our overfitting example, score the same prompt and response with the current model and the Reference. This tells us whether that response has become more or less likely relative to the starting point. DPO compares that change for the preferred answer against the change for the rejected one. Original paper §4
Calculate the loss for one pair
Suppose the current model assigns sequence log-probabilities of $-2,-4$ to the preferred and rejected answers, while the Reference assigns $-3$ to both. These are illustrative numbers; a higher log-probability means the model assigns more probability to that response:
- Preferred response−3 → −2Reference → current model
Change: +1 - Rejected response−3 → −4Reference → current model
Change: −1
Subtracting the two changes gives $1-(-1)=2$. With $\beta=0.2$, the sigmoid input is $0.4$ and loss is about $0.513$. If the current model equals the Reference, both changes are zero and loss is $\log 2\approx0.693$—even when the two responses originally had different probabilities.
Check the calculation in Python
import math
chosen_logp, rejected_logp = -2.0, -4.0
reference_chosen, reference_rejected = -3.0, -3.0
beta = 0.2
relative_gap = (chosen_logp - reference_chosen) - (rejected_logp - reference_rejected)
preference_logit = beta * relative_gap
loss = math.log1p(math.exp(-preference_logit))
assert math.isclose(preference_logit, 0.4)
assert math.isclose(loss, 0.5130152523999526)
assert loss < math.log(2)
print(round(loss, 4))
These small values are convenient for hand calculations; production implementations should use stable logsigmoid / softplus operations. Standard sequence log-probability sums answer-token log-probabilities, with correct prompt, padding, and EOS handling. Replacing the sum with a token mean changes the objective. The TRL DPO documentation helps connect the equations to data formats and loss implementations.
Why is a separate Reward Model unnecessary?
A Bradley–Terry preference model says
$$ \begin{gathered} \Delta r=r(x,y_w)-r(x,y_l),\\ P(y_w\succ y_l\mid x)=\sigma(\Delta r). \end{gathered} $$
Now take a KL-regularized reward objective with a fixed penalty coefficient $\beta>0$:
$$ \max_\pi\ \mathbb E_{x\sim\mathcal D} \left[\mathbb E_{y\sim\pi(\cdot\mid x)}r(x,y) -\beta D_{\mathrm{KL}}\!\left(\pi(\cdot\mid x)\|\pi_{\mathrm{ref}}(\cdot\mid x)\right)\right]. $$
KL is a penalty in this objective, not a hard constraint with a prescribed radius. Optimizing over all policy distributions within the Reference's support, with $0<Z(x)<\infty$ and well-defined relevant expectations, the optimal policy is:
$$ \begin{gathered} \pi^*(y\mid x)=\frac{\pi_{\mathrm{ref}}(y\mid x)}{Z(x)}\\ {}\times\exp\!\left(\frac{r(x,y)}{\beta}\right). \end{gathered} $$
For a hard constraint $\mathbb E_x D_{\mathrm{KL}}(\pi\|\pi_{\mathrm{ref}})\leq\delta$, $\beta$ must instead be treated as a Lagrange multiplier matched to that constraint. An arbitrary fixed $\beta$ does not guarantee a prescribed $\delta$, let alone keep every neural-network update within that radius. The closed-form derivation in Eq. 3 and Appendix A.1 actually uses the penalized objective above.
Rearrange the optimal policy as $r(x,y)=\beta\log[\pi^*(y\mid x)/\pi_{\mathrm{ref}}(y\mid x)]+\beta\log Z(x)$. Substitute into Bradley–Terry: for two responses to the same prompt, $\beta\log Z(x)$ cancels in the reward difference, leaving $\Delta r$ as $\beta$ times the difference of the two policy/reference log-ratios.
Next, replace $\pi^*$ with the policy being trained, $\pi_\theta$, and average the negative log-likelihood over the preference dataset: that is the $\mathcal L_{\mathrm{DPO}}$ above. Reward has not vanished; it has been absorbed into the policy objective.
This derivation comes from DPO §4. It depends on the reward objective, preference model, and support assumptions. It does not establish that all human preferences follow this model, or guarantee that a finite neural network trained on finite data reaches the global optimum.
DPO versus SFT
If A is chosen and B is rejected,
$$ \mathcal L_{\mathrm{SFT}}=-\log\pi_\theta(A\mid x) $$
only says “A is worth imitating.” DPO observes A and B together and learns “A is preferred to B.” Chosen need not be the one uniquely perfect answer, and an ordinary binary preference usually supplies only the order $A>B$, not how much better A is.
$\beta$ participates both in the KL-regularization relation to the Reference and in the preference-logit scale. Mechanically memorizing “larger means more conservative” is unsafe: derivation conventions, loss implementation, and data scale all affect observed training behavior. Write the exact formula or library convention first, then reason about increasing or decreasing it.
Standard offline DPO uses fixed preference pairs. The policy changes, but the dataset does not automatically follow, potentially missing new failures. Measure whether distribution mismatch grows; it need not increase monotonically. Online DPO and iterative data refresh collect more feedback, so “DPO is always offline” is not a boundary for the entire family.
A better relative score need not mean a higher probability
Consider three categories of output:
| Output | Reference probability | Current probability |
|---|---|---|
| chosen | 0.4 | 0.3 |
| rejected | 0.3 | 0.1 |
| all other outputs | 0.3 | 0.6 |
Chosen becomes less likely, but rejected falls further. Dividing the current chosen-to-rejected probability ratio by the Reference's ratio gives $(0.3/0.1)/(0.4/0.3)=2.25$. With illustrative $\beta=1$, this pair's DPO loss falls from $\log 2\approx0.6931$ to $\log(1+1/2.25)\approx0.3677$.
These are two valid distributions, not a claimed gradient-step trajectory. They show that a lower preference loss does not ensure higher absolute chosen probability, unlike an objective that only imitates chosen. See the objective in DPO §4.
Two follow-ups:
- IPO — Uses a different preference objective with a finite target margin for relative log-ratios; it is not simply DPO plus a generic regularizer. Paper
- KTO — Can use unpaired desirable / undesirable labels. This allows a different data format; actual labeling costs still depend on the collection process.
RLVR: let a program check the answer
In one lineThe reward comes from a program. Whatever the checker leaves out, the model can exploit, so keep a separate evaluation.
Math answers can be checked, and code can be tested. When a reliable checker is available, its result can supply that part of the reward without a separately trained Reward Model. DeepSeek-R1-Zero's reward setup is one example. This specifies a feedback source, not a choice between PPO and GRPO.
“Deterministic” does not mean “complete”: a “sorting function” that always returns [1, 2, 3] passes a test containing only [3, 1, 2]. Verifiable rewards starts from this example and takes apart, item by item, what the verifier failed to check. Other gaps can lie in answer extraction, empty test sets, exception handling, or timeouts. An optimizer receives the score you implemented, not the requirements you forgot to implement. A deterministic verifier can remove some subjective scoring errors without eliminating specification gaming. Anthropic's controlled study illustrates how gaps between reward and intent can be exploited; it does not establish that every training run will do so.
Separate training checks from independent evaluation: reserve unseen problems and boundary cases, test new input types, and add human audits where needed. Changing the question while retaining the same faulty checker is not enough independence.
RLVR suits the parts with verifiable outcomes. A broader task can combine program checks, human judgments, and learned rewards rather than force every requirement into one checker.
The table
In one lineHow PPO, GRPO and DPO differ in data, reward, Critic and rollouts, in one table.
| Typical training data | Explicit reward | Critic | Training-time rollout | Central trade-off | |
|---|---|---|---|---|---|
| PPO | prompts + responses from the current/recent policy | RM, rule, or environment | usually | yes | collects online feedback; typical setups coordinate sampling, scoring, and Actor–Critic updates |
| GRPO | prompts + a group of responses per prompt | RM, verifier, or environment | no | yes, multiple times per prompt | removes the Critic; needs within-group variation and spends more generation compute |
| DPO | fixed chosen/rejected pairs | no explicit call; reward difference is implicit in the loss | no | not in standard offline training | removes online sampling from training; labels, coverage, and optimization settings still matter |
The extensions change different parts of training: RLOO changes baseline estimation, REINFORCE++ uses batch statistics, RLVR changes the reward source, and DAPO adjusts sampling, clipping, token weighting, and overlong-response handling. These are not all competing choices at the same level, nor are they necessarily mutually exclusive.
How to choose
In one lineStart from what you have: preference pairs → try DPO; a stable scorer → PPO or GRPO; an automatic check → plug in a verifier.
| Current situation | A reasonable starting point | What a comparison must include |
|---|---|---|
| Good static preference pairs | Standard DPO as a baseline | Label consistency, coverage, held-out preference accuracy, and task outcomes |
| Fresh generation and reliable scoring are available | PPO or GRPO | Equal generation budgets, reward quality, Critic cost or useful group signals |
| Reliable automatic task verification exists | Connect a verifier to an appropriate RL method | Coverage, shortcuts, independent tests, and inference cost |
| A multi-turn environment gives delayed feedback | Specify state, termination, and credit assignment before choosing updates | Do not treat a trajectory as unrelated responses |
Before asking which name is newer, sketch where data comes from, who scores it, how the loss is computed, and who independently checks the result. Those four questions tell you what an algorithm change actually changes.
Step 1: can the reward be verified automatically?
When verification is possible, consider a verifier / RLVR first. Math answers, code tests, and structural constraints can be judged by a stable program without first fitting a Reward Model. Still audit whether the verifier checks only final answers, leaves test loopholes, or fails to represent the actual product objective.
Step 2: can training keep sampling from the current policy?
With only static chosen/rejected pairs, the DPO family is usually the direct choice, accepting coverage gaps and distribution mismatch. If training can keep rolling out and obtaining rewards or environment feedback, an online method such as PPO or GRPO can discover the current policy's new failures. It costs more generation compute, system complexity, and optimization variance.
Step 3: what is the real systems or optimization bottleneck?
If Critic memory, compute, or stability is the bottleneck, consider critic-free methods such as GRPO or RLOO. If long responses are diluted, low-probability tokens cannot recover, or entropy keeps falling, consider DAPO's token-level loss, Clip-Higher, dynamic sampling, and length handling. Do not choose an algorithm name first and force the data to fit it afterwards.
The order is: validate the feedback, decide whether an online loop is possible, then diagnose the system bottleneck.
Down to a checklist
In one lineThree things to watch in training: where the reward comes from, how many groups are all right or all wrong, and length bias.
1. Is the reward learned or verified, and what should each monitor?
For a learned Reward Model, monitor reward hacking, length or style shortcuts, and whether agreement with human judgment decays as the policy drifts. For a verifier, audit the specification gap: whether tests cover the real requirement, final-answer checking rewards guessing, or the model can exploit formatting and execution loopholes.
2. What fraction of GRPO groups are all-right or all-wrong?
Log the zero-variance group rate directly (problem one above explains why these groups carry no signal). If the rate is high, adjust problem difficulty, group size, or reward resolution, or use dynamic sampling to filter uninformative groups—while monitoring the distribution shift caused by filtering.
3. What bias do reward and length normalization introduce?
Plot reward, correctness, response length, entropy, and within-group reward variance together. Group-standard-deviation normalization changes the weight of low-variance groups; response-length averaging can dilute tokens in long sequences. If length rises while correctness stays flat, the model may be exploiting normalization or a reward shortcut.
4. Are long-response tokens being outweighed by short responses?
First determine whether the loss uses a per-sequence mean or batch-wide per-token aggregation. If every response has equal total weight, a token in a 1000-token answer usually receives less weight than one in a 50-token answer. Long-reasoning tasks may need token-level loss aggregation and both response-level and token-level metrics.
5. Which policy produced the DPO preference data, and why does it matter?
Record the generation checkpoint, sampling temperature, decoding constraints, and annotation date. Old pairs may miss errors that the updated model now makes, but policy distance alone does not tell you how well the data covers those errors. Look for actual gaps on held-out prompts before deciding to resample, relabel, or move to an iterative / online preference loop.
Can you explain it in two minutes?
In one lineThe three formulas and three follow-up questions you should manage in two minutes.
Write the three central equations for PPO, GRPO, and DPO.
With Monte Carlo returns, PPO can use $\hat A_t=G_t-V_\phi(s_t)$; GAE additionally involves bootstrapping. The clipped surrogate flattens selected gains; it does not hard-bound the resulting ratio or KL after an update. GRPO commonly uses $\hat A_i=(R_i-\mu_R)/(\sigma_R+\varepsilon)$. DPO uses $-\log\sigma\!\left(\beta[\Delta_w-\Delta_l]\right)$, where each $\Delta$ is the current policy's log-probability change relative to Reference.
Why does GRPO remove the Critic but not rollout?
It still needs the current or recent policy to generate multiple responses to one prompt and score every response; otherwise there is no group-relative baseline. What disappears is the Critic that learns $V_\phi(s)$.
Why does DPO need no explicit Reward Model?
Under the support and integrability conditions above, the optimal policy for a KL-regularized objective with fixed $\beta>0$ can be inverted to give the reward: $r=\beta\log(\pi^*/\pi_{\mathrm{ref}})$ plus a term that depends only on the prompt. Subtracting two responses to the same prompt cancels that term, so the reward difference becomes the difference of chosen/rejected policy-to-reference log-ratios. Reward did not vanish; it is implicit in the DPO loss. See the derivation above.
Two-minute conclusion: can DPO fully replace PPO?
Not in general. Ask where data comes from and when feedback is refreshed. Offline DPO does not collect new failures by itself; PPO / GRPO usually generate and score responses during training. Online DPO can refresh preference data too, so online versus offline and preference loss versus policy gradient are separate choices. Count the whole cost as well: offline DPO avoids online generation during training, but collecting and labeling the pairs still costs something, while PPO / GRPO pay for generation and more system coordination. Compare cost, coverage, and evaluation on matched tasks and budgets rather than ranking the names.
Starting papers
- PPO — clipped objective and trust region
- DeepSeekMath — GRPO
- DAPO — four fixes for four GRPO failure modes
- Understanding R1-Zero-Like Training — Dr. GRPO, the length bias from normalization
- Back to Basics — RLOO
- REINFORCE++ — drop the Critic, keep PPO's stabilizers
- DPO · IPO · KTO
Further reading (Chinese)
- Reinforcement learning in large models — supplementary reading in Chinese. This chapter compares feedback, baselines, and update objectives; check specific formulas and implementations against original papers and pinned code versions.