Make LLM inference fully 4-bit by rotating away activation outliers

March 30, 20247 min

Overview

Decision SnapshotReady For Pilot

Results cover multiple model sizes, include kernel-level benchmarks, and show consistent PPL/accuracy and speed/memory improvements on RTX 3090; caveats remain for smaller models and alternative architectures.

Citations3

Evidence Strength0.90

Confidence0.90

Risk Signals9

Trust Signals

Findings with numeric evidence: 4/4

Findings with evidence refs: 4/4

Results with explicit delta: 2/5

Reproducibility

Status: Partial assets available

Open source: Partial

At A Glance

Cost impact: 80%

Production readiness: 80%

Novelty: 70%

Authors

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

Links

Abstract / PDF / Code

Why It Matters For Business

QuaRot makes production LLM inference much cheaper and memory-light by enabling true end-to-end 4-bit execution and large KV cache compression, so hosting large models on cheaper GPUs or smaller clusters becomes practical.

Who Should Care

Summary TLDR

QuaRot uses randomized Hadamard rotations fused into model weights to remove large activation outliers, enabling end-to-end 4-bit inference (weights, activations, KV cache) without keeping special high-precision channels. On LLAMA2-70B QuaRot gives at most +0.47 WikiText-2 perplexity, preserves ~99% of zero-shot accuracy, yields up to 3.33× prefill speedup and ~3.89× decoding memory savings on consumer GPUs. Code: github.com/spcl/QuaRot.

Problem Statement

Activation outliers (rare large values) make activation and KV-cache quantization hard. Prior fixes keep outliers in higher precision or use calibration. This prevents true end-to-end 4-bit inference with acceptable accuracy and memory savings.

Main Contribution

A practical method (QuaRot) that fuses randomized Hadamard rotations into transformer weights to remove activation outliers without changing model outputs.

An attention-aware extension that rotates keys and values so the KV cache can be quantized.

Key Findings

4-bit end-to-end quantization on LLAMA2-70B with small accuracy loss

NumbersWikiText-2 PPL +0.47 (3.323.79); zero-shot avg drop ~1.09 pts

Practical UseYou can run LLAMA2-70B with all weights, activations, and KV cache in 4 bits and keep ~99% of zero-shot performance on evaluated tasks.

Evidence RefAbstract, Table 1, Table 2

Significant runtime and memory gains on consumer GPUs

Numbersprefill speedup up to 3.33×; peak decoding memory saving up to 3.89×

Practical UseExpect multi× throughput on prefill and multiple× reduction in KV memory during decoding on RTX 3090-class GPUs.

Evidence RefAbstract, Section 5.2, Figure 4

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
WikiText-2 Perplexity (LLAMA2-70B)3.79 (QuaRot GPTQ INT4)3.32 (FP16)+0.47WikiText-2, seq len 2048Table 1, Table 9Table 1
Zero-shot average (LLAMA2-70B)75.98 (QuaRot GPTQ INT4)77.07 (FP16)-1.09LM Eval Harness tasks (avg over PIQA, WG, HS, LA, ARC)Table 2, Table 9Table 2

What To Try In 7 Days

Run QuaRot on a copy of your FP16 LLAMA-2/3 model using the published code and compare WikiText-2 PPL and a couple of zero-shot tasks.

Measure prefill throughput and KV memory usage on your target GPU, focusing on large batch and long context.

If you need conservative rollout, try RTN 8-bit or 6-bit first — they are near-lossless and need no calibration data.

Agent Features

Memory
KV cache quantization (group-wise asymmetric)
Tool Use
Hadamard rotations fused into weightsonline per-token symmetric quantization
Frameworks
PyTorchCUTLASS INT4 kernels
Architectures
Transformer

Optimization Features

Infra Optimization
designed and measured on RTX 3090 consumer GPUs
Model Optimization
fuse randomized Hadamard rotations into weights to reduce incoherenceper-column GPTQ or RTN weight quantization
System Optimization
3×–3.3× prefill speedup (large batch)≈3.6–3.9× KV memory reduction during decoding
Inference Optimization
all INT4 matmuls with INT32 accumulation and FP16 castonline Hadamard transforms to remove activation outlierson-the-fly per-token symmetric activation quantization

Reproducibility

Code AvailableYes
Data AvailableNo
Open Source StatusPartial
LicenseUnknown

Risks & Boundaries

Limitations

Benefits depend on fast INT4 GEMM kernels; you need CUDA/CUTLASS support or similar.

Random orthogonal transforms perform worse than Hadamard; hidden dimension constraints (power-of-two factors) simplify fast Hadamard use.

When Not To Use

If your target hardware lacks fast INT4 support or optimized kernels.

When you cannot afford any drop in small-model accuracy; RTN 4-bit can fail on small models.

Failure Modes

Round-to-nearest (RTN) at 4 bits can cause large quality drops on small models; GPTQ is safer for small sizes.

Using random orthogonal matrices instead of structured Hadamard increases perplexity.

Core Entities

Models

LLAMA-2 (7B,13B,70B)LLAMA-3 (8B,70B)Phi-3-mini-4k-instruct

Metrics

Perplexity (PPL)AccuracyPrefill time speedupPeak decoding memory saving

Datasets

WikiText-2 (used for perplexity/calibration)Zero-shot tasks: PIQA, WinoGrande, HellaSwag, LAMBADA, ARC-Easy, ARC-Challenge

Benchmarks

WikiText-2 perplexityAccuracy