arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2309.02784cs.LGcs.AIcs.CL
收藏

Norm Tweaking:大语言模型的高性能低比特量化

Norm Tweaking: High-performance Low-bit Quantization of Large Language Models

Meituan(美团)

Liang Li, Qingyuan Li, Bo Zhang, Xiangxiang Chu

AI总结:

针对大语言模型低比特量化精度下降问题,提出norm tweaking范数调整技术,通过修正激活分布、优化归一化层权重提升PTQ效果,在2比特量化下可达到浮点模型精度。

摘要:

随着大语言模型(LLM)规模的持续增长,在不损失精度的前提下实现模型压缩已成为部署环节的关键挑战。尽管GPTQ等量化方法在实现可接受的4位仅权重量化方面取得了进展,但更低比特的量化尝试往往会导致严重的性能下降。本文提出一种名为norm tweaking(范数调整)的技术,可作为现有PTQ(训练后量化)方法的插件,在实现高精度的同时保持成本效益。我们的方法源于一项观察:修正量化后的激活分布使其与浮点版分布匹配,即可快速恢复大语言模型的精度。为此,我们精心设计了一套调整策略,包含校准数据生成和逐通道距离约束,用于更新归一化层的权重以提升泛化能力。我们使用多个开源大语言模型在各类数据集上开展了大量实验。我们的方法在仅权重量化以及权重与激活联合量化场景中均展现出显著提升,性能超越现有PTQ方法。在GLM-130B和OPT-66B模型上,我们的方法甚至实现了2比特量化精度与浮点模型精度相当的效果。这一简单有效的方法更适用于实际应用场景。

英文摘要:

As the size of large language models (LLMs) continues to grow, model compression without sacrificing accuracy has become a crucial challenge for deployment. While some quantization methods, such as GPTQ, have made progress in achieving acceptable 4-bit weight-only quantization, attempts at lower-bit quantization often result in severe performance degradation. In this paper, we introduce a technique called norm tweaking, which can be used as a plugin in current PTQ methods to achieve high precision while being cost-efficient. Our approach is inspired by the observation that rectifying the quantized activation distribution to match its float counterpart can readily restore accuracy for LLMs. To achieve this, we carefully design a tweaking strategy that includes calibration data generation and channel-wise distance constraint to update the weights of normalization layers for better generalization. We conduct extensive experiments on various datasets using several open-sourced LLMs. Our method demonstrates significant improvements in both weight-only quantization and joint quantization of weights and activations, surpassing existing PTQ methods. On GLM-130B and OPT-66B, our method even achieves the same level of accuracy at 2-bit quantization as their float ones. Our simple and effective approach makes it more practical for real-world applications.

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

↑