arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.15451cs.LGcs.CL
收藏

基于二进制整数规划的混合专家模型专家负载均衡算法

Binary-Integer-Programming Based Algorithm for Expert Load Balancing in Mixture-of-Experts Models

Yuan Sun

AI总结:

针对MoE模型预训练中专家负载不均衡的问题,提出基于二进制整数规划的负载均衡算法,可全程维持专家负载均衡,同时降低困惑度、减少预训练时间。

摘要:

在MoE(混合专家)模型的预训练中,核心问题之一是专家负载不均衡,这可能导致路由崩溃或计算开销上升。现有方法包括Loss-Controlled(损失控制)方法和Loss-Free(无损失)方法,二者在训练初始几步的不均衡程度仍然较高且下降缓慢。本研究提出BIP-Based Balancing,一种基于二进制整数规划(binary integer programming, BIP)的专家负载均衡算法。该算法在每个MoE层维护一个额外向量q,通过求解一个时间开销极小的二进制整数规划,即可调整s的top-K排序。我们在两个MoE语言模型上实现了该算法:16专家(0.3B参数)和64专家(1.1B参数)。实验结果表明,在两个模型上,与Loss-Controlled方法和Loss-Free方法相比,我们的算法训练出的模型困惑度最低,同时相比Loss-Controlled方法至少节省13%的预训练时间。据我们目前所知,这是首个在整个预训练过程中从第一步到最后一步都能维持每个MoE层中每位专家负载均衡状态的路由算法,且训练出的MoE模型性能同样优异。本研究的代码资源可在https://github.com/sunyuanLLM/bip_routing_algorithm获取。

英文摘要:

For pre-training of MoE (Mixture-of-Experts) models, one of the main issues is unbalanced expert loads, which may cause routing collapse or increased computational overhead. Existing methods contain the Loss-Controlled method and the Loss-Free method, where both the unbalanced degrees at first several training steps are still high and decrease slowly. In this work, we propose BIP-Based Balancing, an expert load balancing algorithm based on binary integer programming (BIP). The algorithm maintains an additional vector q on each MoE layer that can help change the top-K order of s by solving a binary integer programming with very small time costs. We implement the algorithm on two MoE language models: 16-expert (0.3B) and 64-expert (1.1B). The experimental results show that on both models comparing with the Loss-Controlled method and the Loss-Free method, our algorithm trains models with the lowest perplexities, while saves at least 13% of pre-training time compared with the Loss-Controlled method. Within our current knowledge, this is the first routing algorithm that achieves maintaining load balance status on every expert in every MoE layer from the first step to the last step during the whole pre-training process, while the trained MoE models also perform well. The code material of this work is available at https://github.com/sunyuanLLM/bip_routing_algorithm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑