Manuscript Offprint

arXiv:2611.09825

BitDecoding-FP4: Native FP4 KV Cache Decoding via Algorithm-System Co-Design

Dayou Du, Woon Yee Ng, Guangming Sheng, Nick Lau, Jianyi Cheng, Luo Mai

ABSTRACT

The key-value (KV) cache dominates memory capacity and bandwidth in long-context LLM serving. While 4-bit microscaling formats (NVFP4, MXFP4) shrink the cache and run attention on FP4 Tensor Cores, a fundamental gap remains between algorithmic quantization and system-aware acceleration: existing FP4 KV systems use vanilla quantization that causes severe accuracy drops, whereas accuracy-oriented 4-bit algorithms rely on vector codebooks whose lookup overhead degrades decoding throughput. We present BitDecoding-FP4, an algorithm–system co-design for accurate and efficient native FP4 KV decoding. We mitigate three error sources: Dual-Residual Query Quantization splits queries into two FP4 tensors, cutting query logit error from 60% to 1%; Underflow-Aware Probability Scaling prevents E4M3 scales from rounding long-context probabilities to zero; and Outlier-Aware Key Quantization combines static smoothing, Hadamard rotation, and scale search to suppress key outliers under token-wise scaling. At the system level, we remove the softmax bottleneck via transposed softmax with fused probability quantization and stacked query MMA on paged KV caches. Across dense and MoE models with GQA and MLA, BitDecoding-FP4 stays within 0.5 points of BF16 KV accuracy with NVFP4 (1 point with MXFP4), and tracks BF16 KV in RL training rollouts. In end-to-end serving on NVIDIA B300 with Qwen3-4B and Qwen3-30B-A3B, it delivers 2.4–3.0× higher peak serving throughput than BF16 KV. The implementation is available at https://github.com/OpenBitSys/BitDecoding-FP4.

1 INTRODUCTION

Modern large language models (LLMs) have rapidly expanded their context windows, with recent frontier models supporting up to 1M tokens (Gemini Team et al., 2024; Yang et al., 2025), enabling complex applications such as long-document comprehension, repository-level coding, and test-time reasoning scaling (Wei et al., 2022; Guo et al., 2025). However, serving these models at long contexts and large batch sizes is severely bottlenecked by the key-value (KV) cache (Kwon et al., 2023; Du et al., 2026). Unlike static model weights, the KV cache grows linearly with both sequence length and concurrency, quickly dominating GPU memory capacity and bandwidth as it is repeatedly loaded during decoding (Xia et al., 2026; Zhou et al., 2026).

Quantizing the KV cache to low precision effectively compresses its memory footprint and reduces data movement (Liu et al., 2024; Hooper et al., 2024). Recently, 4-bit microscaling formats such as MXFP4 and NVFP4 (Rouhani et al., 2023; NVIDIA, 2025c) have improved low-bit numerical fidelity while enabling native 4-bit matrix multiplications directly on Tensor Cores, delivering 2× or higher throughput than FP8 on modern NVIDIA Blackwell and Rubin GPUs (NVIDIA, 2025a) and eliminating the runtime de-

quantization overhead of low-bit KV caches. Recent works further show that these formats achieve high accuracy and efficiency for weight and activation quantization in training and inference (Cook et al., 2025; Egiazarian et al., 2026), as well as for prefill and non-causal attention (Zhang et al., 2025b; Yu et al., 2026; Zhang et al., 2026).

However, for autoregressive KV cache decoding, a fundamental gap remains between algorithmic quantization and system-aware acceleration, as shown in Figure 1 (right). On the one hand, existing efficient NVFP4 KV cache systems such as TRT-LLM-NVFP4 (NVIDIA, 2025d) directly apply vanilla NVFP4 to the KV cache, causing severe accuracy drops in long-context inference; meanwhile, DeepInfer (DeepSeek-AI, 2026b;a) relies on post-training without considering the underlying quantization error. On the other hand, accuracy-oriented KV quantization algorithms such as TurboQuant (Zandieh et al., 2026) rely on vector codebooks whose online lookup and reconstruction overhead is inefficient on GPUs, severely degrading decoding throughput.

To further push decoding performance, executing attention natively on FP4 Tensor Cores while preserving accuracy poses coupled algorithmic and system challenges. First, at the algorithm level, whereas dequantization-based kernels

Figure

Figure 1. Overview of BitDecoding-FP4 (left), achieving higher accuracy and serving throughput when running Qwen3-4B (right). See Table 1 for the average accuracy and Figure 10(b) for the per-GPU serving throughput on B300 at 128K context.

keep queries QQ and softmax probabilities PP in 16 or 8 bits, native FP4 attention requires all four operands (Q,K,P,V)(Q, K, P, V) in narrow 4-bit microscaling blocks. During long-context decoding, query rounding noise is broadcast across thousands of tokens, small probabilities PP severely underflow under 8-bit E4M3 block scales, and token-wise Tensor Core block layouts clash with steep channel-wise outliers in KK. Second, at the system level, simply invoking FP4 Tensor Cores on paged KV caches (Kwon et al., 2023; Du et al., 2026; Sun et al., 2026) does not automatically yield decoding speedups: as matrix multiplication accelerates, the bottleneck shifts to CUDA-core softmax reductions, and accuracy-preserving quantization steps (e.g., per-tile FP32 rescaling or extra query GEMMs (Zhang et al., 2025b)) stall the decoding pipeline if not co-designed with the kernel.

In this paper, we present BitDecoding-FP4, which addresses both challenges through an algorithm–system co-design for native FP4 KV cache decoding, as illustrated in Figure 1 (left). At the algorithm level, we identify and mitigate the three primary error sources in native FP4 attention: (i) Dual-Residual Query Quantization represents the query as the sum of two FP4 tensors to suppress logit error from query quantization; (ii) Underflow-Aware Probability Scaling prevents E4M3 block scales from rounding small long-context softmax probabilities to zero via exponent rescaling and adaptive scale-maximum selection; and (iii) Outlier-Aware Key Quantization combines static key smoothing, Hadamard rotation, and block-scale search to tame key channel outliers under token-wise quantization. At the kernel level, we remove the softmax bottleneck with a transposed softmax that parallelizes reductions across keys and fuses probability quantization into warp-level butterfly shuffles, while stacked query MMA folds the residual query into a single narrow FP4 MMA and integrates seamlessly with paged KV caches (Kwon et al., 2023) via a device-side control kernel to reduce metadata overhead.

This paper makes the following contributions:

  • Accuracy-preserving FP4 KV quantization algorithm. We propose a microscaling FP4 KV quantization recipe that stays within 0.5 points of BF16 KV in average accuracy with NVFP4 (within 1 point with MXFP4) across challenging long-context and reasoning benchmarks, outperforming FP8 KV and prior 4-bit methods, and generalizes across dense and MoE models up to 770B with GQA and MLA attention. In RL post-training rollouts, it closely tracks BF16 KV accuracy, avoiding the degradation of standard NVFP4.

  • Fast native FP4 decoding kernels. Our native FP4 attention kernels keep the accuracy-recipe overhead within 4% and achieve up to 2.99×2.99\times and 4.01×4.01\times speedups over BF16 KV at 128K context on B300 and RTX PRO 5000, outperforming TRT-LLM-NVFP4, FlashInfer-XQA-NVFP4, and BitDecoding.

  • High end-to-end serving efficiency. In end-to-end serving, BitDecoding-FP4 shrinks KV cache memory by up to 3.5×3.5\times, cuts decoding latency by up to 1.81×1.81\times, and delivers 2.4−3.0×2.4-3.0\times higher peak throughput than BF16 KV at 64K–128K contexts, matching or exceeding TRT-LLM-NVFP4.

References (53)