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

AI-generated keywords: Low Precision KV Cache Quantization

AI-generated Key Points

The license of the paper does not allow us to build upon its content and the key points are generated using the paper metadata rather than the full article.

  • The paper introduces KVQuant for low precision KV cache quantization in large language models (LLMs)
  • Innovative methods in KVQuant include Per-Channel Key Quantization, Pre-RoPE Key Quantization, Non-Uniform KV Cache Quantization, and Per-Vector Dense-and-Sparse Quantization
  • Existing solutions struggle to accurately represent activations in sub-4-bit precision
  • KVQuant achieves less than 0.1 perplexity degradation with 3-bit quantization on datasets like Wikitext-2 and C4
  • Enables serving the LLaMA-7B model 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
  • Custom CUDA kernels were developed for KVQuant, resulting in approximately 1.7x speedups compared to baseline fp16 matrix-vector multiplications for the LLaMA-7B model
Also access our AI generated: Comprehensive summary, Lay summary, Blog-like article; or ask questions about this paper to our AI assistant.

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

NeurIPS 2024

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.

Submitted to arXiv on 31 Jan. 2024

Ask questions about this paper to our AI assistant

You can also chat with multiple papers at once here.

The license of the paper does not allow us to build upon its content and the AI assistant only knows about the paper metadata rather than the full article.

AI assistant instructions?

Results of the summarizing process for the arXiv paper: 2401.18079v6

This paper's license doesn't allow us to build upon its content and the summarizing process is here made with the paper's metadata rather than the article.

The paper "KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization" by Coleman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney, Yakun Sophia Shao, Kurt Keutzer, and Amir Gholami presents a novel approach to low precision KV cache quantization for large language models (LLMs). The authors introduce <kw>KVQuant</kw>, which incorporates several innovative methods to facilitate low precision KV cache quantization. These methods include Per-Channel Key Quantization, Pre-RoPE Key Quantization, Non-Uniform KV Cache Quantization, and Per-Vector Dense-and-Sparse Quantization. As LLMs are increasingly used in applications requiring large context windows, the memory consumption during inference is dominated by KV cache activations. While quantization has shown promise in compressing these activations, existing solutions struggle to accurately represent activations in sub-4-bit precision. To address this issue, the authors propose <kw>KVQuant</kw>, which achieves less than 0.1 perplexity degradation with 3-bit quantization on datasets like Wikitext-2 and C4. This surpasses existing approaches and enables serving the LLaMA-7B model 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. Furthermore, custom CUDA kernels were developed for <kw>KVQuant</kw>, resulting in approximately 1.7x speedups compared to baseline fp16 matrix-vector multiplications for the LLaMA-7B model. This work demonstrates significant advancements in low precision KV cache quantization for LLMs, paving the way for more efficient and scalable inference processes in large language models.
Created on 03 Sep. 2025

Assess the quality of the AI-generated content by voting

Score: 0

Why do we need votes?

Votes are used to determine whether we need to re-run our summarizing tools. If the count reaches -10, our tools can be restarted.

Similar papers summarized with our AI tools

Navigate through even more similar papers through a

tree representation

Look for similar papers (in beta version)

By clicking on the button above, our algorithm will scan all papers in our database to find the closest based on the contents of the full papers and not just on metadata. Please note that it only works for papers that we have generated summaries for and you can rerun it from time to time to get a more accurate result while our database grows.

Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.