arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.01721cs.CL
收藏

DuQuant:通过对偶变换分布离群值可得到更优的量化大语言模型

DuQuant: Distributing Outliers via Dual Transformation Makes Stronger Quantized LLMs

Institute of Automation, CAS(中国科学院自动化研究所);City University of Hong Kong(香港城市大学);Tsinghua University(清华大学);Zhejiang University(浙江大学);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)

Haokun Lin, Haobo Xu, Yichen Wu, Jingzhi Cui, Yingtao Zhang, Linzhan Mou, Linqi Song, Zhenan Sun, Ying Wei

AI总结:

针对大语言模型量化中大量离群激活值导致低比特量化性能下降的问题,提出DuQuant方法,通过旋转与锯齿置换变换平滑离群分布,在4比特量化下多任务表现优于现有基线。

摘要:

大语言模型(LLM)的量化面临重大挑战,尤其是离群激活值的存在会阻碍高效的低比特表示。传统方法主要处理普通离群值(Normal Outliers),即所有token上幅度相对较大的激活值,但这类方法难以平滑数值显著更大的大量离群值(Massive Outliers),会导致低比特量化出现严重的性能下降。本文提出DuQuant这一新型方法,利用旋转和置换变换更有效地缓解大量离群值和普通离群值的问题。首先,DuQuant以特定离群维度为先验知识构建旋转矩阵,通过分块旋转将离群值重新分布到相邻通道;其次,采用锯齿形置换平衡各块间的离群值分布,降低分块方差,随后再进行一次旋转进一步平滑激活分布,提升模型性能。DuQuant简化了量化流程,在离群值管理上表现优异,即使在4比特权重-激活量化设置下,在多种规模和类型的LLM的多个任务上均优于现有最优基线。代码已开源:https://github.com/Hsu1023/DuQuant。

英文摘要:

Quantization of large language models (LLMs) faces significant challenges, particularly due to the presence of outlier activations that impede efficient low-bit representation. Traditional approaches predominantly address Normal Outliers, which are activations across all tokens with relatively large magnitudes. However, these methods struggle with smoothing Massive Outliers that display significantly larger values, which leads to significant performance degradation in low-bit quantization. In this paper, we introduce DuQuant, a novel approach that utilizes rotation and permutation transformations to more effectively mitigate both massive and normal outliers. First, DuQuant starts by constructing the rotation matrix, using specific outlier dimensions as prior knowledge, to redistribute outliers to adjacent channels by block-wise rotation. Second, We further employ a zigzag permutation to balance the distribution of outliers across blocks, thereby reducing block-wise variance. A subsequent rotation further smooths the activation landscape, enhancing model performance. DuQuant simplifies the quantization process and excels in managing outliers, outperforming the state-of-the-art baselines across various sizes and types of LLMs on multiple tasks, even with 4-bit weight-activation quantization. Our code is available at https://github.com/Hsu1023/DuQuant.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑