Lounge
Connecting…
Connecting…
View all

FP4 Quantization Explained: 4-Bit KV Cache Cost and Quality

FP4 quantization of the KV cache cuts memory about 50% versus FP8, but quality depends on format, calibration and outliers. NVFP4, MXFP4 and INT4 compared.

AILatest7 min read20 viewsPublished Updated
Contents8 sections
  1. What is the KV cache and why is it so big?
  2. FP4 quantization formats: FP8 vs NVFP4 vs MXFP4 vs INT4
  3. How a 4-bit KV cache changes LLM inference cost
  4. What happens to quality: outliers and where the error comes from
  5. LLM quantization checklist before you switch
  6. Bottom line: when a 4-bit KV cache makes sense
  7. Frequently asked questions
  8. Sources and references

Key takeaways

  • FP4 quantization stores each number in 4 bits. NVFP4 adds one FP8 scale per 16 values, so the real cost is about 4.5 bits per value.
  • NVIDIA reports that an NVFP4 KV cache uses about 50% less memory than an FP8 KV cache, roughly doubling how much context fits on the same GPU.
  • NVIDIA measured under 1% accuracy loss, but a November 2026 paper warns that naive FP4 KV quantization can cause severe accuracy drops.
  • Savings are largest for long-context, high-concurrency serving and require FP4-capable hardware such as Blackwell plus engine support.
  • Before adopting a quantized setup, check the exact format, the calibration method, long-context results and your own side-by-side evals.

FP4 quantization stores the numbers an LLM works with in 4 bits instead of 16 or 8. Applied to the KV cache, the memory that grows with every token of context, NVIDIA reports that its NVFP4 format uses about 50% less memory than an FP8 KV cache, so roughly twice as much context fits on the same GPU. The catch is quality: how much accuracy you keep depends on which 4-bit format you use and how outliers are handled. This guide walks through the mechanics, the cost effects, the accuracy risks and a practical checklist, using papers and official documentation available as of November 2026.

Two arXiv papers posted on November 6, 2026 put the topic back in focus. BitDecoding-FP4 proposes a way to decode directly from an FP4 KV cache, and CodeQuant2 targets low-precision quantization of large reasoning models (LRMs). Each paper's numbers come from its own models, GPUs and benchmarks, so treat them as data points rather than general guarantees.

What is the KV cache and why is it so big?

LLMs generate text one token at a time, and each new token attends to the key and value vectors of every earlier token. Recomputing those vectors at every step would be wasteful, so inference engines store them once and read them back. That store is the KV cache. As NVIDIA's technical blog puts it, the cache saves compute but costs memory capacity and bandwidth.

The cache grows linearly with context length and with the number of concurrent requests. When the memory pool fills up, older context gets evicted, and if a later request needs it, the engine has to recompute it. A smaller cache therefore buys longer contexts, larger batches and higher cache-hit rates.

A worked sizing example

Per-token KV size is roughly 2 (K and V) × layers × KV heads × head dimension × bytes per value. Take a hypothetical model with 32 layers, 8 KV heads and a head dimension of 128: that is 65,536 values per token. The table shows what one 131,072-token (128K) context would occupy. Real models differ, so plug in your own architecture.

FP16 / BF16

Bytes per value
2 bytes
Per token
128 KiB
One 128K context
16 GiB

FP8

Bytes per value
1 byte
Per token
64 KiB
One 128K context
8 GiB

NVFP4 (incl. scales)

Bytes per value
0.5625 bytes
Per token
36 KiB
One 128K context
4.5 GiB

Only the memory left after loading the weights is available for the cache, so dropping one long conversation from 16 GiB to 4.5 GiB changes how many of them a GPU can serve at once.

FP4 quantization formats: FP8 vs NVFP4 vs MXFP4 vs INT4

FP4 quantization formats: FP8 vs NVFP4 vs MXFP4 vs INT4

According to NVIDIA's NVFP4 introduction, the base FP4 layout is E2M1: 1 sign bit, 2 exponent bits and 1 mantissa bit, covering roughly -6 to 6. Four bits alone cannot capture the spread of real tensors, so each small block of values shares a scale factor. How that scale is stored is what separates the formats.

FP16 / BF16

Structure
16-bit float
Effective bits per value
16
Notes
Default KV precision for most models

FP8 (e.g. E4M3)

Structure
8-bit float
Effective bits per value
8
Notes
Widely used in production KV caches

MXFP4

Structure
FP4 values + one power-of-two scale per 32 values
Effective bits per value
about 4.25
Notes
Simple, but coarse scales can add error

NVFP4

Structure
FP4 values + one FP8 (E4M3) scale per 16 values + one FP32 scale per tensor
Effective bits per value
about 4.5
Notes
Smaller blocks and finer scales, lower error

INT4

Structure
16 integer levels + per-group scale
Effective bits per value
depends on group size
Notes
Often needs software dequantization without a native FP4 path

NVIDIA says NVFP4 lands at about 4.5 bits per value, cutting memory by roughly 3.5x versus FP16 and 1.8x versus FP8. The TensorRT LLM tech blog puts it as 0.5625 bytes per value, against 2 bytes for FP16/BF16 and 1 byte for FP8. The MXFP4 figure of about 4.25 bits follows from one 8-bit power-of-two scale shared across 32 four-bit values.

A model card that just says FP4 does not tell you enough. Check whether it means NVFP4 or MXFP4, what the block or group size is, and whether the KV cache, the weights, or both are quantized.

How a 4-bit KV cache changes LLM inference cost

The savings show up in three places. Capacity: NVIDIA says an NVFP4 KV cache is about 50% smaller than FP8 and effectively doubles the context budget. Bandwidth: decoding reads the cache over and over, so a smaller cache means less data moved per token. Cache hits: with more context resident on the GPU, fewer prefixes must be recomputed, which shortens time to first token (TTFT).

  • NVIDIA, Qwen3-Coder-480B-A35B: up to 3x better TTFT and up to 20% higher cache-hit rate than FP8, with the gap narrowing once cache memory is large enough.
  • BitDecoding-FP4, NVIDIA B300 with Qwen3-4B and Qwen3-30B-A3B: 2.4 to 3.0x higher peak serving throughput than a BF16 KV cache.
  • TensorRT LLM NVFP4 cold-page compression: only pages offloaded to host memory or disk are stored in NVFP4, and on an agentic replay it completed up to 1.64x more requests with up to 1.9x lower TTFT.

These are best-case figures from different setups. A chatbot that mostly handles short prompts at low concurrency may not be bound by the KV cache at all. Long-document analysis and coding agents that reuse the same prefix turn after turn benefit the most. Also note that NVIDIA's current implementation dequantizes NVFP4 to FP8 before the attention math, so storage shrinks but the attention arithmetic is not cut to a quarter.

To see how GPU supply and AI pricing are being discussed among traders and builders, the Theddari AI Telegram trends page tracks the conversation.

What happens to quality: outliers and where the error comes from

On Qwen3-480B-A35B, NVIDIA measured under 1% loss versus BF16 and FP8. MMLU-PRO came in at about 78.2% (FP16), 78.1% (FP8) and 77.4% (NVFP4); Ruler 64K, a long-context test, at about 95.6%, 95.5% and 94.6%. Format choice matters a lot, though: on Llama 3.3 70B, MMLU scored about 81.9% with an NVFP4 KV cache but about 77.8% with MXFP4.

Those results assume a carefully designed format and calibration. The BitDecoding-FP4 authors argue that existing FP4 KV systems use vanilla quantization that causes severe accuracy drops, and they trace the error to three sources.

  1. Query error: splitting each query into two FP4 tensors cut query logit error from 60% to 1% in their tests.
  2. Probability underflow: in long contexts, attention probabilities get tiny and E4M3 scales can round them to zero.
  3. Key outliers: a few channels with very large values drag the block scale up and wipe out precision for everything else. The paper combines static smoothing, Hadamard rotation and scale search to suppress them.

With those fixes, the paper reports staying within 0.5 points of BF16 KV accuracy with NVFP4 and within 1 point with MXFP4. CodeQuant2 is about weight and activation quantization rather than the KV cache, but its warning is related: reasoning models show larger activation swings in the first decoding steps, and calibration sets that skip those states can miss the outliers. Its clustering-based lookup-table approach reports up to 2.85x speedup over BF16.

A sub-1% average loss can hide larger drops on math, code generation, very long contexts beyond 64K tokens or less common languages. Small numerical errors compound in multi-step tasks, so run your own comparison.

LLM quantization checklist before you switch

  1. 1

    Confirm hardware support

    NVFP4 is hardware-accelerated on NVIDIA Blackwell. On earlier GPUs, an FP8 KV cache is usually the practical choice.

  2. 2

    Check engine flags and calibration

    The vLLM docs note that enabling an FP8 KV cache without calibration sets every scale to 1.0, and recommend dataset calibration with llm-compressor. Calibration matters even more at 4 bits.

  3. 3

    Skip sensitive layers

    vLLM documents that some layer types, such as sliding-window attention, are more sensitive to KV quantization and lets you keep them at native precision.

  4. 4

    Evaluate on long, multi-step tasks

    Compare BF16, FP8 and FP4 side by side on prompts that match your real context lengths, reasoning depth and code workloads.

  5. 5

    Measure throughput and latency together

    Record concurrency, average context length, TTFT and tokens per second under identical conditions before claiming a cost saving.

New quantization papers arrive weekly, but production support usually lags. The Theddari blog trends page is a quick way to see which inference topics developers are actually writing about before you commit engineering time.

Bottom line: when a 4-bit KV cache makes sense

  • Long contexts, high concurrency and reused prefixes get the biggest win from moving FP8 to NVFP4.
  • Quality depends on the format (NVFP4, MXFP4, INT4), block size, calibration data and outlier handling, not on the FP4 label alone.
  • Published numbers are best cases on specific models and GPUs. Your own side-by-side evals against BF16 and FP8 are the evidence that counts.
  • Middle-ground options exist, such as compressing only cold KV pages that leave the GPU, which trims cost while limiting accuracy risk.

Frequently asked questions

Is FP4 the same as INT4 quantization?
Both use 4 bits per value, but they spend those bits differently. INT4 uses 16 evenly spaced integer levels. FP4 (E2M1) uses 1 sign bit, 2 exponent bits and 1 mantissa bit, so it packs more levels near zero and fewer at the edges; NVIDIA describes its range as roughly -6 to 6. In practice, block size, scaling and outlier handling matter more than the bit layout. On Blackwell GPUs FP4 has a native hardware path, while many generic INT4 KV caches must be dequantized in software, which can cost speed.
Does quantizing the KV cache also shrink the model weights?
No. KV cache quantization only compresses the key and value tensors that accumulate during a conversation. The weights can stay in FP8 or BF16. NVIDIA's own example applies an NVFP4 KV cache on top of FP8 weights and activations. Moving the weights to FP4 is a separate step with its own accuracy trade-offs.
How much accuracy do you lose with a 4-bit KV cache?
It depends on the method. NVIDIA reported less than 1% loss versus BF16 and FP8 on Qwen3-480B-A35B, for example about 77.4% versus 78.2% on MMLU-PRO. On Llama 3.3 70B, however, MXFP4 scored about 77.8% on MMLU against about 81.9% for NVFP4. The BitDecoding-FP4 authors say vanilla FP4 KV systems suffer severe drops, and their corrected method stays within 0.5 points of BF16. Test on your own long-context and reasoning tasks.
Can I use an NVFP4 KV cache on a consumer GPU?
You need both hardware and engine support. NVFP4 is hardware-accelerated on NVIDIA Blackwell, and as of November 2026 most public material targets data-center Blackwell GPUs with TensorRT-LLM, SGLang or vLLM. On older GPUs, an FP8 KV cache or software-based 4-bit compression is the realistic option. Check your engine's supported KV cache dtypes and GPU requirements first.

Sources and references

  1. 1BitDecoding-FP4: Native FP4 KV Cache Decoding via Algorithm-System Co-Design (arXiv 2611.09825)(opens in a new tab)arxiv.org
  2. 2CodeQuant2: Enhanced Outlier Mitigation and Adaptive Clustering for Low-Precision LRMs (arXiv 2611.09868)(opens in a new tab)arxiv.org
  3. 3NVIDIA Technical Blog: Optimizing Inference for Long Context and Large Batch Sizes with NVFP4 KV Cache(opens in a new tab)developer.nvidia.com
  4. 4NVIDIA Technical Blog: Introducing NVFP4 for Efficient and Accurate Low-Precision Inference(opens in a new tab)developer.nvidia.com
  5. 5vLLM docs: Quantized KV Cache(opens in a new tab)docs.vllm.ai
  6. 6TensorRT LLM tech blog: KV Cache Compression in TensorRT LLM(opens in a new tab)nvidia.github.io