NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

QERA: an Analytical Framework for Quantization Error Reconstruction

Cheng Zhang, Jeffrey T. H. Wong, Can Xiao, George Anthony Constantinides, Yiren Zhao

TL;DR

QERA (Quantization Error Reconstruction Analysis) provides the first closed-form analytical solution for reconstructing quantization errors in Large Language Models (LLMs). By shifting the optimization target from minimizing weight differences to minimizing layer output errors, QERA significantly improves the accuracy of both 2-bit fine-tuning and 4-bit post-training quantization across a wide range of model families.

What Problem Does This Paper Address?

As LLMs grow to hundreds of billions of parameters, deploying them requires aggressive quantization—compressing weights from 16-bit floating point down to 4, 3, or even 2 bits. To recover the lost accuracy, researchers often add a high-precision, low-rank "error reconstruction" term (essentially a LoRA-like adapter) to the quantized weights.

The standard approach (used in methods like LoftQ or ZeroQuant-V2) is to use Singular Value Decomposition (SVD) to minimize the difference between the original weights and the quantized weights. However, the authors identify a "weight error pitfall": minimizing weight error doesn't necessarily minimize the error in the model's actual outputs (activations). While some recent methods like LQER used hand-crafted heuristics to account for activations, they lacked a rigorous mathematical foundation. QERA fills this gap by providing an exact analytical framework for optimal error reconstruction.

Methods

The authors formulate the problem as a minimization of the expected $l_2$ error between the original layer output and the reconstructed layer output. They propose two solutions:

  1. QERA-exact: This is the mathematically optimal solution. It incorporates the autocorrelation matrix ($R_{XX}$) of the input space. The solution involves calculating the matrix square root of $R_{XX}$, performing SVD on a scaled weight error matrix, and then un-scaling the result.
  2. QERA-approx: To reduce the computational overhead of calculating full matrix inverses, the authors introduce an approximation based on the assumption that different embedding dimensions are uncorrelated. This turns the autocorrelation matrix into a simple diagonal matrix of activation statistics, making the computation much faster while remaining theoretically grounded.

Standard methods typically use SVD directly on $(W - \hat{W})$. QERA instead performs SVD on a transformed version of the error that accounts for how the input data "sees" those weights.

Key Insights and Ideas

  • The Weight Error Pitfall: The paper demonstrates that in iterative methods like LoftQ, more iterations can actually increase the model's output error even as the weight error decreases. This proves that weight-matching is a proxy that sometimes fails.
Model output error comparison
  • Theoretical Grounding of Heuristics: QERA-approx explains why previous heuristic methods like LQER worked. LQER was essentially a specific, hand-crafted approximation of the QERA framework.
  • The Uncorrelated Assumption: By profiling LLMs, the authors found that the assumption of uncorrelated input dimensions holds remarkably well for MLP layers (over 60% of layers), though it is less accurate for attention layers.
  • Calibration Matters: For fine-tuning (QPEFT), the choice of calibration data is critical. Using the pretraining dataset (like WikiText2) for calibration led to better convergence than using the specific downstream task data if that data contained heavy padding.

Key Results

QERA consistently outperforms existing state-of-the-art methods in both Parameter-Efficient Fine-Tuning (PEFT) and Post-Training Quantization (PTQ):

  • Aggressive Fine-Tuning: For 2-bit RoBERTa-base on GLUE, QERA achieved a 6.05% accuracy gain over LoftQ (76.23% vs. 70.18% average accuracy).
GLUE benchmark results for RoBERTa-base
  • Post-Training Quantization: On the massive Llama-3.1-70B model (4-bit), QERA obtained 2.97% higher accuracy than ZeroQuant-V2.
  • Perplexity: On WikiText2, QERA reduced perplexity by 0.28 compared to LQER, showing it is more effective at capturing the nuances of language even without fine-tuning.
  • Efficiency: QERA-approx provides a "sweet spot," offering significantly faster initialization than the exact version while maintaining superior performance over weight-only SVD methods.

Datasets Evaluated

The authors conducted an extensive evaluation across diverse models and tasks:

  • Models: RoBERTa-base (encoder), LLaMA-2 (7B, 13B), LLaMA-3.1 (8B, 70B), Gemma-2 (2B), Phi-3.5-mini, and TinyLlama (1.1B).
  • Benchmarks: GLUE (for fine-tuning), WikiText2 (for perplexity), and a suite of zero-shot tasks including ARC, BoolQ, CommonSenseQA, Winogrande, MMLU, and BigBench-Hard.
  • Instruction Tuning: Evaluated using AlpacaEval 2.0 on Vicuna-7b-v1.5.

Limitations and Future Work

The authors acknowledge that QERA-exact is computationally expensive because it currently runs matrix square root calculations on the CPU. They suggest that developing GPU-accelerated versions of these linear algebra operations would be a key optimization. Additionally, while the "uncorrelated assumption" works well for MLPs, the authors noted that attention layers often have strongly correlated input dimensions, suggesting that a hybrid approach—using QERA-exact for attention and QERA-approx for MLPs—might be a promising future direction.

Summary updated

BibTeX
@inproceedings{zhang2025qera,
  author = {Cheng Zhang and Jeffrey T. H. Wong and Can Xiao and George Anthony Constantinides and Yiren Zhao},
  title = {{QERA: an Analytical Framework for Quantization Error Reconstruction}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=LB5cKhgOTu},
}
Figure