LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid

Tianyi Zhang, Anshumali Shrivastava

Introduction

As Large Language Models (LLMs) scale to hundreds of billions of parameters, the hardware required to deploy them becomes prohibitively expensive. Post-training quantization (PTQ)—the process of converting 16-bit weights into lower-precision formats like 4-bit, 3-bit, or 2-bit—has emerged as the standard solution to reduce memory footprints and accelerate inference.

However, current quantization research faces two major hurdles. First is the compatibility gap: many high-accuracy methods rely on exotic data formats or codebooks that require custom, hand-tuned inference kernels, making them difficult to integrate into standard frameworks like llama.cpp or vLLM. Second is the scalability gap: advanced quantization methods often demand massive amounts of GPU memory or days of computation, making it nearly impossible to quantize the largest open-source models (such as Llama-3.1 405B) on accessible hardware.

LeanQuant (Loss-error-aware network Quantization) addresses these challenges by introducing a highly efficient PTQ method that achieves state-of-the-art accuracy and scales seamlessly to massive models without requiring specialized data formats.

The Core Problem: Ignoring Hessian Outliers

The authors identified a critical flaw in existing iterative quantization methods (like GPTQ). These methods typically rely on a simple "min-max" grid to determine quantization steps. Unfortunately, this approach ignores extreme outliers in the inverse Hessian diagonals.

These outliers represent weights that are highly sensitive to change; if they are not quantized precisely, the model's overall performance degrades significantly. The paper demonstrates that the loss error is proportional to the square of the quantization error divided by the inverse Hessian diagonal. Because these diagonals contain massive outliers, a few poorly quantized sensitive weights can ruin the entire model.

Comparison of standard min-max grids versus LeanQuant's loss-error-aware grids.

The LeanQuant Solution

To overcome this limitation, LeanQuant moves away from fixed, non-adaptive grids and introduces Loss-Error-Aware Grids. Instead of merely looking at the minimum and maximum values of a weight group, LeanQuant optimizes the quantization grid to minimize the actual expected increase in task loss. It leverages the Hessian matrix (second-order derivatives) to identify and protect the weights that require higher precision.

Key technical innovations include:

  • Versatile Grid Support: LeanQuant supports both non-uniform quantization (using a weighted k-means clustering approach weighted by the inverse Hessian) and standard affine quantization (using an enumerative search to find optimal scaling factors and zero-points). By improving the grid rather than changing the underlying format, the affine version remains fully compatible with existing high-performance kernels.
  • Uniformly Spaced Initialization: Standard k-means++ initialization often misses extreme outliers. LeanQuant proposes a simple uniform initialization that ensures the entire weight range is represented from the start.
  • Fused GPU Kernels: To make the grid search fast enough for 400B+ parameter models, the authors developed a custom CUDA kernel that parallelizes the search. This results in a staggering 50x speedup for the grid-learning phase, reducing the time to quantize an 8B model from 15 hours to just 16 minutes.

Evaluation and Key Results

LeanQuant was rigorously evaluated using standard datasets (C4, WikiText2) and a battery of zero-shot benchmarks including ARC, LAMBADA, MMLU, HellaSwag, PIQA, and WinoGrande. It was also tested on instruction-following capabilities using MT-Bench with GPT-4o as a judge.

The results demonstrate superior accuracy, particularly in the highly constrained 3-bit and 2-bit regimes. For instance, on the 3-bit Llama-3-8B model, LeanQuant improved average zero-shot accuracy by 17.18% over OmniQuant.

Zero-shot performance across various LLMs showing LeanQuant's superior accuracy at lower bit-widths.

Beyond accuracy, LeanQuant treats scaling as a first-class citizen. It successfully quantized the massive Llama-3.1 405B model in just 21 hours using only two Quadro RTX 8000 (48GB) GPUs. In contrast, competitive methods like SqueezeLLM and OmniQuant failed this test due to Out-of-Memory (OOM) errors.

Limitations and Future Directions

Like most PTQ methods, LeanQuant relies on a small amount of calibration data (e.g., 128 sequences from C4), which may not perfectly capture the final deployment domain's distribution. Additionally, while the affine version is highly compatible with standard hardware, the non-uniform version still requires dedicated CUDA kernels to realize its full inference speed benefits.

Future work will explore extending this loss-error-aware logic to weight-activation quantization (such as W8A8 or W4A4) and investigating even lower bit-widths, including 1-bit or ternary quantization, pushing the boundaries of LLM efficiency even further.

Summary updated

BibTeX
@inproceedings{zhang2025leanquant,
  author = {Tianyi Zhang and Anshumali Shrivastava},
  title = {{LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ISqx8giekS},
}
Figure