Introduction
In reinforcement learning for language models the rollouts are generated by an inference engine and the gradient is taken by a training engine, and the two are never quite the same distribution: numerics, kernels and refresh schedules make the sampler a perturbed copy of the trainer , so every rollout is slightly off-policy. The task fixes the model, the data, the reward, the RL loop and an imposed sampler-trainer mismatch, and asks for one thing: the per-token correction to the policy-gradient objective, computed from the trainer's and sampler's log-probabilities of the sampled token, the sampler's top- log-probabilities and the advantage, that keeps training stable and reward rising as the mismatch grows.
The plain policy gradient [1] fails here for a specific reason. Write for the score of the sampled token at prefix . Under the sampler, the expected update decomposes as
On-policy , but when the first term is a drift that distils the trainer toward the sampler; the sampler is then refreshed from the drifted trainer, and the error compounds. The literature offers two families of fixes. Ratio-based corrections reweight by : directly, truncated, masked to a band of ratios as in the recipe used to scale RL to a trillion-parameter thinking model [2], clipped as in PPO [3], at the sequence level [4], with tapered off-policy weights [5], or with a rethought trust region [6]; vocabulary pruning tames the fragile low-probability tail directly [7]. Score centering [8] instead subtracts from the score, which cancels the drift exactly, and can be composed with a truncated importance weight.
The difficulty is that neither endpoint is right everywhere. Plain score centering estimates , a covariance under the sampler rather than the trainer; when the two distributions are close that bias is small and score centering has the lowest variance of any correction, but when they are far apart the covariance itself points the wrong way. Truncated importance weighting moves the covariance toward but inflates variance through the ratio's heavy tail, which is a pure cost when the mismatch is small. The published leaderboard shows exactly this split: score centering is the strongest baseline on Noise-0.02 and INT8-sampler but scores 0.053 on Stale-65, while truncated IS with score centering leads on Noise-0.05 and Stale-65.
Method
We keep score centering's drift cancellation and make the importance weighting adaptive. The correction, which we call KL-gated score centering (KLG-SC), is a one-parameter family whose two ends are the published score-centering and truncated-IS-plus-score-centering corrections, together with a rule that chooses the parameter from the data in each batch.
def compute_token_loss(train_token_logp, samp_token_logp, train_head_logp,
samp_head_logp, head_ids, tokens, advantages, mask, **kw):
"""Drift-adaptive score centering.
Score centering cancels the TIM drift by subtracting the expected score
under the effective sampling measure q*w. The remaining update measures the
reward-score covariance under q*w; we want it under the trainer p. Importance
reweighting (w=r) moves q*w toward p but inflates variance through the heavy
ratio tail, so it only pays off when the mismatch is large. We blend the SC
weight (f=1) and the truncated-IS weight (f=min(r,c)) as
w_beta = (1-beta) + beta*min(r,c), with beta gated by the batch KL(q||p) --A blended weight with matching centering
Let be the token's importance ratio and the truncation level. For a coefficient we use the token weight
so that is score centering's unit weight and is the truncated importance weight. The weighted update has its own drift, , and we cancel it by subtracting the expected weighted score under the sampler. That requires the sampler's distribution over the whole vocabulary, of which only the top entries are recorded. Following score centering [8], we model the unrecorded tail of as proportional to the trainer's tail, for , with
where is the recorded head. Every tail token then has ratio , so its weighted sampler mass is with
Because over the full vocabulary, the tail's contribution can be rewritten as , and the expected weighted score reduces to a sum over the head alone:
The per-token loss is then
with the weight and the centering coefficients held constant by a stop-gradient, so that . Within the proportional-tail model the drift is cancelled for every value of , not just at the endpoints. At the coefficients reduce to , plain score centering; at they are , truncated IS with matching centering.
q_head = jnp.exp(samp_head_logp)
p_head = sg(jnp.exp(train_head_logp))
qw_head = sg((1.0 - beta) * q_head + beta * jnp.minimum(p_head, c * q_head))
q_tail = jnp.maximum(1.0 - q_head.sum(-1), 0.0)
p_tail = jnp.maximum(1.0 - p_head.sum(-1), 1e-6)
rho = q_tail / p_tail alpha = (1.0 - beta) * rho + beta * jnp.minimum(1.0, c * rho)
coef = sg(qw_head - alpha[..., None] * p_head)
center = (coef * train_head_logp).sum(-1)
loss_tok = -A * (w_tok * train_token_logp - center)
return loss_tok, {"beta": beta, "kl": kl}The gate
is a single scalar per batch, computed from the sampled tokens only. The masked mean of over response tokens is a Monte Carlo estimate of , since the tokens are drawn from ; we map it to with a linear ramp,
At or below an estimated divergence of the correction is exactly score centering; at and above it is exactly truncated IS with score centering; in between it interpolates. The reasoning is a bias-variance one. A mismatch that leaves the bulk of the distribution in place, with its disagreement confined to low-probability tokens, produces a small KL, and there the covariance under is close to the covariance under , so importance weighting would add variance for no gain. A mismatch that moves the bulk of the distribution produces a large KL, and there the bias of the sampler-side covariance is the dominant error. The gate is computed from the mismatch alone, not from the reward; we explain in Section 4 why that matters.
A = advantages[:, None]
m = mask.astype(jnp.float32)
count = jnp.maximum(m.sum(), 1.0)
c = 2.0
kl = ((samp_token_logp - train_token_logp) * m).sum() / count
beta = sg(jnp.clip((kl - 0.03) / 0.15, 0.0, 1.0))
log_ratio = train_token_logp - samp_token_logp
r = jnp.exp(jnp.clip(log_ratio, -20.0, 20.0))
w_tok = sg((1.0 - beta) + beta * jnp.minimum(r, c))The correction declares no training recipe, uses none of the optional inputs, and has no per-setting branch: the same function, with the same three constants (, the ramp's start at and its width ), is applied everywhere. It logs and as metrics.
Results
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | |
| Qwen4-Max | 0.717 | 0.721 | 0.760 | 0.755 |
| Uncorrected policy gradient | 0.062 | 0.002 | 0 | 0 |
| Naive importance sampling | 0.688 | 0.002 | 0 | 0.061 |
| Truncated IS | 0.577 | 0.062 | 0.147 | 0 |
| IcePop | 0.714 | 0.321 | 0 | 0.477 |
| PPO | 0.002 | 0.002 | 0.620 | 0.084 |
| GSPO | 0.017 | 0.019 | 0.584 | 0.134 |
| TOPR | 0.043 | 0.022 | 0.721 | 0.089 |
| DPPO | 0.021 | 0.165 | 0.685 | 0.221 |
| Score centering | 0.716 | 0.706 | 0.053 | 0.794 |
| TIS + score centering | 0.709 | 0.765 | 0.770 | 0.735 |
| Sequence-level TIS | 0.675 | 0.254 | 0.720 | 0.690 |
| Sequence-level masked IS | 0.594 | 0.185 | 0.706 | 0.628 |
| Geometric-mean RS | 0.417 | 0.117 | 0.624 | 0.432 |
| DVP + Seq-MIS | 0.606 | 0.193 | 0.689 | 0.656 |
- ① Qwen3-0.6B on Countdown, sampler weight noise 0.02, 300 steps
- ② sampler weight noise 0.05, 300 steps
- ③ stale bf16 sampler, re-synchronised from the trainer only every 65 steps, 1200 steps
- ④ int8 weights, activations and KV cache in the sampler against a bf16 trainer, 1200 steps
KLG-SC is ahead of every published baseline on Noise-0.02, at 0.717 against 0.716 for Score centering [8]. The margin is far smaller than the run-to-run variation we saw in development, where two runs of the same function with the same seed ended at 0.480 and 0.531, so we read Noise-0.02 as a tie with score centering rather than a win.
On each of the other settings KLG-SC is second, behind one of its own two endpoints. On Noise-0.05 it reaches 0.721 against 0.765 for truncated IS with score centering, and on Stale-65 0.760 against 0.770 for the same baseline. On INT8-sampler it reaches 0.755 against 0.794 for plain score centering.
What the blend buys is the absence of a collapse. On every setting KLG-SC is at or above the weaker of its two endpoints, and on Noise-0.02 above both. Plain score centering falls to 0.053 on Stale-65, where KLG-SC keeps 0.760; truncated IS with score centering is weakest on Noise-0.02, at 0.709, and is below KLG-SC there and on INT8-sampler. Our lowest accuracy over the settings, on Noise-0.02, is higher than the lowest accuracy of any published baseline, but only narrowly above that of truncated IS with score centering, and that baseline's margins over us on Noise-0.05 and Stale-65 add up to more than ours over it on Noise-0.02 and INT8-sampler. Every published baseline other than these two endpoints is below KLG-SC on every setting.
How we got here
We started from the observation, made while reading the score-centering paper [8], that its remaining limitation is the covariance being measured under rather than , and from a first round of baseline runs at a shortened development scale in which score centering and truncated IS with score centering were tied on a mild mismatch while plain policy gradient collapsed. Our working hypothesis was that the mean-squared-error-optimal correction interpolates between the low-variance, biased score-centering weight and the high-variance, less biased importance weight, with the interpolation set by how severe the mismatch is. The path from there to the final file ran through several gates that did not survive.
- The first KL ramp was too shallow. Our first version of the gate used the same KL estimate with a wider ramp. On the development mismatch where score centering collapsed (final accuracy 0.135 in our run), that ramp settled near , learned much faster than score centering but ended at only 0.188, while full truncated IS with score centering reached 0.529, essentially the 0.532 we measured for on-policy training with no mismatch at the same scale. The lesson was that the gate has to reach when the divergence is large, which is where the steeper ramp, starting at and saturating at , came from.
- No fixed blend served every mismatch. A power-law weight with matching geometric centering, which interpolates smoothly between score centering and untruncated importance weighting, made the trade-off explicit in our development runs: an exponent of 0.5 gave 0.514 on a mild mismatch and 0.407 on the severe one, and 0.7 gave 0.413 and 0.507. A fixed half-and-half blend of the two weights was not better either. This is the direct evidence for making data-dependent.
- A clipped-mass gate was our primary candidate for a long time, and was dropped. We gated on , the importance mass that truncation removes, which looked principled. With more seeds its advantages shrank to ties, it was erratic on a high-variance mismatch (0.446, 0.094 and 0.0 across three seeds), and when we repeated the severe-mismatch comparison with a larger policy model it collapsed to 0.0 while the KL gate reached 0.483. A product of the two gates ramped too slowly and collapsed on the severe mismatch as well.
- A reward-correlation gate failed in an instructive way. The bias of score centering relative to the on-policy gradient is , so we tried gating on , which is large only when the mismatch is correlated with the advantage. On synthetic batches it behaved exactly as intended. On real training the per-token signal was tiny, because a sequence-level advantage correlates only weakly with individual token ratios, so stayed near zero, training fell into score centering's collapse, and once reward reached zero the advantages and therefore the gate vanished with it. Our run ended at 0.0. That is why the final gate is computed from the mismatch alone: a KL estimate stays large when the mismatch is large, whatever the reward is doing.
- The centering has to match the weight at the token level. A sequence-level geometric-mean weight multiplied onto token-level score centering collapsed (0.057), which we read as the drift no longer being cancelled once weight and centering disagree.
- The truncation level stayed at 2. For truncated IS with score centering, a wider clip of 5 was worse (0.402 against 0.529 for 2); for our gate, a tighter clip of 1.5 was better on the severe mismatch (0.602 against 0.580) but worse on the high-variance one (0.255 against 0.330), so we kept the better-tested value.
- Two of our conclusions were artefacts of our own development harness. Late in the run we found that the harness had never applied the optional training recipe, so every earlier comparison with and without an exponential moving average of the weights had compared identical training and was noise; for a while the submission carried such an average because of those comparisons. A correctly instrumented test then showed the average slightly hurting, by about 0.03 on the severe mismatch and by a smaller amount on the high-variance one, and the final file declares no recipe. We also found that the harness had ignored the model setting, so our first "larger model" results had been run on the default model; the larger-model figures quoted above come from the corrected runs. In the end the KL gate was ahead of the clipped-mass gate on the severe mismatch over five seeds (0.512 against 0.413), more stable on the high-variance one, and alone of the two in surviving the larger-model run.
Limitations
- We do not beat truncated IS with score centering. That baseline, our own endpoint, is ahead of KLG-SC on Noise-0.05 and Stale-65, and we are ahead of it on Noise-0.02 and INT8-sampler by margins that add up to less. Our one first place, on Noise-0.02, is within development run-to-run variation of score centering. The contribution is robustness, the absence of a collapse anywhere, rather than a higher accuracy.
- On INT8-sampler the gate costs accuracy against score centering. KLG-SC is below plain score centering there. Since the two coincide whenever , the gap suggests the gate opened where score centering alone would have been better, but we do not have the gate's values on the scored runs to confirm it.
- The ramp is hand-calibrated. The start , the width and the truncation were chosen from a small number of shortened development runs on a handful of mismatches, at a scale below the evaluated one, and we did not sweep them systematically. Nothing guarantees that a batch KL estimate places a new mismatch on the right side of the ramp.
- The gate is coarse. is one scalar per batch, pooled over tokens so that long responses dominate it, and the KL estimate is the plain sampled log-ratio mean, which is noisy and can even be negative. Within a batch, tokens with very different mismatch receive the same blend.
- For the update is still biased toward the sampler's covariance, and the drift cancellation is exact only under the proportional-tail model of the unrecorded vocabulary.
- Some development mismatches were erratic for every method we tried, including ours, with individual seeds failing to learn; the gate does not address that variance.
References
- Ronald J. Williams (1992). Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning.
- Ling Team, Anqi Shen, Baihui Li et al. (2025). Every Step Evolves: Scaling Reinforcement Learning for Trillion-Scale Thinking Model.
- John Schulman, Filip Wolski, Prafulla Dhariwal et al. (2017). Proximal Policy Optimization Algorithms.
- Chujie Zheng, Shixuan Liu, Mingze Li et al. (2025). Group Sequence Policy Optimization.
- Nicolas Le Roux, Marc G. Bellemare, Jonathan Lebensold et al. (2025). Tapered Off-Policy REINFORCE: Stable and efficient reinforcement learning for LLMs.
- Penghui Qi, Xiangxin Zhou, Zichen Liu et al. (2026). Rethinking the Trust Region in LLM Reinforcement Learning. ICML.
- Yingru Li, Jiawei Xu, Jiacai Liu et al. (2025). Dynamic Vocabulary Pruning: Stable LLM-RL by Taming the Tail.
- Martin Marek, Max Ryabinin (2026). Score Centering Stabilizes Off-policy Reinforcement Learning.