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

QQQ:面向大语言模型的高质量四位量化方法

QQQ: Quality Quattuor-Bit Quantization for Large Language Models

Meituan(美团);Zhejiang University(浙江大学)

Ying Zhang, Peng Zhang, Mincong Huang, Jingyang Xiang, Yujie Wang, Chao Wang, Yineng Zhang, Lei Yu, Chuan Liu, Wei Lin

AI总结:

本文提出QQQ方法,通过4位权重、8位激活值的量化方案,结合自适应平滑与Hessian补偿技术,在保持大语言模型性能的同时显著加速推理。

摘要:

量化是一种被证明有效的大语言模型压缩方法。尽管W8A8和W4A16等流行技术能够有效保持模型性能,但它们往往无法同时加速推理的预填充和解码阶段。W4A8是一种有前景的策略,可以同时加速这两个阶段,但通常会导致显著的性能下降。为了解决这些问题,我们提出了QQQ,一种具有4位权重和8位激活值的高质量四位量化方法。QQQ采用自适应平滑和基于Hessian矩阵的补偿,在无需大量训练的情况下显著提升量化模型的性能。此外,我们精心设计了W4A8 GEMM内核以提高推理速度。我们专用的逐通道W4A8 GEMM和逐组W4A8 GEMM相比FP16 GEMM分别实现了3.67倍和3.29倍的显著加速。大量实验表明,QQQ在性能上与现有最先进的大语言模型量化方法相当,同时显著加速推理,与FP16、W8A8和W4A16相比,分别实现了最高2.24倍、2.10倍和1.25倍的加速。

英文摘要:

Quantization is a proven effective method for compressing large language models. Although popular techniques like W8A8 and W4A16 effectively maintain model performance, they often fail to concurrently speed up the prefill and decoding stages of inference. W4A8 is a promising strategy to accelerate both of them while usually leads to a significant performance degradation. To address these issues, we present QQQ, a Quality Quattuor-bit Quantization method with 4-bit weights and 8-bit activations. QQQ employs adaptive smoothing and Hessian-based compensation, significantly enhancing the performance of quantized models without extensive training. Furthermore, we meticulously engineer W4A8 GEMM kernels to increase inference speed. Our specialized per-channel W4A8 GEMM and per-group W4A8 GEMM achieve impressive speed increases of 3.67$\times$ and 3.29 $\times$ over FP16 GEMM. Our extensive experiments show that QQQ achieves performance on par with existing state-of-the-art LLM quantization methods while significantly accelerating inference, achieving speed boosts up to 2.24 $\times$, 2.10$\times$, and 1.25$\times$ compared to FP16, W8A8, and W4A16, respectively.

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

↑