arXiv:2609.00049cs.LGAug 2026

Manuscript Offprint

arXiv:2609.00049

REAL-Q: E2E LLM Quantization via Dynamic Gradient Descent

Qian Zhang, Yaoming Li, Zhewen Tan, Yanshu Wang, Heng Lu, Kun Su, Zongwei Lv, Wenhan Yu, Yongge Ma, Yinjun Han, Ruikuang Liu, Tong Yang

Abstract

Post-training quantization (PTQ) is essential for deploying large language models (LLMs) under strict resource constraints. State-of-the-art PTQ methods quantize each layer with a single closed-form second-order solver: to remain analytically tractable, they heavily approximate the global loss (dropping cross-channel coupling, pooling output rows into groups), and they then freeze the resulting Hessian across the entire layer, with no way to refresh it as the loss landscape shifts column by column—a phenomenon we call information misalignment. We propose REAL-Q (Real-time E2E-loss Aligned LLM Quantization), a novel PTQ paradigm that breaks this compromise: instead of diluting the objective for the sake of analytic tractability, REAL-Q targets an end-to-end-aligned surrogate of the global loss and refines it via fine-grained, dynamic Block-wise Gradient Descent applied after every column block (128 columns). By coupling this fine-grained correction with a sliding window mechanism for smooth cross-layer transitions, REAL-Q effectively mitigates error propagation across the network. On LLaMA-3.1 (8B and 70B) and Qwen3 (0.6B–32B) at W4A16, REAL-Q reduces end-to-end KL divergence by up to ~49% relative to state-of-the-art globally-guided methods.

1 Introduction

Large language models (LLMs) have demonstrated remarkable capabilities across a wide range of natural language processing tasks [Grattafori et al., 2024]. However, deploying models with billions of parameters incurs substantial compute and memory costs. Post-training quantization (PTQ) offers a practical solution by compressing model weights to low-bit representations without requiring costly retraining [Gholami et al., 2021].

Among PTQ methods, GPTQ [Frantar et al., 2023] has emerged as the foundational algorithm for weight-only compression. Building upon the Optimal Brain Surgeon (OBS) framework [Hassibi et al., 1993], its column-wise solver has been widely integrated into mainstream inference engines (e.g., vLLM, TensorRT-LLM) and extended by a vast lineage of state-of-the-art techniques [Dettmers et al., 2024, Li et al., 2025, Kim et al., 2025]. Despite its success, GPTQ has a fundamental limitation:

Inaccuracy of the Layer-Local Objective. GPTQ minimizes a layer-wise reconstruction MSE ∥Wx−W^x∥22\|\mathbf{W}\mathbf{x} - \hat{\mathbf{W}}\mathbf{x}\|_2^2, where x\mathbf{x} is the full-precision activation. This local objective suffers from a dual misalignment. Upstream, it assumes full-precision input activations x\mathbf{x} and ignores the perturbed inputs x^\hat{\mathbf{x}} arriving from previously quantized layers, leaving compounding errors uncorrected. Downstream, it weights all output-channel perturbations uniformly, ignoring that the true KL divergence depends on a strongly non-linear, highly coupled mapping through subsequent transformer blocks and the LM head. A surrogate that relies on unperturbed inputs and uniformly weights squared errors is therefore misaligned with the true quantization loss.

Preprint.

Recent works attempt to address these blind spots: GPTAQ [Li et al., 2025] recalibrates inputs to correct upstream errors, yet its per-layer loss remains a uniform reconstruction MSE. Conversely, GuidedQuant [Kim et al., 2025] incorporates end-to-end gradients to capture downstream sensitivity. However, it still leaves upstream errors uncorrected, and it relies on structural approximations such as ignoring fine-grained cross-channel coupling and sharing the Hessian across output groups. In addition, because the true end-to-end Hessian is prohibitively expensive to recompute, the already-approximated matrix remains static within each layer. While the true loss landscape shifts as weights are progressively quantized column by column, the misaligned Hessian causes compensation errors to accumulate as the column-wise sweep progresses. We refer to this phenomenon as information misalignment. Here, "information" refers to first- or second-order information such as the gradient and Hessian.

The shared limitation of these methods is structural: requiring the column-wise update to remain analytically solvable forces them to (i) heavily approximate the global loss—dropping cross-channel coupling, pooling output rows into groups, and otherwise compressing the second-order information until it fits a closed-form solver—and (ii) freeze the resulting Hessian over the entire layer, with no way to refresh it at finer granularity as the loss landscape shifts with each column quantization step. REAL-Q (Real-time E2E-loss Aligned LLM Quantization) addresses both limitations by interleaving fine-grained, dynamic corrections into the column-wise sweep, via two components:

An end-to-end-aligned objective: Aggregated Fisher MSE. REAL-Q's surrogate is a transformer-block-output Fisher MSE, derived from a second-order Taylor expansion of the global KL divergence at the current block's output. Using the full aggregated Fisher matrix preserves the cross-channel coupling that grouped baselines must discard, while the choice of expansion point keeps backpropagation confined to at most two adjacent blocks. A loss sliding window smooths the objective across block boundaries to prevent discontinuous jumps in the optimization landscape.

Fine-grained, dynamic Block-wise Gradient Descent. Rather than committing the entire layer to one frozen second-order solver, REAL-Q interleaves a single Adam [Kingma and Ba, 2014] gradient step into the GPTQ sweep after every column block (128 columns). This raises the correction granularity from the per-layer level used by prior solvers to the column-block level—roughly two orders of magnitude finer—and lets each step react to the most recent quantized state, since the gradient is recomputed online against the actual partially quantized weights. Adam's diagonal preconditioner additionally adapts the per-coordinate scale on the fly, providing implicit second-order information without ever inverting a Hessian.

In summary, our main contributions are as follows:

  • Aggregated Fisher MSE with Loss Sliding Window: Within the GPTQ-lineage sequential pipeline, we adopt an end-to-end-aligned objective in place of the layer-local MSE. We formulate an aggregated Fisher MSE that preserves cross-channel coupling while keeping the backpropagation overhead confined to localized block boundaries. To stabilize the sequential quantization process, we introduce a loss sliding window mechanism that smooths the transition of the objective across consecutive transformer blocks and prevents discontinuous jumps in the loss landscape.

  • Dynamic Block-wise Gradient Descent (Block-GD): We address the information misalignment of prior works by replacing static analytical solvers with a dynamic first-order approach. By aligning Adam-driven gradient feedback directly with column-block updates, this mechanism adapts to the shifting loss landscape and corrects accumulated upstream errors online.

  • Empirical Performance: Experiments on LLaMA-3.1 (8B and 70B) and Qwen3 (0.6B–32B) show that REAL-Q achieves the lowest KL on every model evaluated, reducing KL by up to ~49% on Qwen3-1.7B at W4A16 (Figure 1).