提出无需训练的激活平滑方法,提升INT4量化精度
Rotated Runtime Smooth: Training-Free Activation Smoother for accurate INT4 inference
- 运行时用通道最大值平滑激活,消除通道级异常值
- 引入旋转操作缩小尖峰异常值与正常值差距
- 在LLaMA/Qwen模型上实现INT4推理精度显著提升
大语言模型在参数规模扩大后展现出强大能力,但服务时面临巨大的计算和内存开销。量化方法被用于降低服务成本与延迟。然而,激活值中的异常值阻碍了权重-激活INT4量化的发展。现有方法将异常值分离为两矩阵或转移至权重,导致高延迟或精度下降。观察发现,异常值可分为通道级和尖峰型。本文提出旋转运行时平滑(RRS),一种即插即用的激活平滑方法,包含运行时平滑(RS)与旋转操作。RS通过运行时使用通道最大值平滑激活,消除通道级异常值;旋转操作缩小尖峰异常值与正常值的差距,缓解通道平滑带来的副作用。该方法在LLaMA与Qwen系列模型上优于当前最优方法,使INT4推理下WikiText-2困惑度从57.33降至6.66。
原文摘要 · Abstract (English)
Large language models have demonstrated promising capabilities upon scaling up parameters. However, serving large language models incurs substantial computation and memory movement costs due to their large scale. Quantization methods have been employed to reduce service costs and latency. Nevertheless, outliers in activations hinder the development of INT4 weight-activation quantization. Existing approaches separate outliers and normal values into two matrices or migrate outliers from activations to weights, suffering from high latency or accuracy degradation. Based on observing activations from large language models, outliers can be classified into channel-wise and spike outliers. In this work, we propose Rotated Runtime Smooth (RRS), a plug-and-play activation smoother for quantization, consisting of Runtime Smooth and the Rotation operation. Runtime Smooth (RS) is introduced to eliminate channel-wise outliers by smoothing activations with channel-wise maximums during runtime. The rotation operation can narrow the gap between spike outliers and normal values, alleviating the effect of victims caused by channel-wise smoothing. The proposed method outperforms the state-of-the-art method in the LLaMA and Qwen families and improves WikiText-2 perplexity from 57.33 to 6.66 for INT4 inference.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。