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

将专家合并为一个:提高混合专家的计算效率

Merging Experts into One: Improving Computational Efficiency of Mixture of Experts

University of Maryland, College Park(马里兰大学帕克分校);The University of Sydney(悉尼大学);University of Chinese Academy of Sciences(中国科学院大学);JD Explore Academy(京东探索研究院)

Shwai He, Run-Ze Fan, Liang Ding, Li Shen, Tianyi Zhou, Dacheng Tao

AI总结:

本文提出一种名为MEO的高效计算方法,通过将多个专家合并为单个专家来降低混合专家模型的计算成本,同时引入token级注意力块进一步提升效率与性能。

摘要:

扩大语言模型的规模通常会在 NLP 任务中带来显著的进步。但这往往伴随着计算成本增加的代价。尽管稀疏的混合专家(Mixture of Experts, MoE)可以通过为每个输入激活一小部分参数(例如一个专家)来降低成本,但如果增加被激活专家的数量,其计算量会显著增加,限制了其实用性。我们能否在不大幅增加计算成本的情况下保留添加更多专家的优势?在本文中,我们首先证明了选择多个专家的优越性,然后提出了一种计算高效的方法,称为 Merging Experts into One(MEO),该方法将计算成本降低到单个专家的水平。大量实验表明,MEO 显著提高了计算效率,例如,FLOPS 从 vanilla MoE 的 72.0G 降至 28.6G(MEO)。此外,我们提出了一个 token 级注意力块,进一步增强了 token 级 MEO 的效率和性能,例如,在 GLUE 基准测试上的平均得分为 83.3%(MEO)对比 82.6%(vanilla MoE)。我们的代码将在被接受后发布。代码发布地址:https://github.com/Shwai-He/MEO。

英文摘要:

Scaling the size of language models usually leads to remarkable advancements in NLP tasks. But it often comes with a price of growing computational cost. Although a sparse Mixture of Experts (MoE) can reduce the cost by activating a small subset of parameters (e.g., one expert) for each input, its computation escalates significantly if increasing the number of activated experts, limiting its practical utility. Can we retain the advantages of adding more experts without substantially increasing the computational costs? In this paper, we first demonstrate the superiority of selecting multiple experts and then propose a computation-efficient approach called \textbf{\texttt{Merging Experts into One}} (MEO), which reduces the computation cost to that of a single expert. Extensive experiments show that MEO significantly improves computational efficiency, e.g., FLOPS drops from 72.0G of vanilla MoE to 28.6G (MEO). Moreover, we propose a token-level attention block that further enhances the efficiency and performance of token-level MEO, e.g., 83.3\% (MEO) vs. 82.6\% (vanilla MoE) average score on the GLUE benchmark. Our code will be released upon acceptance. Code will be released at: \url{https://github.com/Shwai-He/MEO}.

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

↑