重新定义残差误差,让大模型量化更精准。
Rethinking Residual Errors in Compensation-based LLM Quantization
- 改进补偿量化中的校准目标,直接对齐原始模型输出。
- 发现并引入‘补偿感知误差’,提升每层权重更新精度。
- 可无缝集成现有方法,适合追求高精度量化的研究者。
基于权重补偿的量化方法通过迭代量化与补偿,在大语言模型(LLMs)量化中表现出色。代表性工作GPTQ引入多项关键技术,使该方法适用于数十亿参数的模型。GPTAQ进一步提出非对称校准流程,将每层量化输出与补偿后权重的输出对齐,并在补偿框架中引入残差误差。本文重新审视残差误差的定义,发现现有方法在层内校准时,仅将量化输出与补偿权重输出对齐,而非真实全精度模型输出,存在次优目标。为此,我们重新定义目标,使量化输出在每一步都精确对齐原全精度模型输出。同时揭示残差误差不仅来自前层输出差异,还源于本层补偿权重与原始权重间的偏差,称之为‘补偿感知误差’。借助GPTAQ的神经元分解技术,可高效将该误差融入权重更新。大量实验表明,所提改进可无缝集成至GPTQ与GPTAQ,显著提升量化性能。代码已开源:https://github.com/list0830/ResComp。
原文摘要 · Abstract (English)
Methods based on weight compensation, which iteratively apply quantization and weight compensation to minimize the output error, have recently demonstrated remarkable success in quantizing Large Language Models (LLMs). The representative work, GPTQ, introduces several key techniques that make such iterative methods practical for LLMs with billions of parameters. GPTAQ extends this approach by introducing an asymmetric calibration process that aligns the output of each quantized layer with its full-precision counterpart, incorporating a residual error into the weight compensation framework. In this work, we revisit the formulation of the residual error. We identify a sub-optimal calibration objective in existing methods: during the intra-layer calibration process, they align the quantized output with the output from compensated weights, rather than the true output from the original full-precision model. Therefore, we redefine the objective to precisely align the quantized model's output with the original output of the full-precision model at each step. We then reveal that the residual error originates not only from the output difference of the preceding layer but also from the discrepancy between the compensated and original weights within each layer, which we name the 'compensation-aware error'. By inheriting the neuron decomposition technique from GPTAQ, we can efficiently incorporate this compensation-aware error into the weight update process. Extensive experiments on various LLMs and quantization settings demonstrate that our proposed enhancements integrate seamlessly with both GPTQ and GPTAQ, significantly improving their quantization performance. Our code is publicly available at https://github.com/list0830/ResComp.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。