NQKV: A KV Cache Quantization Scheme Based on Normal Distribution Characteristics

Zhihang Cai, Xingjun Zhang, Zhendong Tan, Zheng Wei
5/22/2025
cs.LGcs.AIcs.CL
quantization-pruning

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) have demonstrated remarkable proficiency across a wide range of tasks. However, LLMs often require larger batch sizes to enhance throughput or longer context lengths to meet task demands, which significantly increases the memory resource consumption of the Key-Value (KV) cache during inference, becoming a major bottleneck in LLM deployment.

Show full abstract

To address this issue, quantization is a common and straightforward approach. Currently, quantization methods for activations are limited to 8-bit, and quantization to even lower bits can lead to substantial accuracy drops. To further save space by quantizing the KV cache to even lower bits, we analyzed the element distribution of the KV cache and designed the NQKV algorithm. Since the elements within each block of the KV cache follow a normal distribution, NQKV employs per-block quantile quantization to achieve information-theoretically optimal quantization error. Without significantly compromising model output quality, NQKV enables the OPT model to perform inference with an 2x larger batch size or a 4x longer context length, and it improves throughput by 9.3x compared to when the KV cache is not used.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{cai2025nqkv,
  title  = {NQKV: A KV Cache Quantization Scheme Based on Normal Distribution Characteristics},
  author = {Zhihang Cai and Xingjun Zhang and Zhendong Tan and Zheng Wei},
  year   = {2025},
  eprint = {2505.16210},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.16210v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.16210.svg)](https://codeofpaper.com/paper/2505.16210)

Discussion