arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.18219cs.CLcs.LG
收藏

深入探究大型语言模型中的混合专家模型

A Closer Look into Mixture-of-Experts in Large Language Models

University of Macau(澳门大学);University of Edinburgh(爱丁堡大学);Tsinghua University(清华大学);INF Technology(INF技术);Shanghai AI Lab(上海人工智能实验室)

Ka Man Lo, Zeyu Huang, Zihan Qiu, Zili Wang, Jie Fu

AI总结:

本文通过分析三个流行MoE模型,揭示神经元即细粒度专家、路由器偏好大范数专家及专家多样性随层增加而最后一层异常等机制,并为MoE实践提供设计建议。

摘要:

混合专家模型(Mixture-of-Experts, MoE)因其独特的性质和卓越的性能,尤其是在语言任务上的表现,正受到越来越多的关注。通过为每个令牌(token)稀疏地激活一部分参数,MoE架构可以在不牺牲计算效率的情况下增加模型规模,从而在性能与训练成本之间实现更好的权衡。然而,MoE的底层机制仍缺乏进一步的探索,其模块化程度也存疑。在本文中,我们初步尝试理解基于MoE的大型语言模型的内部工作机制。具体而言,我们全面研究了三个流行的基于MoE的模型的参数和行为特征,并揭示了一些有趣的观察结果,包括:1)神经元扮演着细粒度专家的角色;2)MoE的路由器通常选择具有较大输出范数的专家;3)专家多样性随层数增加而增加,而最后一层是异常值,这一发现通过初步实验得到进一步验证。基于这些观察,我们还为广泛的MoE实践者提供了建议,例如路由器设计和专家分配。我们希望这项工作能为未来关于MoE框架和其他模块化架构的研究提供启示。代码可在 https://github.com/kamanphoebe/Look-into-MoEs 获取。

英文摘要:

Mixture-of-experts (MoE) is gaining increasing attention due to its unique properties and remarkable performance, especially for language tasks. By sparsely activating a subset of parameters for each token, MoE architecture could increase the model size without sacrificing computational efficiency, achieving a better trade-off between performance and training costs. However, the underlying mechanism of MoE still lacks further exploration, and its modularization degree remains questionable. In this paper, we make an initial attempt to understand the inner workings of MoE-based large language models. Concretely, we comprehensively study the parametric and behavioral features of three popular MoE-based models and reveal some intriguing observations, including 1) Neurons act like fine-grained experts; 2) The router of MoE usually selects experts with larger output norms; 3) The expert diversity increases as the layer increases, while the last layer is an outlier, which is further validated by an initial experiment. Based on the observations, we also provide suggestions for a broad spectrum of MoE practitioners, such as router design and expert allocation. We hope this work could shed light on future research on the MoE framework and other modular architectures. Code is available at https://github.com/kamanphoebe/Look-into-MoEs.

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

↑