Lune

NeurIPS2024Top-tier venue

KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization

Coleman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney, Yakun Sophia Shao, Kurt Keutzer, Amir Gholami

Abstract

LLMs are seeing growing use for applications which require large context windows, and with these large context windows KV cache activations surface as the dominant contributor to memory consumption during inference. Quantization is a promising approach for compressing KV cache activations; however, existing solutions fail to represent activations accurately in sub-4-bit precision. Our work, KVQuant, facilitates low precision KV cache quantization by incorporating several novel methods: (i) Per-Channel Key Quantization, where we adjust the dimension along which we quantize the Key activations to better match the distribution; (ii) Pre-RoPE Key Quantization, where we quantize Key activations before the rotary positional embedding to mitigate its impact on quantization; (iii) Non-Uniform KV Cache Quantization, where we derive per-layer sensitivity-weighted non-uniform datatypes that better represent the distributions; and (iv) Per-Vector Dense-and-Sparse Quantization, where we isolate outliers separately for each vector to minimize skews in quantization ranges. By applying our method to the LLaMA, Llama-2, Llama-3, and Mistral models, we achieve<0.1 perplexity degradation with 3-bit quantization on both Wikitext-2 and C4, outperforming existing approaches. Our method enables serving LLaMA-7B with a context length of up to 1 million on a single A100-80GB GPU and up to 10 million on an 8-GPU system. We develop custom CUDA kernels for KVQuant, showing that we can achieve up to 1.7x speedups, compared to baseline fp16 matrix-vector multiplications, for the LLaMA-7B model.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

92 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Efficient Streaming Language Models with Attention Sinks cites SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
  • Efficient Streaming Language Models with Attention Sinks cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Efficient Streaming Language Models with Attention Sinks
  • CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion cites CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving
  • CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving cites CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
  • CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Reducing Transformer Key-Value Cache Size with Cross-Layer Attention cites FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
  • Reducing Transformer Key-Value Cache Size with Cross-Layer Attention cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving cites SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
  • CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving cites FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
  • CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
  • SnapKV: LLM Knows What You are Looking for Before Generation cites Efficient Streaming Language Models with Attention Sinks
  • SnapKV: LLM Knows What You are Looking for Before Generation cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Mooncake: Trading More Storage for Less Computation - A KVCache-centric Architecture for Serving LLM Chatbot cites Reducing Transformer Key-Value Cache Size with Cross-Layer Attention
  • Mooncake: Trading More Storage for Less Computation - A KVCache-centric Architecture for Serving LLM Chatbot cites CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving
  • Mooncake: Trading More Storage for Less Computation - A KVCache-centric Architecture for Serving LLM Chatbot cites FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
  • Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation cites Efficient Streaming Language Models with Attention Sinks
  • Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation cites Reducing Transformer Key-Value Cache Size with Cross-Layer Attention
  • Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers92

  1. Mooncake: Trading More Storage for Less Computation - A KVCache-centric Architecture for Serving LLM ChatbotRuoyu Qin, Zheming Li, Weiran He, Jialei Cui et al.FAST 2025 · 337 citations
  2. Reducing Transformer Key-Value Cache Size with Cross-Layer AttentionWilliam Brandon, Mayank Mishra, Aniruddha Nrusimha, Rameswar Panda et al.NeurIPS 2024 · 150 citations
  3. Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level ComputationSangmin Bae, Yujin Kim, Reza Bayat, Sungnyun Kim et al.NeurIPS 2025 · 143 citations
  4. CacheGen: KV Cache Compression and Streaming for Fast Large Language Model ServingYuhan Liu, Hanchen Li, Yihua Cheng, Siddhant Ray et al.SIGCOMM 2024 · 111 citations
  5. CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge FusionJiayi Yao, Hanchen Li, Yuhan Liu, Siddhant Ray et al.EuroSys 2025 · 68 citations

Builds on20

  1. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  2. SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language ModelsGuangxuan Xiao, Ji Lin, Mickaël Seznec, Hao Wu et al.ICML 2023 · 1,493 citations
  3. SnapKV: LLM Knows What You are Looking for Before GenerationYuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh et al.NeurIPS 2024 · 1,019 citations
  4. H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen et al.NeurIPS 2023 · 1,003 citations
  5. FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPUYing Sheng, Lianmin Zheng, Binhang Yuan, Zhuohan Li et al.ICML 2023 · 683 citations

Related papers

  1. QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMsSaleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li et al.NeurIPS 2024 · 723 citations
  2. KVmix: Gradient-Based Layer Importance-Aware Mixed-Precision Quantization for KV CacheFei Li, Song Liu, Weiguo Wu, Shiqiang Nie et al.AAAI 2026 · 1 citation
  3. CommVQ: Commutative Vector Quantization for KV Cache CompressionJunyan Li, Yang Zhang, Muhammad Yusuf Hassan, Talha Chafekar et al.ICML 2025
  4. VecInfer: Efficient LLM Inference with Low-Bit KV Cache via Outlier-Suppressed Vector QuantizationDingyu Yao, Chenxu Yang, Zhengyang Tong, Zheng Lin et al.ACL 2026 · 4 citations
  5. COMET: Towards Practical W4A4KV4 LLMs ServingLian Liu, Long Cheng, Haimeng Ren, Zhaohui Xu et al.ASPLOS 2025 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines