arXiv:2410.06270cs.LGcs.CL2024-10ICLR被引 42

提出无需训练的压缩方法,显著减少专家模型内存与计算开销。

Mixture Compressor for Mixture-of-Experts LLMs Gains More

  • 根据专家和令牌重要性动态分配精度,实现自适应量化
  • 在2.54比特下压缩76.6%参数,仅损失3.8%准确率
  • 支持推理时动态剪枝,激活参数再降15%,性能损失<0.6%

混合专家大语言模型(MoE-LLMs)虽推动了语言模型发展,但面临两大挑战:专家参数导致显著内存占用与加载延迟;当前激活的专家存在冗余,许多令牌其实只需单个专家。基于此,我们观察到:不同专家在激活重构误差、路由得分与激活频率上表现各异,体现其重要性差异;且并非所有令牌同等重要,仅有少数关键。据此提出无训练的混合压缩器MC,结合专家与令牌重要性实现极致压缩。首先引入预加载混合精度量化,将自适应位宽分配建模为线性规划问题,平衡各专家重要性因素;其次提出在线动态剪枝,识别关键令牌并动态选择专家,提升推理效率。MC融合静态量化与动态剪枝,在保持性能前提下实现极端压缩。实验表明:在2.54比特下,模型压缩率达76.6%,平均准确率损失仅3.8%;推理中进一步降低15%激活参数,性能下降低于0.6%。

原文摘要 · Abstract (English)

Mixture-of-Experts large language models (MoE-LLMs) marks a significant step forward of language models, however, they encounter two critical challenges in practice: 1) expert parameters lead to considerable memory consumption and loading latency; and 2) the current activated experts are redundant, as many tokens may only require a single expert. Motivated by these issues, we investigate the MoE-LLMs and make two key observations: a) different experts exhibit varying behaviors on activation reconstruction error, routing scores, and activated frequencies, highlighting their differing importance, and b) not all tokens are equally important -- only a small subset is critical. Building on these insights, we propose MC, a training-free Mixture-Compressor for MoE-LLMs, which leverages the significance of both experts and tokens to achieve an extreme compression. First, to mitigate storage and loading overheads, we introduce Pre-Loading Mixed-Precision Quantization, which formulates the adaptive bit-width allocation as a Linear Programming problem, where the objective function balances multi-factors reflecting the importance of each expert. Additionally, we develop Online Dynamic Pruning, which identifies important tokens to retain and dynamically select activated experts for other tokens during inference to optimize efficiency while maintaining performance. Our MC integrates static quantization and dynamic pruning to collaboratively achieve extreme compression for MoE-LLMs with less accuracy loss, ensuring an optimal trade-off between performance and efficiency. Extensive experiments confirm the effectiveness of our approach. For instance, at 2.54 bits, MC compresses 76.6% of the model, with only a 3.8% average accuracy loss. During dynamic inference, we further reduce activated parameters by 15%, with a performance drop of less than 0.6%.

MoE模型压缩量化动态剪枝

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。