arXiv:2412.20185cs.LG2024-12被引 11

通过动态补偿关键通道误差,3比特大模型推理质量显著提升

DecDEC: A Systems Approach to Advancing Low-Bit LLM Quantization

  • 将量化误差残差存于CPU,仅动态加载激活异常的通道数据
  • 3比特Llama-3-8B指令模型困惑度降至9.12,优于3.5比特版本
  • 内存开销不足0.0003%,推理延迟仅增加1.7%,适合移动端部署

大语言模型(LLM)量化近期广受关注,尤其适用于资源受限的设备端场景。尽管高效,量化在极端低比特设置(如3比特、4比特)下仍会显著降低模型性能。本文提出DecDEC推理方案,在保持量化核心优势(显存节省、延迟降低)的同时,提升低比特LLM的质量。DecDEC将全精度与量化权重之差(残差矩阵)存储于CPU,并仅动态获取激活异常通道对应的残差数据,用于修正这些关键通道的量化误差。异常通道在每步解码时根据输入激活动态识别,适应激活分布的动态变化,最大化误差补偿效果。实验表明,结合当前顶尖量化方法,DecDEC可使3比特Llama-3-8B-Instruct模型的困惑度从10.15降至9.12,超越其3.5比特对应模型表现,同时显存开销增加不足0.0003%,在NVIDIA RTX 4050 Mobile上仅引入1.7%推理延迟增加。

原文摘要 · Abstract (English)

Quantization of Large Language Models (LLMs) has recently gained popularity, particularly for on-device settings with limited hardware resources. While efficient, quantization inevitably degrades model quality, especially in aggressive low-bit settings such as 3-bit and 4-bit precision. In this paper, we propose DecDEC, an inference scheme that improves the quality of low-bit LLMs while preserving the key benefits of quantization: GPU memory savings and latency reduction. DecDEC stores the residual matrix -- the difference between full-precision and quantized weights -- in CPU, and dynamically fetches the residuals for only a small portion of the weights. This portion corresponds to the salient channels, marked by activation outliers, with the fetched residuals helping to correct quantization errors in these channels. Salient channels are identified dynamically at each decoding step by analyzing the input activations -- this enables adaptation to the dynamic nature of activation distribution, thus maximizing the effectiveness of error compensation. We demonstrate the effectiveness of DecDEC by augmenting state-of-the-art quantization methods. For example, DecDEC reduces the perplexity of a 3-bit Llama-3-8B-Instruct model from 10.15 to 9.12 -- outperforming its 3.5-bit counterpart -- while adding less than 0.0003\% to GPU memory usage and incurring only a 1.7\% inference slowdown on NVIDIA RTX 4050 Mobile.

量化低比特推理优化大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。