Sampler Replay: Train The Sampler Not The Trainer in Reinforcement Learning with Verifiable Rewards
该论文提出了一种名为Sampler Replay的算法,通过在训练过程中回放采样器的隐藏状态和 logits 来提高强化学习在可验证奖励(RLVR)中的训练稳定性。
更新于 2026-12-01。作者:Milad Aghajohari、Kamran Chitsaz、Sarath Chandar、Alessandro Sordoni、Michael Noukhovitch、Aaron Courville。
中文摘要
训练与推理不匹配是一个已知问题,它降低了具有可验证奖励的强化学习(RLVR)的性能。目前,这个问题被描述为使用来自自身不完美版本的样本来训练训练器:一个针对某些效率标准进行优化的采样器。因此,当前的RLVR算法旨在考虑由于采样器的离策略回滚而导致训练器梯度的差异。在本文中,我们重新审视了这个问题:我们认为RLVR应该努力训练采样器,因为我们对测试时采样器的性能最关心。因此,我们将训练器仅仅视为获取采样器真实梯度的近似机制。我们提出了采样器回放算法,该算法在训练器的正向传递中回放采样器的隐藏状态、logits和路由决策,以更好地近似采样器的梯度。在多个任务和模型规模上,我们表明采样器回放算法在由量化(权重、激活、KV缓存)、权重扰动和陈旧性引起的严重训练与推理不匹配下稳定了训练,并优于强大的基线。此外,我们表明采样器回放是文献中广泛使用的技术的推广,但迄今为止,这些技术被独立处理。值得注意的是,我们通过数学证明了得分中心是采样器回放的一个特例,其中只回放logits。
英文摘要
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.
解读
一句话总结
该论文提出了一种名为Sampler Replay的算法,通过在训练过程中回放采样器的隐藏状态和 logits 来提高强化学习在可验证奖励(RLVR)中的训练稳定性。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:在强化学习(RLVR)中,训练和推理之间存在不匹配(TIM),这会导致训练不稳定和效率降低。
- 现有方案不足:现有的RLVR算法通常将训练师作为目标,而将采样器仅视为手段,导致梯度估计偏差。
- 研究目标:提出Sampler Replay算法,通过训练采样器来提高RLVR的训练稳定性。
问题2:论文的核心创新点是什么?
- 技术创新:提出了Sampler Replay算法,该算法在训练师的正向传播中回放采样器的隐藏状态和 logits。
- 方法改进:通过回放隐藏状态和 logits,更好地近似采样器的梯度,从而减少TIM的影响。
- 优势:与现有方法相比,Sampler Replay在减轻TIM方面更有效,提高了训练稳定性。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个任务和模型规模上进行了实验,包括 Countdown、GSM8K、DAPO、Sokoban 和 INTELLECT-2。
- 性能提升:Sampler Replay在所有实验中都表现优于基线方法,例如 Score Centering 和 SC + TIS。
- 对比结果:与基线方法相比,Sampler Replay在训练奖励和稳定性方面都有显著提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:该算法可以应用于需要稳定训练的RLVR场景,例如强化学习、自然语言处理和计算机视觉。
- 实施建议:建议在RLVR训练中使用Sampler Replay来提高训练稳定性。
- 局限与展望:虽然Sampler Replay在减轻TIM方面很有效,但它可能需要进一步的优化以适应异步RLVR等不同场景。
来源
机器可读索引:llms.txt