针对专家模型量化难题,提出平衡采样与亲和引导新方法。
MoEQuant: Enhancing Quantization for Mixture-of-Experts Large Language Models via Expert-Balanced Sampling and Affinity Guidance
- 通过专家均衡采样构建分布均匀的校准数据集
- 4比特量化下代码评测得分提升超10分(DeepSeekMoE-16B)
- 适合需要高效部署专家模型的研究者与工程师
混合专家(MoE)大语言模型通过动态路由与稀疏激活提升了效率与可扩展性,但面临显著内存开销,制约实际部署。后训练量化(PTQ)在应用于MoE模型时导致严重精度下降与泛化能力退化。本文分析发现,其核心挑战在于:(1) 专家间不平衡——样本在专家间分布不均,导致使用较少的专家校准不足且有偏差;(2) 专家内不平衡——由MoE特有的聚合机制引起,不同样本与其对应专家间的相关性差异大。为此,提出MoEQuant,包含两项新技术:(1) 专家均衡自采样(EBSS),基于词元累积概率与专家平衡度指标,高效构建专家分布均衡的校准集;(2) 亲和引导量化(AGQ),将样本与专家间的亲和关系引入量化过程,精准评估单个样本对各专家的影响。实验表明,MoEQuant在4比特量化下使DeepSeekMoE-16B在HumanEval上提升超过10分,显著改善性能与效率。
原文摘要 · Abstract (English)
Mixture-of-Experts (MoE) large language models (LLMs), which leverage dynamic routing and sparse activation to enhance efficiency and scalability, have achieved higher performance while reducing computational costs. However, these models face significant memory overheads, limiting their practical deployment and broader adoption. Post-training quantization (PTQ), a widely used method for compressing LLMs, encounters severe accuracy degradation and diminished generalization performance when applied to MoE models. This paper investigates the impact of MoE's sparse and dynamic characteristics on quantization and identifies two primary challenges: (1) Inter-expert imbalance, referring to the uneven distribution of samples across experts, which leads to insufficient and biased calibration for less frequently utilized experts; (2) Intra-expert imbalance, arising from MoE's unique aggregation mechanism, which leads to varying degrees of correlation between different samples and their assigned experts. To address these challenges, we propose MoEQuant, a novel quantization framework tailored for MoE LLMs. MoE-Quant includes two novel techniques: 1) Expert-Balanced Self-Sampling (EBSS) is an efficient sampling method that efficiently constructs a calibration set with balanced expert distributions by leveraging the cumulative probabilities of tokens and expert balance metrics as guiding factors. 2) Affinity-Guided Quantization (AGQ), which incorporates affinities between experts and samples into the quantization process, thereby accurately assessing the impact of individual samples on different experts within the MoE layer. Experiments demonstrate that MoEQuant achieves substantial performance gains (more than 10 points accuracy gain in the HumanEval for DeepSeekMoE-16B under 4-bit quantization) and boosts efficiency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。