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

QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs

Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, James Hensman

Abstract

Quantizing Large Language Models (LLMs) to 4-bit precision offers significant potential for reducing memory overhead and increasing inference speed. However, the presence of high-magnitude outliers in activations typically degrades performance or necessitates complex mixed-precision schemes. This paper discusses QuaRot, a quantization framework that utilizes randomized Hadamard rotations to eliminate outliers by distributing their energy across dimensions. By leveraging computational invariance, QuaRot enables a fully 4-bit end-to-end inference pipeline—including weights, activations, and the Key-Value (KV) cache—achieving up to 3.3x speedups and 3.89x memory savings while maintaining near-lossless accuracy.

1. Introduction

The deployment of Large Language Models (LLMs) is currently constrained by the massive memory and computational requirements of transformer architectures. Quantization, the process of mapping high-precision floating-point values to lower-bit integers, is a primary strategy for mitigation. While 4-bit weight quantization is well-established, quantizing activations and the Key-Value (KV) cache to 4 bits remains a significant challenge due to the emergence of "outlier" features—specific channels with extreme values that dominate the dynamic range.

Existing solutions often resort to keeping these outliers in higher precision (e.g., FP16 or INT8), which introduces architectural complexity and execution bottlenecks. QuaRot addresses this by transforming the model's internal representations into a coordinate system where outliers are suppressed, allowing for a uniform 4-bit data path.

2. Methodology: The Power of Rotation

The core innovation of QuaRot is the application of randomized Hadamard transforms to "smear" outliers across all dimensions of the activation vector.

2.1 Computational Invariance

QuaRot relies on the principle of computational invariance in linear layers. For a weight matrix $W$ and input $X$, the operation $Y = XW$ can be modified by an orthogonal matrix $Q$ such that $Y = (XQ)(Q^T W)$. By choosing $Q$ as a randomized Hadamard matrix, the model can be "rotated" into a new basis. Because Hadamard matrices are orthogonal, the underlying information is preserved, but the statistical distribution of the values changes. This rotation makes the activations "incoherent," making simple Round-to-Nearest (RTN) quantization highly effective.

2.2 Weight Fusing and Online Rotation

To avoid the overhead of performing rotations during inference, QuaRot "fuses" these transformations into the model's weights offline. For most layers, the rotation is absorbed into the preceding and succeeding weight matrices. However, for the attention mechanism, the authors introduce "online" rotations for the Query and Key matrices. This ensures that the resulting KV cache is also outlier-free and can be stored in 4-bit precision without significant information loss.

2.3 End-to-End 4-Bit Quantization

Unlike previous methods that only target weights or specific activation bottlenecks, QuaRot enables a complete 4-bit integer (INT4) data path. Every major matrix multiplication (MatMul) in the transformer block is executed using 4-bit arithmetic, maximizing hardware utilization on modern GPUs.

3. Experimental Evaluation

The authors evaluated QuaRot across the Llama-2 (7B, 13B, 70B), Llama-3 (8B, 70B), and Phi-3-mini architectures. Performance was measured using perplexity on WikiText-2 and accuracy across a suite of zero-shot reasoning tasks, including PIQA, WinoGrande, HellaSwag, ARC, and LAMBADA.

3.1 Accuracy Preservation

QuaRot demonstrates remarkable robustness. On the Llama-2-70B model, the transition to a fully 4-bit pipeline resulted in a negligible perplexity increase of 0.47 on WikiText-2. Across zero-shot benchmarks, the 4-bit model retained approximately 99% of the performance of the original FP16 baseline. Notably, for 6-bit and 8-bit configurations, the method is virtually lossless and requires no calibration data to tune scales.

3.2 Hardware Performance and Efficiency

The practical benefits of QuaRot were demonstrated on NVIDIA RTX 3090 and A100 GPUs:

  • Throughput: During the prefill phase (processing the initial prompt), QuaRot achieved up to a 3.33x speedup compared to standard 16-bit implementations on a Llama-2-70B model.
  • Memory Footprint: The 4-bit KV cache enabled a 3.89x reduction in peak memory usage during the decoding phase, allowing larger models to fit on consumer-grade hardware.

4. Discussion and Limitations

While QuaRot represents a significant step toward efficient LLM inference, some components remain in higher precision. Residual connections and LayerNorm operations are still computed in higher precision to maintain numerical stability. Furthermore, while the rotation principles are general, the current implementation is optimized for Llama-style Transformer architectures. Future work may explore extending these techniques to Mixture-of-Experts (MoE) models and integrating with emerging hardware standards like NVIDIA's Blackwell B200, which supports native 4-bit floating point (FP4).

5. Conclusion

QuaRot demonstrates that the "outlier problem" in LLM quantization is largely a function of the coordinate system rather than the data itself. By applying randomized rotations, QuaRot eliminates the need for complex mixed-precision systems, delivering a streamlined, high-performance 4-bit inference solution that significantly lowers the barrier for deploying state-of-the-art models on accessible hardware.

Summary updated

BibTeX
@inproceedings{ashkboos2024quarot,
  author = {Saleh Ashkboos and Amirkeivan Mohtashami and Maximilian L. Croci and Bo Li and Pashmina Cameron and Martin Jaggi and Dan Alistarh and Torsten Hoefler and James Hensman},
  title = {{QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=dfqsW38v1X},
}
Figure