RL for LLMs: RLHF, GRPO, RLVR

How reinforcement learning post-trains a language model: the token MDP, PPO for RLHF, GRPO and RLOO, verifiable rewards, GRPO's fixes, engine/trainer mismatch, pass@k, agents and infrastructure. A child of Topic: rl; real rollouts of Qwen2.5-0.5B-Instruct computed for this page. Data as of October 2026. Reading: 53 min, plus 13 in closed details.

The idea in one screen

RL post-trains a language model by sampling its answers, scoring each whole answer with one number, and raising the probability of every token in proportion to how much better than expected its answer scored; the algorithms differ in how they estimate "expected": a learned critic at every token (PPO), or the mean of a group of answers to the same prompt (GRPO, RLOO).

Fig. 1, step by step: one real group of answers, scored and credited

  1. Sample a group. The policy (the glass plate) answers GSM8K test problem 3 sixteen times at temperature 1. Each bar is one answer, drawn to its length: 141 to 355 tokens.
  2. Score each whole answer with one number. A verifier checks the boxed answer: 6 of 16 pass and score 1 (raised), 10 fail and score 0. The score lands on the last token; every other token's reward is 0.
  3. Estimate what was expected. GRPO's estimate is the group itself: mean score 0.375 (the glass sheet), spread (standard deviation) 0.484. No network predicts it; sixteen samples measure it.
  4. Advantage: better or worse than expected. Each answer rises or sinks by (score − mean) / spread, the same on every token: (1 − 0.375) / 0.484 = +1.291 on a passing answer, (0 − 0.375) / 0.484 = −0.775 on a failing one. Dr. GRPO skips the division: +0.625 and −0.375.
  5. PPO's critic instead: credit token by token. The camera moves to answer 7 (242 tokens, wrong). Its critic, the chance of passing from each prefix, is measured here from 16 continuations at each of 10 prefixes (VinePPO's method): 0.5 at the start, falling from 0.56 to 0.19 over tokens 48 to 73, where the working goes wrong, and 0 by token 97. PPO's advantage, 0 minus that estimate (KL left out, β = 0; GAE's λ = 1), blames the early tokens and nothing after the answer was lost; GRPO's flat −0.775 is the sheet behind.
  6. Update the policy. Each token's log-probability gradient, weighted by its advantage, flows back into the policy: passing answers are pulled up, failing ones pushed down, harder the larger |Â|. Then the next prompt's group is sampled. Section 4 steps through every number on one answer.

Real data: Qwen2.5-0.5B-Instruct on GSM8K test problem 3, this page's rollouts (the Real rollouts tab lists all 16 answers).

You need: the policy-gradient theorem, baselines, GAE and PPO's clip from Policy gradients and actor-critic (sections 4, 6 and 9); where RL sits in post-training from Alignment: SFT, RLHF, DPO Family, RLVR (section 4 draws the PPO and GRPO loops, section 7 the swap of a reward model for a verifier).

policy πθ
the LLM being trained; it starts as the SFT model
reference πref
a frozen copy of the SFT model that the KL penalty anchors the policy to
reward model
a network trained on human preference pairs that scores a whole response with one number
verifier
a program that checks an answer (answer match, unit tests) and returns pass or fail
rollout
one response sampled from the policy, with its per-token log-probabilities
advantage Â
how much better a response (or token) did than a baseline; the weight on its log-probability gradient
group, G
the G responses sampled for one prompt; GRPO's baseline is their mean score
importance ratio ρ
πθ(token) / πθold(token), the policy now against the policy that sampled the token
engine, trainer
the inference server that samples rollouts (vLLM, SGLang) and the training stack that computes gradients; their probabilities differ slightly
pass@k
the chance that at least one of k samples solves a problem

Why RL at all: supervised fine-tuning (SFT) can only imitate demonstrations; RL can improve on them, because it needs a way to score an answer, not a way to write one. That makes RL the engine behind instruction-following chat models (RL from human feedback, RLHF) and behind reasoning models such as DeepSeek-R1 (RL with verifiable rewards, RLVR). Three methods carry most of the field, and each removes one component from the one before it:

MethodWhere the score comes fromHow a token gets its creditWhere the KL to the reference goesLarge models in memoryRollouts per prompt
RLHF with PPO (InstructGPT)A learned reward modelA learned value model (critic) and GAE, token by tokenInto the per-token reward4 (policy, reference, reward, value)usually 1
GRPO (DeepSeekMath)Any scorerThe response's score minus its group's mean, divided by the group's spread; the same for every tokenInto the loss (k3 estimator)3, or 2 with a verifiera group, 8 to 64
RLVR (Tülu 3, R1-Zero)A program that checks the answerEither of the aboveEither; often droppedPPO or GRPO minus the reward modelas the optimiser

Read as a lineage, these are two deletions: GRPO deletes RLHF's critic, RLVR deletes its learned reward model. GRPO with verifiable rewards is the default open recipe for reasoning models, and most research since 2025 is about its biases and their fixes (Dr. GRPO, DAPO, GSPO, CISPO, section 7) and about the gap between the engine that samples and the trainer that learns (section 8). Elsewhere: SFT, reward-model training and the DPO family are on Alignment; proxies in general are on Reward Hacking; one batch through PPO, GRPO and DPO with the memory each needs is "Same batch, three algorithms" on Topic: llm-training-and-post-training; where these methods sit among all of RL is the Topic: rl root's Method atlas.

Real data on this page: 160 responses sampled for it from Qwen2.5-0.5B-Instruct on ten GSM8K test problems (16 per problem, temperature 1), with per-token log-probabilities under three numerical set-ups and under the base model, three verifiers, and a real reward model, Skywork-Reward-V2-Qwen3-0.6B; the Real rollouts tab lists every answer, src/rollouts/ has the scripts.

1Token generation as a Markov decision process

The MDP vocabulary of the root (Topic: rl, "The loop, state and return") maps onto generation with three things unusual: the environment is trivial, the action space is huge, and the reward comes once.

  • State st: the prompt plus the tokens so far, the "state = full history" choice St = Ht, Markov by construction because nothing is hidden. Action at: the next token, one of about 105 (151,936 for the Qwen model on this page, from its config.json). Transition: deterministic and known, the token is appended (agentic RL breaks this, section 11). Policy: the LLM, πθ(at | st).
  • Reward: zero at every token except the last, where one scalar lands (a reward-model score, or a verifier's pass or fail): the hero's top row. The horizon is the generation length and γ is typically 1, so the return from every token of a response is the same number, the final score.
J(θ) = 𝔼q ∼ 𝒟, o ∼ πθ(· | q) [ r(q, o) ],    ∇θJ ≈ (1/N) Σn Σt ∇θ log πθ(o(n)t | q(n), o(n)<t) · Â(n)t
q, o, r(q, o)
a prompt from the training set 𝒟; a response (o1, ..., o|o|) sampled token by token, |o| its length; the scalar score of the whole response
N, Ât
the number of sampled responses; the estimated advantage of token t: the score minus a baseline that estimates how well responses to this prompt were expected to score. A baseline that does not depend on the action leaves the gradient unbiased and cuts its variance (the theorem is derived on Policy gradients and actor-critic).

How the advantage is estimated is exactly what separates the algorithms on this page: PPO learns a value model to predict it token by token; GRPO and RLOO estimate it from a group of samples for the same prompt. Three consequences: credit assignment is severe (one scalar for hundreds or thousands of tokens); the environment model is trivially known, so model-based planning buys nothing (the reward model does not make RLHF model-based, the root's common mistakes); and rollouts are expensive, because generating at inference speed dominates wall-clock time (section 12).

2RLHF with PPO: four models, a shaped reward and a critic

The standard recipe since InstructGPT (verified on the InstructGPT page, which trains the three-step pipeline live in its "Run the three steps" tab) runs four models:

  1. Policy πθ, initialised from the SFT model, and a frozen reference πref, a copy of it.
  2. Reward model rφ: frozen, trained beforehand on human preference pairs, one scalar per full response. InstructGPT's was 6B parameters, trained on rankings of 4 to 9 answers per prompt with the Bradley-Terry pairwise loss (on Alignment, section 3).
  3. Value model Vψ (the critic): trained alongside the policy (InstructGPT initialised it from the RM); it predicts the expected final reward from each prefix, which gives per-token advantages through GAE.

Fig. 2, step by step: one RLHF step on a real answer

  1. The policy writes one answer. A prompt goes in and one response comes out (PPO for RLHF usually samples one per prompt): here answer 7 to GSM8K problem 3, 242 tokens, from Qwen2.5-0.5B-Instruct.
  2. The reward model scores the whole answer. Frozen, it reads all 242 tokens and returns one scalar, 8.46 (Skywork-Reward-V2-Qwen3-0.6B, a real model), which lands on the last token only. The answer is wrong, which the reward model is not told; it scores the group's first correct answer 7.10 (section 4).
  3. The reference taxes every token. The frozen reference reads the same tokens, and the per-token KL penalty is subtracted so the reward the policy sees already contains it: −β log(πθ/πref) with β = 0.02, so tokens the policy now likes more than the reference are taxed. The orange line is the running sum: −0.86 over this answer (the base model stands in for the reference).
  4. The critic values every prefix. The value model predicts, from each prefix, the score the finished answer will get. Here it is measured from 16 real continuations per prefix: 4.00 at the start, about 8.7 from token 169 on.
  5. GAE turns rewards and values into per-token advantages. With γ = λ = 1, Ât is the shaped return minus V(prefix): the early tokens get about +3.6 (the critic expected 4.0; the answer earned 8.46 less its tax), the last ones about −0.8 (the critic already expected more than the answer got).
  6. Update two of the four. The advantages flow into the policy through PPO's clipped objective (ε = 0.2); the returns Ât + V(st) flow into the critic, which is regressed onto them. The reward model and the reference stay frozen: four large models in memory, two trained. Then the next batch of prompts.
rt = 1[t = T] · rφ(q, o) − β log( πθ(ot | q, o<t) / πref(ot | q, o<t) )
T
= |o|, the last token; 1[t = T] puts the RM score there only
β
the KL coefficient (0.02 in InstructGPT); the log-ratio is a one-sample estimate of KL(πθ ‖ πref) at that token. Summed over a response it is InstructGPT's sequence-level term β log(πRL(y | x) / πSFT(y | x)) (Eq. 2)

Why the KL penalty: it keeps the policy where the reward model is trustworthy, near the data it was trained on (the leash against over-optimisation, drawn on Reward Hacking section 2); it preserves general capabilities and fluency; and it ties the policy to a fixed anchor, a trust region relative to the start rather than to last iteration's policy.

GAE over tokens. GAE (Schulman et al. 2015; the λ dial is explained on Policy gradients and actor-critic, section 6) blends one-step and multi-step estimates of how much better a token turned out than the critic expected:

δt = rt + γVψ(st+1) − Vψ(st),    Ât = Σl=0T−t (γλ)l δt+l
δt
the temporal-difference (TD) error at token t; Vψ(st) is zero after the last token; γ = 1 here
λ
in [0, 1]: λ = 0 trusts the critic completely (low variance, biased when it is wrong); λ = 1 uses the actual final reward minus the baseline (unbiased, high variance). The critic is regressed onto the returns Ât + Vψ(st).

With γ = λ = 1 the sum telescopes: Ât = (final score − β × the sum of the remaining log-ratios) − V(st), and the critic serves only as a per-prefix baseline (the hero's PPO row). With λ < 1 a token's credit is mostly the jump in predicted value it caused: the point of a critic, and its weakness, because it must be right about every prefix of every response.

The clipped update is PPO's, unchanged: maximise min(ρtÂt, clip(ρt, 1 − ε, 1 + ε) Ât) with the per-token ratio ρt = πθ(ot | st) / πθold(ot | st) and ε typically 0.2 (Schulman et al. 2017). Once a token's ratio has moved more than ε the way its advantage wants, its gradient is zero; a wrong-way move keeps its gradient, which makes several minibatch epochs on one batch of rollouts safe. The four cases, the derivation from TRPO and the clip animated over epochs are on Policy gradients and actor-critic, section 9; what the clip does to rare tokens in an LLM is section 7 here.

Pain points: four large models in memory; a value model as big as the policy, trained from scratch during RL, asked to value every prefix when the true reward is one scalar at the end. How hard that is was measured: on MATH and GSM8K, PPO's value networks "often produce poor estimate of expected return and barely outperform a random baseline when comparing alternative steps"; replacing them with Monte Carlo estimates from extra rollouts at intermediate states (VinePPO, the method this page's hero uses) beat PPO in up to 3.0 times less wall-clock time (Kazemnejad et al., ICML 2025). GRPO removes the pain differently: it gives up per-token credit altogether.

Where RLHF came from, and what InstructGPT achieved and cost (closed)

RLHF began with simulated robots and Atari learning from preferences between clips (Christiano et al. 2017); PPO with a KL-penalised learned reward arrived with fine-tuning language models from preferences (Ziegler et al. 2019), moved to summarisation (Stiennon et al. 2020) and became the standard recipe with InstructGPT, which also mixed in pretraining gradients ("PPO-ptx") to limit regressions on public benchmarks.

Results (verified on the InstructGPT page): outputs of the 1.3B InstructGPT model were preferred to those of 175B GPT-3; 175B InstructGPT was preferred to 175B GPT-3 85 ± 3% of the time; the RL stage cost 60 petaflop/s-days against 3,640 for pretraining GPT-3, about 1.6% (60 / 3,640 = 0.0165).

Corrections carried from the InstructGPT page
InstructGPT is "about 1.4 to 1.5 times as truthful" by human labels, not "twice"; it is 16 to 20% less toxic at 175B when asked to be respectful, not "25%", and no less biased on Winogender or CrowS-Pairs (InstructGPT page).
One group, step by step: a lone correct answer in a hard group gets a far bigger push under GRPO than under Dr. GRPO or RLOO

Click a response to flip its score. The "real" groups are this page's Qwen2.5-0.5B-Instruct samples on GSM8K, with their real lengths in tokens and the strict verifier's verdicts; the others are worked examples with illustrative lengths. Dr. GRPO removes the division by the standard deviation and replaces 1/|oi| by a constant (here the longest length in the group); RLOO subtracts the mean of the other responses.

3GRPO and RLOO: a group of samples instead of a critic

Group Relative Policy Optimization is PPO minus the value model (DeepSeekMath, Shao et al. 2024; the DeepSeekMath page animates PPO against GRPO on one question and trains six methods live). For each prompt, sample a group of G responses, score each, and give every token of a response the same advantage: its score's distance from the group mean, in units of the group's spread.

A group of four, worked. A maths prompt, G = 4, a binary verifier; one response is correct and three are wrong, r = (1, 0, 0, 0). Computed by the page's engine and checked against src/recompute.py:

  1. Baseline: the group mean is (1 + 0 + 0 + 0) / 4 = 0.25.
  2. Spread: the deviations are 0.75, −0.25, −0.25 and −0.25; their squares average to (0.5625 + 3 × 0.0625) / 4 = 0.1875, so the standard deviation is √0.1875 = 0.433.
  3. Advantages: the correct response gets 0.75 / 0.433 = +1.732 on every one of its tokens; each wrong response gets −0.25 / 0.433 = −0.577. They sum to zero: the correct answer is pushed up by as much as the three wrong ones together are pushed down.

If all four had been correct, or all wrong, every advantage would be zero and the group would teach nothing but cost four rollouts; DAPO's dynamic sampling (section 7) filters such groups. On this page's real data, 4 of 10 GSM8K groups of 16 from the 0.5B model are uniform under the strict verifier (all four all-wrong).

Predict first: in a group of 16 with one correct answer, is that answer's advantage larger or smaller than a correct answer's in a half-right group? Then pick "1 of 16" and watch.

The group widget, step by step

  1. Sample a group. The policy samples G responses to one prompt at temperature 1; each bar is drawn to the response's length in tokens.
  2. Score with the verifier. Each response passes (1) or fails (0). No reward model and no critic read it.
  3. Group statistics. The group mean is the baseline, the role V(s) plays in actor-critic; GRPO also divides by the standard deviation. If every response scored the same, the spread is 0 and the group carries no signal at all (dividing by a zero standard deviation is also a classic bug).
  4. Advantages. GRPO: Â = (r − mean) / std, so a lone correct answer in a hard group gets a large push (1 of 16: +3.873) while each correct answer in a half-right group gets +1.000: Dr. GRPO's difficulty bias. Dr. GRPO: Â = r − mean (+0.938 and +0.500). RLOO: one minus the others' pass rate, G/(G − 1) times Dr. GRPO's.
  5. Spread over tokens. GRPO divides each response's advantage by its own length (the bars at the right), so a long wrong answer is penalised less per token than a short one, and wrong answers drift longer: Dr. GRPO's length bias. Dr. GRPO divides every response by the same constant, so each token weighs the same, short answer or long.

In symbols, with rewards r1, ..., rG for the group of prompt q, the advantage and the objective (the clip as in PPO, the KL added to the loss rather than folded into the reward, so it does not contaminate the advantages) are:

Âi,t = ( ri − mean(r1, ..., rG) ) / std(r1, ..., rG)
𝒥GRPO(θ) = 𝔼 [ (1/G) Σi (1/|oi|) Σt { min( ρi,t Âi,t, clip(ρi,t, 1 − ε, 1 + ε) Âi,t ) − β 𝔻KL[πθ ‖ πref] } ]
mean, std
over this prompt's group only. The empirical mean is a Monte Carlo estimate of the prompt's value V(q), computed from samples instead of predicted by a network; dividing by the standard deviation rescales each prompt to unit spread
ρi,t
πθ(oi,t | q, oi,<t) / πθold(oi,t | q, oi,<t), the per-token importance ratio
|oi|
the length of response i in tokens: each response's tokens are averaged first, then the G responses (section 7 shows why this is biased)

The KL is estimated per token with Schulman's k3 estimator (Approximating KL divergence): 𝔻KL ≈ x − log x − 1 with x = πref(token) / πθ(token). It is never negative (x − log x − 1 ≥ 0 for every x > 0, zero only at 1) and unbiased for KL(πθ ‖ πref) when tokens are sampled from πθ, because the expectation of x under πθ is exactly 1. On a token the reference gives half the policy's probability, x = 0.5 and k3 = 0.5 + 0.693 − 1 = 0.193.

k3 is never negative, but on a few tokens it is far larger than the plain log-ratio

Corrections carried from the DeepSeekMath page
The paper never trains PPO: GRPO's memory saving is asserted, not measured, and the first head-to-head is in DeepSeek-R1's supplementary material. And differentiating k3 in the loss gives, in expectation, the gradient of KL(πref ‖ πθ), not of KL(πθ ‖ πref): the value is an unbiased estimate of one divergence, its gradient pushes on the other (DeepSeekMath page, "k3 gradient" widget).

RLOO, REINFORCE leave-one-out, is the older member of the family: response i's baseline is the mean of the other G − 1 rewards (Kool et al. 2019). That baseline does not use ri, so the estimator is exactly unbiased, and algebra shows it is the mean-centred reward scaled by G/(G − 1): ri − (Σj≠i rj)/(G − 1) = (G/(G − 1)) (ri − mean). For (1, 0, 0, 0) that is +1.000 and −0.333. GRPO's mean-centring includes ri in its own baseline, which only shrinks the advantage by (G − 1)/G; the bias that matters is the standard-deviation division (section 7). Ahmadian et al. 2024 ("Back to Basics") argued that such "simpler REINFORCE-style optimization variants outperform both PPO and newly proposed 'RL-free' methods such as DPO and RAFT" for RLHF.

When the reward depends on the group. Everything above assumes a response's reward is its own. A diversity bonus, a coverage reward or a distribution-matching reward also depends on the groupmates, and then the group baseline changes the objective: in expectation GRPO and RLOO weight a response's effect on its groupmates' rewards by −1/(G − 1) instead of the true gradient's +1 (plain REINFORCE weights it 0), so each response is rewarded for beating its groupmates, a zero-sum tournament. A pairwise diversity bonus keeps 0, 1/3 and 3/7 of its weight at G = 2, 4 and 8, never more than half; at G = 2, two different good answers and two copies of one good answer both get zero advantage. Team-GRPO credits each response with its marginal effect on the group's total reward (a difference reward, computed from the reward matrix with no extra model calls for pairwise rewards) and restores the true gradient. Plain per-response verifier rewards are unaffected (When Rewards Depend on the Group, GRPO Plays a Tournament (arXiv 2611.02404)).

When beating the group is not enough. A group baseline credits a response for beating its siblings, even when every sibling is bad. QORL, an RL run that teaches a 4B model to write Postgres query hints, first rewarded a search with the log of its speedup over Postgres's default plan and gave a search with no valid plan −3. In one group of four, two failures (−3, −3), a slower plan (0.80x, ln 0.80 = −0.23) and a copy of the default plan (−0.05), mean-centring gave the copy +1.52, the largest push of the four. The fix anchors the advantage to the fixed reference and to the timing noise: a response's quality is its log speedup soft-thresholded by 0.05 (anything within about 5% counts as zero, so keeping the default scores exactly zero), its baseline is RLOO's leave-one-out mean of its siblings floored at zero, so it is never credited for being the least bad, and a failed search costs −0.1. The same four then get −0.10, −0.10, −0.18 and −0.02 (a small penalty for picking the default): nothing is reinforced (Training a 4B model to produce faster query plans).

Group-dependent rewards: the evidence and its limits (closed)

The −1/(G − 1) weight is a theorem for any exchangeable group reward; the retained fraction of a pairwise bonus is (G − 2)/(2(G − 1)), and as G grows GRPO approaches REINFORCE, not the true gradient. Retuning the bonus coefficient cannot fix G = 2. Team-GRPO's advantage is R(group) − G/(G − 1) R(group without response k), unbiased for any G ≥ 2, with variance 1.1 to 2.1 times RLOO's for G ≥ 4. Experiments use one 9B policy (Qwen3.5-9B, rank-16 LoRA) on two tasks: on GlobalOpinionQA at G = 2 the squared error to the human answer distribution went from 0.20 untrained to 0.49 under GRPO (collapse onto majority answers) and 0.08 under Team-GRPO; on NoveltyBench GRPO lost diversity in every seed, and Team-GRPO raised set utility over GRPO by 1.16 at G = 2 and 0.56 at G = 8. Clipping with several epochs per batch was tested only in simulation.

What GRPO gains and loses. No value model: roughly half the memory and no critic warm-up. The DeepSeek-R1 team report that PPO can match GRPO, but only with careful GAE tuning (λ = 1.0; "the default value in most open-source PPO implementations", 0.95, is much worse), and still at the cost of a full value model (DeepSeek-R1 page). GRPO is group-baselined REINFORCE with PPO-style clipping, policy-based rather than actor-critic because nothing bootstraps from the baseline (the root's common mistakes). It pays with equal credit for every token, noisier on long agentic tasks, and with G rollouts per prompt (typically 8 to 64), shifting cost from memory to inference compute. Buying token-level credit back also costs generated tokens, so a dense reward must be compared at a matched token or GPU-hour budget, not per update: with small Qwen models trained on MATH, a Monte-Carlo process reward (continuations sampled from cut points of each response, the hero's VinePPO-style measurement) trailed outcome-only GRPO at equal generated tokens at 0.6B, 1.5B, 1.7B and 4B; on Qwen2.5-1.5B it led by 1.5 points per update, yet trailed by 14.3 at equal tokens (the continuations were 91% of them) and by 7.8 at equal GPU-hours (Are Dense Rewards Worth Their Tokens in GRPO?).

The clip on the worked example, published settings, and the std convention (closed)

The clip, on one token of the correct response: suppose that after a few minibatch steps its ratio is ρ = 1.3, with ε = 0.2. The unclipped term is 1.3 × 1.732 = 2.252 and the clipped term 1.2 × 1.732 = 2.078; the min takes 2.078, which does not depend on θ, so this token contributes no more gradient. The same ratio on a token of a wrong response: unclipped 1.3 × (−0.577) = −0.751, clipped 1.2 × (−0.577) = −0.693; the min takes −0.751, the unclipped term, so the gradient still pushes that token's probability back down. With one gradient step per batch the ratio stays at 1 (up to the rollout mismatch of section 8) and the clip never binds: the update is plain REINFORCE with a group baseline, and the clip matters only when a batch is reused for several steps.

Published settings. DeepSeekMath-RL 7B used G = 64 samples per question, β = 0.04, a policy learning rate of 1e-6 and a single policy update per sampling batch, so its clip barely binds; it lifted the 7B instruct model from 46.8% to 51.7% on MATH and 82.9% to 88.2% on GSM8K. DeepSeek-R1-Zero used G = 16, β = 0.001, a learning rate of 3e-6, a reference replaced every 400 steps, and 16 minibatches per rollout trained once each with an unusually large clip ratio of 10 (DeepSeekMath page, DeepSeek-R1 page). The β values are not comparable with InstructGPT's 0.02, which sits in the reward rather than the loss.

The standard deviation. Implementations differ on dividing by G or G − 1 (for (1, 0, 0, 0): 0.433 and +1.732 / −0.577 with G; 0.5 and +1.5 / −0.5 with G − 1), and add a small constant so that a uniform group does not divide by zero (without it the loss becomes NaN); the examples on this page divide by G.

PPO's credit varies token by token and needs four models; GRPO's is flat and needs a group of 16 rollouts

4Before and after: one real response, three updates

The same response, run through everything each method computes for each of its tokens. Before: RLHF with PPO, a reward model's score at the end, a KL penalty on every token, a critic's value at every prefix, GAE. After: GRPO with a verifier, the recipe that replaced it for reasoning: a pass or fail, the group's mean and spread, one number for every token. Dr. GRPO is the 2025 fix of GRPO's two normalisations (section 7). Predict before stepping: on the wrong answer, does the reward model score it above or below the correct one?

The animation, step by step: before, RLHF with PPO

  1. The response. Fig. 2's answer 7 (242 tokens, wrong) or the group's first correct one (202 tokens): the buttons switch. PPO samples one response per prompt.
  2. The score. The reward model's one number on the last token: 8.46 for the wrong answer, 7.10 for the correct one, so PPO against it would push the wrong answer up. "PPO reward: verifier" scores 1 or 0 instead, as Tülu 3 ran PPO.
  3. The KL to the reference. −β log(πθ/πref) on every token's reward (β = 0.02): taxed where the policy now prefers a token more than the reference (orange), subsidised where less (green).
  4. The baseline. The critic's value of every prefix, measured from 16 continuations at each of 10 prefixes (dots), as VinePPO does. Under the verifier, the chance of passing collapses exactly where the working goes wrong.
  5. The advantage, token by token. GAE: with λ = 1, shaped return minus the prefix's value; with λ = 0.95 (the toggle), mostly the change in value a token caused. DeepSeek found PPO matched GRPO only at λ = 1.
  6. The weight each token gets in the loss. Its own advantage (PPO averages over the batch's tokens): pushed hardest where the value jumped up, pushed down where it fell, even inside a good answer.

What it shows: the critic places credit where the predicted outcome changed, and pays with a second network that must be right about every prefix (here measured with real continuations, as VinePPO does); GRPO gives every token the same push and pays with a group of rollouts per prompt; Dr. GRPO keeps that and stops long responses being let off lightly.

5RLVR: a program as the reward, and what it gets wrong

RL with verifiable rewards replaces the learned reward model with a program: exact-match answer checking for maths, unit tests for code, format checks, task-success checks for agents. The reward is binary or a small rubric sum. The name and first recipe are Tülu 3's (November 2024: a reward of 10 when the verifier accepts, optimised with PPO and a value model; Lambert et al.; its lineage is on Alignment section 7). DeepSeek-R1-Zero's reward is the reference shape: an accuracy reward (the final answer matched against the reference for maths; compilation plus hidden test cases for code) plus a format reward for reasoning inside <think> tags, equally weighted, and deliberately no neural reward model "because of reward hacking" by neural reward models at scale (DeepSeek-R1 page). It needs no preference data, cannot be flattered the way a reward model can, and scales with compute; it works only where a checker exists, and an imperfect checker is the new proxy.

VerifierChecksTypical failure
Answer match (rule-based)An extracted final answer equals the reference, after normalisationFalse negatives on equivalent forms ("0.5" against "1/2"), false positives when extraction is lenient. Rule-based verifiers "fail to recognize equivalent answers in different formats, leading to substantial false negatives that increasingly hinder RL performance as the policy model gets stronger": a correct answer punished teaches the checker's format, not maths (Huang et al. 2025)
Unit testsCode runs and passes testsWeak tests, special-cased outputs, edited tests, exiting before assertions (Reward Hacking section 4 and its Case gallery)
Format or constraint checkTags, length, an instruction's constraints (IFEval)Satisfied in form, not in substance: a <think> block can be empty or decorative
Model-based verifier or LLM judgeAn LLM decides whether an answer matches or is good; covers open-ended tasks and rubricsThey "substantially improve static accuracy" but are "highly susceptible to reward hacking during RL, where they misclassify certain patterns in responses as correct, particularly after fine-tuning" (Huang et al.); "master keys", a lone ":" or "." or an opener such as "Thought process:" or "Let's solve this step by step", "can consistently elicit false positive rewards without any substantive reasoning"; the authors' fix trains the judge on truncated answers as negatives (Zhao et al. 2025)

Three checkers on the same 160 real answers. Strict takes the last \boxed{...}, strips "$" and commas and compares its last number with the reference (no box, no reward; the reward used everywhere else on this page). Last number takes the last number anywhere, forgiving a missing box and rewarding a stray trailing number. Lenient passes if the reference number appears anywhere, the buggy extractor that rewards listing many numbers. Of 160 answers the strict checker passes 37, last-number 43 and lenient 66: the lenient checker passes 29 answers the strict one fails, most of them wrong answers that merely mention the reference number on the way. Where two checkers disagree, one is wrong, and a policy trained against it learns the wrong thing.

How often the three checkers agree, on 160 answers
The real disagreements, answer by answer (closed)

Beyond maths and code, rubric-based and generative verifiers are a main 2026 research front; rubric-based rewards gave up to 31% relative improvement on HealthBench over Likert-style judge rewards (Rubrics as Rewards, Scale AI, authors' measurement).

6DeepSeek-R1 and R1-Zero: the recipe that made GRPO the default

Released in January 2025 (arXiv 2501.12948), published in Nature in September 2025 in a much longer version (Nature); the DeepSeek-R1 page rebuilds its tables, decodes its figures and trains a tiny R1-Zero live.

  • R1-Zero: GRPO plus verifiable accuracy and format rewards applied directly to the DeepSeek-V3 base model, no SFT. Long chains of thought, self-verification and backtracking appeared from RL alone; response length grew from about 500 to about 14,200 tokens (28 times, 14,200 / 500 = 28.4), with its steepest step where the length cap was doubled from 32,768 to 65,536 tokens at step 8.2k. AIME 2024 pass@1 (the chance that a single sample solves a problem of the American Invitational Mathematics Examination) climbed from 15.6% to 71.0% in the January 2025 preprint (arXiv v1) and to 77.9% in the later version (arXiv v2 and Nature), which reports the curve to the end of training. Weaknesses: readability and language mixing.
  • R1: cold-start SFT on curated long chains of thought, reasoning RL, rejection sampling into about 800K new SFT samples, and a final RL stage for helpfulness and harmlessness that used preference reward models only in its last 400 steps. It matched o1-class reasoning at open weights.
  • Distillation beats RL on small models: on Qwen2.5-32B, plain SFT on 800K R1-generated samples reached 72.6 on AIME 2024, against 47.0 for the full R1-Zero RL recipe run on the same base for over 10,000 steps.
  • Cost: R1's RL and data generation took 147K H800 GPU-hours (about $294K at $2 per hour, 147,000 × 2) on top of the base model's 2.788M hours: a post-training bill, not "the cost of R1" (the root's Milestones and benchmarks tab keeps the dated figures).
Correction: R1-Zero's AIME figure has two versions
The old page said "climbed from 15.6% to 77.9%" without a version. 71.0% is the January 2025 preprint (v1); 77.9% is v2 and the Nature version; the R1 page's decoding of Figure 1 finds the curve's peak at 77.7% and v1's 71.0% equal to the curve at step 8,400. Do not mix them. And the "aha moment" was not created by RL: the base model already produces reflective words, and RL changed how often and how long (DeepSeek-R1 page).

7GRPO's biases and the fixes: Dr. GRPO, DAPO, CISPO, GSPO

Each fix below removes one measured bias of the objective in section 3. The DeepSeekMath page's Then and now tab walks GRPO's objective term by term through them; here each is derived with numbers.

Dr. GRPO: two normalisations that bias the update

"GRPO Done Right", from Understanding R1-Zero-Like Training (Liu et al. 2025):

  • Length bias from 1/|oi|. Each response's token losses are averaged over its own length, so each token of a long response carries less weight. For a correct response that favours short answers; for a wrong one it penalises long answers less per token, so the policy drifts toward long wrong answers. With the worked example's  = −0.577, each token of a 100-token wrong response is weighted −0.577 / 100 = −0.00577, each token of a 1,000-token one only −0.000577: ten times less push-down per token.
  • Difficulty bias from std. Prompts whose rewards barely vary (nearly all right or nearly all wrong) have a small standard deviation, so dividing by it inflates their advantages. In a group of 16 with a single correct answer the mean is 0.0625 and the standard deviation 0.242, so the correct answer gets +3.873; in a group of 16 with 8 correct, the standard deviation is 0.5 and a correct answer gets +1.0 (the group widget in section 3).

The fix drops both: Âi,t = ri − mean(r1, ..., rG), and token losses are summed and divided by a constant (the maximum generation length in the authors' code) instead of each response's own length. What is left is an unbiased REINFORCE-style estimator with a group-mean baseline (1 of 16 now gets +0.9375 and 8 of 16 gets +0.5: the push reflects how surprising the success was, not the group's spread). The paper reports less length inflation, especially on wrong answers, at equal reasoning performance, and its minimalist recipe reaches 43.3% on AIME 2024 from a 7B base model.

DAPO: four fixes for long chain-of-thought RL

DAPO (Decoupled Clip and Dynamic sAmpling Policy Optimization; ByteDance Seed with Tsinghua University's Institute for AI Industry Research, Yu et al. 2025), an open, widely adopted recipe, reports 50 points on AIME 2024 from the Qwen2.5-32B base model, above DeepSeek-R1-Zero-Qwen-32B's 47 with 50% of its training steps:

  1. Clip-higher: decouple the clip range into εlow = 0.2 and εhigh = 0.28 (entropy, below).
  2. Dynamic sampling: over-sample and drop groups whose rewards are all identical, since their advantages are zero and they only dilute the batch; keep sampling until the batch is full of groups that carry signal.
  3. Token-level loss: average over all tokens in the batch, (1/Σi|oi|) ΣiΣt, instead of per response and then per group, (1/G) Σi (1/|oi|) Σt, so every token has equal weight and long responses are not under-weighted.
  4. Overlong reward shaping: instead of a flat penalty for truncated responses, a soft length penalty added to the reward:
Rlength(y) = 0 if |y| ≤ Lmax − Lcache;   ((Lmax − Lcache) − |y|) / Lcache if Lmax − Lcache < |y| ≤ Lmax;   −1 if |y| > Lmax
|y|
the response length in tokens; Lmax the maximum length (16,384 in the paper) and Lcache the width of the soft zone before it (4,096). A 14,336-token response sits halfway into the zone: (12,288 − 14,336) / 4,096 = −0.5.

Shaping changes how a truncated rollout is scored, not the fact that the cap censors what the model is trained on. On Qwen3.5-4B trained with GRPO under an 8k cap, loss masking of truncated rollouts, DAPO's soft overlength penalty and Dr. GRPO each still let the cap become a learned limit on how far accuracy grows with a larger test-time budget (single-seed ablations, Budget Internalization); what that does to test-time scaling is taught on Test-time compute and reasoning section 6.

The overlong penalty ramps from 0 to −1 across the last 4,096 tokens instead of jumping

One rare token, sixteen updates: the clip freezes it after a few steps; CISPO keeps pushing
Probability of the token, step by step (log scale)
Gradient weight on the token at each step

At the defaults (start 0.010, η = 0.05), after 16 steps the token reaches 0.0124 under the 0.2 clip (gradient on 4 of 16 steps), 0.0131 under clip-higher (5 of 16), 0.0259 under CISPO and 0.0385 with no clip (16 of 16). illustrative One sampled token with advantage +1, a softmax over its logit and the rest of the vocabulary, sixteen gradient steps on the same rollout (R1-Zero used 16 minibatches per rollout), exact gradients of each objective. In a real model the same token appears in many contexts; the toy isolates one. CISPO's cap is set to the same 1.28 as clip-higher so the two are comparable; MiniMax does not publish its value. Checked against src/recompute.py.

Entropy collapse, and the clip that causes it: clip-higher and CISPO

The symmetric clip treats rare tokens unfairly. With ε = 0.2, a token the policy gives probability 0.01 can rise only to 0.012 in one update, while a token at 0.9 is effectively unconstrained (0.9 × 1.2 > 1). Low-probability exploratory tokens can barely grow, the distribution sharpens, and entropy collapses; with εhigh = 0.28 the same rare token can reach 0.0128. The collapse has a fitted law: in long runs, performance follows R = −a eH + b in the policy's entropy H, so it is capped at −a + b once entropy reaches 0; clip-higher and covariance-based clipping (Clip-Cov and KL-Cov, which restrict updates on the few tokens whose log-probability and advantage covary most) keep entropy alive (Cui et al. 2025).

MiniMax-M1's CISPO (MiniMax 2025) names the tokens this hurts: reflective tokens such as "However", "Recheck", "Wait" and "Aha" have low probability under the base model, so their ratios grow fast, they are clipped after the first update, and they stop contributing gradient. CISPO "clips importance sampling weights rather than token updates": every token keeps its gradient, and only the importance weight is clipped, under a stop-gradient:

𝒥CISPO(θ) = 𝔼 [ (1/Σi|oi|) Σi Σt sg( r̂i,t(θ) ) Âi,t log πθ(oi,t | q, oi,<t) ],   r̂ = clip(ρ, 1 − εISlow, 1 + εIShigh)
sg
stop-gradient: the clipped ratio only scales the REINFORCE term, it is never differentiated; "we did not impose a lower bound on the IS weight by setting εISlow to a large value; instead, we only tuned εIShigh"

The rare-token toy, in four stretches

  1. Update 0: one rare token, advantage +1. The rollout sampled a token the policy gives probability 0.010, in a response that scored above its group. Every objective starts with weight 1: ratio 1, nothing clipped yet.
  2. Updates 1 to 3: every objective pushes. Sixteen gradient steps are taken on the same rollout (R1-Zero used 16 minibatches per rollout). Inside the clip range the token's weight is its ratio, so all four curves rise together.
  3. Updates 4 to 6: the clip binds. Once the ratio passes 1 + ε the clipped objective is flat: weight 0, and the token stops learning from this rollout. At the defaults that happens after 4 updates under the 0.2 clip and 5 under clip-higher, near p0 × 1.2 and p0 × 1.28 (the dashed lines).
  4. Updates 7 to 16: CISPO keeps pushing. CISPO never zeroes the gradient: it caps the weight at 1.28, and a rare reflective token keeps learning from every minibatch. With no clip the weight is the raw ratio and grows with every step, on the strength of one advantage estimate: what the clip exists to stop.

On Qwen2.5-32B and AIME 2024, "CISPO achieves a 2x speedup compared to DAPO", matching DAPO's results in 50% of the training steps. It gives up the clip's trust region and relies on the weight cap and small steps. CISPO is a component of ScaleRL, the recipe from a 400,000-GPU-hour study of how RL scales (section 12).

GSPO: the ratio at the sequence level

GSPO (Group Sequence Policy Optimization; Qwen Team, Alibaba, Zheng et al. 2025) argues that token-level ratios are noisy and misaligned with a reward given to the whole sequence, which destabilises long sequences and mixture-of-experts (MoE) training. A 3-token response with per-token ratios 1.1, 0.9 and 1.0 gets one ratio, exp((ln 1.1 + ln 0.9 + ln 1.0)/3) = exp(−0.00335) = 0.99666, in place of three noisy ones:

si(θ) = ( πθ(oi | q) / πθold(oi | q) )1/|oi| = exp( (1/|oi|) Σt log ρi,t ),   𝒥GSPO(θ) = 𝔼 [ (1/G) Σi min( si Âi, clip(si, 1 − ε, 1 + ε) Âi ) ]
si
the geometric mean of the response's per-token ratios; Âi its group-relative advantage

Because the sequence ratio sits so close to 1, the clip ranges are tiny: 3e-4 below and 4e-4 above (against 0.2 and 0.27 for the paper's GRPO runs), with "a difference of two orders of magnitude in the fractions of clipped tokens between GSPO and GRPO", GSPO clipping more and still training more efficiently. The price is the per-token view: one outlier token is no longer clipped on its own. For MoE models it removes the need for "Routing Replay" (caching which experts were active during rollout so token ratios stay comparable). The paper credits GSPO with contributing to the RL of the Qwen3 models; a GSPO-token variant restores per-token advantages for multi-turn settings. Section 8 computes si on all 160 real responses.

8Off-policy corrections: the rollout engine is not the trainer

Real systems are off-policy in two ways: minibatch updates make later steps off-policy within a batch (the ratio and the clip handle this), and training/inference mismatch: the vLLM or SGLang engine computes slightly different probabilities than the training stack (kernels, precision, KV cache, batch shapes), so an implementation gap quietly turns on-policy RL into off-policy RL (Yao et al. 2025, "Your Efficient RL Framework Secretly Brings You Off-Policy RL Training"). How large is it? Below, the same weights computed three ways on this page's rollouts.

A precision gap moves almost no token past a TIS cap; a sampler the trainer does not know about moves many

Per-token log(πtrain / πrollout) for every sampled token. Real, on this page's rollouts: float16 with a KV cache (generation, Apple MPS) against float32 in one pass (CPU), mean |log-ratio| 0.0015 nats per token over 55,718 tokens; bfloat16 in one pass against float32, 0.0112; and an engine left with the model's shipped repetition penalty 1.1 against the plain model, 0.298 over 32 responses (9,397 tokens). The trainer here is the same weights in float32; a real trainer (FSDP, Megatron) and engine differ in more ways (kernels, batch-dependent reductions, FP8 rollouts), so production gaps can be larger. Histograms are binned (0.0005 nats for float16, 0.004 for bfloat16, 0.05 for the penalty); fractions are read from the bins.

The fix that spread is truncated importance sampling (TIS), introduced in that post, against the probabilities the engine actually sampled with:

wt = min( πtrain(ot | st) / πrollout(ot | st), C )
πtrain, πrollout
the probability the training stack computes for the sampled token under the old policy; the probability the engine sampled it with
C
the truncation threshold; verl suggests "typical threshold 1.5-5.0" for token-level weights and starts from decoupled_token_is(threshold=2.0) (verl, Rollout Correction)

A token the engine sampled at 0.20 that the trainer scores at 0.25 gets weight 1.25; one sampled at 0.05 and scored at 0.25 has ratio 5, truncated to 2. Unlike PPO's two-sided clip the cap is one-sided: weights below 1 pass through. The sequence-level variant multiplies the per-token ratios over the response (∏ρt), which compounds every token's gap, so its thresholds are higher ("typical threshold 2.0-10.0" in verl); rejection sampling (masked importance sampling, MIS) instead drops tokens or sequences whose ratio falls outside set bounds; CISPO's clipped weight (section 7) is the same idea applied to the policy ratio. verl distinguishes a "decoupled" mode with three policies (rollout, old, current) from a "bypass" mode that sets πold = πrollout to skip a forward pass.

The sequence ratio compounds every token's gap; GSPO's geometric mean stays within a hair of 1

In production the gap matters. ScaleRL found that computing the language-model head in FP32 for both generator and trainer "dramatically improves the asymptotic performance A from 0.52 to 0.61" (Khatri et al. 2025); the Qwen team's study of a 30B MoE model over "hundreds of thousands of GPU hours" argues that a token-level objective is a valid surrogate for the sequence reward "only when both the training-inference discrepancy and policy staleness are minimized" (Zheng et al. 2025). The weight export opens a quieter gap: casting the fp32 master to bf16 with round-to-nearest drops every update smaller than half a bf16 step, so on Qwen3-1.7B (AdamW, learning rate 10-6) only 0.4 to 0.5% of served weights change per step and the sampler serves a policy 50 to 150 optimizer steps stale, a staleness that importance ratios computed on the trainer's fp32 copy cannot see. Fair Cast exports with stochastic rounding and computes the loss on the served copy, so rollouts are on-policy for the weights that produced them; in GRPO runs on one H100 each with models up to 4B parameters (Qwen3-0.6B to 4B, OLMoE-1B-7B), it ended more than a point ahead on 18 of 25 matched seed-pairs and within a point on 6 (Fair Cast). MoE models add a discrete version, router drift: a tiny probability difference can flip which experts a token is routed to. And low-precision rollouts widen the gap on purpose, to buy speed: the recipes that work treat the mismatch, not the quantisation error, as the thing to engineer, and reach BF16-level RL with FP4 rollouts (TRACE, up to 5.4x faster rollouts), or avoid the gap by training in the rollout's format from the first pretraining step. Both in detail:

Router drift in MoE models, and low-precision rollouts (TRACE, TRIAGE, KV4-RL) (closed)

The trainer computes the gradient through different experts than the engine sampled with (router drift). Routing replay (R3) reuses the rollout's expert choices during training; Router Drift Control argues that replay biases the gradient, because it drops the experts the training router would have picked, and instead rejects whole responses whose routing disagreement is high. In asynchronous RL, Router Drift Control plus TIS raised the average peak validation accuracy on AIME 2024 and 2025 by 5.5 points over TIS alone and 4.5 over R3 (Router Drift Control (arXiv 2610.21682)).

TRACE guides the trainer's FP4 rounding by the rollout's and reaches RL "comparable to BF16 rollout" with FP4 weights, activations and KV cache on four large MoE models, with up to 5.4x faster rollouts (TRACE (arXiv 2610.07767)); TRIAGE repairs mismatched updates by their gradient direction and keeps native NVFP4 W4A4 on both sampler and learner, reaching full-precision scores on five math benchmarks with Qwen3-4B and Qwen3-30B-A3B at up to 2.3x BF16 rollout throughput (TRIAGE (arXiv 2610.07043)); KV4-RL found that plain INT4 KV rollouts "can degrade learning even with token-level truncated importance sampling" and fixed it by keeping attention sinks and recent tokens in INT8 (KV4-RL (arXiv 2610.14448)). The other route is one numerics configuration from pretraining to the last rollout: Thinking Machines ran Inkling 2 Small's expert layers with an NVFP4 forward pass from the start, so its RL sampler runs the same NVFP4 forward the model was trained with and no 4-bit checkpoint has to be calibrated at the end; it reports about 20% faster RL than full MXFP8 with "no discernible difference in reward" (a vendor figure for one model, with no reward curve or task given; End-to-End 4-Bit Training). The formats themselves are on Quantization and Precision.

Drift: what the mismatch does to the expected update. On-policy, the trainer's expected score at a prefix is zero, Σv pv ∇log pv = ∇Σv pv = 0 (the identity every baseline relies on, Policy gradients and actor-critic). When the token is drawn from the engine's q but scored through the trainer's p, s̄ = Σv qv ∇log pv is not zero, and the expected update at each prefix splits into drift, 𝔼q[R] · s̄, plus signal, Covq(R, ∇log p). Drift ignores which rollout won and pulls the trainer toward the sampler; since the sampler is then refreshed from the trainer, the pull compounds. Group centring does not remove it: at a prefix whose expected reward differs from the group mean, drift survives in proportion to that difference. Exact importance weights cancel it, but the cap or mask every recipe uses brings it back. Score centering subtracts s̄ from each token's score: an additive, deterministic bias correction (not a variance reduction), computed from the engine's top 128 logged log-probabilities with the tail modelled from the trainer, at under 1% extra wall-clock, and it composes with TIS or MIS, which together remove what each leaves (Marek and Ryabinin, Score Centering; Score Centering, our reading of Wolfe's explainer).

Score centering: the evidence and its limits (closed)

The paper made the mismatch severe on purpose (a fixed weight offset, INT8 samplers with FP4 or INT4 KV caches, syncing every 64 steps), with short sequences, plain SGD and mostly training accuracy, and reads it as a proxy for mild mismatch over long runs. At 30B (Qwen3-30B-A3B-Base on math) it ties TIS with an FP4 cache (52% against 51% training accuracy) and wins only with an INT4 cache (30% against 12%, 4 and 3 seeds); with FP8 uncorrected training was fine. Under stale rollouts it needs TIS or MIS beside it, because its covariance is measured under the stale sampler. A later paper found the top-128 shortcut weaker than Monte Carlo centring and score centering behind on agentic tasks with rare refreshes; it does not cover MoE routing differences, which still need routing replay. Like every correction here, it trusts the probabilities the engine logs, so the export lag of the Fair Cast paper sits upstream of it.

Theory caught up: Group-Relative REINFORCE Is Secretly an Off-Policy Algorithm (Yao et al., ICLR 2026) derives group-relative REINFORCE without assuming where the data came from, reframes GRPO and its relatives as regularised REINFORCE and clarifies "the roles of importance sampling and clipping in GRPO", which makes these corrections principled rather than patches. For a from-scratch loop: log the engine's log-probabilities and compare them with the trainer's; the gap is your mismatch diagnostic.

9pass@1 against pass@k: does RLVR teach, or elicit?

RLVR reliably raises pass@1. The question is whether it adds abilities the base model lacked or makes the base model's best answers its usual ones (sharpening). The tool is pass@k = 1 − (1 − p)k for a problem solved with probability p per sample, averaged over problems: sharpening raises pass@1 and can lower pass@k at large k, because probability taken from rarely solved problems is coverage lost. Predict: if RL only sharpens, which model solves more problems with 1,024 tries?

What the evidence says. Yue et al. 2025 (NeurIPS 2025 oral): RLVR-trained models beat their base at small k, but "the base models achieve a higher pass@k score when k is large"; RLVR operates "within the base model's capabilities rather than expanding beyond them", six popular RLVR algorithms "perform similarly and remain far from optimal", and distillation introduces genuinely new reasoning patterns. Against: prolonged RL with KL control and reference resets (ProRL) "consistently outperform[s] base models across a wide range of pass@k evaluations", including problems the base cannot solve at any sampling budget (Liu et al. 2025). Agentic tool use pays the same tax: base models with a light harness "often surpass their post-trained counterparts in solution coverage (pass@K)", and the loss of retry value, a Sharpening Tax estimable from a few rollouts, is positive in 36 of 42 base and post-trained pairs, while the base model reaches more tasks at pass@128 in only 26 (clearly in 18, mostly the larger models): the two counts differ. Posterior-tempered group sampling (PTGS), which sets each prompt's sampling temperature from its estimated difficulty during RL, lowered the tax only within run-to-run noise (five runs per arm, two grid-world games, one 7B model), and a plain fixed temperature of 0.5 paid a smaller tax in both games: promising, not shown (Sharpening Tax in Post-Training, paper page; arXiv 2610.01509). And a warning about reading any gain: spurious rewards, random ones, lifted Qwen2.5-Math-7B on MATH-500 by 21.4 points against 29.1 for true rewards, traced to "clipping bias" in GRPO amplifying a pretraining behaviour (code-style reasoning, 65% to over 90% of answers), an effect that "often fail[s] to produce gains for other model families, such as Llama3 or OLMo2" (Shao et al. 2025).

Where the gain lives. Comparing Qwen3-4B-Base with its RL-trained model on 120 AIME problems, taking the RL model's token only at the positions where the two models' greedy choices differ (about 4% of positions) and the base model's everywhere else recovered 90.5% of the pass@1 gain; forcing just the RL model's opening word, "Alright", recovered 35%, and power sampling the base model (sharpening its own distribution, at 8,192 tokens) gave nothing over greedy decoding (What RL Brings to Reasoning (arXiv 2610.24663)). So RL changes a few decisions the base model would not make, and sharpening the base model's own distribution does not find them. The markers people read as RL-made reasoning are mostly inherited: RL from a base model almost never coins "wait"; it arrives with the data (mid-training, reasoning-trace SFT) and some RL recipes multiply it where present, so a marker's frequency is not evidence that RL induced the reasoning (Inherited, Not Invented (arXiv 2610.30882)). The RL itself does matter against a filtered-data baseline: in a pre-registered comparison (Qwen3-4B-Base, LoRA, 3 seeds, one synthetic task), GRPO beat a rejection-sampling fine-tune tuned over 27 runs on every prompt set (Is it RL or Data? (arXiv 2610.25812)).

Sharpening doubles pass@1 yet loses at large k; the curves cross

Sharpening only: pass@1 10.4% (base) to 21.1% (after RL); pass@1024 80.0% to 77.9%. With expansion, pass@1024 rises to 82.9%. illustrative 40 problems with per-sample success probabilities spread from 0 to 0.9 for the base model; "sharpening" raises every probability above 0.15 toward 1 and pushes the rest toward 0; "expansion" also gives a quarter of the unsolved problems a small chance. pass@k computed exactly per problem and averaged; the shape, not the numbers, is the point.

The reading the sources support: RLVR reliably converts pass@k into pass@1 and improves reasoning validity, through a small number of changed decisions that plain sharpening of the base model does not reproduce and that training on the base model's own filtered samples matches only partly; the coverage post-training gives up shows in agentic tool use as in maths and code, and how much depends partly on how rollouts are sampled; whether it creates capability outside the base model's support remains contested, with prolonged multi-stage RL the strongest claim for expansion. Measure pass@k at large k, on more than one base family, before claiming a new capability. The same question seen from inference (a measured chart where pass@1 climbs and pass@256 does not, and what that means for spending samples) is on Test-time compute and reasoning, section 8.

The rest of the evidence, in the order it arrived (closed)
  • DeepSeekMath already saw the shape in 2024: RL raised majority-vote accuracy (Maj@K) but not Pass@K; the page's decoding of its Figure 7 finds Pass@64 slightly lower after RL (DeepSeekMath page).
  • The invisible leash: RLVR as "a support-constrained optimization mechanism"; token-level entropy can rise while answer-level entropy falls (Wu et al. 2025).
  • Reasoning quality: judging the chain and not just the answer (CoT-Pass@k), RLVR "can encourage sound reasoning processes even when rewards depend solely on answer correctness" (Wen et al. 2025).
  • Agentic detail: base models "equipped with a light inference harness, can serve as capable agents" despite far lower pass@1; post-training pushes tasks to always solved or never solved; the 42 cases are 14 base and post-trained pairs from four families on three agentic benchmarks.
  • On-policy distillation shows the same shape: it "improves performance without expanding the student's capabilities" (Cui et al. (arXiv 2610.03185)).

10Reward hacking, specifically in LLM RL

Every RL method optimises the reward it is given, not the one intended. The general picture, the over-optimisation curve of Gao et al. 2022 (proxy reward keeps rising while the true reward peaks and falls as the policy moves away from its start) and how the KL leash decides where the policy stops on it, is Reward Hacking section 2; chat models are its section 3, coding agents section 4, and its Case gallery tab lists every documented case. What is specific to the RL step of a language model, measured where this page can:

  • Length. Reward models in chat tend to prefer longer answers (Reward Hacking section 3), and GRPO's 1/|o| makes long wrong answers cheap (section 7): two independent pushes toward verbosity. On this page's data the reward model's scores fall with length instead (r = −0.54), which is why the preference must be measured, not assumed.
  • The reward model's blind spots. A learned scorer ranks some wrong answers above right ones and the policy finds those regions: the real reward model here misranks 15% of right-wrong pairs, and on GSM8K problem 3 it scores a wrong answer above a right one (section 4).
  • Lenient verifiers. An extractor that accepts the reference number anywhere rewards a policy that lists many numbers: here such a verifier passes 29 answers the strict checker fails (section 5). Model-based judges are fooled by "master keys" and hacked "particularly after fine-tuning". A judge's accuracy on a fixed set does not rank it as a reward: thinking judges were more accurate than answer-only judges, yet the answer-only judges trained better policies (online DPO) in 7 of 8 matched settings (Scaling Laws for Generative Reward Models (arXiv 2610.30765)).
  • Tests and format. Special-cased outputs, edited tests and early exits pass a suite without solving the task; a <think> block satisfies a format reward while empty.

Defences that belong to the RL loop: the KL penalty or a refreshed reference; rule rewards for long runs and learned rewards only briefly (R1's last 400 steps); held-out verifiers; logging reward components separately; and reading samples, especially the highest-reward ones. Monitoring the chain of thought helps, but training against the monitor teaches the model to hide it (Reward Hacking, section 6); routing a flagged rollout's update into an adapter deleted after training, instead of penalising its reward, keeps the monitor out of the objective (GRAFT, paper page; Reward Hacking, section 7).

The real reward model ranks right above wrong 85% of the time, and prefers shorter answers

Every one of the 160 answers as a dot: reward-model score across, length up; filled when the strict verifier passes it. A reward model a policy could not exploit would put every filled dot right of every hollow one. Here it ranks a correct answer above a wrong one in 85% of pairs (AUC), scores 10 of 123 wrong answers above the average correct one, and its score falls with length (r = −0.54: long answers here are mostly truncated or confused ones, so the sign of a length preference depends on the reward model and the data, which is why it has to be measured).

11Agentic and multi-turn RL

When the policy calls tools, the MDP of section 1 changes in three ways. The transition is no longer trivial: after a tool call the environment appends tokens the policy did not generate (a search result, a test log, a shell's output). Those tokens must be masked out of the loss, because the policy cannot be credited or blamed for them; Search-R1 introduced "retrieved token masking for stable RL training" (Jin et al. 2025). And episodes span many turns with one reward at the end, so credit assignment is harder than in single-turn reasoning; GiGPO adds step-level advantages computed from states that recur across a group, and reports over 12% better than GRPO on ALFWorld and 9% on WebShop (arXiv 2505.10978, authors' measurement).

  • Exact token accounting. If the trainer re-tokenises the engine's text instead of using the engine's token ids, the same text can tokenise differently, the trainer scores tokens the engine never sampled, and the data is silently off-policy (section 8). Mercor's 397B run calls the discipline "token-in-token-out" (Mercor, 1 September 2026).
  • Cost as a term in the objective. Cognition trained SWE-2's whole effort ladder in one RL run with the reward R = S − λeC, where S ∈ {0, 1} is success, C the rollout's cost, and λe "tuned to match the slope of the Pareto curve of the base model at effort level e", instead of one checkpoint per effort tier (Cognition, 10 September 2026).
Agentic recipes in detail: SWE-2's numbers, several rewards at once, Mercor's 397B run (closed)
  • SWE-2's saving showed up in turns: on FrontierCode 1.1 Main, SWE-2 medium used 53 steps against SWE-1.7's 127 (58% fewer, 1 − 53/127) at 81% lower average cost (Cognition, 10 September 2026). For agents, turn count is where the money goes once per-token price is competitive.
  • Several objectives at once. When a run optimises several rewards, gradient keeps flowing into the ones already mastered. Learn What's Left, Not What's Mastered normalises each objective per group and down-weights it by (1 − saturation)γ, the multi-objective cousin of DAPO's dynamic sampling (no disagreement, no signal); its paper page trains it live and finds the gains unproven: single runs, and the obvious fixed-weight rival never run.
  • The largest published recipe in this shape: Mercor with SkyRL trained Qwen3.5-397B-A17B on 1,928 expert knowledge-work tasks (consulting, banking, law) and "improved Pass@1 by 70% relative, from 16.11% to 27.29%" on APEX-Agents (27.29 / 16.11 = 1.69). Most of its write-up is about exact token accounting, fully asynchronous RL with in-flight weight updates, timeouts and error classes for robust environments, and the harness: fixing its tool servers "raised the base ... from 22.74% to 28.69% mean reward, with zero training". Its authors' summary: "algorithm choices mattered less than the data". The recipe in full is on Topic: llm-training-and-post-training.

12Infrastructure: rollouts, weights and environments

An RL step for an LLM is four jobs on one or two pools of GPUs: generate rollouts with an inference engine (vLLM, SGLang), score them (a verifier, a reward model, an environment), train on them, and sync the new weights back to the engine. verl's HybridFlow colocates trainer and engine on the same GPUs and switches between them, which makes weight sync fast; disaggregated designs give each its own pool and ship weights over the network. The frameworks (verl, OpenRLHF, TRL, SkyRL, NeMo RL) are listed on Alignment; few methods reach them: of 1,598 papers proposing general RL methods from January 2025 to June 2026, 37 reached any of seven open frameworks, and the included papers more often trained 30B+ policies (41% against 10%) (From RL Papers to Framework Code (arXiv 2610.28027)); checkpoints, failures and goodput on Fault tolerance at scale.

Fig. 3, step by step: one RL step on the GPUs

  1. Generate. The inference engine holds a copy of the weights (the glass plates, version v) and decodes a batch: here 16 slots on 16 real answers to one GSM8K problem, 228 to 478 tokens long.
  2. Wait for the longest. A synchronous step moves on only when the batch's longest answer is done; the dashed boxes are slots idling after their answer finished, 32% of slot time on this batch. Reasoning lengths have a long tail, so the gap grows with them.
  3. Score. Each finished answer goes to the scorer (a verifier, a reward model or an environment): 2 of these 16 pass.
  4. Train. Answers, scores and the engine's log-probabilities go to the trainer (FSDP, Megatron), which computes advantages and takes a gradient step: its weights become version v + 1.
  5. Sync the weights. The new weights go back to the engine before the next batch. Colocated, as in verl's HybridFlow, trainer and engine share the GPUs and switch roles, so the sync is a local copy; disaggregated, as drawn, each has its own pool and the weights cross the network.
  6. Or run ahead: asynchronous. The engine starts the next answers at once while the trainer works, so it never idles; but answers begun before a sync were sampled by weights that are now old (the orange bars of the next batch). On the timeline model of the next figure, 121 of 160 answers are trained on after the weights moved on, by at most 2 versions: the off-policy problem of section 8.

Synchronous or asynchronous. A synchronous step waits for the longest response in the batch, and reasoning lengths have a long tail, so most of the engine idles at the end of every generation phase. Asynchronous systems let generation run ahead, and pay with staleness, the off-policy problem of section 8. Predict how much of the engine's time the synchronous schedule wastes on this page's real lengths, then compare the two timelines on the right (the same 160 responses, the same engine):

  • AReaL's rollout workers "continuously generate new outputs without waiting" while trainers update "whenever a batch of data is collected", with "a staleness-enhanced PPO variant" for the older samples, reaching "up to 2.77× training speedup" (Fu et al. 2025); PipelineRL updates weights in flight, pausing generation only briefly so sequences already in progress continue on the new weights, about 2× faster learning on 128 H100s (Piché et al. 2025).
The same 160 real responses finish 1.49 times sooner when the engine never waits, at the cost of stale samples

On this model the synchronous schedule takes 5,915 ticks with the engine busy 59% of slot time; the asynchronous one 3,982 ticks, 87% busy, and 121 of the 160 responses are trained on after the weights moved on, by at most 2 versions.

How RL scales. A 400,000-GPU-hour study fits reward against compute with a sigmoid, RC − R0 = (A − R0) / (1 + (Cmid/C)B), and finds that most recipe details (loss aggregation, normalisation, curriculum, the off-policy algorithm) change the efficiency B more than the ceiling A (Khatri et al. 2025).

Environments at scale and the ScaleRL recipe (closed)
  • Environments are now the expensive part for agents. DeepSeek's sandbox layer runs about 3 million sandboxes a day, over 5,000 created per second, on about 160 nodes, co-designed so stateful rollouts survive preemptible GPU training; the paper page judges the production scale self-reported (DSec page, which places a burst of sandboxes live).
  • ScaleRL, the study's recipe, combines PipelineRL, forced length interruptions, CISPO, prompt-level loss averaging, batch-level advantage normalisation, FP32 logits, zero-variance filtering and "No-Positive-Resampling" (prompts whose historical pass rate reaches 0.9 or more leave the pool).

13Trade-offs: which one when

ChoiceBuysCostsUse it when
PPO-RLHFPer-token credit from a learned critic; works with any learned rewardFour large models in memory, a value model fitted during RL, many sensitive hyperparameters (GAE λ among them)The reward is a learned preference model and you have the infrastructure for the critic
GRPOA critic-free loop with roughly half the memory and a baseline that needs no trainingG rollouts per prompt; equal credit for every token of a responseThe default for single-turn reasoning with a verifier; long-horizon agentic tasks feel its lack of per-token credit most
RLOOThe same group baseline, exactly unbiased, no std divisionAs GRPOYou want REINFORCE's simplicity with a free baseline (Ahmadian et al.)
GRPO with the Dr. GRPO and DAPO fixesGRPO's cost without its length and difficulty biases; zero-signal groups filtered; entropy kept aliveMore rollouts to fill a batch (dynamic sampling)Long chain-of-thought runs; the checklist below makes each an explicit decision
GSPOStability on long responses and MoE models by clipping whole sequencesThe per-token view of the ratio: one outlier token no longer gets clipped on its ownMoE policies, long responses
CISPORare tokens keep their gradient; 2× faster than DAPO in MiniMax's runsNo trust region from the clip; relies on the weight cap and small stepsLong reasoning where reflective tokens matter
Verifier or reward modelA verifier cannot be flattered and needs no preference dataExists only where correctness is checkable; a reward model covers open-ended quality and is exploitableVerifier for checkable tasks; reward model briefly, as R1 confined its preference rewards to the final 400 steps of its last RL stage
Offline preference methods (DPO family)No RL loop: cheap broad preference shapingConsistently weaker than online RL at equal data where it matters most (reasoning, agentic behaviour)Cheap style and preference tuning; on Alignment

14Depth: mistakes, a checklist, and an unverified claim

Mistakes that cost real runs (closed)

Letting the engine's sampling defaults change the policy. A model's shipped generation_config.json can carry sampling settings the trainer knows nothing about; Qwen2.5-0.5B-Instruct's sets repetition_penalty 1.1, temperature 0.7, top_p 0.8 and top_k 20 (file). Building this page, a first run that overrode temperature, top_p and top_k but not the repetition penalty sampled from a different distribution than πθ: its stored log-probabilities differed from the model's by 0.08 to 0.45 nats per token on average across 32 responses (up to 3.2 on one token), against about 0.0015 for a pure precision gap (section 8's third set-up). Sample at temperature 1 with every processor off, or record and correct for what you change.

Assuming the rollout policy is the old policy. Computing ρ against the trainer's recomputed log-probabilities alone hides the engine's systematic gap; log both and correct with TIS or rejection sampling.

Counting the KL penalty twice. RLHF-PPO puts it in the reward, GRPO in the loss. Doing both, or comparing β across the two placements (0.02 in InstructGPT's reward, 0.04 and 0.001 in DeepSeek's losses), mixes up two different regularisers.

Expecting PPO's behaviour from GRPO. With one gradient step per batch the clip never binds (section 3's closed block); the clip matters only when a batch is reused, as in R1-Zero's 16 minibatches.

Training on environment tokens. In multi-turn RL, tool outputs are part of the state, not the policy's actions; mask them from the loss, and pass token ids end to end.

Checklist for a from-scratch RLVR loop (closed; ticks stay in this browser only)

The Mercor run in section 11 makes the same point about where the difficulty sits: steps 1, 2, 5 and 7 are where its work actually landed.

Rewarding calibrated confidence: RLCR, and TypeSafe's unpublished "RL for Calibrated Decisions" (closed)

RLVR pays 1 for a right answer and 0 for a wrong one, so guessing pays. RLCR (RL with Calibration Rewards, Damani et al. 2025) has the model state a confidence q after its answer and rewards R = c − (q − c)2, correctness minus the Brier penalty: wrong at 0.9 earns −0.81, wrong at 0.2 earns −0.04, right at 0.9 earns 0.99. Because the Brier score is a proper scoring rule, stating the true chance of being right maximises the expected reward (a model right 70% of the time earns 0.49 by saying 0.7 and 0.40 by saying 1.0). On Qwen2.5-7B trained on HotpotQA, against RLVR, it cut expected calibration error from 0.37 to 0.03 at 62.1% against 63.0% accuracy; on six other datasets, from 0.46 to 0.21, with accuracy 56.2% against 53.9% (Table 1(a)). The baselines are RLVR and post-hoc classifiers, not RLVR plus temperature scaling. A worked walk-through: Language Models for Text Classification.

Unconfirmed
TypeSafe names its own method, behind the Jev decision model, "Reinforcement Learning for Calibrated Decisions" (RLCD), which "optimizes for: Calibrated decisions: answers with epistemically honest probabilities on System One tasks" (TypeSafe blog). As checked on 27 November 2026 it gives no reward, objective or paper, and no connection to RLCR has been stated, so RLCD's mechanism is undocumented. Jev as a product, its prices and the independent measurements of it are on Other notable providers.