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

更难的任务需要更多专家:MoE模型中的动态路由

Harder Tasks Need More Experts: Dynamic Routing in MoE Models

Peking University(北京大学);AGIBang;Kuaishou Technology(快手科技)

Quzhe Huang, Zhenwei An, Nan Zhuang, Mingxu Tao, Chen Zhang, Yang Jin, Kun Xu, Kun Xu, Liwei Chen, Songfang Huang, Yansong Feng

AI总结:

本研究提出MoE模型的动态专家选择框架,依据输入难度与专家选择置信度动态调整激活专家数,在激活参数不足90%时较Top-2路由平均提升0.7%,还发现Transformer不同层专家需求有差异,为异构MoE设计提供参考。

摘要:

本文提出了一种适用于混合专家(Mixture of Experts, MoE)模型的新型动态专家选择框架,旨在根据输入难度调整激活的专家数量,从而提升计算效率与模型性能。传统MoE方法依赖固定的Top-K路由机制,无论输入复杂度如何,都激活预设数量的专家;而我们的方法则根据每个输入在专家选择上的置信度水平动态选择专家。这一机制能更高效地利用计算资源:对于需要高级推理的复杂任务,激活更多专家;对于较简单的任务,则激活更少专家。通过大量评估,我们的动态路由方法在各类基准测试中相比传统Top-2路由实现了显著提升,在激活参数不足90%的情况下,平均提升幅度达0.7%。进一步分析表明,我们的模型会为需要复杂推理能力的任务(如BBH)分配更多专家,证实了其能根据输入复杂度动态分配计算资源的能力。我们的研究还发现,Transformer模型不同层所需的专家数量存在差异,这为设计异构MoE框架提供了思路。代码与模型可在https://github.com/ZhenweiAn/Dynamic_MoE获取。

英文摘要:

In this paper, we introduce a novel dynamic expert selection framework for Mixture of Experts (MoE) models, aiming to enhance computational efficiency and model performance by adjusting the number of activated experts based on input difficulty. Unlike traditional MoE approaches that rely on fixed Top-K routing, which activates a predetermined number of experts regardless of the input's complexity, our method dynamically selects experts based on the confidence level in expert selection for each input. This allows for a more efficient utilization of computational resources, activating more experts for complex tasks requiring advanced reasoning and fewer for simpler tasks. Through extensive evaluations, our dynamic routing method demonstrates substantial improvements over conventional Top-2 routing across various benchmarks, achieving an average improvement of 0.7% with less than 90% activated parameters. Further analysis shows our model dispatches more experts to tasks requiring complex reasoning skills, like BBH, confirming its ability to dynamically allocate computational resources in alignment with the input's complexity. Our findings also highlight a variation in the number of experts needed across different layers of the transformer model, offering insights into the potential for designing heterogeneous MoE frameworks. The code and models are available at https://github.com/ZhenweiAn/Dynamic_MoE.

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

↑