BoA: Attention-aware Post-training Quantization without Backpropagation

Junhan Kim, Ho-young Kim, Eulrang Cho, Chungman Lee, Joonyoung Kim, Yongkweon Jeon

TL;DR

BoA (Backpropagation-free optimization for Attention-aware PTQ) is a novel post-training quantization method that optimizes Large Language Model (LLM) weights by accounting for dependencies between layers within the attention module. By deriving "attention-aware" Hessian matrices, BoA achieves state-of-the-art accuracy at ultra-low bit-widths (2-bit and 3-bit) without the massive computational overhead of gradient-based training.

What Problem Does This Paper Address?

To run LLMs on consumer hardware or edge devices, they must be compressed, typically via quantization (converting 16-bit weights to 4-bit or even 2-bit). There are two primary approaches: Quantization-Aware Training (QAT), which is accurate but prohibitively expensive for billion-parameter models, and Post-Training Quantization (PTQ), which is fast but often suffers significant accuracy degradation at low bit-widths.

The current gold standard for PTQ, GPTQ, has a major blind spot: it assumes each layer is independent. It optimizes weights to minimize the reconstruction error of a single layer's output. However, in Transformers, the Query ($W_Q$), Key ($W_K$), and Value ($W_V$) projections are deeply interdependent—their errors interact through the softmax function to affect the final attention output. Ignoring these "inter-layer dependencies" causes catastrophic performance drops when pushing models down to 2 or 3 bits.

Methods

The authors introduce BoA, which moves beyond simple layer-wise reconstruction. Instead of minimizing local error, BoA optimizes weights to minimize the error of the entire attention output.

The key technical contributions include:

  1. Attention-aware Hessians: The authors derive new Hessian matrices specifically for the $W_Q, W_K, W_V$, and $W_{out}$ layers. These matrices capture how a change in one weight matrix (like Query) affects the final output after interacting with others (like Key).
Hessian formulations in GPTQ vs. BoA
  1. Hessian Relaxation: Computing the exact Hessian for attention involves a massive Jacobian matrix for the softmax function, which would require hundreds of gigabytes of memory. BoA uses a mathematical "relaxation" (an upper bound) to create a simpler surrogate Hessian that remains effective but is computationally feasible.
  2. Simultaneous Head Quantization: To utilize GPU parallelism, BoA quantizes the same rows across different attention heads simultaneously. This prevents the algorithm from becoming a slow, sequential bottleneck.
  3. Kronecker Product Efficiency: By exploiting the properties of Kronecker products, BoA computes inverse Hessians with a complexity of $O(d^3)$, making it nearly as efficient as standard GPTQ despite the more complex optimization objective.
Visual comparison of GPTQ and BoA quantization procedures

Datasets and Evaluation

The researchers evaluated BoA using:

  • Calibration: 128 random sequences (2048 tokens each) from the WikiText-2 dataset.
  • Evaluation: Perplexity (PPL) on the WikiText-2 test set and zero-shot accuracy on eight commonsense reasoning benchmarks (ARC-challenge, ARC-easy, BoolQ, HellaSwag, LAMBADA, OpenbookQA, PIQA, and WinoGrande).
  • Models: A wide range of LLMs including OPT (125M to 30B), LLaMA-1/2/3, and the newer LLaMA-3.2 (1B and 3B).

Key Insights

  • The Softmax Interaction Matters: Local layer-wise error is a poor proxy for model performance. Because $W_Q$ and $W_K$ are multiplied before a softmax, their quantization errors can compound or cancel out in ways that standard PTQ ignores.
  • Synergy with Transformations: BoA works exceptionally well when paired with model "rotation" techniques like QuaRot or SpinQuant. These methods smooth out activation outliers, and BoA then provides the high-precision weight tuning needed to maintain accuracy.
  • Parallelism is Possible: Even though BoA considers inter-layer dependencies, assuming independence between different attention heads allows for massive speedups without sacrificing much accuracy.

Key Results

BoA consistently outperforms GPTQ and other backpropagation-free methods, particularly in the "danger zone" of 2-bit and 3-bit quantization:

  • 2-bit Performance: On LLaMA2-7B, BoA achieved a perplexity of 12.76, compared to 30.85 for GPTQ. In zero-shot tasks, BoA improved average accuracy by over 3% absolute.
  • 3-bit Performance: BoA often reaches within 1-2% of the full-precision (FP16) baseline accuracy, a feat rarely achieved by PTQ methods without expensive fine-tuning.
  • Weight-Activation Quantization: When combined with SpinQuant, BoA achieved state-of-the-art results for W2A4KV4 (2-bit weights, 4-bit activations/KV cache), outperforming previous methods by up to 12.5% in accuracy on some models.
  • Efficiency: Thanks to simultaneous quantization, BoA is highly practical for large models. Quantizing a LLaMA-30B model takes about 3.3 hours on a single H100 GPU, whereas a naive sequential implementation would take over 135 hours.

Limitations and Future Work

  • Memory Overhead: While "relaxation" helps, BoA still requires more memory than GPTQ because it needs to store additional matrices related to the attention inter-dependencies.
  • Quantization Speed: BoA is roughly 8-10x slower than GPTQ. While 3.3 hours for a 30B model is acceptable, it remains a trade-off for the increased accuracy.
  • Future Directions: The authors suggest exploring ways to quantize even more rows simultaneously within each head to further close the speed gap with simpler PTQ methods. They also aim to extend this "dependency-aware" logic to other parts of the Transformer, such as the Feed-Forward Networks (FFN).

Summary updated

BibTeX
@inproceedings{kim2025boa,
  author = {Junhan Kim and Ho-young Kim and Eulrang Cho and Chungman Lee and Joonyoung Kim and Yongkweon Jeon},
  title = {{BoA: Attention-aware Post-training Quantization without Backpropagation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=Uvj6XcSJ5d},
}
Figure