Source-linked AI summary
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
TL;DR
Existing PTQ solvers approximate the global loss and freeze Hessians, creating information misalignment as columns are quantized. REAL-Q uses an end-to-end-aligned Fisher objective with sliding-window smoothing and dynamic Block-GD, reducing W4A16 end-to-end KL by up to ∼49% relative to globally guided methods.
Problem
Prior PTQ methods approximate the global loss by dropping cross-channel coupling or grouping output rows, then freeze the Hessian while the loss landscape shifts during column-wise quantization.
Method
REAL-Q combines a full Aggregated Fisher MSE and loss sliding window with Adam-based Block-GD after every 128-column block.
Results
REAL-Q achieves the lowest KL on every evaluated model and reduces KL by up to ∼49% on Qwen3-1.7B at W4A16.
Takeaways & Limitations
REAL-Q reduces information misalignment while preserving cross-channel coupling through dynamic, fine-grained corrections.
Takeaways & Limitations
The Adam descent guarantee does not directly transfer from the SGD analysis, although consistent empirical descent is observed at the experimental learning rates.
Abstract
from arXiv · showhide
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
REAL-Q targets the end-to-end quantization loss rather than GPTQ-style layer-local reconstruction, addressing upstream error accumulation, downstream sensitivity, structural approximations, and frozen Hessians. It combines an Aggregated Fisher MSE, sliding-window stabilization, and dynamic Block-GD, achieving the lowest KL across evaluated models.
- PTQ compresses LLM weights to low-bit representations to reduce deployment compute and memory costs without costly retraining.
- GPTQ’s layer-local reconstruction MSE assumes full-precision inputs and therefore leaves errors from previously quantized layers uncorrected.
- The true end-to-end loss is misrepresented when output perturbations are weighted uniformly despite nonlinear, strongly coupled downstream mappings.
- Prior methods approximate the global loss by dropping cross-channel coupling and freeze an approximate Hessian while the loss landscape shifts during column-wise quantization.
- REAL-Q uses an end-to-end-aligned Aggregated Fisher MSE, a sliding window across blocks, and Adam-based Block-GD after every 128-column block.
- REAL-Q achieves the lowest KL on every evaluated model and reduces KL by up to ∼49% on Qwen3-1.7B at W4A16.
2 Related Work
Related work builds on second-order GPTQ-style compression and increasingly incorporates broader model context. REAL-Q is positioned against methods that recalibrate inputs or use end-to-end saliency while retaining structural approximations.
- GPTQ scaled OBS-style second-order compression to billion-parameter LLMs and became a dominant sequential PTQ pipeline.
- Figure 1 compares W4A16 per-row KL divergence on WikiText-2, where lower values are better and REAL-Q is compared with GuidedQuant.
- GPTAQ recalibrates activations using outputs from previously quantized layers to incorporate upstream quantization drift.
- Related work also covers rotations, weight-only representations, quantization-aware training, classical Fisher methods, and BRECQ, whose pipeline differs fundamentally from REAL-Q.
3 Preliminaries
The preliminaries define PTQ as minimizing output-quality degradation under quantized weights and review GPTQ’s column-wise Hessian compensation. GuidedQuant adds saliency-weighted Hessians but groups output rows, discarding exact cross-channel coupling.
- PTQ seeks quantized weights that minimize degradation in a pretrained LLM’s output quality.
- Quantization quality is measured using KL divergence between original and quantized model outputs, with perplexity and zero-shot accuracy reported secondarily.
- GPTQ quantizes weight columns sequentially, computes each column’s residual, and updates remaining unquantized columns to compensate.
- GPTQ groups columns into blocks and applies a batch update using the accumulated block error and the localized reconstruction-MSE Hessian.
- GuidedQuant weights its Hessian computation with end-to-end saliency scores and maintains separate Hessians for four output-row groups.
- Grouping makes GuidedQuant computationally feasible but discards exact cross-channel coupling and reduces second-order precision.
4 REAL-Q
REAL-Q combines an end-to-end-aligned Aggregated Fisher MSE surrogate with dynamic Block-wise Gradient Descent and a loss sliding window to improve sequential PTQ.
- 4 REAL-Q: REAL-Q augments the conventional saliency-weighted analytical update with Fisher guidance, dynamic Block-GD, and cross-block objective interpolation.This coarse-to-fine hierarchy targets residual upstream perturbations and structural imprecision left by static solvers.
- 4 REAL-Q: REAL-Q replaces layer-local MSE with an end-to-end-aligned Aggregated Fisher MSE that preserves cross-channel coupling while remaining tractable.The surrogate moves the objective to transformer-block outputs and uses a full aggregated Fisher matrix.
- 4 REAL-Q: The surrogate deliberately trades token-wise correlations for full cross-channel covariance, avoiding the memory cost of per-token Hessians.Mean-field decoupling makes the full aggregated Fisher materializable without memory explosion.
- 4 REAL-Q: REAL-Q applies one Adam correction after every 128-column block to update remaining unquantized weights using the current partially quantized state.Already-quantized weights remain locked, and the gradient is computed against the current transformer-block surrogate.
- 4 REAL-Q: The loss sliding window blends objectives across consecutive transformer blocks, smoothing discontinuities while limiting backpropagation to two adjacent blocks.The cumulative block-step index spans all linear modules within a transformer block.
5 Theoretical Analysis
The analysis formalizes error accumulation in static Hessian solvers and gives a sufficient cosine-similarity condition for first-order surrogate updates to descend on the true loss.
- 5 Theoretical Analysis: Under linear structural drift, static analytical solvers incur expected uncompensated error scaling as Ω(n · ¯ϵ2 · ∥H∥2).Here n is the column dimension and ¯ϵ2 is the expected squared residual.
- 5 Theoretical Analysis: The linear growth with module width indicates that static solvers cannot prevent compounding cross-column errors under the stated assumption.The result concerns the gap between the shifting true Hessian and the static approximation.
- 5 Theoretical Analysis: For a β-smooth true objective, a surrogate-gradient step strictly decreases the global loss when the surrogate and true gradients satisfy the derived cosine threshold.The condition is stated for the first-order update analyzed in the descent-lemma argument.
- 5 Theoretical Analysis: The cosine condition does not directly transfer to Adam because its preconditioned step direction is not necessarily aligned with the surrogate gradient.The paper reports consistent empirical descent for Adam under the learning rates used in its experiments.
6 Experiments
REAL-Q is evaluated across weight-only, low-bit, weight-activation, ablation, and gradient-alignment settings, using KL divergence as the primary fidelity metric. It achieves the lowest KL divergence on representative W4A16 models, beats baselines at lower weight bit-widths, and maintains strong surrogate-gradient alignment.
- Evaluation setup: KL divergence is the primary fidelity metric because post-trained Qwen3 bf16 references are not necessarily optimal for perplexity or zero-shot accuracy.Perplexity and downstream accuracy are reported as secondary metrics.
- Main results: REAL-Q achieves the lowest KL divergence on every representative W4A16 model reported in Table 1.The comparison covers one LLaMA-3.1 model and three Qwen3 sizes, with the full seven-model table deferred to Appendix D.2.
- Low-bit weight-only quantization: REAL-Q beats every baseline, including GuidedQuant, on Qwen3-8B at both W3A16 and W2A16.These are low-bit weight-only settings with group size 128.
- Weight-activation quantization: The weight-activation evaluation covers Qwen3-8B under W4A4KV4, W3A4KV4, and W2A4KV4 configurations with activation-aware and activation-unaware variants.Weights use group size 128, while activations and KV cache are quantized per-token.
- Ablation: Column block size B has the largest single-knob impact in the Qwen3-4B ablation, supporting finer and more frequent gradient corrections.The base configuration uses sliding window, aloss_clip=0.95, B=128, and 32 backward samples per step.
- Loss approximation quality: REAL-Q’s full Fisher surrogate remains aligned with the true end-to-end KL gradient, while GuidedQuant, GPTQ, and GPTAQ surrogates remain near zero alignment.The alignment comparison is reported on Qwen3-0.6B at W4A16.
7 Discussion, Limitations, and Future Work
REAL-Q replaces static analytical quantization solvers with dynamic, coarse-to-fine optimization that preserves fuller global-loss information and refreshes updates during quantization. The approach adds calibration-time computation and memory overhead, motivating future systems optimization.
- Discussion: REAL-Q combines an aggregated Fisher objective, Block-wise Gradient Descent, and a sliding-window loss to reduce information misalignment.The method is presented as a dynamic, coarse-to-fine optimization hierarchy replacing static analytical solvers.
- Method implications: The aggregated Fisher formulation preserves cross-channel coupling while the sliding window smooths objective transitions across transformer blocks.The algorithm computes Fisher quantities before sequentially quantizing layers and modules.
- Limitations and future work: REAL-Q introduces additional calibration-time computational and memory overhead compared with static solvers.The paper identifies memory-efficient backward kernels and intermediate activation offloading as future optimization directions.
- Optimization procedure: Block-wise Gradient Descent applies Adam updates after each column block, using either true KL divergence at the final layer or a sliding-window loss elsewhere.The algorithm updates trailing columns after each block-wise quantization step.
B Extended Related Work
Extended related work spans weight-only PTQ, rotation-based preprocessing, QAT, Fisher/Hessian compression, and block-output reconstruction. These methods differ from REAL-Q in optimization regime or structural approximations, including grouped Hessians and mean-field decoupling.
- Weight-only PTQ: Weight-only PTQ protects salient channels, clusters weights non-uniformly, preserves outliers, or optimizes quantization parameters while keeping activations higher precision.The cited methods include AWQ, SqueezeLLM, SpQR, and OmniQuant.
- Incoherence and rotation-based methods: Rotation-based methods apply orthogonal transforms to reduce outlier magnitudes and produce more uniform weight and activation distributions.QuIP, QuIP#, and SliceGPT represent this family.
- Quantization-aware training and fine-tuning: Quantization-aware training and fine-tuning trade calibration efficiency for additional optimization, using distillation, low-rank adapters, alternating optimization, or codebook tuning.These approaches require training beyond a purely post-training analytical solver.
- Hessian and Fisher information in compression: Second-order compression methods use empirical Fisher or estimated Hessian information for pruning and quantization, providing precedents for Fisher-based objectives.The cited examples include WoodFisher, structured-pruning Fisher metrics, HAWQ, and HAWQ-V2.
- Comparison with BRECQ: BRECQ uses a conceptually similar block-output Fisher reconstruction loss but jointly optimizes continuous block parameters, unlike REAL-Q’s discrete sequential GPTQ-style pipeline.Its optimization regime therefore differs from REAL-Q even where the loss construction is related.
- Grouped Hessian approximations: Grouped Hessian formulations approximate the full objective by pooling output rows, while REAL-Q’s derivation identifies the resulting gap with cross-channel covariance terms.The cited derivation connects the decoupled surrogate to a trace-covariance discrepancy.
C.2 Error Accumulation in Column-wise Quantization
Column-wise GPTQ-style quantization uses a fixed Hessian to derive closed-form compensation, but the downstream-aware Hessian can drift as quantization proceeds. Under stated drift and residual assumptions, the resulting uncompensated penalty grows with the number of columns.
- Fixed-Hessian column quantization: GPTQ minimizes a layer-wise quadratic reconstruction objective using input covariance H as a fixed Hessian and compensates remaining columns after each quantization step.The OBS-style update yields an exact closed-form reconstruction error under the fixed-Hessian objective.
- Hessian drift: Static compensation becomes misaligned when the true downstream-aware Hessian H(j) differs from the cached H as column quantization progresses.The analysis models this difference through ΔH(j) and its projection along the compensation direction.
- Hessian drift: Under a linear structural-drift assumption, the projection gap grows at least proportionally to j/n, increasing the step-wise penalty later in the quantization sweep.The bound depends on the compensation direction and the spectral norm of H.
- Cumulative penalty: Assuming residual magnitudes are independent of macroscopic progress, the expected cumulative uncompensated penalty scales as Ω(n · ε̄^2 · ||H||_2).This lower bound is derived under the stated structural-drift and residual-independence assumptions.
- Descent condition: A surrogate gradient guarantees strict descent on the true objective only when its cosine similarity with the true gradient exceeds a learning-rate- and smoothness-dependent threshold.The condition follows from the descent lemma for a β-smooth objective.
- Descent condition: REAL-Q’s full aggregated Fisher matrix empirically achieves high gradient cosine similarity and satisfies this condition under the tested learning rates.The cited evidence supports the empirical observation for the SGD-style condition, while Adam’s preconditioned direction is not directly covered by the same inequality.
D.2 Full W4A16 Results (continuation of Section 6.2)
The full seven-model W4A16 sweep reports REAL-Q as the lowest-KL method on every evaluated model. Its learning rates were selected using a coarse, low-fidelity proxy search rather than fine-grained per-model tuning.
- Full W4A16 results: REAL-Q achieves the lowest KL on every model in the seven-model W4A16 sweep.The sweep covers the models summarized in Section 6.2; LLaMA-3.1-70B uses 256 calibration samples, while other rows use 2048.
- Hyperparameter selection: Learning rates were chosen from a coarse log-scale grid on a proxy pipeline with larger column blocks and fewer backward samples.The reported settings were not obtained through fine-grained per-model tuning.
D.4 Experimental Details for Loss Approximation Quality
The experiments assess gradient alignment, runtime, memory, and calibration-seed stability. REAL-Q adds computation and Fisher-storage requirements, while its W4A16 results remain stable across calibration sampling and its dominant runtime scales roughly linearly with model size at fixed block size.
- Gradient alignment: Gradient-alignment evaluation compares true end-to-end KL gradients with REAL-Q Fisher-MSE, Saliency-guided MSE, and Module-MSE surrogate gradients.The true gradients use backward passes through subsequent layers and the language-model head.
- Gradient alignment: REAL-Q maintains strong overall gradient alignment, but fidelity degrades slightly on FFN modules, particularly up_proj and down_proj, because of SwiGLU non-linearity.This architectural heterogeneity motivates a stated limitation of the approximation.
- Runtime: Dynamic gradient corrections add overhead, but dominant Stage-1 cost scales roughly linearly with the number of transformer-block, linear-module, and column-block triples.The reported setup uses RTX Pro 6000 GPUs and summarizes total end-to-end cost in GPU-hours.
- Memory: REAL-Q requires extra offline-calibration memory because it caches full, ungrouped Fisher matrices for every transformer block.For hidden dimension d and L blocks, bfloat16 storage is exactly 2 × L × d^2 bytes.
- Calibration stability: Across five Qwen3-0.6B calibration seeds, standard deviations are roughly 0.7% for KL and 0.2% for PPL, while the worst seed remains below GuidedQuant.The stability evaluation holds model, bit-width, hyperparameters, and evaluation protocol fixed.
E Detailed Limitations and Future Directions
REAL-Q’s future directions focus on improving surrogate fidelity, optimizer adaptation, and system-level memory efficiency. These directions address limitations involving nonlinear FFN modules, short optimizer warm-up, and higher peak memory overhead.
- E Detailed Limitations and Future Directions: Future work should refine REAL-Q through dynamic gradient-based corrections and improved computational efficiency.The paper presents these directions as avenues for further methodological refinement.
- Enhancing Surrogate Fidelity for Severe Non-linearities: The aggregated Fisher MSE correlates less accurately with true end-to-end gradients in some FFN modules, notably up_proj and down_proj.The authors attribute this degradation to SwiGLU nonlinearity and suggest higher-order or nonlinear proxy functions.
- Cross-Module Optimizer State Transfer: Adam is re-initialized for each linear module, limiting first- and second-moment warm-up before quantization is finalized.The paper proposes cross-module state transfer or optimizers designed for short, non-stationary trajectories.
- System-Level Memory Optimizations: Stage-0 pre-computation requires the full-precision model and per-layer Fisher matrices, leaving peak memory overhead above vanilla, zero-shot GPTQ.An FSDP two-stage pipeline mitigates this overhead for 70B-class models, but does not eliminate the remaining footprint.