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

  • 2026-11-30 18:45:22
  • Milad Aghajohari, Kamran Chitsaz, Sarath Chandar, Alessandro Sordoni, Michael Noukhovitch, Aaron Courville
  • 0

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 \emph{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 \emph{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.

 

Quick Read (beta)

loading the full paper ...