Before you start: words you need#
| Word | Plain meaning |
|---|---|
| W4A4KV4 | Weights, activations and KV cache all in 4 bits, so the matrix multiplies run on 4-bit tensor cores. |
| Orthogonal matrix / rotation | A matrix Q with Q·Qᵀ = I. Multiplying by it rotates vectors without changing their length, and can be undone by multiplying by Qᵀ (10.a). |
| Hadamard matrix | An orthogonal matrix whose entries are all +1 or −1 (scaled). Multiplying by one can be done fast, in O(n log n), like an FFT. |
| Computational invariance | The fact that you can insert Q·Qᵀ (= identity) between layers, fold Q into one weight and Qᵀ into the next, and the network computes exactly the same function. |
| Incoherence | Spreading a vector’s energy evenly across all its coordinates, so no coordinate is an outlier. Random rotations make vectors incoherent. |
| Outlier channel | A hidden dimension with values far larger than the rest (30.h). The thing that breaks low-bit activation quantization. |
| RMSNorm | A normalisation layer that divides by the root mean square; it commutes with rotations, which is what makes QuaRot possible (11.e). |
1. The paper#
- Title: “QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs”
- Authors: Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, James Hensman (ETH Zurich, EPFL, Microsoft Research, IST Austria)
- Venue: NeurIPS 2024 (arXiv March 2024).
- Link: arXiv:2404.00456 · code: spcl/QuaRot
2. The problem#
The quantization thread so far:
- LLM.int8() (30.h) kept outliers in 16-bit: accurate, slow.
- SmoothQuant (30.k) moved outliers into the weights: good for 8-bit, not enough for 4-bit (Llama-2-7B W4A4 perplexity 83 instead of 5.5).
- GPTQ and AWQ (30.i, 30.m) quantized only the weights: 4-bit memory savings, but the matmul stays 16-bit, so compute-bound prefill gains little.
To run every matmul on 4-bit tensor cores you must quantize activations to 4 bits, and with outlier channels 100× larger than the rest, 16 levels are far too few. Methods that kept a few hundred outlier channels in higher precision (QUIK, Atom) worked but needed awkward mixed-precision kernels.
3. The idea#
Rotate the outliers away instead of working around them.
If x has one huge coordinate, a random rotation Hx spreads that energy across all coordinates. The result has no outliers and quantizes well. And because H is orthogonal, the network can be rewritten so the output is exactly the same:
y = W·x = (W·Hᵀ)·(H·x)QuaRot applies this everywhere it matters:
- The residual stream. Rotate the hidden state by a random Hadamard matrix Q, and fold Q and Qᵀ into the weights on each side (embedding, attention and MLP input and output projections, LM head). This uses computational invariance (from the authors’ earlier SliceGPT work): it requires RMSNorm, which commutes with rotations, after folding the norm’s scale into the next weights. These rotations cost nothing at run time.
- Inside the MLP. The input to the down-projection is not on the residual stream, so it gets an online Hadamard transform (computed at run time, fast) before quantization.
- Attention and KV cache. Online Hadamard transforms on the keys and queries (after RoPE) and on the values/output path, so the KV cache can be stored in 4 bits too.
Then quantize: weights with GPTQ (or plain round-to-nearest), activations per token, KV cache per group, all to INT4.
flowchart LR X["Hidden state with outlier channels"] --> H["Multiply by random Hadamard (folded into weights)"] H --> F["Flat activations, no outliers"] F --> Q["INT4 quantize: weights (GPTQ), activations, KV cache"] Q --> M["INT4 tensor-core matmul"] M --> O["Same output as the unrotated model, up to rounding"] class X warn class H,F neutral class Q,M compute class O io
4. How it works#
- Why Hadamard? Any orthogonal matrix would preserve the output, but a random Hadamard matrix spreads outliers well and can be applied in O(n log n) with a fast Walsh–Hadamard transform, so the online ones are cheap. Most rotations are folded into weights offline; the paper counts about 1.5 online Hadamard transforms per Transformer layer.
- Preparing a model takes minutes: rotating Llama-2-70B took about 5 minutes on one A100, and GPTQ quantization is the longer step.
- Kernels. INT4 matmuls with CUTLASS on Ampere tensor cores (INT32 accumulate), plus fused kernels for the online Hadamard, quantization and dequantization.
- Also for 6 and 8 bits. With rotation, simple round-to-nearest at 6 or 8 bits was lossless, without any calibration data.
5. Results#
Perplexity, WikiText-2, all of W4A4 (Table 1):
| Method | Outlier channels kept in high precision | Llama-2-7B | Llama-2-13B | Llama-2-70B |
|---|---|---|---|---|
| FP16 baseline | – | 5.47 | 4.88 | 3.32 |
| SmoothQuant (4-bit) | 0 | 83.12 | 35.88 | – |
| OmniQuant | 0 | 14.26 | 12.30 | – |
| QUIK-4B | 256 | 8.87 | 7.78 | 6.91 |
| QuaRot (GPTQ weights) | 0 | 6.10 | 5.40 | 3.79 |
| QuaRot-128G (group size 128) | 0 | 5.93 | 5.26 | 3.61 |
- Llama-2-70B lost at most 0.47 perplexity and kept 99% of zero-shot accuracy (1.09% average loss).
- Speed and memory (measured on one Transformer block on an RTX 3090): up to 3.33× faster prefill (batch 64, 2048 tokens) and 3.89× less memory during decode for Llama-2-70B-sized layers.
Note the speed setup: a single layer on a consumer Ampere GPU with INT4 tensor cores, not a full server deployment.
6. What held up and what did not#
Held up
- Rotation is now a standard quantization tool. SpinQuant (Meta, 2024) learns the rotations
instead of choosing them at random; later 4-bit and FP4 recipes add Hadamard transforms to
tame outliers, and
llm-compressorships rotation transforms in the QuaRot/SpinQuant style. - Computational invariance — folding orthogonal transforms into weights for free — is widely reused, for quantization and for pruning.
- Quantize the KV cache too. Rotated K and V quantize far better; Hadamard-rotated low-bit KV caches appear in several engines and papers (13.h).
- The same incoherence idea appears in FlashAttention-3’s FP8 path (30.n) and QuIP#/QTIP weight quantization.
Did not, or changed
- INT4 tensor cores went away. Hopper has no INT4 tensor-core path, and Blackwell offers FP4 (NVFP4, MXFP4) instead. W4A4 in production in 2026 means NVFP4 or MXFP4, whose small block scales (16 or 32 values) absorb much of the outlier problem by themselves (13.g). Rotations still help FP4 accuracy, but are optional.
- Online transforms cost something and complicate kernels and tensor parallelism; many deployments use only the offline (folded) rotations.
- Accuracy loss at W4A4 is still larger than at W8A8 or W4A16 on hard tasks (long reasoning, code), so 4-bit activations are used selectively.
7. Where it lives in 2026#
- Taught in depth: INT4 and low-bit inference in 13.f, FP4 in 13.g, KV quantization in 13.h, quantization research in 24.d, low-precision kernels in 25.g.
- Rotation-based methods are available in
llm-compressorand other open tools; NVFP4 checkpoints for Blackwell are the common production form of W4A4.
Checked on 13 November 2026.
8. Questions#
- Why does one outlier channel make 4-bit activation quantization fail?
- Show that inserting H·Hᵀ between two linear layers leaves the output unchanged.
- Which rotations does QuaRot fold into weights, and which must run online? Why the difference?
- Why does QuaRot need RMSNorm rather than LayerNorm (or a conversion of LayerNorm)?
- Why a Hadamard matrix rather than any random orthogonal matrix?
- QuaRot targeted INT4 tensor cores. What changed on Hopper and Blackwell, and does rotation still matter?
- How does rotating keys and values help KV-cache quantization?
9. Further reading#
- arXiv:2404.00456 — sections 3 and 4.
- Liu et al., “SpinQuant: LLM quantization with learned rotations” (ICLR 2025).
- 13.f, 13.g and 24.d in this material.
- Next: DeepSeek-V2 and V3 (30.v).