[论文解读] Auxiliary-Loss-Free Load Balancing Strategy for Mixture-of-Experts
论文提出 Loss-Free Balancing,一种无辅助损失的方法,通过动态偏置专家路由分数来控制 MoE 的负载均衡,在不干扰梯度的情况下提升困惑度和负载均衡。
For Mixture-of-Experts (MoE) models, an unbalanced expert load will lead to routing collapse or increased computational overhead. Existing methods commonly employ an auxiliary loss to encourage load balance, but a large auxiliary loss will introduce non-negligible interference gradients into training and thus impair the model performance. In order to control load balance while not producing undesired gradients during training, we propose Loss-Free Balancing, featured by an auxiliary-loss-free load balancing strategy. To be specific, before the top-K routing decision, Loss-Free Balancing will first apply an expert-wise bias to the routing scores of each expert. By dynamically updating the bias of each expert according to its recent load, Loss-Free Balancing can consistently maintain a balanced distribution of expert load. In addition, since Loss-Free Balancing does not produce any interference gradients, it also elevates the upper bound of model performance gained from MoE training. We validate the performance of Loss-Free Balancing on MoE models with up to 3B parameters trained on up to 200B tokens. Experimental results show that Loss-Free Balancing achieves both better performance and better load balance compared with traditional auxiliary-loss-controlled load balancing strategies.
研究动机与目标
- 动机:在 MoE 中需要实现平衡的专家路由,以避免路由崩溃和过度计算。
- 提出 Loss-Free Balancing,以在不引入干扰梯度的情况下控制负载均衡。
- 证明该方法在 1B 和 3B MoE 模型上,相较于基于辅助损失的方法,获得更好的验证困惑度和负载均衡。
- 展示与专家并行性的兼容性,并分析相较于其他方法的理论泄漏。
提出的方法
- 在进入前 K 路由之前,将按专家的偏置增加到门控分数上。
- 基于观测到的专家负载,迭代更新每个偏置 b_i,以抑制高负载专家、提升低负载专家。
- 使用算法 1 在每个训练批次之后更新偏置,而不向主目标添加梯度。
- 在基准 MoE 设置上,将 Loss-Free Balancing 与辅助损失控制的负载平衡和 Expert Choice 进行比较。
- 使用验证困惑度和全局负载平衡指标 MaxVio(全局和批量变体)进行评估。
- 讨论与专家并行性的兼容性,并分析未来 token 泄漏的担忧。
实验结果
研究问题
- RQ1无辅助损失的门控分数偏置是否比辅助损失产生更好的负载均衡?
- RQ2Loss-Free Balancing 是否能在 1B 和 3B 的 MoE 模型中同时提升模型性能(困惑度)和负载均衡?
- RQ3该方法是否与专家并行性兼容且不产生干扰梯度?
- RQ4在未来 token 泄漏和训练安全性方面,Loss-Free Balancing 与 Expert Choice 相比如何?
主要发现
- Loss-Free Balancing 在 1B 和 3B 模型上都实现了比辅助损失控制方法更低的验证困惑度。
- 全局 MaxVio 负载平衡指标在 Loss-Free Balancing 下显著更低(0.04),相比辅助损失(1B 为 0.72;3B 为 0.52)。
- 如 MaxVio_batch 曲线持续呈现优势,Loss-Free Balancing 在整个训练过程中维持更好的负载平衡。
- 该方法仍然与专家并行性兼容,并且随着计算-批量大小的增加,平衡性得到改善。
- 加性专家偏置在平衡和性能方面优于乘性偏置。
- Softmax 门控实验表明,在该设置下,Loss-Free Balancing 具有更好的平衡性和略优的困惑度,相较于辅助损失。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。