Stabilizing MoE Reinforcement Learning by Aligning Training and Inference Routers
Wenhan Ma, Hailin Zhang, Liang Zhao, Yifan Song, Yudong Wang, Zhifang Sui, Fuli Luo
TL;DR
This work addresses the instability of reinforcement learning with Mixture-of-Experts by identifying training–inference routing discrepancies as a key root cause. It introduces Rollout Routing Replay (R3), a simple yet effective mechanism that reuses inference-time routing masks during training to align routing behavior, while preserving gradient flow and keeping rollout overhead under $3\%$. Empirical results show substantial reductions in training–inference $D_{KL}$ divergence and extreme token discrepancies, leading to improved stability and performance over GSPO and TIS across multiple RL tasks, including multi-turn dialogues. The approach is compatible with both on-policy and mini-batch off-policy training and can be integrated with routing mask caching for efficiency, offering a practical solution for stabilizing RL in MoE models with broad applicability to real-world LLM workflows.
Abstract
Reinforcement learning (RL) has emerged as a crucial approach for enhancing the capabilities of large language models. However, in Mixture-of-Experts (MoE) models, the routing mechanism often introduces instability, even leading to catastrophic RL training collapse. We analyze the training-inference consistency of MoE models and identify a notable discrepancy in routing behaviors between the two phases. Moreover, even under identical conditions, the routing framework can yield divergent expert selections across repeated forward passes. To address this foundational inconsistency, we propose Rollout Routing Replay (R3), a method that records routing distributions from the inference engine and replays them during training. R3 significantly reduces training-inference policy KL divergence and mitigates extreme discrepancies without compromising training speed. Extensive experiments on various settings confirm that R3 succeeds in stabilizing RL training, preventing collapse and outperforming methods such as GSPO and TIS. We believe this work can offer a new solution for stabilizing RL in MoE models.
