Skip to content

Quantization Formats, Number Types, and KV-Cache Compression

4-Bit KLD Frontier & Live VRAM Calculator

Compare published KL-divergence drift at ~4 bpw and estimate exact deployment memory before downloading.

Measured quality vs. effective bit-width (lower KLD & lower bpw is better)

Optimal frontier (compact & high fidelity)0.0000.0100.0200.0303.5 bpw4.0 bpw4.5 bpw5.0 bpw5.5 bpwEXL3 Trellis (0.0066)GGUF UD-IQ4_XS (0.0162)NVFP4 W4A16 (0.0102)NVFP4 W4A4 (0.0244)GGUF UD-Q4_K_XL (0.0084)

VRAM & unified memory footprint estimator

KV-cache precision
Weights: 11.8 GB · KV Cache: 3.7 GB · Overhead: 1.2 GB · Total: 16.7 GBScale: 0–128 GB

Hardware fit: Fits 24 GB GPU (RTX 3090 / 4090) or 32-36 GB Mac

Hybrid linear-attention architecture significantly reduces KV-cache growth at long contexts compared to standard full-attention transformers.

Most confusion around quantization comes from conflating three independent layers of the stack: file containers (GGUF, Safetensors/EXL3, MLX, UQFF), quantization algorithms (K-quants, Unsloth Dynamic, GSQ-RCO, EXL3/QTIP, AWQ, GPTQ, AutoRound, MLX DWQ), and hardware number types (FP8 E4M3, NVFP4, MXFP4, INT4) [46]. Because these layers compose, you must select a matched (format, method, kernel, hardware) tuple rather than a bare bit width [46].

The Effective Bits-Per-Weight Reality Check

Section titled “The Effective Bits-Per-Weight Reality Check”

A “4-bit” checkpoint almost never occupies 4.0 bits per weight on disk or in VRAM. Every quantized block stores scaling metadata (and sometimes zero-points), alongside sensitive unquantized layers such as embeddings, output projections, and norms [47]:

effective bpw=element_bits+scale_bits+zero_point_bitsblock_size+unquantized_layer_overhead\text{effective bpw} = \text{element\_bits} + \frac{\text{scale\_bits} + \text{zero\_point\_bits}}{\text{block\_size}} + \text{unquantized\_layer\_overhead}

Applying this formula to late-2026’s primary 4-bit formats explains real download and VRAM footprints [46]:

  • MXFP4 (OCP standard: 4-bit E2M1 element, 8-bit UE8M0 scale per 32 weights): 4 + 8/32 = 4.25 bpw (0.531 bytes/param).
  • NVFP4 (NVIDIA Blackwell: 4-bit E2M1 element, 8-bit E4M3 scale per 16 weights + FP32 tensor scale): 4 + 8/16 = 4.50 bpw (0.563 bytes/param).
  • MLX Affine 4-bit (Apple default: 4-bit element, 16-bit scale + 16-bit offset per 64 weights): 4 + 32/64 = 4.50 bpw (0.563 bytes/param).
  • GPTQ / AWQ INT4 (group size 128, FP16 scale + 4-bit zero-point): 4 + 16/128 + 4/128 = 4.16 bpw (0.520 bytes/param).
  • GGUF Q4_K_M (heuristic mixed precision with super-block scales and elevated precision on critical tensors): roughly 4.89 bpw on Llama 3.1 8B (~0.60 bytes/param in practice).

The Low-Bit GGUF Debate (Unsloth Dynamic 3.1 vs. ISTA-DASLab GSQ-RCO)

Section titled “The Low-Bit GGUF Debate (Unsloth Dynamic 3.1 vs. ISTA-DASLab GSQ-RCO)”

Two competing per-tensor optimization pipelines dominate Hugging Face GGUF releases. Unsloth Dynamic v3.1 pairs chat-template fixes and coding/tool calibration sets with per-layer precision selection [59]. Meanwhile, ISTA’s DASLab developed GSQ-RCO (Gumbel-Softmax Quantization + Riemannian Constrained Optimization), allocating bit budgets under an exact size target to emit standard stock GGUFs [29].

On Qwen3.8-27B, DASLab reports its 11.8 GB IQ3_S (3.50 bpw) matches the 53.8 GB BF16 checkpoint on AIME25 (100.00) and LiveCodeBench v6 (85.71) while remaining within 0.51 points on GPQA-Diamond; at 8.4 GB (~2.50 bpw), DASLab reports IQ2_XS leading Unsloth UD-IQ2_S on AIME25 (96.67 vs. 86.67), GPQA-D (84.85 vs. 76.26), and LiveCodeBench v6 (76.57 vs. 72.00) [29]. Active dispute: Unsloth publicly questioned reproducibility of certain GSQ-RCO long-context figures without a formal DASLab refutation, while community testers frequently favor GSQ-RCO at 2.5–3.5 bpw and Unsloth UD-Q4_K_XL+ at 4–8 bpw [61, 70]. Both run unmodified in stock llama.cpp.

ExLlamaV2 is archived and read-only; ExLlamaV3 (EXL3) builds on Cornell’s QTIP trellis coding to quantize sequences at arbitrary continuous bitrates [46]. EXL3 / EXL3 SC leads quality-per-bit (0.0066 KLD at 4.05 bpw) [54, 63], and Atomic.chat measured ExLlamaV3/TabbyAPI processing 2,048-token prompts up to 2.5x faster than llama.cpp on RTX 5090—whereas llama.cpp decoded tokens 15–21% faster at matched sizes [55]. On tied-embedding models like Qwen3.8-27B, ExLlamaV3 can keep embeddings in host DRAM so a 4.0 bpw build fits inside 12.5 GB VRAM on a 16 GB card [78].

Why “NVFP4 Is 2.5x Faster” Misleads Single-User Builders

Section titled “Why “NVFP4 Is 2.5x Faster” Misleads Single-User Builders”

NVFP4 cuts scaling MSE nearly ninefold versus MXFP4 (0.08 vs. 0.72) [53], but headline 2.5x NVFP4 speedups come from 128 concurrent requests on an NVIDIA B200 using W4A4 tensor cores [28]. On a single RTX 5090 at batch size 1, decode is memory-bandwidth bound: Atomic.chat measured NVFP4 speeding up 4K prefill by 28–58% while single-stream decode improved only 2–10% [46]. Furthermore, W4A4 incurs higher KLD drift (0.0244) than W4A16 (0.0102) [54].

On multi-user vLLM servers running INT4 models, the GEMM kernel dwarfs the algorithmic gap between AWQ and GPTQ: Spheron’s H200 benchmark showed switching AWQ to Marlin boosted throughput 10.9x (68 → 741 tok/s), while Marlin-GPTQ jumped 2.6x (277 → 712 tok/s) [71].

KV-Cache Quantization Is Mandatory Above 32K Context

Section titled “KV-Cache Quantization Is Mandatory Above 32K Context”
  1. FP8 KV cache is the near-lossless, highest-throughput production default in vLLM on Hopper and Blackwell [82].
  2. Asymmetric K8V4 (8-bit Keys, 4-bit Values) is the local llama.cpp sweet spot—Keys degrade sharply below 8 bits while Values tolerate 4 bits, cutting cache RAM ~25% vs. Q8_0 with virtually identical retrieval (82/96 vs. 83/96) [83].
  3. TurboQuant / TurboQuant+ (TQ k8v4, turbo3, turbo4) uses Walsh-Hadamard rotations to compress KV tensors further: Red Hat AI’s vLLM study confirmed TQ k8v4 matches BF16 accuracy, and community llama.cpp builds report up to 1.79x faster decode vs. Q8_0 at 128K context [82, 84].