Research ·
Sampler Replay: Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards
A new paper reframes RLVR's train-inference mismatch by proposing Sampler Replay, which replays the sampler's hidden states, logits and routing in the trainer's forward pass, and proves Score Centering is a special case of it.

A Hugging Face paper called Sampler Replay: Train The Sampler Not The Trainer addresses train-inference mismatch (TIM), a known problem that degrades reinforcement learning with verifiable rewards (RLVR). Existing algorithms treat TIM as training a trainer policy with off-policy samples from an imperfect sampler optimized for efficiency, and compensate for the resulting gradient discrepancy. The authors instead argue that the sampler's test-time performance is what matters, so the sampler should be the thing being trained, with the trainer serving only as a mechanism to approximate the sampler's gradient.
The proposed algorithm, Sampler Replay, replays the sampler's hidden states, logits, and routing decisions inside the trainer's forward pass, so the trainer's backward pass approximates the sampler's gradient. The authors show it stabilizes training under severe mismatch induced by quantization of weights, activations and KV cache, weight perturbation, and staleness, across tasks and model scales, outperforming strong baselines including Score Centering (SC) and SC+TIS. They also prove mathematically that Score Centering is a special case of Sampler Replay where only the logits are replayed, meaning several widely used TIM techniques are unified under one framework.
For anyone training models with RLVR under efficient but imperfect samplers, this reframing offers a more robust way to handle off-policy rollouts: rather than correcting the trainer's gradient for the mismatch, you make the trainer effectively compute the sampler's own update. Code and a blog post are available per the first author's discussion note.
References
- Hugging Face · huggingface.co
Read the full story at Hugging Face ↗Like, save or discuss on Buzz