Large language model serving is governed by two physical bottlenecks: memory bandwidth during autoregressive decoding and compute throughput during prompt prefill. While weight-only post-training quantization (such as GPTQ or AWQ) reduces parameter footprint to 4 bits, it leaves activations in 16-bit floating-point formats. As a result, inference engines cannot utilize high-throughput INT4 tensor cores, and the key-value (KV) cache continues to consume massive memory pools.
Attempting to quantize activations to 4 bits (W4A4) using traditional uniform rounding causes immediate catastrophic accuracy degradation. The root cause is the emergence of systematic activation outliers: sparse, high-magnitude features that dominate specific hidden channels. Rotational quantization solves this structural problem by transforming the internal coordinate system of the transformer using orthogonal rotations. By rotating activation vectors with randomized Hadamard matrices or learned orthogonal transformations, these methods disperse outlier energy across all dimensions, converting heavy-tailed distributions into uniform sub-Gaussian profiles that fit standard low-bit integer grids without altering network output.

The Activation Outlier Bottleneck in Low-Bit Serving
As language models scale past 6.7 billion parameters, their internal representations undergo an emergent phase transition. As documented by Dettmers et al. (2022), a tiny fraction of hidden channels (typically less than 0.1%) begin exhibiting magnitude spikes that are up to 100 times larger than the median activation values. These outliers are not random noise; they carry critical semantic and syntactic information, consistently appearing in the same coordinate dimensions across different sequence positions.
When quantizing an activation tensor into a uniform low-bit grid (such as unsigned or signed 4-bit integers with discrete levels), the quantization step size must span the entire dynamic range:
Because the dynamic range is dictated by the extreme outlier spikes, the vast majority of non-outlier features (which reside in a narrow band around zero) are collapsed into just one or two quantization bins. The resulting roundoff error destroys the representational capacity of the model.
Prior techniques attempted to mitigate this with channel-wise scaling. For instance, SmoothQuant (Xiao et al., 2023) applies a diagonal scaling matrix to divide out activation spikes and multiply them into the corresponding weight columns:
While SmoothQuant works well for 8-bit quantization (W8A8), it breaks down at 4 bits (W4A4). Smoothing migrates difficulty from activations to weights, and when the target precision is 4 bits, the scaled weight matrix itself develops severe quantization distortion. Furthermore, diagonal scaling cannot resolve activation outliers that occur inside attention key-value projections or across intermediate non-linear states.
The Principle of Computational Invariance
Rotational quantization operates on the principle of computational invariance in neural networks, formalized in SliceGPT (Ashkboos et al., 2024) and QuaRot (Ashkboos et al., 2024).
Consider a standard linear projection , where is an input activation matrix and is the weight matrix. Let be an orthogonal matrix satisfying , where is the identity matrix. Because , we can insert this identity transformation directly between the activations and the weights:
Here, represents the rotated activation tensor, and represents the rotated weight matrix. The output is mathematically identical to the unrotated computation.
Because orthogonal transformations preserve Euclidean lengths and inner products ( for any vector ), the geometric norm of the hidden states remains invariant under rotation.
This property extends across normalization layers. Modern transformer architectures use Root Mean Square Normalization (RMSNorm):
Because , the denominator equals . Consequently, rotating the inputs to an RMSNorm layer rotates the normalized outputs by the exact same matrix , allowing rotations to be propagated through normalization layers without breaking the forward pass.
Incoherence Processing via Randomized Hadamard Transforms
The goal of rotational quantization is to select an orthogonal matrix that maximizes the incoherence of the activations. In compressive sensing and quantization theory, incoherence measures how uniformly distributed a vector's energy is across its basis coordinates.
If an activation vector has an isolated spike of magnitude along a single coordinate axis, its peak-to-average ratio is extremely high. By applying an orthogonal transform whose entries have uniform magnitude, that concentrated energy is redistributed equally across all dimensions.
The Walsh-Hadamard Transform (WHT) provides an optimal, multiplication-free orthogonal operator. A normalized Hadamard matrix is defined recursively for powers of two:
Every element in is either or , and all columns are mutually orthogonal ().
To prevent deterministic alignment between structured model features and the Hadamard basis, QuaRot and QuIP# (Tseng et al., 2024) employ the Randomized Hadamard Transform (RHT):
where is a random Rademacher vector with entries sampled uniformly from .
When an activation vector containing a coordinate outlier is multiplied by , the resulting rotated vector exhibits coordinate values bounded by:
In a modern model with hidden dimension or , the factor attenuates the outlier peak by a factor of 64 to 90. The coordinate distribution transitions from a heavy-tailed, spike-dominated profile into a spherically symmetric, Gaussian-like distribution. Because the dynamic range is compressed without truncating values, standard 4-bit uniform quantization bins cover the distribution with minimal quantization error.
Weight Absorption and Online Fast Walsh-Hadamard Transforms
Applying rotations at every layer could introduce unacceptable computational overhead if implemented naively. Rotational quantization frameworks divide transformations into two categories: offline fused rotations and online fast transforms.
1. Offline Weight Absorption
Wherever a rotation matrix directly precedes or follows a linear layer, it can be fused offline into the model weights during the quantization compilation phase:
- For an input projection , the rotated weights are precomputed as .
- For an output projection , the rotated weights are precomputed as .
Because these matrix multiplications are computed once during offline preparation, they introduce zero floating-point operations, zero memory overhead, and zero runtime latency during inference.
2. Online Fast Walsh-Hadamard Transform (FWHT)
Rotations cannot be absorbed across non-linear operations, such as the SwiGLU activation functions in modern feed-forward networks ($\text{SwiGLU}(x) = (x W_{\text{gate}} \odot \text{silu}(x W_{\text{up}})) W_{\text{down}}$) or the Softmax operation in multi-head attention.
In these locations, the model must apply an explicit rotation during runtime before quantizing the intermediate tensor (such as the input to the down-projection layer or the key-value states).
Instead of computing a general dense matrix multiplication ( operations), the transformation is executed using the Fast Walsh-Hadamard Transform (FWHT). FWHT leverages the recursive Kronecker structure of Hadamard matrices via a butterfly algorithm, requiring only:
Crucially, the Walsh-Hadamard matrix contains only entries. The butterfly computation requires exclusively addition and subtraction operations, with a single global scalar multiplication at the end. Highly optimized CUDA and Triton kernels execute the FWHT in memory-bandwidth-bound fashion, accounting for less than 1% to 2% of total per-layer inference time.
Learned Orthogonal Rotations: SpinQuant
While randomized Hadamard matrices successfully suppress outliers, their fixed structure possesses two notable constraints:
- They require matrix dimensions to be powers of two (or products of small Sylvester-compatible integers), requiring padding for non-standard hidden dimensions.
- They treat all feature dimensions uniformly, ignoring the non-isotropic curvature of the loss landscape.
To address this, SpinQuant (Liu et al., 2024) introduced learned orthogonal rotations. Rather than relying solely on fixed Hadamard transformations, SpinQuant parameterizes continuous rotation matrices directly on the Special Orthogonal group and optimizes them using gradient descent.
To guarantee that remains strictly orthogonal throughout gradient-based optimization, SpinQuant employs the Cayley transform:
where is an unconstrained skew-symmetric matrix (). For any real skew-symmetric matrix , the Cayley transform produces a strictly orthogonal matrix with determinant .
During a lightweight calibration phase on a small dataset (such as 128 sequences from WikiText-2), SpinQuant optimizes the skew-symmetric parameters alongside quantization step sizes to minimize the layer-wise Mean Squared Error (MSE) reconstruction loss:
where denotes the uniform 4-bit quantization operator.
By optimizing the rotation matrices to align with the empirical Hessian of the activations, SpinQuant concentrates quantization precision in the directions that most heavily impact downstream task accuracy. On LLaMA-2-70B under full 4-bit weight, activation, and KV cache quantization (W4A4KV4), SpinQuant improves zero-shot benchmark accuracy by up to 16 percentage points compared to unoptimized round-to-nearest baselines, closing the remaining performance gap to unquantized FP16 models.
Hardware Execution and Serving Economics
The ability to maintain activation representations in 4-bit formats reshapes the economics of large language model serving across three fronts:
1. True INT4 Tensor Core Utilization
On modern GPU architectures (such as Nvidia Ada Lovelace, Hopper, and Blackwell), INT4 Tensor Core operations provide double the raw arithmetic throughput (TFLOPS/TOPS) of FP16 or BF16 operations. Weight-only quantization (W4A16) cannot leverage these integer units because inputs must be upcast to FP16 prior to matrix multiplication. Rotated W4A4 models execute end-to-end integer GEMMs directly on Tensor Cores, accelerating prompt prefill latency by over .
2. End-to-End KV Cache Footprint Reduction
During generation, the memory required by the KV cache scales linearly with context length and batch size:
For a 70-billion-parameter model serving a 128k context window, a 16-bit KV cache requires tens of gigabytes per concurrent user. By rotating key and value projections before writing to cache memory, QuaRot and SpinQuant enable 4-bit KV caching (KV4) with zero outlier-induced perplexity blowup, reducing KV memory overhead by 75% and quadrupling maximum serving concurrency on a single node.
3. Outlier-Free Weight Quantization
Beyond activations, applying randomized Hadamard transformations to weight matrices (known as incoherence processing in QuIP#) removes weight outliers as well. This homogenizes the weight distribution into a sphere-shaped Gaussian distribution, allowing extreme sub-4-bit compression (including 2-bit vector quantization with lattice codebooks) to maintain downstream task performance.
Rotational quantization demonstrates that activation outliers are not an immutable property of large language models, but an artifact of standard Cartesian coordinate representations. By rotating internal representations into an incoherent coordinate space, modern inference runtimes achieve uniform 4-bit quantization across weights, activations, and KV caches without sacrificing model accuracy.
Sources
- QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs (Ashkboos et al., 2024)
- SpinQuant: LLM Quantization with Learned Rotations (Liu et al., 2024)
- QuIP#: Even Better LLM Quantization with Hadamard Incoherence and Lattice Codebooks (Tseng et al., 2024)
- LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale (Dettmers et al., 2022)
- SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models (Xiao et al., 2023)
- SliceGPT: Compress Large Language Models by Deleting Rows and Columns (Ashkboos et al., 2024)



