CodeQuant通过聚类与量化联合优化,显著降低低精度MoE模型中的异常值误差。
CodeQuant: Unified Clustering and Quantization for Enhanced Outlier Smoothing in Low-Precision Mixture-of-Experts

- 将激活和权重异常值统一处理,利用可学习旋转和平移聚类中心进行平滑。
- 在多种MoE模型上实现比现有方法更高精度,最高提速4.15倍。
- 适合追求高效低精度部署的大语言模型研发者使用。
异常值已成为低精度大规模模型(尤其是混合专家MoE架构)保持准确性的主要瓶颈。后训练量化(PTQ)下,异常值引发显著量化误差,导致严重精度下降。尽管近期基于旋转的平滑技术能缓解问题,但残余误差仍阻碍可靠部署。本文提出CodeQuant,一种统一的量化与聚类方案:通过可学习旋转平滑激活异常值,并将权重异常值吸收进微调后的聚类中心,从而降低极端值影响,减少量化误差的同时保持表达能力。结合针对GPU和CPU的专用内核设计,CodeQuant在多种MoE模型上实现最高4.15倍加速,且精度显著优于当前最优量化方法。结果表明,CodeQuant是低精度约束下高效准确部署MoE型大语言模型的有前景方向。代码已开源:https://github.com/SAI-Lab-NYU/CodeQuant。
原文摘要 · Abstract (English)
Outliers have emerged as a fundamental bottleneck in preserving accuracy for low-precision large models, particularly within Mixture-of-Experts (MoE) architectures that are increasingly central to large-scale language modeling. Under post-training quantization (PTQ), these outliers induce substantial quantization errors, leading to severe accuracy degradation. While recent rotation-based smoothing techniques alleviate the problem by redistributing outlier magnitudes, residual errors remain and continue to impede reliable low-precision deployment. In this work, we tackle this challenge by introducing CodeQuant, a unified quantization-and-clustering scheme that contains smoothing activation outliers via learnable rotation and absorbing weight outliers into fine-tuned cluster centroids for MoE. This design reduces the influence of extreme values by fitting them within cluster centroids, thereby lowering quantization error while maintaining expressive capacity. Coupled with a dedicated kernel design for GPU and CPU, CodeQuant achieves up to $4.15\times$ speedup while delivering significantly higher accuracy than state-of-the-art quantization approaches across diverse MoE models. Our results highlight CodeQuant as a promising direction for efficient and accurate deployment of MoE-based large language models under low-precision constraints. Our code is available at https://github.com/SAI-Lab-NYU/CodeQuant.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。