The problem: fewer bits do not guarantee faster decoding
KV caches grow with the length of a generation, so storing them in 4-bit form could preserve more tokens in the same amount of GPU memory. But compression alone does not guarantee a speedup. H100 and H200 GPUs have no dedicated FP4 hardware, which means low-bit values must be unpacked and processed in software during decoding. The extra instructions can outweigh the benefit of reading fewer bytes. The new study argues that this is primarily an implementation problem—not proof that 4-bit KV caches are inherently slow.
Reworking the kernel around Hopper’s limits
The authors estimate that an H200 has an issue budget of about seven thread instructions per byte read. Their instruction counts put existing 4-bit paths in vLLM at roughly two to six times that budget. They also identify serialization between loading data, decoding it, and performing matrix operations. Together, these costs help explain why current NVFP4 implementations can trail FP8 on Hopper.
The proposed kernel changes both the data layout and the execution schedule. A TMA producer warp handles data movement so loading can overlap with decoding. The cache is laid out so decoded values can be delivered from registers to tensor cores, and the operand order is swapped for small query groups. The goal is to limit instruction overhead and hide decoding latency, without relying on FP4 hardware that Hopper does not have.
Measured speedups—and an accuracy boundary
On an H200, the bare kernel was 1.10–1.48 times as fast as the faster of TensorRT-LLM’s XQA and FlashAttention-4’s native FP8 kernels across 11 tested shapes. When the 4-bit K and V data used FP8 tensor cores, the reported advantage was 1.22–1.76 times.
The vLLM 0.33 integration adds several accuracy-related choices: K mean removal, K rotation, four BF16 sink tokens, and keeping layer 0 in BF16. For Llama-3.1-8B, the decode step was 1.12–1.64 times faster than FlashInfer FP8 at batch sizes of eight and above, and roughly even at batch one. The cache held 1.63 times as many tokens. Results for the 32B and 72B models showed smaller gains, at 1.04–1.18 times.
The quality results need equal attention. Across five evaluated models, the reported 95% intervals ruled out accuracy losses greater than about 3.5 percentage points relative to BF16 KV. But at 120K tokens on Llama-3.1-8B, the 4-bit cache lost about 15 points versus BF16 KV—roughly comparable to vLLM’s default FP8 path. The implementation is also limited to head dimension 128 and is tied to a vLLM 0.33 plugin. The results therefore should not be treated as a universal guarantee for other models or serving configurations.
Why it matters
The study reframes low-bit cache performance as a systems-design question. Reduced memory traffic is useful only if the kernel can decode values efficiently and overlap that work with loading. For inference services, a larger cache may support longer prompts or more concurrent requests, but operators must weigh those benefits against accuracy changes, model-specific behavior, and integration constraints. The authors provide code and a comparison utility; testing against the actual GPU, model, and FP8 baseline remains essential.
Comments
Checking sign-in status...
Loading comments...