Sampler Replay: Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards

Milad Aghajohari, Kamran Chitsaz, Sarath Chandar, Alessandro Sordoni, Michael Noukhovitch, Aaron Courville

Mila · Université de Montréal · Polytechnique Montréal · Chandar Research Lab

Published November 30, 2026 · on the feed December 1, 2026 · ▲ 17 · arXiv 2611.41862

The abstract

Train-inference mismatch is a well-known problem that degrades reinforcement learning with verifiable rewards (RLVR) performance. This problem is currently framed as training the trainer with samples coming from an imperfect version of itself: a sampler optimized to meet some efficiency criteria. Therefore, current RLVR algorithms are designed to account for the discrepancy in the trainer's gradient due to the sampler's off-policy rollouts. In this paper, we reframe the problem: we argue that RLVR should strive to train the sampler, since it is the sampler's performance at test time that we ultimately care about. Therefore, we view the trainer merely as a mechanism to get an approximation of the sampler's true gradient. We propose Sampler Replay, an algorithm that replays the sampler's hidden states, logits, and routing decisions in the trainer's forward pass to better approximate the sampler's gradient. Across tasks and model scales, we show that Sampler Replay stabilizes training under severe train-inference mismatch induced by quantization (weights, activations, KV cache), weight perturbation, and staleness, outperforming strong baselines. Furthermore, we show that Sampler Replay is a generalization of techniques that have been widely used in the literature to address TIM but that, so far, have been treated independently. Notably, we mathematically prove that Score Centering is a special case of Sampler Replay, where only the logits are replayed.

The Brief

2:24

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Sampler Replay. Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards. By Milad Aghajohari and five others, from Mila, the Université de Montréal, and two other institutions. Published on the thirtieth of November.

Reinforcement learning with verifiable rewards, or RLVR, suffers from a well-known problem: train-inference mismatch. Rollouts come from a sampler, a version of the model optimized to meet some efficiency criteria, and that sampler is an imperfect copy of the trainer. The usual framing is that we are training the trainer, using samples from this imperfect version of itself. So current RLVR algorithms are designed to correct the trainer's gradient for the discrepancy introduced by the sampler's off-policy rollouts.

This work turns the framing around. What we ultimately care about is how the sampler performs at test time, so RLVR should aim to train the sampler. On that view, the trainer is merely a mechanism for getting an approximation of the sampler's true gradient. The question changes from how to correct for the sampler to how to make the trainer's gradient look more like the sampler's.

Sampler Replay is the algorithm built on that view. During the trainer's forward pass, it replays what the sampler actually computed: its hidden states, its logits, and its routing decisions. Feeding those back in gives the trainer a closer approximation of the gradient the sampler would have. The aim is not to make the sampler more like the trainer, but to make the trainer's gradient a better stand-in for the sampler's.

Across tasks and model scales, Sampler Replay stabilizes training under severe train-inference mismatch and outperforms strong baselines. The mismatch is induced in several ways: by quantization of weights, activations, and the KV cache, by weight perturbation, and by staleness. These are different sources of the same gap between the model that generates rollouts and the model that is updated.

There is also a unifying result. The authors show that Sampler Replay generalizes techniques that have been widely used to address this mismatch, but that until now have been treated independently. In particular, they prove mathematically that Score Centering is a special case of Sampler Replay: the case where only the logits are replayed. Replay the hidden states and routing decisions as well, and you have the fuller version of the same idea.

The contribution is a change of target. If the sampler is the model that gets deployed, then the sampler is the one to train, and the trainer becomes a tool for estimating its gradient. Seen that way, replaying the sampler's own internal states is a natural move, and earlier fixes such as Score Centering fall out as partial versions of it.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.