ELI Ladder

What is quantization in LLMs?

Quantization stores an AI model's numbers with fewer bits, like rounding, so the model needs less memory and runs faster with little loss.

16-bit: very fine steps 4-bit: only 16 levels (some shown) Small rounding error per weight, big saving in memory and speed. 70B model, weights only 16-bit ≈ 140 GB 8-bit ≈ 70 GB 4-bit ≈ 35 GB plus small per-block scales Fewer bits per number: like a 16-crayon box instead of 120.

Rung 1 Explain like I'm 6

Imagine your box of 120 crayons is too heavy to carry to school. So you take a small box of 16 crayons instead. Your drawings still look almost the same. The sky is still blue, the grass still green. You lose a few in-between shades, but the bag is much lighter.

An AI model is made of billions of numbers, and each one is stored very precisely, like having all 120 crayons. Quantization keeps fewer "shades" for each number. The model gets much smaller and faster, and it still gives almost the same answers.

Rung 2 High-school level

A large language model (LLM) is mostly a giant list of numbers called weights. Training usually stores each weight in 16 bits. A model with 70 billion weights at 16 bits (2 bytes) needs about 140 GB just to hold them, more than most single graphics cards (GPUs) have.

Quantization stores those numbers with fewer bits:

  • 8 bits (int8 or FP8): about 70 GB
  • 4 bits (int4, FP4): about 35 GB, plus a little extra for scale factors

Fewer bits means a smaller model, less data to move from memory, and faster answers. The cost is rounding error: each weight is now only close to its original value. Done carefully, the model's answers barely change.

Quantization in machine learning mostly happens after training, when the model is used to answer questions (called inference). It is why big models can now run on a laptop or phone.

Check yourself: Roughly how much memory do the weights of a 70-billion-parameter model need at 4 bits?

About 35 GB (70 billion × half a byte), plus a little for scales.

Rung 3 Undergraduate level

The simplest scheme is symmetric absmax int8. Pick a scale so the largest weight maps to 127, then round:

scale = max|w| / 127, q = round(w / scale), w′ = q × scale

Take four weights: 0.12, −0.50, 0.31, 0.07.

  • max|w| = 0.50, so scale = 0.50 / 127 ≈ 0.003937
  • 0.12 / 0.003937 ≈ 30.48 → q = 30 → w′ ≈ 0.1181
  • −0.50 → q = −127 → w′ = −0.50
  • 0.31 / 0.003937 ≈ 78.74 → q = 79 → w′ ≈ 0.3110
  • 0.07 / 0.003937 ≈ 17.78 → q = 18 → w′ ≈ 0.0709

Every error is under 0.002. We now store four 1-byte integers plus one scale.

The catch is outliers. One huge value stretches the scale and crushes small values towards zero. So real schemes use one scale per small block (say 32 or 64 weights) instead of per tensor, limiting the damage from any single outlier.

Two families:

  • Post-training quantization (PTQ): quantize a finished model, sometimes using a small calibration set. Cheap and common.
  • Quantization-aware training (QAT): simulate rounding during training so the model learns to tolerate it. Better at very low bits, but costs training.

Besides weights, you can quantize activations (values flowing between layers) and the KV cache (stored attention keys and values for past tokens).

Rung 4 Graduate level

Weights-only vs weights-and-activations. Weight-only int4 shrinks memory and speeds up memory-bound token generation, but the maths still runs in 16-bit after unpacking. Quantizing activations too (W8A8, FP8, FP4) lets the hardware's low-precision tensor cores do the multiplication, which also speeds up compute-bound work such as processing long prompts.

Outliers are the main obstacle. LLM.int8() (2022) found that large transformers develop systematic outlier features; it kept those dimensions in 16-bit and ran over 99.9% of values in 8-bit, halving inference memory without measured loss on models up to 175B parameters [1].

Smarter rounding. GPTQ (2022) uses approximate second-order information to choose rounding that minimises each layer's output error. It quantized 175B-parameter models to 3 or 4 bits in about four GPU hours, with reported speedups over FP16 of about 3.25× on an A100 and 4.5× on an A6000 [2].

Integer vs float formats. Int formats space values evenly; small floats (FP8, FP4) space them more densely near zero, which suits bell-shaped weight distributions. Block scaling (a shared scale per small group) is now built into hardware formats.

KV cache quantization. For long contexts and many users, the KV cache can outgrow the weights. KIVI (2024) quantized it to 2 bits, keys per-channel and values per-token, reporting 2.6× lower peak memory, up to 4× larger batches and 2.35–3.47× higher throughput [3].

What breaks first. Below 4 bits quality usually drops noticeably, and long reasoning chains and maths tend to degrade before simple chat does. Always evaluate on your own task, not only on perplexity.

Check yourself: Why do quantization schemes use a separate scale for each small block of weights?

So one outlier only distorts its own block instead of squashing the precision of the whole tensor.

Rung 5 PhD level

Quantization is lossy compression of a function, not just of numbers. The real objective is to keep each layer's output, or the final loss, unchanged, which is why methods such as GPTQ minimise layer output error using second-order (Hessian) information rather than raw weight error [2].

Open problems:

  • Outliers and their origin. Emergent large-magnitude features [1] are a property of how transformers train. Rotations, smoothing and mixed precision move or absorb them, but why they arise, and whether training can prevent them cheaply, is still studied.
  • The low-bit frontier. At 4 bits, PTQ is often near-lossless; at 3 bits and below, quality depends heavily on model, method and task. Where the true limits lie for a given model size is unsettled.
  • Evaluation gaps. Perplexity and short benchmarks can hide damage that shows up in long-context retrieval, multi-step reasoning or rare languages.
  • Hardware co-design. A format is only fast if tensor cores support it. Format choices (block size, scale type) are now made jointly by model and chip designers.
  • Training in low precision. Quantizing inference is mature; training stably in 8-bit or 4-bit needs careful handling of gradients and outliers, and is an active area [6].

Key papers: LLM.int8() (2022) [1], GPTQ (2022) [2], KIVI (2024) [3].

Rung 6 State of the art: what experts work on now

Last checked 18 November 2026.

As of 2026-11-18.

4-bit floating point arrived in hardware. In June 2025 NVIDIA described NVFP4 for its Blackwell GPUs: 4-bit E2M1 values, an FP8 (E4M3) scale for every 16 values, and an FP32 scale per tensor. NVIDIA reported about 3.5× lower memory than FP16 and about 1.8× lower than FP8, with 1% or less accuracy loss on key tasks when quantizing DeepSeek-R1-0528 from FP8 [4]. The related MXFP4 format uses a coarser power-of-two scale per 32 values [4].

Models ship pre-quantized. OpenAI's open-weight gpt-oss models (2025) were post-trained with MXFP4 quantization of their mixture-of-experts weights, letting the 117B-parameter gpt-oss-120b run on a single 80 GB GPU and the smaller gpt-oss-20b (about 21B parameters) within 16 GB of memory [5].

Training in 4 bits. In September 2025 NVIDIA reported pretraining a 12B-parameter model on 10 trillion tokens in NVFP4, with loss and downstream accuracy matching an FP8 baseline [6].

KV cache quantization remains a key lever for long contexts, building on 2-bit methods such as KIVI [3].

Sources

  1. Dettmers et al., LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale (2022)
  2. Frantar et al., GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers (2022)
  3. Liu et al., KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache (2024)
  4. NVIDIA, Introducing NVFP4 for Efficient and Accurate Low-Precision Inference (2025)
  5. OpenAI, gpt-oss-120b model card (2025)
  6. NVIDIA, Pretraining Large Language Models with NVFP4 (2025)