arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2404.03605cs.LGcs.CL
收藏

通过激活正则化缓解大语言模型量化中离群通道的影响

Mitigating the Impact of Outlier Channels for Language Model Quantization with Activation Regularization

Massachusetts Institute of Technology(麻省理工学院);MIT-IBM Watson AI Lab(MIT-IBM沃森人工智能实验室);IBM Research(IBM研究院);IST Austria(奥地利科学技术研究所);Neural Magic, Inc.(Neural Magic公司)

Aniruddha Nrusimha, Mayank Mishra, Naigang Wang, Dan Alistarh, Rameswar Panda, Yoon Kim

AI总结:

针对语言模型4比特量化中离群通道阻碍激活量化的问题,提出结合量化感知训练与激活峰度正则化的方法,成功获得性能媲美标准精度的W4A4模型。

摘要:

我们考虑语言模型的精确量化问题,其中权重和激活值均被均匀量化为每个参数4比特,这是GPU硬件原生支持的最低比特宽格式。在此背景下,关键挑战在于激活量化:已知语言模型包含离群通道,其平均值比其他通道高出数个数量级,这阻碍了利用现有技术进行精确的低比特宽量化。我们系统地研究了这一现象,发现这些离群通道在训练早期就会出现,并且在带有残差流的层中出现得更频繁。随后,我们提出了一种简单的策略,通过量化感知训练(QAT)正则化层的输入,并通过激活峰度正则化正则化其输出。我们证明,同时正则化输入和输出对于防止模型将输入量化的难度“迁移”到权重中至关重要,因为这种迁移会使权重的训练后量化(PTQ)变得更加困难。当与权重PTQ相结合时,我们表明该方法能够获得一个W4A4模型,其性能可与标准精度的W16A16基线相媲美。

英文摘要:

We consider the problem of accurate quantization for language models, where both the weights and activations are uniformly quantized to 4 bits per parameter, the lowest bitwidth format natively supported by GPU hardware. In this context, the key challenge is activation quantization: it is known that language models contain outlier channels whose values on average are orders of magnitude higher than than other channels, which prevents accurate low-bitwidth quantization with known techniques. We systematically study this phenomena and find that these outlier channels emerge early in training, and that they occur more frequently in layers with residual streams. We then propose a simple strategy which regularizes a layer's inputs via quantization-aware training (QAT) and its outputs via activation kurtosis regularization. We show that regularizing both the inputs and outputs is crucial for preventing a model's "migrating" the difficulty in input quantization to the weights, which makes post-training quantization (PTQ) of weights more difficult. When combined with weight PTQ, we show that our approach can obtain a W4A4 model that performs competitively to the standard-precision W16A16 baseline.

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

↑