QoKV: Comprehending and Surpassing the Hurdles of KV Cache Quantization
Large language models (LLMs) have demonstrated outstanding performance in various tasks. However, the memory footprint of the key-value (KV) cache generated during model inference poses significant challenges for efficient model deployment. This paper presents a detailed analysis of the KV cache and identifies potential sources of quantization errors. We find that the attention scores exhibit a strong power-law distribution while showing an additional attention to the initial and recent tokens, and that only a small subset of outlier channels in KV cache span a wide numerical range. Based on these findings, we propose QoKV, an efficient post-training quantization (PTQ) method designed for the KV cache, which facilitates accurate low-bit quantization through a novel group evaluation strategy and numerical scaling. Extensive experimental results across various tasks demonstrate that our proposed method outperforms existing methods, achieving near-floating-point performance while saving 73.75% of the cache footprint.
Authors
- Haifeng Sun (ORCID: https://orcid.org/0000-0003-3072-7422)
- Jinguang Wang (ORCID: https://orcid.org/0000-0003-2430-6701)
- Yuexi Yin
- Tingting Yang (ORCID: https://orcid.org/0000-0002-7406-2170)
- Jingyu Wang (ORCID: https://orcid.org/0000-0002-2182-2228)
- Qi Qi (ORCID: https://orcid.org/0009-0002-4302-9973)
- Zirui Zhuang
Institutions
- Beijing University of Posts and Telecommunications (CN)
- Peng Cheng Laboratory (CN)
- State Key Laboratory of Networking and Switching Technology
Publication Details
- Published
- 2025-03-12
- DOI
- https://doi.org/10.1109/icassp49660.2025.10890716
- Citations
- 1
- Primary Topic
- Algorithms and Data Compression
- Type
- article
- Field-Weighted Citation Impact
- 2.48
Funders
- Ministry of Education
- National Natural Science Foundation of China
- Fundamental Research Funds for the Central Universities