Introduction
In reinforcement learning for language models, the rollouts come from an inference engine and the gradient is computed by a training engine, and the two are never quite the same model. Precision, kernels and the timing of weight refreshes all make the sampler's distribution differ from the trainer's , so every rollout is slightly off-policy. The task fixes the model, the data, the reward and the RL loop, imposes a mismatch, and asks for the per-token correction to the policy-gradient objective, computed from the trainer's and the sampler's log-probabilities, the sampler's top-K log-probabilities and the advantage, that keeps training stable and reward rising.
Ignoring the mismatch is not an option. The uncorrected policy gradient [1] reaches 0.063 on Noise-0.02 and 0.002 on Noise-0.05. The field's responses fall into a few families. Importance weights fix the bias in principle but have heavy tails, so they are truncated, masked to a band [2], clipped as in PPO [3], tapered [4], moved to the sequence level [5], replaced by a rethought trust region [6], or computed over a pruned vocabulary [7]. Score centering [8] takes a different route: it subtracts the expectation of the score under the sampler, so that a constant reward produces no update at all.
What makes the problem hard is that the mismatch is not one thing. A numerical perturbation (noise, reduced precision) changes every logit a little and does not grow with training. A lagging sampler is different: the trainer takes many steps on data from fixed weights, and the divergence between them grows with every step it takes. A correction tuned against the first regime is too permissive in the second, and a restoring force strong enough for the second pulls the trainer toward a noisy sampler in the first. The published baselines show the tension: on this task's leaderboard none of the uncorrected, PPO-type or tapered methods is strong on every setting, and plain score centering reaches 0.794 on INT8-sampler but 0.053 on Stale-65.
Method
Our method, EKD (excess-divergence damping), keeps a drift-free base update and adds a single batch-level scalar that measures how far the trainer has travelled from the sampler, as opposed to how different the two engines are numerically.
The base: centred truncated importance sampling
Write for the sampled token at position , for the truncated importance weight of token with , and for the sampler's top-K head at that position. The tail outside the head is modelled as proportional to the trainer, with , which gives tail weights . The truncated-IS score is centred by its exact expectation under the sampler, head exact and tail modelled:
where the tail's contribution follows because the probabilities sum to one. The per-token loss before damping is
with all coefficients behind a stop-gradient. This is the form of the truncated IS plus score centering baseline [8]; in our development runs its gradient was identical to that baseline's. We chose it over plain score centering for a reason we give in Section 4: the weights are what make the update depend on the trainer's own distribution.
m = mask.astype(jnp.float32)
count = jnp.maximum(m.sum(), 1.0)
A = sg(advantages)[:, None]
lq_h, lp_h = samp_head_logp, sg(train_head_logp)
q_h, p_h = jnp.exp(lq_h), jnp.exp(lp_h)
q_tail = jnp.maximum(1.0 - q_h.sum(-1), 0.0)
p_tail = jnp.maximum(1.0 - p_h.sum(-1), 1e-6)
rho = q_tail / p_tail # modelled tail: q_v = rho * p_v
ell = jnp.clip(lp_h - lq_h, -20.0, 20.0) # log p/q on the head
# 1. centred truncated importance sampling
w_tok = jnp.minimum(jnp.exp(jnp.clip(sg(train_token_logp) - samp_token_logp, -20.0, 20.0)), _CAP)
qw_h = jnp.exp(jnp.minimum(lp_h, lq_h + jnp.log(_CAP))) # q_v * min(p_v / q_v, CAP)
alpha = jnp.minimum(1.0, _CAP * rho) # rho * min(1 / rho, CAP)
coef = sg(qw_h - alpha[..., None] * p_h)
center = (coef * train_head_logp).sum(-1)
loss_tok = -A * (w_tok * train_token_logp - center)Measuring divergence the trainer created itself
The question the damping asks is how far the trainer has run from the sampler that produced the data. The raw divergence cannot answer it, because a numerical perturbation also produces divergence. If the mismatch were isotropic logit noise of variance , a second-order expansion gives
We estimate at each position as the variance of over the low-probability half of the sampler's head (the entries at or below the median of ), where nothing much is being learned, so systematic movement the trainer has made on the tokens it is training does not leak into the noise estimate. The measured per-position divergence, head exact plus the modelled tail , is compared with that prediction. Both are winsorised at 1 nat per position so that a few shared positions cannot dominate, and the batch statistic is the masked mean of the difference, floored at zero:
2. How far has the trainer run from the sampler that produced the data, as
opposed to merely being numerically different from it? Numerical
mismatch (noise, quantisation) perturbs all logits alike, and white logit
noise of variance s2 gives KL(q||p) = s2 (1 - sum_v q_v^2) / 2. s2 is
read off the low-probability half of the sampler's top-K head, where
nothing is being learned, so the batch-mean KL in EXCESS of the white
prediction is divergence the trainer created itself (per-position values
winsorised so that a few shared positions cannot dominate). Measured: it # 2. white-noise scale from the low-probability half of the head, and the excess KL
deep = (lq_h <= jnp.median(lq_h, axis=-1, keepdims=True)).astype(jnp.float32)
n_deep = jnp.maximum(deep.sum(-1), 1.0)
mu = (ell * deep).sum(-1) / n_deep
var = (jnp.square(ell - mu[..., None]) * deep).sum(-1) / n_deep
kl = (q_h * -ell).sum(-1) + q_tail * jnp.log(jnp.maximum(rho, 1e-9))
kl_white = 0.5 * var * jnp.maximum(1.0 - jnp.square(q_h).sum(-1), 0.0)
excess = jnp.maximum(((jnp.minimum(kl, _KL_CAP) - jnp.minimum(kl_white, _KL_CAP)) * m).sum() / count, 0.0)Damping the whole step
The loss is scaled by one positive number per batch,
where is the divergence (in nats per token) at which the step has shrunk by , and is a floor on how far it may shrink. Because is a positive scalar it cannot introduce drift or change the direction of the centred update; it only shortens it. Under a purely numerical mismatch , , and the update is essentially the centred truncated-IS update.
Under a lagging sampler the damping becomes a step-size schedule without any state. If the excess grows at a rate proportional to the step actually taken, , then with , and
a Robbins–Monro schedule inside every window between refreshes. Late steps in a window then average the evidence the window contains instead of random-walking away from the data, so the trainer is in good shape at the moment it is refreshed or evaluated. Finally, the evaluated policy is an exponential moving average of the trained weights with decay 0.9: under mismatch single iterates flip between behaviours from step to step, and their average does not.
# 3. damping
damp = sg(jnp.maximum(jnp.exp(-excess / _DELTA), _FLOOR))
return damp * loss_tok, {"damp": damp, "excess_kl": excess,
"kl_qp": (kl * m).sum() / count,
"w_mean": (w_tok * m).sum() / count}
RECIPE = {"ema": 0.9} purely numerical mismatch the factor stays ~1 and the update is exactly
the centred truncated-IS update. Being a
positive scalar per batch it cannot introduce drift or change the
direction of the centred update; the floor bounds the slow-down should a
mismatch ever look structured without being lag.
The evaluated policy is an EMA of the trained weights (RECIPE): single
iterates under mismatch flip between behaviours from step to step, their
average does not.EKD has no branch on the kind of mismatch and no per-setting constants: the same statistic decides, batch by batch, whether the trainer has moved.
Results
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | |
| Claude Fable 5.2 | 0.736 | 0.740 | 0.740 | 0.683 |
| 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
On Noise-0.02 EKD is ahead of every published baseline, with an accuracy of 0.736 against 0.716 for the strongest one, Score centering [8]. On Noise-0.05 and Stale-65 it is second, behind truncated IS with score centering: 0.740 against 0.765 on Noise-0.05 and 0.740 against 0.770 on Stale-65. On INT8-sampler it reaches 0.683, behind three baselines: score centering (0.794), truncated IS with score centering (0.735) and sequence-level truncated IS (0.690).
The comparison that matters most for our claim is with truncated IS plus score centering, because that is our base update: EKD changes it only by the damping factor and the averaged evaluation policy. Against that baseline EKD is ahead on Noise-0.02 (0.709) and behind on Noise-0.05, Stale-65 and INT8-sampler. The measured means therefore do not show that the damping improves on its base; they show that it does not break it. Unlike most of the published baselines, EKD has no setting on which it collapses: its lowest per-setting mean is 0.683, while score centering falls to 0.053 on Stale-65 and IcePop-style masked IS to 0.000 there.
How we got here
We began with a literature survey and an initial comparison of reference corrections, and the method was narrowed by failures from there. Every development number below is from our own development runs, which used far fewer samples per evaluation than one would like; we treated a single difference of about 0.06 in accuracy as noise.
- Score centering never looks at the trainer. In logit space the score-centred update is : it saturates only when the sampler is confident. In one development run with a numerical perturbation, score centering reached a training reward of 0.49 on the sampler while the raw trainer it produced scored 0.025, rambling to the length limit; an average of its weights scored 0.535 on the same trajectory. The trainer had been over-sharpened until it and the sampler disagreed confidently. Truncated weights tie the update to , which is why our base is centred truncated IS rather than plain centering, and the same run showed the value of evaluating an average of the weights.
- Under lag, an anchor to the sampler helped, and then could not be kept. Our first candidate combined excess-gated, tempered importance weights with a gated reverse-KL pull toward the sampler, an idea taken from work on regularised score centering (not in our reference list). Evaluated after one window of lag, it scored 0.385, against 0.320 without the anchor, 0.298 for score centering and 0.292 for centred truncated IS. But every such restoring force we tried, four versions in all, including hinge-type guards at positions where the sampler is confident, became a drift loop under numerical mismatch: at initialisation the perturbed sampler's confident mode can be the bad one, and a pull toward it slows or prevents the escape. We worked out why the anchor had helped: uniform averaging of a window's gradients has the stateless recursion , a step plus a pull toward the refresh point, and the anchor was approximating the pull. A drift-free method can only implement the first half. The damping is that half.
- Tapers on the importance weight failed in both directions. A sign-split centred taper scored below score centering after one window (0.255), which we traced to a centring leak. A symmetric log-odds taper with no threshold destroyed the signal under numerical noise: its projection on the clean on-policy gradient was 0.007 against 0.076 for score centering. With a soft threshold at two noise standard deviations it recovered (0.071), but under lag the band inflated with the spread of the divergence and lost control. Thresholded truncated-IS variants also fell into the short-answer mode early in two development runs, against none in six runs of unthresholded truncated-IS variants under the same perturbation.
- Smaller ideas that did not pay. Visitation normalisation of tokens with shared prefixes, survival-type and energy-weighted baselines, self-normalised truncated IS (it moved too far from the sampler and collapsed under lag) and a higher sampling temperature were all tried and dropped.
- The damping was adopted because it did no harm where it was not needed. Our interim submission was the truncated IS plus score centering reference with the averaged evaluation policy. We replaced it with the damped version once early runs showed the factor staying near 1 under numerical mismatch, so that the update there was the base update, while the windows under lag stayed healthy. A tally we made later over runs of the final method confirmed it: under numerical mismatch the factor averaged 0.977 with median 1.000, and it decreased as the lag grew, from a mean of 0.82 at the shortest lags we tried to 0.51 at the longest. The floor never bound in a healthy run. A last change clipped the head log-ratio to , which left the loss unchanged on the batches we checked and keeps every edge case finite.
- Development evidence under lag. At the lag we tested most, final accuracies of the damped method averaged about 0.456 over seeds, against about 0.38 for the same base with the averaged policy but no damping. The trainer ended each window about 40% closer to its sampler (median divergence 0.13 against 0.22 nats per token), and the per-window sampler reward was not slower: equal after one window (0.298 against 0.295) and ahead after two (0.410 against 0.307). Fitting the logged factor to over 16 windows gave between 18 and 46 steps, close to the value the derivation predicts, with no constant refitted.
- One ablation of our own statistic. Reading the noise scale from the lowest quarter, half or three quarters of the head changed the readings little; reading it from the whole head let the lag signal leak into the noise estimate and lost most of it. Restricting to the low-probability part is necessary, but the fraction is not a sensitive constant.
- What we could not fix. One of ten development runs at the lag we tested most collapsed to an accuracy of 0.0. The trainer flipped to a short-answer mode inside a window, which the lagging sampler's data could not show; at the next refresh the batch had far fewer tokens and the step was five to ten times its normal size. The baseline without damping had two bad runs in six, one of which collapsed the same way. The batch statistic did not foretell the flip: the divergence that matters sits at the shared first response positions, which a winsorised batch mean barely sees. A per-trajectory step guard was considered and not adopted, and we ran out of time to test a step normalisation applied only when a refresh reveals a length collapse.
Limitations
- The damping does not beat its own base on the measured means. EKD is ahead of truncated IS with score centering only on Noise-0.02, and behind it on Noise-0.05, Stale-65 and INT8-sampler. On INT8-sampler three baselines are ahead of it. The gains we saw in development under lag do not show up as a margin over the base on the leaderboard.
- Blind to first-token flips. The statistic is a winsorised batch mean, so a large divergence at a few shared positions is invisible to it. That is the path of the one collapse we observed in development, and the damping lowers its frequency without detecting it.
- The noise model is idealised. The prediction assumes isotropic logit noise. A relative perturbation of the weights produces logit noise that scales with the logits, so as the policy sharpens the mismatch stops being white, and part of it may be read as self-made divergence; under one numerical perturbation the factor started at 0.86 to 0.93 before settling near 1.
- Constants set on few runs. , the floor of , the winsorisation at 1 nat and the truncation were chosen from a small number of development runs, each with a noisy evaluation; we did not sweep them.
- The averaged evaluation policy carries part of the effect. In development, averaging the weights helped by a modest amount on average and mattered most when a raw iterate had flipped; we did not separate its contribution from the damping's on the measured settings.
- We used part of the interface. We did not use the optional full-vocabulary terms, the entropy input or the step counter, and the damping keeps no state between steps.
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.
- Nicolas Le Roux, Marc G. Bellemare, Jonathan Lebensold et al. (2025). Tapered Off-Policy REINFORCE: Stable and efficient reinforcement learning for LLMs.
- Chujie Zheng, Shixuan Liu, Mingze Li et al. (2025). Group Sequence Policy Optimization.
- 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.