提出新量化方法BDQ,显著降低大模型推理时的精度损失。
Theory-optimal Quantization Based on Flatness

- 基于平坦度指标设计矩阵变换,分散激活异常值分布
- W4A4下LLaMA-3-8B模型精度损失小于1%,性能领先
- 在极低比特(W2A4KV16)场景下减少39.1%性能差距
后训练量化已成为压缩和加速大语言模型(LLMs)推理的常用技术。其主要挑战源于激活异常值,尤其在低比特精度下会显著损害模型性能。尽管现有方法通过跨特征维度的线性变换缓解异常值问题,但我们的分析发现,变换后的权重与激活仍存在集中分布的异常值模式。本文首先建立量化误差与异常值之间的数学关系,提出新的平坦度(Flatness)指标用于量化异常值分布。基于此,推导出关于平坦度的理论最优解。在此基础上,提出双向对角量化(BDQ)框架,通过学习到的对角操作优化矩阵变换,有效分散异常值模式。大量实验表明,BDQ建立了新的量化基准:在LLaMA-3-8B模型上实现W4A4量化时精度损失低于1%;在更难的W2A4KV16设置下,相较于现有最优方法,于DeepSeek-R1-Distill-LLaMA-70B模型上将性能差距缩小了39.1%。
原文摘要 · Abstract (English)
Post-training quantization has emerged as a widely adopted technique for compressing and accelerating the inference of Large Language Models (LLMs). The primary challenges in LLMs quantization stem from activation outliers, which significantly degrade model performance especially at lower bit precision. While recent approaches attempt to mitigate outliers through linear transformations across feature dimensions, our analysis reveals that the transformed weights and activations still exhibit persistent outlier patterns with concentrated magnitude distributions. In this paper, we first model the mathematical relationship between quantization error and outliers, and then introduce a new metric Flatness to quantify the distribution of outliers. Based on this, we derive the theoretical optimal solution with respect to Flatness. Building on these insights, we propose Bidirectional Diagonal Quantization (BDQ), a novel post-training quantization framework that effectively disperses outlier patterns through optimized matrix transformations. BDQ strategically distributes outlier magnitudes across matrix dimensions via learned diagonal operations. Extensive experiments demonstrate that BDQ establishes a new quantization benchmark. It achieves less than 1\% accuracy drop in W4A4 quantization on the LLaMA-3-8B model. In the more challenging W2A4KV16 experiment, compared to state-of-the-art approaches, BDQ reduces the performance gap by 39.1\% on the DeepSeek-R1-Distill-LLaMA-70B model.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。