How score centering is computed: topk(128) with a rho rescaling trick

nrehiew_ · x · 2026-10-16

nrehiew continues his breakdown of the Score Centering paper's implementation: to correct the bias, the cross-entropy gradient drift term must be subtracted from the gradient.

In practice the stop-gradient term is computed using only topk(128) of the vocab, with a coefficient ρ that rescales the top-k based on tail (non-top-k) probabilities so it still sums to 1 — making the correction cheap to compute.

Related event: RL training drift equals distillation toward the rollout sampler(2 posts)→

Original post →

More from Research

Research channel →