Manuscript Offprint

arXiv:2609.31009

G2^2PTQ: Improving LLM Post-Training Quantization with Generalized Gradient Compensation

Ruikang Liu, Haoli Bai, Yuxuan Sun, Qian Zhang, Wenzheng Cai, Yanqi Hao, Feiyu Wang, Weidong Zhong, Zhuang Wang, Tong Yang, Xiangsheng Zhou

ABSTRACT

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²PTQ, 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²PTQ 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²PTQ enables better alignment with the full-precision model, outperforming state-of-the-art baselines. Code is available at: https://github.com/G2PTQ/G2PTQ.

1 INTRODUCTION

Large language models (LLMs) have demonstrated remarkable capabilities across a wide range of tasks, yet their deployment remains challenging due to substantial memory and computational requirements. Post-training quantization (PTQ) has emerged as a practical solution, compressing model weights to low-bit representations without retraining. Among PTQ methods, GPTQ (Frantar et al., 2023) and its variants have become the de facto standard, framing quantization as a second-order optimization problem: when a weight is quantized, the remaining weights are updated to compensate for the induced error using the layer-wise Hessian matrix.

Despite their success, existing GPTQ-based methods suffer from two complementary limitations. First, methods such as GPTQ (Frantar et al., 2023) and QuIP (Chee et al., 2023) minimize a local layer-wise mean-squared error (MSE) objective, which aligns individual linear layer outputs but may lead to suboptimal global model performance. Recent work (Edalati et al., 2025; Kim et al., 2025; Tseng et al., 2025) addresses this by replacing the local objective with an end-to-end negative log-likelihood (NLL) or KL divergence loss, using the Fisher information matrix to approximate the resulting Hessian. However, these methods compute the Hessian once at the start of quantization and keep it fixed throughout, causing the estimates to become increasingly stale as weights are progressively quantized. Second, GPTQ explicitly omits the first-order gradient term under the assumption of model convergence. While FOEM (Zheng et al., 2026) reintroduces this term and demonstrates its importance, it relies on a first-order Taylor approximation to compute gradients — an approximation that is exact only for the layer-wise MSE loss and introduces unnecessary

∗^{*}Corresponding author.

error under more expressive objectives such as KL divergence or block-wise MSE. Neither line of work simultaneously addresses both limitations: existing global-objective methods lack first-order information, while first-order methods remain confined to local objectives.

We propose G²PTQ (Post-Training Quantization with Generalized Gradient Compensation), a unified framework that integrates both first- and second-order information under a globally supervised, block-wise optimization objective. Rather than minimizing layer-wise MSE, G²PTQ adopts a block-wise strategy: for each Transformer block, it minimizes the discrepancy between the quantized and full-precision block outputs, using block-wise MSE for intermediate blocks and KL divergence for the final block. Crucially, G²PTQ refreshes both the gradient and Hessian estimates before quantizing each block via efficient backward passes through that block alone, avoiding the staleness that plagues methods with fixed Hessians while remaining far cheaper than full-model backward passes. For the first-order term, G²PTQ computes exact gradients rather than relying on Taylor approximations, and introduces a trust-region scaling mechanism that dynamically bounds the gradient compensation step to prevent exploding weight updates. We further derive efficient Hessian approximations for both block-wise objectives and a gradient compensation scheme with computational complexity of O(max⁡{dcol3,drow⋅dcol2})\mathcal{O}(\max\{d_{\mathrm{col}}^3, d_{\mathrm{row}} \cdot d_{\mathrm{col}}^2\}), matching the complexity of vanilla GPTQ.

The main contributions of this work are summarized as follows:

• We propose G²PTQ, a PTQ framework that integrates first- and second-order quantization error compensation under a block-wise optimization objective. Together with the refreshed information and a trust-region gradient compensation strategy, G²PTQ provides accurate and globally informed guidance for weight updates.

• We derive efficient implementations for the block-wise Hessian approximation and exact gradient compensation, making G²PTQ practical to deploy. For instance, quantizing an 8B model requires only 2.24 hours and 12.54 GB of memory on a single accelerator.

• Extensive experiments across diverse model families demonstrate that G²PTQ achieves closer alignment with full-precision models, as evidenced by lower KL divergence compared to state-of-the-art baselines, ultimately leading to enhanced downstream task accuracy.

References (74)