Abstract
The growth of long-context Large Language Models (LLMs) significantly increases memory and bandwidth pressure during autoregressive decoding due to the expanding Key-Value (KV) cache. While accuracy-preserving KV-cache quantization (e.g., 4-bit or 2-bit) reduces memory footprint, existing systems decode inefficiently by relying solely on CUDA cores, underutilizing Tensor Cores—the dominant compute resource on GPUs. We present BitDecoding, the first inference system to efficiently decode low-bit KV caches by cooperatively leveraging CUDA cores and Tensor Cores. BitDecoding smartly induces Tensor-Core-friendly layouts, introduces warp-level dequantization parallelism, and provides unified system support through query transformation, high-performance tensor- and channel-wise quantization, and a software-pipelined dequantization kernel enabling mixed-precision execution. Architecture-aware optimizations further leverage Hopper's warpgroup tensor instructions and Blackwell's NVFP4 (MXFP4) tensor formats. Evaluated on Blackwell, Hopper, and Ampere GPUs, BitDecoding achieves an average 7.5x decoding speedup over FP16 FlashDecoding-v2, up to 8.6x on Blackwell with NVFP4, and up to 4.3x over state-of-the-art approaches. On LLaMA-3.1-8B with a 128K context, BitDecoding reduces single-batch decoding latency by 3x.
The KV Cache Bottleneck in Long-Context LLMs
As Large Language Models (LLMs) evolve to support "infinite" context windows exceeding 128K tokens, the Key-Value (KV) cache has become the primary memory and performance bottleneck. For a 7B parameter model with a 32K context and a batch size of 8, the KV cache consumes approximately 128GB of VRAM—significantly more than the model weights themselves.
While low-bit quantization (compressing KV values to 2 or 4 bits) effectively reduces the memory footprint, existing inference systems struggle to maintain high throughput. Most current implementations rely exclusively on CUDA cores for dequantization and matrix multiplication. This leaves the Tensor Cores—specialized hardware units designed for high-speed arithmetic—idle. The primary challenge lies in the fact that Tensor Cores require specific data layouts that are difficult to maintain when the KV cache grows dynamically token-by-token.
BitDecoding: A Cooperative Execution Model
BitDecoding introduces a novel system design that enables CUDA cores and Tensor Cores to work in harmony. Rather than forcing one hardware unit to handle the entire decoding pipeline, BitDecoding assigns tasks based on hardware strengths: CUDA cores handle bit-wise manipulation and dequantization, while Tensor Cores perform dense matrix mathematics.
Key Technical Innovations
- Induced Layouts: Instead of performing expensive global data reshapes, BitDecoding utilizes hardware instructions (such as
ldmatrix) to "induce" Tensor-Core-friendly layouts during the quantization process. This ensures that data is in the exact format required by Tensor Cores the moment it is retrieved for computation. - Warp-Level Parallelism: The system re-architects GPU warp assignments to parallelize dequantization. By distributing the workload across multiple warps, BitDecoding effectively hides the latency associated with converting low-bit data back into high-precision formats.
- Software-Pipelined Kernels:
- Residual Kernel: This kernel manages new tokens by fusing computation and quantization into a single step. It maintains a small FP16 "residual" buffer to ensure that Tensor Core tiles are always fully populated, even when sequence lengths are irregular.
- Packing Kernel: This kernel employs a software-defined pipeline to overlap data movement with computation, ensuring that Tensor Cores are never starved for data.
- Architecture-Aware Tuning: BitDecoding includes specific optimizations for NVIDIA’s latest architectures, leveraging Hopper’s
wgmmainstructions and Blackwell’s nativeNVFP4(MXFP4) 4-bit support.
Evaluation and Performance
The system was evaluated across four generations of NVIDIA GPUs (Blackwell, Hopper, Ada, and Ampere) using modern LLM families including LLaMA-2, LLaMA-3.1, and Qwen3.
Speed and Throughput
BitDecoding achieves substantial performance gains over standard baselines and state-of-the-art (SOTA) systems:
- Average Speedup: The system achieves an average 7.5× speedup over FP16 FlashDecoding-v2.
- Blackwell Performance: On the Blackwell architecture, speedups reach up to 8.6× using NVFP4.
- Comparison to SOTA: BitDecoding outperforms QServe ( a leading CUDA-core-only system) by up to 4.3× at the kernel level. For LLaMA-3.1-8B with a 128K context, it reduces single-batch decoding latency by 3× and achieves 4× higher throughput than QServe.
Accuracy and Reliability
Using the LongBench benchmark for long-context tasks (summarization, multi-document QA), BitDecoding demonstrated high fidelity. 4-bit quantization resulted in a negligible 0.2% accuracy drop, making it a near-lossless solution for memory-constrained environments. While 2-bit quantization incurs a more noticeable ~2.7% drop, it remains a viable path for extreme compression scenarios.
Conclusion
BitDecoding effectively unlocks the latent power of GPU Tensor Cores for low-bit KV cache decoding, bridging the gap between memory efficiency and computational speed. By enabling efficient 4-bit and 2-bit decoding, the system allows for the deployment of massive context windows on existing hardware. Future work will focus on narrowing the accuracy gap for 2-bit quantization and exploring the potential of 1-bit KV cache formats to further push the boundaries of LLM context scaling.
Summary updated