LLM Quantization: Symmetric INT8, INT4, Activation Outliers, AWQ & FP8
How Quantization shrinks a 70B LLM from 140 GB down to 35 GB and speeds up memory-bound Decode by 2×–3.2×: symmetric quantization math, why 100× activation outliers break naive INT8, AWQ salient-channel scaling, and native Hopper/Blackwell FP8.
LLM Quantization compresses FP16 weights (and activations) into compact INT8, FP8, or INT4 formats—using outlier-aware methods like AWQ to protect the 1% most salient channels.
LLM decode speed is bottlenecked by moving weights from GPU HBM; 4-bit quantization cuts VRAM by 4× and speeds up token generation 2×–3× on the exact same GPU.
Quantization is how you run a 70B frontier LLM on a single GPU (or an 8B model on your laptop!) at 2×–3.2× higher tokens/sec with <0.1% quality drop!
Choosing FP8 (W8A8) on H100/B200 clusters (2× Prefill + 2× Decode!) vs. AWQ / GGUF INT4 (W4A16) on smaller GPUs or edge laptops is a daily production deployment decision.
Understanding that KV-Cache can also be quantized to FP8 (doubling max context length and concurrent users!) unlocks huge cost savings in long-context RAG.
Top inference systems question: 'Why does W4A16 INT4 speed up Decode even when weights are dequantized back to FP16 for matmul, and how does AWQ protect salient channels?'
Why does W4A16 (4-bit weights, 16-bit activations) speed up single-user LLM Decode by ~3× even though Tensor Cores still multiply in FP16?
- Compute symmetric quantization & dequantization q = round(w / s), ŵ = q · s and explain group-wise scaling (group_size = 128)
- Explain why LLMs above ~6.7B parameters develop emergent 100× Activation Outlier channels that ruin naive per-tensor quantization
- Contrast W4A16 Weight-Only Quantization (AWQ / GPTQ) with native hardware W8A8 FP8 (E4M3 on H100/B200)
- Explain why Weight-Only INT4 accelerates memory-bandwidth-bound Decode (~3×) even though math still executes in FP16!
FP16 stores every LLM weight to 4 decimal places (0.7341) — like measuring the distance to the grocery store in millimeters! Quantization rounds weights onto a clean 4-bit or 8-bit ruler. The only catch: ~1% of channels carry 100× giant activation spikes (like one skyscraper on a flat street). AWQ simply zooms in on those 1% VIP channels using a mathematical scaling trick so the 99% normal weights AND the 1% skyscrapers stay razor-sharp!
1. Symmetric Quantization Grid & Group-Wise Scaling
Switch between INT4 / INT8 / INT16 in the mini-lab below to see the exact quantization rounding error on w = 0.734!
Why Group-Wise Quantization (group_size = 128) Is Essential
A single scale factor across an entire matrix gets stretched by one large outlier, crushing normal weights to 0. Computing a fresh scale for every tiny 128-weight group keeps quantization error tiny for only ~0.125 bits/weight of extra storage!
Symmetric Quantization Grid Lab (True Weight = 0.734)
2. Emergent Activation Outliers & AWQ Salient Channels
How does AWQ protect the 1% outlier-driven weight channels without slow mixed-precision hardware branching?
The Elegant AWQ Mathematical Identity
By multiplying the top 1% salient weight columns by before INT4 rounding (and folding into the preceding RMSNorm layer!), AWQ slashes relative rounding error on critical channels while keeping 100% pure uniform INT4 kernels!
3. W4A16 (AWQ/GPTQ) vs. Native Hardware W8A8 FP8
Choose W4A16 when VRAM & small-batch Decode dominate; choose FP8 (W8A8) on H100/Blackwell when you serve high-throughput batches!
Production Precision Playbook
- Edge / Single-GPU / Small Batch: INT4 AWQ / GGUF Q4_K_M (4× VRAM reduction, ~3× Decode speedup).
- Cloud H100 / B200 High-Batch APIs: Native FP8 E4M3 (2× VRAM reduction + 2× Tensor Core FLOPs for both Prefill and large-batch Decode, plus FP8 KV-Cache!).
Worked Example: Symmetric INT4 Quantization of a Weight Vector
Weights w = [0.80, -0.40, 0.15] in signed INT4 (max_int = 7).
.
On an NVIDIA H100 serving high-concurrency traffic, why is W8A8 FP8 often faster than W4A16 INT4 during long-prompt Prefill?
Why does FP8 (E4M3) beat INT8 for quantizing Transformer activations on H100 GPUs?
The exact honest questions almost every beginner wonders — answered in plain English without hiding behind jargon.
PTQ (AWQ, GPTQ, FP8) quantizes an already-trained checkpoint in minutes using ~128 calibration samples. QAT simulates quantization rounding during training (e.g., 1.58-bit BitNet / INT4 QAT) for even tighter accuracy at ultra-low bit widths.
70B LLM Quantization Precision & Decode Speedup Studio
Watch a 70B model compress from FP16 → FP8 → INT4 AWQ while single-user Decode tokens/sec climbs 3.2×.
Local LLMs (llama.cpp / Ollama GGUF Q4_K_M)
Runs 8B–70B models on Apple Silicon unified memory at interactive speeds.
Cloud H100/B200 FP8 Serving (vLLM / TensorRT-LLM)
Default production format for LLaMA 3 70B/405B and DeepSeek-V3 (natively trained in FP8!).
import torch
# Activation-Aware Weight Quantization (AWQ) intuition: protect salient weight channels
torch.manual_seed(0)
W = torch.randn(8, 16) * 0.2
X = torch.randn(32, 16)
X[:, 3] *= 15.0 # Channel 3 has a massive activation outlier!
def quant_dequant_int4(mat: torch.Tensor) -> torch.Tensor:
s = mat.abs().max() / 7.0
return torch.round(mat / s).clamp(-7, 7) * s
# Naive INT4 vs AWQ channel-scaled INT4 (scale up salient W channels, divide X)
scale = (X.abs().mean(dim=0) / X.abs().mean()).pow(0.5)
err_naive = (X @ W.T - X @ quant_dequant_int4(W).T).pow(2).mean().sqrt().item()
err_awq = (X @ W.T - (X / scale) @ quant_dequant_int4(W * scale).T).pow(2).mean().sqrt().item()
print(f"Naive INT4 output RMSE: {err_naive:.4f} | AWQ-scaled RMSE: {err_awq:.4f}")