通过原子专家粒度与海森信息,实现高效低损的MoE模型压缩。
HEAPr: Hessian-based Efficient Atomic Expert Pruning in Output Space
- 将专家拆解为原子单元,用海森信息衡量其重要性。
- 在20%~25%压缩比下几乎无精度损失,计算量降低近20%。
- 适合追求高压缩率且保持性能的LLM部署场景。
大型语言模型中的混合专家(MoE)架构相比密集模型具有卓越性能和更低推理成本,但其庞大的参数量带来高昂内存开销,限制实际部署。现有剪枝方法多集中于专家级剪枝,粒度粗导致显著精度下降。本文提出HEAPr,将专家分解为更小的不可分割原子专家,实现更精细灵活的剪枝。利用类最优脑外科理论的二阶信息衡量每个原子专家的重要性,并借助原子专家固有属性,将专家参数的二阶信息转化为原子专家输出的二阶信息,使空间复杂度从$O(d^4)$降至$O(d^2)$。HEAPr仅需在小校准集上进行两次前向、一次反向传播即可完成重要性计算。在DeepSeek MoE和Qwen MoE系列模型上的大量实验表明,HEAPr在多种剪枝比例和基准测试中均优于现有专家级剪枝方法。尤其在20%~25%剪枝比下,多数模型实现近乎无损压缩,同时减少近20%的计算量。代码已公开于[https://github.com/LLIKKE/HEAPr](https://github.com/LLIKKE/HEAPr)。
原文摘要 · Abstract (English)
Mixture-of-Experts (MoE) architectures in large language models (LLMs) deliver exceptional performance and reduced inference costs compared to dense LLMs. However, their large parameter counts result in prohibitive memory requirements, limiting practical deployment. While existing pruning methods primarily focus on expert-level pruning, this coarse granularity often leads to substantial accuracy degradation. In this work, we introduce HEAPr, a novel pruning algorithm that decomposes experts into smaller, indivisible atomic experts, enabling more precise and flexible atomic expert pruning. To measure the importance of each atomic expert, we leverage second-order information based on principles similar to the Optimal Brain Surgeon theory. To address the computational and storage challenges posed by second-order information, HEAPr exploits the inherent properties of atomic experts to transform the second-order information from expert parameters into that of atomic expert parameters, and further simplifies it to the second-order information of atomic expert outputs. This approach reduces the space complexity from $O(d^4)$, where $d$ is the model's dimensionality, to $O(d^2)$. HEAPr requires only two forward passes and one backward pass on a small calibration set to compute the importance of atomic experts. Extensive experiments on MoE models, including DeepSeek MoE and Qwen MoE family, demonstrate that HEAPr outperforms existing expert-level pruning methods across a wide range of pruning ratios and benchmarks. Specifically, HEAPr achieves nearly lossless compression at pruning ratios of 20% ~ 25% in most models, while also reducing FLOPs nearly by 20%. The code can be found at [https://github.com/LLIKKE/HEAPr](https://github.com/LLIKKE/HEAPr).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。