Sampler Replay:通过重放采样器状态修复 RLVR 训练-推理失配
Sampler Replay: Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards
训练和推理不一致会悄悄毁掉你的 RLVR 效果,这篇论文换了个思路:与其修正训练器,不如直接重放采样器的 logits 和隐藏状态。实验覆盖量化、KV cache 失配等场景,做 RL 后训练的工程师值得复现试试。
arXiv 论文 2611.41862 提出 Sampler Replay 算法,重新定义了 RLVR(可验证奖励强化学习)中的训练-推理失配问题:作者主张应训练的是采样器本身,因为测试时真正执行的是采样器,训练器只是获取采样器真实梯度的近似机制。
具体做法是在训练器前向传播中重放采样器的隐藏状态、logits 和路由决策,从而更准确地逼近采样器梯度。论文还从数学上证明 Score Centering 是 Sampler Replay 的特例,即只重放 logits 的情形,将此前文献中被独立处理的多项 TIM 缓解技术统一到同一框架下。
在多种任务和模型规模上,该方法在量化(权重、激活、KV cache)、权重扰动和过时策略导致的严重失配下稳定了训练,成绩超过强基线。
Sampler Replay: Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards
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.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include RLVR, Sampler Replay, reinforcement learning, Score Centering.
Source attribution: curated from arXiv cs.LG (@Milad Aghajohari, Kamran Chitsaz, Sarath Chandar, Alessandro Sordoni, Michael Noukhovitch, Aaron Courville).