Sam Babichenko

Reading notes / Running RL at scale

How Off-Policy Can GRPO Be?

Tian et al., 2026

Sampling
q;q; oi;o_i; oi,to_{i,t}question; ii-th sampled answer; its tt-th token
G;G; ∣oi∣|o_i|answers per question (8 here); length of oio_i in tokens
πθ;\pi_\theta; πold\pi_{\rm old}policy being trained; policy that sampled the current data (the paper's β)
πθ(oi,t∣⋅)\pi_\theta(o_{i,t}\mid\cdot)probability of oi,to_{i,t} given qq and oi,<to_{i,\lt t}
μ\muoptimizer updates per batch of sampled answers (the staleness)
BBa minibatch of answers (32 questions' groups)
Rewards and ratios
Ri;R_i; A^i\hat A_ireward of oio_i (1 if correct, else 0); its group-normalized advantage
ρi,t\rho_{i,t}token ratio πθ(oi,t∣⋅)/πold(oi,t∣⋅)\pi_\theta(o_{i,t}\mid\cdot)/\pi_{\rm old}(o_{i,t}\mid\cdot)
ρi,<t\rho_{i,\lt t}prefix ratio ∏j<tρi,j\prod_{j\lt t}\rho_{i,j} (the paper's Rt−1R_{t-1})
Veto
κi\kappa_iposition of the first trigger token in oio_i (∞\infty if none)
mim_iveto mask: 0 for a negative-advantage answer with a trigger, else 1
T,T, Sκ,S_\kappa, Hκ,H_\kappa, SseqS_{\rm seq}masking scopes: trigger tokens; all tokens after the first trigger; those minus the triggers; the whole answer
χ2;\chi^2; a,a, rrchi-square divergence; mass of the retained tokens and the factor it shrinks by, in the appendix bound (Step 4)
Constants
ε\varepsilonGRPO's clip range, 0.2, giving the interval [0.8, 1.2]
[0,5][0,5]μ-GRPO's relaxed clip interval for the token ratio
τc\tau_ctrigger threshold on ρi,t\rho_{i,t}, 10−410^{-4}

Context. group relative policy optimization: PPO without a value model, in which every token of an answer gets the answer's reward minus its group's mean reward, divided by the group's standard deviation, as advantage for reinforcement learning in which a program checks each answer and returns the reward, here 1 for a correct final answer and 0 otherwise is usually run close to on-policy: the current model samples a batch of answers, a few gradient steps are taken on it (four is a common choice), and then the model samples again. Each refresh moves the new weights from the training engine to the inference engine that generates answers, and to switch quickly between the two, systems keep the trainer's parameters and optimizer state on the GPUs during generation, which leaves less memory for generating. Training is already somewhat off-policy in practice, through this reuse of each batch, through asynchronous pipelines and through numerical differences between the two engines. Tian et al. (2026) ask how much further the data can lag behind the policy, and push GRPO to over a thousand updates per batch of samples.

Stale samples still carry useful gradient after more than a thousand updates, and what goes wrong at that staleness is specific and can be filtered out. With GRPO's usual clip interval, more and more stale tokens fall outside it and stop contributing, so learning stalls. With a much wider interval, training learns fast at first and then collapses, because the clip's lower bound was what stopped the update from pushing down tokens of below-average answers: without it, the same sampled answers are suppressed again and again, and their tokens become far less likely than when they were sampled. The damage comes from the tokens that follow such a token (one that has become far less likely), which the policy is still trained on although the prefix they follow has become very unlikely under it. Dropping any below-average answer that contains such a token, together with the wide interval, lets GRPO train in four stages of 1024 updates each. On four of five models this matched or beat ordinary GRPO, with end-to-end training time 1.53 times shorter on average over the five models.

Setting. For a question qq, the sampling policy the policy that generated the current data, frozen while it is used; πθ\pi_\theta is the policy being trained (the paper writes β\beta for the sampling policy) draws the number of answers sampled per question, 8 in the experiments answers o1,…,oGo_1,\dots,o_G; write oi,to_{i,t} for token tt of oio_i, ∣oi∣|o_i| for its length, and πθ(oi,t∣⋅)\pi_\theta(o_{i,t}\mid\cdot) for the probability of oi,to_{i,t} given qq and oi,<to_{i,\lt t}. Each answer gets a reward Ri∈{0,1}R_i\in\{0,1\} and every one of its tokens the advantage A^i=(Ri−Rˉ)/std⁡(R)\hat A_i=(R_i-\bar R)/\operatorname{std}(R), with Rˉ\bar R and std⁡(R)\operatorname{std}(R) the mean and standard deviation of the rewards in the group of qq; negative for answers below the group's average. The the number of optimizer updates made on one batch of sampled answers: the batch's number of questions divided by the number per update; μ=1\mu=1 is fully on-policy counts the updates made before the data are refreshed; ordinary GRPO uses μ=4\mu=4, and μ-GRPO uses μ=1024\mu=1024 with 32 questions per update. With ρi,t=πθ(oi,t∣⋅)/πold(oi,t∣⋅)\rho_{i,t}=\pi_\theta(o_{i,t}\mid\cdot)/\pi_{\rm old}(o_{i,t}\mid\cdot), the probability ratio of token tt of oio_i, computed from the log-probabilities stored at sampling time the ratio of token tt, ρi,t=πθ(oi,t∣⋅)/πold(oi,t∣⋅)\rho_{i,t}=\pi_\theta(o_{i,t}\mid\cdot)/\pi_{\rm old}(o_{i,t}\mid\cdot); GRPO maximizes the per-token clipped objective min⁡(ρi,tA^i,clip⁡(ρi,t,1−ε,1+ε)A^i)\min\big(\rho_{i,t}\hat A_i,\operatorname{clip}(\rho_{i,t},1-\varepsilon,1+\varepsilon)\hat A_i\big), averaged over the tokens of each answer and then over answers, with GRPO's clip range, giving the interval [0.8, 1.2] and no KL term. μ-GRPO widens the interval to [0,5][0,5] and adds a rule the paper calls the negative-advantage veto. A token is a a token of an answer with negative advantage whose ratio has fallen below τc\tau_c: the current policy finds it at least 10410^4 times less likely than the sampling policy did if A^i<0\hat A_i\lt0 and ρi,t<τc\rho_{i,t}\lt\tau_c, with the trigger threshold on a token's ratio; let the veto mask of oio_i: 0 if oio_i has negative advantage and contains a trigger token at the current update, 1 otherwise; recomputed at every update and not differentiated be 0 for an answer with a trigger and 1 otherwise. Over a minibatch BB of answers, μ-GRPO maximizes1∣B∣∑i∈Bmi∣oi∣∑t=1∣oi∣min⁡(ρi,tA^i,clip⁡(ρi,t,0,5)A^i).\begin{aligned}&\frac1{|B|}\sum_{i\in B}\frac{m_i}{|o_i|}\sum_{t=1}^{|o_i|}\\&\quad\min\big(\rho_{i,t}\hat A_i,\operatorname{clip}(\rho_{i,t},0,5)\hat A_i\big).\end{aligned}Training runs in stages: πold\pi_{\rm old} is frozen, generates answers to 32,768 questions (1024 updates times 32) with their log-probabilities, is released from memory, and the trainer makes 1024 updates on that data before the next stage begins from the updated policy.

Main findings (empirical apart from an appendix bound). (a) At μ=1024\mu=1024, GRPO with its usual clip loses accuracy: on Qwen2.5-Math-7B the average over AMC 2023 and 2024, AIME 2024 and 2025, and MATH500, scored by pass@1 averaged over 16 samples per problem for AIME and 4 for the others falls from 47.3% at μ=4\mu=4 to 41.8%. μ-GRPO at μ=1024\mu=1024 gets 48.0%. (b) Against ordinary GRPO at μ=4\mu=4, μ-GRPO matches or improves the average on four of five models (1.7B to 8B), with the largest gain on the paper's name for DeepSeek-R1-Distill-Qwen-7B, Qwen2.5-Math-7B fine-tuned on reasoning traces of DeepSeek-R1 (68.6% against 66.1%) and a loss on Qwen3-8B-Base (48.2% against 50.3%), and it makes generation time 1.82 times and end-to-end training time 1.53 times shorter, each the mean over the five models of GRPO's time divided by μ-GRPO's. (c) Relaxing the clip without the veto collapses mid-training; vetoing only the trigger tokens still collapses, while vetoing the tokens after the first trigger is stable. (d) The veto removes few tokens, on average over stages 0.17% to 4.03% of tokens depending on the model, and the result is similar for the three veto scopes that include the post-trigger tokens.

Consequences. For GRPO-style training on verifiable rewards, rollouts can be generated in a few large batches and reused for about a thousand updates, which removes most weight synchronizations and lets generation use all the GPU memory, provided the clip interval is wide and below-average answers containing a token whose ratio has fallen below 10−410^{-4} are dropped. With stale data, ordinary clipping is the wrong safeguard in two ways: it stops too many useful tokens, and it is the only thing limiting how far below-average answers are pushed down, so removing it requires another limit. The rule for the veto follows from the cause: once a sampled answer contains a token the current policy has nearly ruled out, the rest of that answer follows a prefix the policy would almost never produce, so its later tokens should not be trained on.

Step 1

At high staleness, the usual clip discards useful signal and a relaxed clip learns fast and then collapses. On Qwen2.5-Math-7B at μ=1024\mu=1024, the interval [0.8, 1.2] clips a growing fraction of tokens as πθ\pi_\theta moves away from the frozen πold\pi_{\rm old}, and accuracy plateaus below that of GRPO at μ=4\mu=4. Widening it to [0,5][0,5] keeps the clipped fraction low and recovers the fast early gains, which shows that the stale data still carry useful gradient, but this run collapses partway through. Neither interval works alone.

Step 2

The clip's lower bound is what stops below-average answers from being pushed down, and collapse follows the loss of that bound. For A^i<0\hat A_i\lt0, the clipped term equals A^imax⁡(ρi,t,clip⁡(ρi,t,1−ε,1+ε))\hat A_i\max\big(\rho_{i,t},\operatorname{clip}(\rho_{i,t},1-\varepsilon,1+\varepsilon)\big), so its gradient is zero once ρi,t<1−ε\rho_{i,t}\lt1-\varepsilon: with the usual interval, a token of a below-average answer stops being pushed down when its probability has fallen by more than 20%. With the lower bound at 0 that stop is gone, and the gradient of such a token is A^i ρi,t ∇θlog⁡πθ(oi,t∣⋅)\hat A_i\,\rho_{i,t}\,\nabla_\theta\log\pi_\theta(o_{i,t}\mid\cdot) at every remaining update of the stage. Over a thousand updates on the same frozen samples, below-average answers are suppressed again and again. In the paper's runs, the mean ratio of negative-advantage tokens falls sharply before each collapse, while in stable runs it stays near 1. Tokens with very small ratios are therefore used as triggers.

Step 3

The harmful updates are on the tokens after the first trigger, and masking the triggers alone does not help. Let the position of the first trigger token in oio_i, and ∞\infty if oio_i has none be the position of the first trigger in oio_i. Under the [0,5][0,5] interval, the authors mask, in negative-advantage answers only, one of four sets: the trigger tokens TT; all tokens after κi\kappa_i, SκS_\kappa; those minus the triggers, HκH_\kappa; or the whole answer once it has a trigger, SseqS_{\rm seq}. Masking TT collapses like no masking at all. Masking HκH_\kappa, which keeps the trigger tokens and removes the others after them, is stable, as are the larger sets that contain it. So a trigger marks the point after which updates become harmful, and the harmful updates are on the tokens after it, whose own ratios are not small. In the final runs μ-GRPO uses SseqS_{\rm seq}, the simplest of the three stable scopes.

Step 4

Tokens after a trigger follow a prefix the current policy would almost never produce, and the per-token ratio cannot see this. The probability that πθ\pi_\theta produces the first t−1t-1 tokens of oio_i, relative to πold\pi_{\rm old}, is the prefix ratioρi,<t=πθ(oi,<t∣q)πold(oi,<t∣q)=∏j<tρi,j.\rho_{i,\lt t}=\frac{\htmlData{gr=gn4}{\pi_\theta}(o_{i,\lt t}\mid q)}{\pi_{\rm old}(o_{i,\lt t}\mid q)}=\prod_{j\lt t}\rho_{i,j}.Once a trigger appears at κi\kappa_i, its ratio (below 10−410^{-4}) is a factor of every later ρi,<t\rho_{i,\lt t}. GRPO weights each later token by its own ρi,t\rho_{i,t} only, which can be near 1, so these tokens keep receiving full updates although the current policy would almost never reach them. The trigger tokens themselves are harmless by comparison, because their own small ratio multiplies their gradient. In an appendix the authors make the mismatch precise: they compare the distribution of (answer, position) pairs under πold\pi_{\rm old} with the one in which the answer's prefix up to that position comes from πθ\pi_\theta instead, and show that a χ2(P∥Q)=∫(dP/dQ−1)2 dQ\chi^2(P\|Q)=\int(dP/dQ-1)^2\,dQ, a measure of how far a distribution PP is from QQ that is large where QQ has much less mass than PP between them is at least a(1−r)2/ra(1-r)^2/r when a retained set of tokens has mass aa under the first and at most rara under the second, which grows without bound as r→0r\to0 even if every retained token has ratio 1.

Step 5

A few large stages replace a thousand small refreshes, and stale data keep their value. Over 4096 updates, GRPO at μ=4\mu=4 refreshes its data and synchronizes weights 1024 times; μ-GRPO at μ=1024\mu=1024 does so four times. With few refreshes, the inference engine can run alone on the GPUs during generation, with more memory for generating in parallel. Two experiments on Qwen2.5-Math-7B separate staleness from the amount of data. With one fixed set of answers (8 per question on the whole training set) and only the batch size varied, the smallest batch, 32 questions per update and so μ=1259\mu=1259, gives the best average, 44.2% against 41.9% for 256 questions per update (μ=157\mu=157): more updates outweigh the higher staleness. With the number of updates fixed at 4096 and the number of stages varied, 8, 4 and 2 stages give 47.3%, 48.0% and 46.1%, and a single stage (μ=4096\mu=4096) gives 45.7%, so the data still need an occasional refresh.

Step 6

Results change little across reasonable settings, the veto acts rarely, and the wide interval also helps on fresh data. All on Qwen2.5-Math-7B (average accuracy): a trigger threshold τc\tau_c of 10−110^{-1}, 10−210^{-2}, 10−410^{-4} and 10−610^{-6} gives 45.2, 46.4, 48.0 and 47.6, so too large a threshold vetoes answers too early; an upper clip bound of 3, 5, 10 and none gives 47.3, 48.0, 47.8 and 43.6, so some upper bound is still needed. The veto scopes HκH_\kappa, SκS_\kappa and SseqS_{\rm seq} give 47.9, 47.6 and 48.0. The fraction of tokens vetoed is largest in the first stage (15.24% for this model, under 0.4% in later stages). Run at μ=4\mu=4, μ-GRPO's update rule gets 47.7% against GRPO's 47.3%, with the veto never triggering and the clipped fraction falling from 4×10−44\times10^{-4} to 8×10−78\times10^{-7}, which suggests that GRPO's usual interval is tighter than needed even on fresh data.

Step 7

The speedup carries over to code and to asynchronous training. On Qwen2.5-Coder-7B trained on code_contests and scored on a benchmark of recent competitive-programming problems scored by hidden tests; here pass@4, GRPO and μ-GRPO reach 39.3% and 38.6% from 8.2%, with training time cut from 98.9 to 45.7 hours (2.16 times). In a fully asynchronous setup, with generation and training on separate GPUs and samples allowed to lag up to 1024 updates behind, μ-GRPO keeps GRPO's accuracy on Qwen2.5-Math-7B (47.7% against 47.9%) and cuts training time from 22.3 to 17.4 hours, as the share of the trainer's time spent waiting for samples falls from 24.2% to 0.6%.

Limits. No seeds or error bars are reported, and the reported checkpoint is the best of those evaluated every 200 updates, chosen by its average on the same five test benchmarks. The models are 1.7B to 8B with 4k to 8k-token contexts on four GPUs, trained on one math dataset; whether a thousand updates of staleness is safe for larger models or longer answers is not tested. μ-GRPO is behind GRPO on the largest model, Qwen3-8B-Base, and within two points of a method for stale data (Zheng et al., 2025) that masks high-variance tokens until a batch-level second moment of the importance weights is below a threshold, 0.04 here, the closest earlier method, on every model, while faster than it (1.49 times on average). The 2.2-times speedup in the paper's opening figure is a time-to-accuracy ratio on DeepSeek-7B: the wall-clock time GRPO took to reach its best accuracy divided by the time μ-GRPO took to reach the same accuracy. That model's end-to-end training time fell only 1.21 times (61.9 to 51.3 hours, my computation from the paper's Table 1), and the abstract's "around 2×" speedup in training time is above the table's five-model average of 1.53.

Terms

Staleness μ\mu
optimizer updates per batch of sampled answers; GRPO usually 4, μ-GRPO 1024
Clipping dilemma
at high staleness [0.8, 1.2] stalls learning, [0, 5] learns then collapses
Lower clip bound
for A^i<0\hat A_i\lt0 it stops a token's push-down once ρi,t<1−ε\rho_{i,t}\lt1-\varepsilon; [0,5][0,5] removes that stop
Trigger token
A^i<0\hat A_i\lt0 and ρi,t<τc=10−4\rho_{i,t}\lt\tau_c=10^{-4}
Post-trigger suffix
tokens after the first trigger; their updates cause the collapse (HκH_\kappa masking is stable, TT is not)
Prefix ratio
ρi,<t=∏j<tρi,j\rho_{i,\lt t}=\prod_{j\lt t}\rho_{i,j}; a trigger makes it tiny for every later token
Negative-advantage veto
mi=0m_i=0 for a below-average answer with a trigger (scope SseqS_{\rm seq}), recomputed every update
Staged training
4 stages of 1024 updates: 4 weight syncs instead of 1024 over 4096 updates
Speed
generation 1.82× and end-to-end training 1.53× shorter (mean of per-model time ratios, five models)
Veto fraction
0.17% to 4.03% of tokens averaged over stages, by model; highest in the first stage for four of five models

Quiz

  1. Run at μ=4\mu=4, μ-GRPO's update rule gets 47.7% against GRPO's 47.3%, with the veto never triggering. What does this suggest?
  2. The paper's opening figure shows a 2.2-times speedup on DeepSeek-7B. How should that number be read?

Sources