用大模型做强化学习,如何稳定训练有了新解释。
Stabilizing Reinforcement Learning with LLMs: Formulation and Practices
- 通过近似推导,说明在特定条件下可用词级目标优化序列奖励。
- 实验验证:重要性采样+裁剪+路由回放可显著提升训练稳定性。
- 适合研究大模型强化学习的从业者,尤其关注训练不稳定的场景。
本文提出一种新的大语言模型强化学习公式,解释了为何以及在何种条件下可通过替代的词级目标优化真正的序列级奖励,方法基于策略梯度如REINFORCE。通过一阶近似分析,我们发现该近似有效性依赖于训练-推理差异与策略僵化性的最小化。这一洞见为多项广泛采用的稳定技术提供了理论依据,包括重要性采样修正、裁剪和混合专家(MoE)模型中的路由回放。基于一个300亿参数的MoE模型,耗时数十万GPU小时的大量实验表明:在在线策略训练中,带重要性采样修正的基本策略梯度算法表现最优;引入离线策略更新以加速收敛时,裁剪与路由回放结合是缓解策略僵化导致不稳定的关键。值得注意的是,一旦训练稳定,长期优化始终能获得相当的最终性能,无论初始状态如何。我们希望这些洞察与实践指南能推动后续研究。
原文摘要 · Abstract (English)
This paper proposes a novel formulation for reinforcement learning (RL) with large language models, explaining why and under what conditions the true sequence-level reward can be optimized via a surrogate token-level objective in policy gradient methods such as REINFORCE. Specifically, through a first-order approximation, we show that this surrogate becomes increasingly valid only when both the training-inference discrepancy and policy staleness are minimized. This insight provides a principled explanation for the crucial role of several widely adopted techniques in stabilizing RL training, including importance sampling correction, clipping, and particularly Routing Replay for Mixture-of-Experts (MoE) models. Through extensive experiments with a 30B MoE model totaling hundreds of thousands of GPU hours, we show that for on-policy training, the basic policy gradient algorithm with importance sampling correction achieves the highest training stability. When off-policy updates are introduced to accelerate convergence, combining clipping and Routing Replay becomes essential to mitigate the instability caused by policy staleness. Notably, once training is stabilized, prolonged optimization consistently yields comparable final performance regardless of cold-start initialization. We hope that the shared insights and the developed recipes for stable RL training will facilitate future research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。