Skip to main content
QUICK REVIEW

[论文解读] Outlier Suppression+: Accurate quantization of large language models by equivalent and optimal shifting and scaling

Xiuying Wei, Yuncheng Zhang|arXiv (Cornell University)|Apr 18, 2023
Topic Modeling被引用 6
一句话总结

Outlier Suppression+ (OS+) 提出了一种针对大语言模型的新型后训练量化框架,通过通道级偏移与缩放操作,抑制激活值中不对称且集中的异常值。通过将这些操作等效迁移至后续层,并优化偏移/缩放值以最小化输出变化,OS+ 在 8 位和 6 位下实现了接近浮点精度的性能,在 4 位 BERT 上实现了 15.5% 的准确率提升,创下新的 SOTA 记录。

ABSTRACT

Post-training quantization~(PTQ) of transformer language models faces significant challenges due to the existence of detrimental outliers in activations. We observe that these outliers are concentrated in specific channels and are asymmetric across channels. To address this issue, we propose the Outlier Suppression+~(OS+) framework, which contains the channel-wise shifting for asymmetry and channel-wise scaling for concentration. We show that these operations can be seamlessly migrated into subsequent modules while maintaining equivalence. Second, we propose a fast and stable scheme to calculate effective shifting and scaling values. The channel-wise shifting aligns the center of each channel for removal of outlier asymmetry. The channel-wise scaling quantitatively evaluates changes brought by migration and quantization for better quantization burden balance. We validate our OS+ under both standard and fine-grained quantization settings with models including BERT, OPT, BLOOM, BLOOMZ, and LLaMA. Comprehensive results across various tasks demonstrate the superiority of our approach. Especially, with standard quantization, OS+ can achieve near-floating-point performance on both small models and large language models on 8-bit and 6-bit. Besides, we establish a new state-of-the-art for 4-bit BERT with 15.5\% improvement. Our code is available at \url{https://github.com/ModelTC/Outlier_Suppression_Plus}.

研究动机与目标

  • 为解决后训练量化中不利异常值对大语言模型性能造成的损害,提升模型准确率。
  • 识别并利用此前被忽视的特性:通道间异常值分布的非对称性。
  • 开发一种方法,在保持全精度等价性的同时,通过优化偏移与缩放操作最小化量化误差。
  • 实现在无需额外训练或推理开销的前提下,高效且硬件友好的量化。
  • 在多种大语言模型上,于标准与细粒度量化设置下均实现最先进性能。

提出的方法

  • 引入通道级偏移,消除通道间异常值分布的非对称性,降低整体张量范围。
  • 应用通道级缩放,集中并抑制极端异常值,最小化其对量化的影响。
  • 设计统一的迁移模式,将偏移与缩放的影响转移至后续层,保持全精度模型输出不变。
  • 提出一种快速且稳定的优化方案,基于最小化输出变化而非仅激活或权重量化误差,计算有效的偏移与缩放值。
  • 使用量化目标函数平衡各层的量化负担,确保端到端输出偏差最小化。
  • 通过前序层的参数更新实现转换,无需额外计算或重新训练即可部署。

实验结果

研究问题

  • RQ1为何变换器激活中的异常值在后训练量化中会导致显著性能下降?
  • RQ2如何系统性地解决通道间异常值分布的非对称性,以提升量化准确率?
  • RQ3是否可以以一种保持全精度等价性的方式应用偏移与缩放操作,同时减少量化误差?
  • RQ4何种偏移与缩放值的优化策略可使量化模型的端到端输出变化最小化?
  • RQ5该方法是否可在 4 位、6 位和 8 位等低比特宽度下,于多种大语言模型上实现最先进性能?

主要发现

  • OS+ 在 8 位和 6 位量化下,于小型与大型语言模型上均实现了接近浮点精度的性能,准确率损失极小。
  • 在 4 位 BERT 上,OS+ 相较于先前方法实现了 15.5% 的准确率提升,创下新的 SOTA 记录。
  • 该方法将测试层的输出量化误差降低至 1334.89,显著低于 OS(6182.52)与 SQ(3535.86)。
  • OPT-175B 的校准仅需约 20 分钟,展现出实际应用中的高效性。
  • 推理延迟最高提升 1.5 倍,且在部署模型中无额外计算开销。
  • 在固定存储约束下,量化后的大型模型性能优于较小的 FP16 模型,表明其具备鲁棒性与可扩展性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。