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

FactorLLM:通过混合专家为大语言模型分解知识

FactorLLM: Factorizing Knowledge via Mixture of Experts for Large Language Models

Peking University(北京大学);UC Berkeley(加州大学伯克利分校);PhiGent Robotics(PhiGent机器人公司);University of Arizona(亚利桑那大学)

Zhongyu Zhao, Menghang Dong, Rongyu Zhang, Wenzhao Zheng, Yunpeng Zhang, Huanrui Yang, Dalong Du, Kurt Keutzer, Shanghang Zhang

AI总结:

本文提出FactorLLM方法,将大语言模型中的密集前馈网络分解为稀疏子网络,并结合混合专家路由和先验近似损失,在保留高达85%模型性能的同时实现超30%的推理加速。

摘要:

近期研究表明,大语言模型(LLMs)中的前馈网络(FFNs)在存储各种语言和事实知识方面发挥着关键作用。传统方法经常面临由其单体和冗余架构引起的知识混淆挑战,这需要以最小的计算开销实现更高效的解决方案,特别是对于LLMs。在本文中,我们探索了LLMs中的FFN计算范式,并引入了FactorLLM,这是一种新颖的方法,它将训练良好的密集FFN分解为稀疏子网络,无需任何进一步的修改,同时保持同等水平的性能。此外,我们嵌入了来自混合专家(MoE)的路由器,结合我们设计的先验近似(PA)损失项,以促进专家的动态激活和知识适应,从而使用最少的训练数据和微调步骤加速计算过程并提升性能。因此,FactorLLM实现了高效的知识分解,并激活专门为指定任务定制的选定专家组,模拟人脑的交互式功能分割。跨各种基准的广泛实验证明了我们提出的FactorLLM的有效性,它实现了与源模型相当的性能,在获得超过30%的推理速度提升的同时,保留了高达85%的模型性能。代码:https://github.com/zhenwuweihe/FactorLLM。

英文摘要:

Recent research has demonstrated that Feed-Forward Networks (FFNs) in Large Language Models (LLMs) play a pivotal role in storing diverse linguistic and factual knowledge. Conventional methods frequently face challenges due to knowledge confusion stemming from their monolithic and redundant architectures, which calls for more efficient solutions with minimal computational overhead, particularly for LLMs. In this paper, we explore the FFN computation paradigm in LLMs and introduce FactorLLM, a novel approach that decomposes well-trained dense FFNs into sparse sub-networks without requiring any further modifications, while maintaining the same level of performance. Furthermore, we embed a router from the Mixture-of-Experts (MoE), combined with our devised Prior-Approximate (PA) loss term that facilitates the dynamic activation of experts and knowledge adaptation, thereby accelerating computational processes and enhancing performance using minimal training data and fine-tuning steps. FactorLLM thus enables efficient knowledge factorization and activates select groups of experts specifically tailored to designated tasks, emulating the interactive functional segmentation of the human brain. Extensive experiments across various benchmarks demonstrate the effectiveness of our proposed FactorLLM which achieves comparable performance to the source model securing up to 85% model performance while obtaining over a 30% increase in inference speed. Code: https://github.com/zhenwuweihe/FactorLLM.

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

↑