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

稀疏专家混合语言模型的高效专家剪枝:提升性能并降低推理成本

Efficient Expert Pruning for Sparse Mixture-of-Experts Language Models: Enhancing Performance and Reducing Inference Costs

Cranberry-Lemon University(蔓越莓柠檬大学)

Enshu Liu, Junyi Zhu, Zinan Lin, Xuefei Ning, Matthew B. Blaschko, Shengen Yan, Guohao Dai, Huazhong Yang, Yu Wang

AI总结:

本文提出无梯度进化剪枝策略EEP,仅靠模型推理即可大幅减少SMoE模型的专家总数和激活专家数,在节省GPU内存、加速推理的同时保持甚至提升下游任务性能,挑战了传统剪枝认知。

摘要:

大型语言模型(LLMs)的快速发展催生了参数量从数十亿到数万亿的架构,由于其对内存、计算能力和能耗的巨大需求,给部署带来了重大挑战。稀疏专家混合(SMoE)架构作为一种解决方案应运而生,每个token仅激活部分参数,从而在保持性能的同时实现更快的推理。然而,SMoE模型由于参数量庞大和显著的GPU内存需求,在更广泛的部署中仍面临限制。在本工作中,我们引入了一种名为EEP(Efficient Expert Pruning,高效专家剪枝)的无梯度进化策略,以增强SMoE模型中专家的剪枝效果。EEP仅依赖模型推理(即无需梯度计算),并在下游任务上实现更高的稀疏性,同时保持甚至提升性能。EEP既可用于减少专家总数(从而节省GPU内存),也可用于减少激活专家数(从而加速推理)。例如,我们证明对Mixtral 8×7B-Instruct中多达75%的专家进行剪枝,可在性能损失最小的情况下大幅减少参数量。值得注意的是,当剪枝一半专家时,我们观察到在某些任务上性能有所提升,例如在SQuAD数据集上的准确率显著提高(从53.4%提升至75.4%)。基于这些结果,EEP不仅降低了部署SMoE模型的门槛,还通过表明更少的专家可以在无需任何微调的情况下带来更好的任务特定性能,挑战了传统的模型剪枝认知。代码可在https://github.com/imagination-research/EEP获取。

英文摘要:

The rapid advancement of large language models (LLMs) has led to architectures with billions to trillions of parameters, posing significant deployment challenges due to their substantial demands on memory, processing power, and energy consumption. Sparse Mixture-of-Experts (SMoE) architectures have emerged as a solution, activating only a subset of parameters per token, thereby achieving faster inference while maintaining performance. However, SMoE models still face limitations in broader deployment due to their large parameter counts and significant GPU memory requirements. In this work, we introduce a gradient-free evolutionary strategy named EEP (Efficient Expert P}runing) to enhance the pruning of experts in SMoE models. EEP relies solely on model inference (i.e., no gradient computation) and achieves greater sparsity while maintaining or even improving performance on downstream tasks. EEP can be used to reduce both the total number of experts (thus saving GPU memory) and the number of active experts (thus accelerating inference). For example, we demonstrate that pruning up to 75% of experts in Mixtral $8\times7$B-Instruct results in a substantial reduction in parameters with minimal performance loss. Remarkably, we observe improved performance on certain tasks, such as a significant increase in accuracy on the SQuAD dataset (from 53.4% to 75.4%), when pruning half of the experts. With these results, EEP not only lowers the barrier to deploying SMoE models,but also challenges the conventional understanding of model pruning by showing that fewer experts can lead to better task-specific performance without any fine-tuning. Code is available at https://github.com/imagination-research/EEP.

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

↑