G^2PTQ:利用广义梯度补偿改进LLM训练后量化
研究论文 · 2026/09/29
训练后量化(PTQ)是降低大语言模型(LLM)内存和计算开销的实用方法,无需重新训练。基于GPTQ的方法已成为事实标准,但存在两个互补的局限:局部逐层目标的方法缺乏全局监督;而全局目标的方法在开始时固定Hessian估计并忽略一阶梯度,导致量化过程中指导信息过时。本文提出G^2PTQ,一个统一的PTQ框架,采用广义梯度补偿,在全局监督的块级优化目标下整合一阶和二阶信息。通过在量化每个Transformer块之前刷新梯度和Hessian估计,G^2PTQ避免了先前全局方法的过时问题。此外,为稳定精确的一阶补偿,我们引入信赖域缩放机制,动态限制梯度步长以防止权重更新爆炸。最后,我们推导了块级Hessian近似和精确梯度补偿的高效实现。在不同模型系列和位宽上的实验结果表明,G^2PTQ能更好地与全精度模型对齐,优于最先进的基线。代码见:https://github.com/G2PTQ/G2PTQ。
该论文针对现有GPTQ类训练后量化方法的两个关键局限(局部目标缺乏全局监督、全局目标指导信息过时),提出了统一的解决方案,在全局监督下整合一阶和二阶信息,并通过信赖域缩放稳定优化,实验证明优于现有方法,对LLM高效部署有实际意义。
Post-training quantization (PTQ) is a practical approach to reducing the memory and computational footprint of large language models (LLMs) without retraining. GPTQ-based methods have become the de facto standard, yet they suffer from two complementary limitations. Methods with local, layer-wise objectives lack global supervision; while methods with global objectives fix their Hessian estimates at the start and ignore first-order gradients, so their guidance grows stale as quantization proceeds. This paper presents G^2PTQ, a unified PTQ framework with Generalized Gradient Compensation that integrates both first- and second-order information under a globally supervised, block-wise optimization objective. By refreshing gradient and Hessian estimates before quantizing each Transformer block, G^2PTQ avoids the staleness of prior global methods. Furthermore, to stabilize the exact first-order compensation, we introduce a trust-region scaling mechanism that dynamically bounds the gradient step to prevent exploding weight updates. Finally, we derive efficient implementations for block-wise Hessian approximation and exact gradient compensation. Experimental results on various model families and bit-widths demonstrate that G^2PTQ enables better alignment with the full-precision model, outperforming state-of-the-art baselines. Code is available at: https://github.com/G2PTQ/G2PTQ.