arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2411.15708cs.CL
收藏

LLaMA-MoE v2:从后训练混合专家视角探索LLaMA的稀疏性

LLaMA-MoE v2: Exploring Sparsity of LLaMA from Perspective of Mixture-of-Experts with Post-Training

Shanghai AI Laboratory(上海人工智能实验室);Soochow University(苏州大学);The Chinese University of Hong Kong(香港中文大学)

Xiaoye Qu, Daize Dong, Xuyang Hu, Tong Zhu, Weigao Sun, Yu Cheng

AI总结:

本文通过为LLaMA的注意力和MLP模块构建MoE来探索稠密模型的稀疏化,并提出两阶段后训练策略以缓解稀疏化带来的性能下降,在LLaMA3上验证了指令化MoE模型的有效性。

摘要:

近年来,受稀疏性概念的启发,混合专家(Mixture-of-Experts, MoE)模型在保持激活参数数量不变的同时扩大模型规模,因而日益受到关注。本研究通过为Transformer模块中的注意力(即Attention MoE)和MLP(即MLP MoE)分别构建MoE,深入探究了稠密LLaMA模型的稀疏性。具体而言,我们在相同激活条件下研究了不同的专家构建方法和粒度,以分析模型稀疏化的影响。此外,为全面评估稀疏化后模型在对话、代码、数学等多个领域的能力,我们将稀疏性应用于经过指令微调的大语言模型(LLMs),并构建了指令化的MoE模型。为抵消稀疏性增加所导致的性能下降,我们设计了一种两阶段后训练策略来提升模型性能。在LLaMA3模型上的实验证明了该方法对未来指令化MoE模型发展的潜在有效性。源代码和模型可在以下地址获取:\url{https://github.com/OpenSparseLLMs/LLaMA-MoE-v2}。

英文摘要:

Recently, inspired by the concept of sparsity, Mixture-of-Experts (MoE) models have gained increasing popularity for scaling model size while keeping the number of activated parameters constant. In this study, we thoroughly investigate the sparsity of the dense LLaMA model by constructing MoE for both the attention (i.e., Attention MoE) and MLP (i.e., MLP MoE) modules in the transformer blocks. Specifically, we investigate different expert construction methods and granularities under the same activation conditions to analyze the impact of sparsifying the model. Additionally, to comprehensively evaluate the model's capabilities across various domains (e.g., conversation, code, math) after sparsification, we apply sparsity to the instructed large language models (LLMs) and construct instructed MoE models. To counteract the performance degradation resulting from increased sparsity, we design a two-stage post-training strategy to enhance model performance. Experiments on the LLaMA3 model demonstrate the potential effectiveness of this approach for future developments of instructed MoE models. The source codes and models are available at: \url{https://github.com/OpenSparseLLMs/LLaMA-MoE-v2}.

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

↑