用分阶段压缩和蒸馏,让大MoE模型变小变快还保持高性能。
SlimMoE: Structured Compression of Large MoE Models via Expert Slimming and Distillation
- 通过剪枝专家+多阶段知识蒸馏,逐步压缩模型参数。
- 仅用4000亿词训练数据,将419亿参数模型压缩到38亿参数。
- 可在单张显卡上微调,适合科研与资源受限场景。
混合专家(MoE)架构已成为扩展大语言模型(LLM)并保持推理效率的强大范式。然而,其庞大的内存需求使其在资源受限环境中难以微调或部署。为此,我们提出SlimMoE,一种多阶段压缩框架,可将大型MoE模型转化为更小、高效的变体,而无需从头训练的高昂成本。该方法通过系统性地剪枝专家并经由中间阶段进行知识迁移,有效缓解了一次性剪枝常见的性能下降问题。利用此框架,我们将Phi 3.5-MoE(总参数419亿,激活参数66亿)压缩为Phi-mini-MoE(总参数76亿,激活参数24亿)和Phi-tiny-MoE(总参数38亿,激活参数11亿),仅使用4000亿词——不到原模型训练数据的10%。这些压缩模型可在单张GPU(A100用于Phi-mini-MoE,A6000用于Phi-tiny-MoE)上微调,非常适合学术与资源受限环境。实验表明,这些压缩模型在同类规模中表现更优,且与更大模型相当。例如,Phi-mini-MoE仅用2/3的激活参数,即达到甚至优于Phi-3-mini的表现,并在MMLU评测中与Llama 3.1 8B相当,同时延迟显著更低。结果表明,结构化剪枝结合分阶段蒸馏是打造高质量紧凑型MoE模型的有效路径,推动了MoE架构的广泛应用。模型已公开于https://huggingface.co/microsoft/Phi-mini-MoE-instruct 和 https://huggingface.co/microsoft/Phi-tiny-MoE-instruct。
原文摘要 · Abstract (English)
The Mixture of Experts (MoE) architecture has emerged as a powerful paradigm for scaling large language models (LLMs) while maintaining inference efficiency. However, their enormous memory requirements make them prohibitively expensive to fine-tune or deploy in resource-constrained environments. To address this challenge, we introduce SlimMoE, a multi-stage compression framework for transforming large MoE models into much smaller, efficient variants without incurring the prohibitive costs of training from scratch. Our method systematically reduces parameter counts by slimming experts and transferring knowledge through intermediate stages, effectively mitigating the performance degradation common in one-shot pruning approaches. Using this framework, we compress Phi 3.5-MoE (41.9B total/6.6B activated parameters) to create Phi-mini-MoE (7.6B total/2.4B activated parameters) and Phi-tiny-MoE (3.8B total/1.1B activated parameters) using only 400B tokens--less than 10% of the original model's training data. These compressed models can be fine-tuned on a single GPU (A100 for Phi-mini-MoE, A6000 for Phi-tiny-MoE), making them highly suitable for academic and resource-limited settings. Our experiments demonstrate that these compressed models outperform others of similar size and remain competitive with larger models. For instance, Phi-mini-MoE achieves similar or better performance to Phi-3-mini using only 2/3 of the activated parameters and yields comparable MMLU scores to Llama 3.1 8B despite having significantly lower latency. Our findings demonstrate that structured pruning combined with staged distillation offers an effective path to creating high-quality, compact MoE models, paving the way for broader adoption of MoE architectures. We make our models publicly available at https://huggingface.co/microsoft/Phi-mini-MoE-instruct and https://huggingface.co/microsoft/Phi-tiny-MoE-instruct .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。