[论文解读] Towards Efficient Mixture of Experts: A Holistic Study of Compression Techniques
本文提出了一种统一框架,通过两种互补策略压缩Mixture-of-Experts(MoE)模型:专家瘦身(通过量化和剪枝压缩单个专家)和专家裁剪(移除整个专家或模块)。作者引入了激进的剪枝技术——层移除(Layer Drop)和块移除(Block Drop),可移除整个MoE或注意力模块,使Mixtral-8×7B在仅使用20.0GB显存的情况下实现6.05倍的加速,同时保持原始性能的92%以上。
Scaling large language models has driven remarkable advancements across various domains, yet the continual increase in model size presents significant challenges for real-world deployment. The Mixture of Experts (MoE) architecture offers a promising solution by dynamically selecting and activating only a subset of experts during inference, thus substantially reducing computational costs while preserving high performance. Despite these benefits, MoE introduces new inefficiencies, such as excessive parameters and communication overhead. In this work, we present a holistic study of compression techniques for Mixture of Experts to enhance both efficiency and scalability. While recent efforts have focused on Expert Trimming, which reduces the number of experts, these approaches still suffer from considerable communication and computational costs. To address this, we propose more aggressive strategies, such as Layer Drop, which removes entire MoE layers, and Block Drop, which eliminates transformer blocks. Surprisingly, these aggressive pruning techniques not only preserve model performance but also substantially improve computation and memory efficiency. Furthermore, beyond Expert Trimming, we also introduce Expert Slimming, which compresses individual experts to further boost performance and can be seamlessly integrated with Expert Trimming. Extensive experimental results demonstrate the effectiveness of our proposed methods-Layer Drop and Block Drop-along with the comprehensive recipe that integrates Expert Slimming and Expert Trimming, achieving a 6.05x speedup with 77.1% reduced memory usage while maintaining over 92% of performance on Mixtral-8x7B. Our code is released at https://github.com/CASE-Lab-UMD/Unified-MoE-Compression.
研究动机与目标
- 解决Mixture-of-Experts(MoE)模型压缩这一尚未充分探索的挑战,以提升其在实际部署中的效率。
- 系统分析MoE架构中的冗余性与通信开销,特别是参数重复与专家间通信成本。
- 开发一个统一的压缩框架,整合专家级压缩(瘦身)与结构化模块移除(裁剪),实现整体优化。
- 识别并探索MoE压缩中的新设计空间,特别是粗粒度剪枝策略(如层移除与块移除)。
- 为实践者提供一种端到端的压缩方案,结合瘦身与裁剪,以部署高效MoE模型。
提出的方法
- 提出一个统一框架,整合两种压缩视角:专家瘦身(压缩单个专家)与专家裁剪(移除结构化模块)。
- 通过量化(特别是AWQ)与剪枝应用专家瘦身,以降低专家层级的模型大小与推理成本。
- 引入层移除(Layer Drop),即移除MoE层中的所有专家;以及块移除(Block Drop),即移除Transformer块中的注意力与MoE层。
- 利用基于相似性的度量(如特征相似性与参数相似性)验证粗粒度剪枝(如层移除与块移除)的可行性。
- 在顺序流水线中结合专家瘦身与专家裁剪:先应用量化,再应用激进剪枝(层/块移除)以进一步降低FLOPs与内存占用。
- 采用硬件友好的量化方法(AWQ),在大幅降低显存使用的同时保持性能,尤其在MoE设置中效果显著。
实验结果
研究问题
- RQ1现有压缩技术如何被系统性地统一并适配于Mixture-of-Experts(MoE)模型?此类模型具有独特的冗余性与通信模式。
- RQ2与细粒度专家移除(Expert Drop)相比,粗粒度剪枝策略(如层移除与块移除)在性能与效率之间平衡方面能有多大的优势?
- RQ3如何最优组合专家瘦身与专家裁剪技术,以在MoE模型中最大化推理速度并最小化内存占用?
- RQ4模型特定特性(如专家冗余性、特征相似性)如何影响压缩策略的选择与有效性?
- RQ5能否将无需训练的压缩方法与压缩后微调有效结合,以在不从头训练的情况下进一步提升性能?
主要发现
- 作为激进剪枝策略,层移除与块移除显著降低FLOPs与内存占用,同时保持高性能,优于细粒度专家移除。
- AWQ量化与块移除的结合在Mixtral-8×7B上实现6.05倍加速,仅使用20.0GB显存,且在多个基准测试中保持超过92%的原始性能。
- 通过块移除实现的专家裁剪将Mixtral-8×7B的FLOPs从54.4T降低至46.0T,同时在MMLU基准上保持68.0的高平均得分。
- 在DeepSeek-MoE-16B上,该方法实现3.67倍加速,仅使用8.4GB显存,表明其在不同MoE架构中具有强大泛化能力。
- 该框架揭示,像DeepSeek-MoE这样的MoE模型相比Mixtral具有更高的专家冗余性与更低的特征相似性,提示应采用任务与模型特定的压缩策略。
- 压缩后微调是可行且有益的,因为该框架可实现高效、可微调的压缩MoE模型,而无需完全重新训练。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。