Introduction
In reinforcement learning for language models the rollouts are generated by an inference engine and the gradient is computed by a training engine. The two share parameters but not numerics, so the sampler's distribution and the trainer's differ at every position, and every rollout is slightly off-policy. The question this task asks is narrow and hard: with the model, data, reward, training loop and an imposed sampler-trainer mismatch all fixed, what 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, keeps training stable and reward rising as the mismatch grows?
The uncorrected policy gradient [1] treats sampler tokens as if the trainer had drawn them. That is not merely noisy: at a prefix, the expected score under the sampler, , is not zero, so the update contains a term proportional to the mean advantage times , a drift that distils the trainer toward the sampler whether or not any token was rewarded. The field's answers fall into two groups.
Reweight the tokens. Importance sampling with cancels the drift exactly, since , but its variance grows with the mismatch. Clipped and truncated ratios bound that variance at the price of reintroducing bias, as in PPO [2]; masking tokens whose ratio leaves a band discards them instead, a remedy used when scaling RL to a very large thinking model [3]; tapering the importance ratio is another compromise [4]; sequence-level ratios move the correction to whole responses [5]; and the trust region can be rethought for this regime directly [6]. Pruning the vocabulary tail, where the sampler's and the trainer's log-probabilities disagree most, attacks the mismatch at its source [7].
Centre the score. Score centering subtracts the sampler's expected score from each token's score, so the update becomes a covariance between reward and score under the sampler and the drift is gone without any weight at all [8]. Centering and truncated IS can also be composed by centering the weighted score.
Neither repair is complete on its own. Centering cancels the drift but has no brake: when the trainer moves far from the sampler, nothing stops the update from following the sampler's tokens. Ratios supply that brake but carry their variance and their bias with them. Our method keeps the centering and asks what weight should be centred.
Method
We call the method centered shrinkage importance sampling (CSIS). It has three parts: a shrinkage weight in place of the importance ratio, a score-centering term that is exact for that weight up to a model of the vocabulary tail, and two training-recipe choices.
A shrinkage weight instead of the ratio
For a token at some position, write for the trainer's probability and for the sampler's. Instead of we use
Where the sampler is confident, , this is the ordinary ratio; where the sampler barely proposed the token, , the denominator is held up by and the weight stays near instead of exploding. We arrived at this shape from a squared-bias-plus-variance argument for the centred per-position estimator, whose optimum is a weight of the form ; we treat the shrinkage constant as a single tuned per position.
The property that matters most is the effective mass the sampler gives a token in the update,
It vanishes as : a token the trainer has abandoned no longer pulls on the update however often the sampler emits it, which is the brake that score centering alone lacks. And it vanishes as : tokens in the sampler's noisy tail are suppressed. The hard cap at 2 bounds any single token's coefficient, so no one token can produce a gradient spike.
is not a fixed number. The scale at which a probability counts as "small" depends on how peaked the trainer is, so we tie to the trainer's typical token probability , with the entropy of at that position:
clipped to a fixed interval whose lower end is 0.002. If the harness does not provide the entropy, falls back to 0.01.
p_tok = jnp.exp(sg(train_token_logp))
q_tok = jnp.exp(samp_token_logp)
p_head = sg(jnp.exp(train_head_logp))
q_head = jnp.exp(samp_head_logp)
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 = jnp.clip(q_tail / p_tail, 1e-3, 1e3)
w_tok = sg(jnp.minimum(p_tok / (q_tok + lam), CAP))
w_head = jnp.minimum(p_head / (q_head + lam[..., None]), CAP)Centering the weighted score
The weight alone is not enough: any weight not proportional to the exact ratio leaves a drift term behind. We therefore subtract the expected weighted score under the sampler, with . At a fixed prefix the update direction for a sampled token with advantage is then
so the term proportional to the mean advantage cancels for any choice of , and what remains is the covariance between the reward and the weighted score.
is a sum over the whole vocabulary, and we only see the sampler's top-K head. We split it into the head and a modelled tail. For the tail we assume that the sampler's tail probabilities are a constant multiple of the trainer's, with the ratio of the two tail masses, and that every tail token gets the same weight , which we evaluate at a representative tail probability , the smallest trainer probability in the head:
Because the score has zero mean under the trainer, , and the tail part of becomes with , clipped to . The centering term is therefore a sum over the head alone, with coefficients
itself is clipped to and the trainer's tail mass is floored at . In code, the weights and the coefficients are constants (stop-gradient), and the per-token loss is
whose negative gradient is exactly .
pbar = jnp.min(p_head, axis=-1)
w_tail = jnp.minimum(pbar / (rho * pbar + lam), CAP)
alpha = sg(jnp.clip(rho * w_tail, 0.0, 4.0))
coef = sg(q_head * w_head - alpha[..., None] * p_head)
center = (coef * train_head_logp).sum(-1)
loss_tok = -A * (w_tok * train_token_logp - center)Two recipe choices
The task lets a submission set a small training recipe alongside the correction. We set two entries: an exponential moving average of the weights with decay 0.99, which is the policy that is reported, and a sampling temperature of 1.15, which compresses the log-ratios between the two engines and so shrinks the mismatch the correction has to absorb. The step counters the harness offers are declared in the signature but not used.
RECIPE = {'ema': 0.99, 'temperature': 1.15}
def compute_token_loss(train_token_logp, samp_token_logp, train_head_logp,
samp_head_logp, head_ids, tokens, advantages, mask,
train_entropy=None, step=None, total_steps=None):The starter file computed the uncorrected policy gradient, , and declared no recipe. Everything above replaces it; the method has no per-setting constants and no branch on the setting.
Results
| Method | ① | ② | ③ | ④ |
|---|---|---|---|---|
| Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | Countdown accuracy ↑ | |
| Muse Wonder Full | 0.702 | 0.658 | 0.738 | 0.779 |
| 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
CSIS reaches an accuracy of 0.702 on Noise-0.02, 0.658 on Noise-0.05, 0.738 on Stale-65 and 0.779 on INT8-sampler. It is not the best method on any setting. The strongest baseline is Score centering [8] on Noise-0.02 (0.716) and on INT8-sampler (0.794), and TIS + SC [8] on Noise-0.05 (0.765) and on Stale-65 (0.770).
What CSIS does show is the absence of collapse. Most corrections in the table fail badly somewhere: score centering alone, the strongest method on two of the settings, falls to 0.053 on Stale-65; IcePop's masked IS reaches 0.000 there; sequence-level TIS drops to 0.254 on Noise-0.05. CSIS and truncated IS plus score centering are the only two methods in the table that never fall below our lowest accuracy, 0.658 on Noise-0.05; every other method drops below it somewhere. Between those two, the baseline is ahead on Noise-0.02 (0.709 against our 0.702), Noise-0.05 (0.765 against 0.658) and Stale-65 (0.770 against 0.738), and CSIS is ahead on INT8-sampler (0.779 against 0.735).
Against score centering alone, the closest relative of our centering term, CSIS is behind on Noise-0.02, Noise-0.05 and INT8-sampler, and far ahead on Stale-65, where centering without a weight collapses. That is the trade the weight was meant to make: it gives up a little where unweighted centering already works and keeps training alive where it does not.
How we got here
We began from the theory of score centering [8], read in full: centering cancels the drift, importance weights correct the distribution under which the reward-score covariance is measured, and the two can be composed by centering the weighted score. That framing fixed the structure early; the rest of the work was a search for the weight to centre.
- Diagnostics first. Before settling on a weight we measured the mismatch on our local development configurations. On one configuration per-token log-ratios were tame, but sequence-level ratios were hopeless: the standard deviation of the summed log-ratio over a response was about 11, which ruled out trajectory-level importance weights. The sampler's top-K head carried at least 0.9966 of the probability mass everywhere we looked, so the tail model in the centering term has little mass to get wrong. The token-level correlation between advantage and log-ratio was about 0.016 at most, too weak to serve as a detector of how far off-policy the batch was.
- A synthetic estimator study chose the weight family. We computed, in closed form, the bias and variance of the centred estimator for more than a dozen candidate weights under two synthetic mismatch models. The first, raw mean-squared error was swamped by variance; a scale-invariant version (squared bias after the best global rescaling, plus variance divided by a batch size) favoured the family at the smaller batch size, with between 0.01 and 0.03, while truncation at 2 was mediocre and unweighted centering showed large bias under one of the models. We set up the same analysis on token-level dumps from real development runs and recorded that it agreed.
- Screening the baselines. We screened three baselines in development. The uncorrected gradient failed on every configuration we tried; score centering learned fastest where it survived but over-sharpened the policy and died on our hardest configuration; truncated IS plus score centering was the only one of the three alive on all of them. We installed it as a placeholder submission while candidates ran.
- A weight whose mass does not vanish has no brake. The symmetric variant scored best in the synthetic study at the larger batch size, but in development it collapsed to an accuracy of 0.000 on our hardest development configuration. Its effective mass does not go to zero as . That failure is why the final weight has no in its numerator.
- The cap was found by a crash. An early uncapped run of the family died from a single step whose gradient norm was 9.0 against a typical 0.5; with a token's weight can reach . We added the cap at 2 and tightened the tail coefficient's clip to 4, and the repaired variant trained normally on the configuration where the uncapped one had died.
- Abandoned brakes. A soft trust-region gate on the ratio and a constant entropy bonus both drove the policy's entropy to explosion. A global step scale keyed to the measured trainer-sampler divergence looked healthy at first, but it couples the step size to whatever drives the divergence: in our runs it released the brake exactly when the gradient was largest and then choked the recovery, and it killed two independent development runs. A variant that tapered only negative-advantage tokens by the same divergence shared the coupling and was dropped with it. Two optimizer minibatches per step hurt on the hardest configuration, and a step scale of 1.5 learned faster but over-sharpened without a net gain.
- A second family, kept in reserve. We also tried the interpolated weight and a harmonic weight . In our development runs the leading families were within the noise of one another; we carried the capped weight forward to the final, longer comparison.
- Why the weights are averaged. On one configuration the raw final iterate of the capped weight was caught in a transient dip at the end of training (0.258), while the same method with weight averaging at decay 0.99 ended at 0.461 on a smooth curve. A decay of 0.995 lagged too much over the runs we could afford (0.367 against 0.537 for the raw iterate on another configuration). Temperature 1.15 was neutral to slightly positive in development and was kept.
- The deciding run. In runs twice as long as our screening runs, on our hardest development configuration, the capped weight with both recipe entries reached 0.551 and the same without the temperature 0.541, while truncated IS plus score centering peaked at 0.514 and ended at 0.242. We installed that method.
- Entropy-relative . We then replaced the constant by the entropy-relative form for generality across entropy regimes. Locally the two are nearly identical: the mean in the confirmation runs was between 0.0116 and 0.0123, and the relative form scored 0.467 on the same configuration against 0.461 for the constant- weight with averaging alone. Confirmation runs of the exact submitted file ended at 0.496 and 0.539 on two configurations, and shorter runs under mild mismatch and with no mismatch at all showed no pathology from the shrinkage, the temperature or the averaging.
All figures in this section are our own development measurements on a small local configuration of our own, mostly from single runs; most of the distinctions between our leading candidates were within the noise of those runs.
Limitations
- CSIS does not beat the strongest baseline anywhere. Truncated IS plus score centering is ahead of it on Noise-0.02, Noise-0.05 and Stale-65, and score centering alone is ahead of it on Noise-0.02, Noise-0.05 and INT8-sampler. Our contribution, as measured, is robustness, not peak accuracy.
- The development evidence did not transfer. The method was chosen on one long development run in which truncated IS plus score centering degraded and ours did not. In the evaluated means that baseline is the strongest method on Noise-0.05 and Stale-65, so whatever degraded it in our development runs did not show here, and the margin that decided our design is absent from the results.
- The tail model is an approximation. The centering term is exact only if the sampler's tail is a constant multiple of the trainer's and every tail token receives the same weight, evaluated at the smallest head probability. With the head carrying nearly all the mass this mattered little in development, but it is not exact.
- The constants are hand-set. The shrinkage scale 0.015, the cap at 2, the tail-coefficient clip at 4, the averaging decay 0.99 and the temperature 1.15 were set by hand and tested only in single development runs at small scale, not derived; the entropy-relative was adopted for a regime we never tested, since locally it was indistinguishable from a constant.
- The recipe and the correction are confounded. Weight averaging and the sampling temperature act on every setting together with the weight, and the evaluated results do not separate their contributions from that of the correction itself.
- We used part of the interface. The optional full-vocabulary terms and the step counters were not used, so nothing in CSIS looks beyond the sampler's top-K head or adapts over training.
References
- Ronald J. Williams (1992). Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning.
- John Schulman, Filip Wolski, Prafulla Dhariwal et al. (2017). Proximal Policy Optimization Algorithms.
- Ling Team, Anqi Shen, Baihui Li et al. (2025). Every Step Evolves: Scaling Reinforcement Learning for Trillion-Scale Thinking Model.
- 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.