Skip to main navigation Skip to search Skip to main content

ZigZagKV: Dynamic KV Cache Compression for Long-context Modeling based on Layer Uncertainty

  • Meizhi Zhong
  • , Xikai Liu
  • , Chen Zhang
  • , Yikun Lei
  • , Yan Gao
  • , Yao Hu
  • , Kehai Chen*
  • , Min Zhang
  • *Corresponding author for this work
  • Harbin Institute of Technology Shenzhen
  • Xiaohongshu

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Large Language models (LLMs) have become a research hotspot. To accelerate the inference of LLMs, storing computed caches in memory has become the standard technique. However, as the inference length increases, growing KV caches might lead to out-of-memory issues. Many existing methods address this issue through KV cache compression, primarily by preserving key tokens throughout all layers to reduce information loss. Most of them allocate a uniform budget size for each layer to retain. However, we observe that the minimum budget sizes needed to retain essential information vary across layers and models based on the perspectives of attention and hidden state output. Building on this observation, this paper proposes a simple yet effective KV cache compression method that leverages layer uncertainty to allocate budget size for each layer. Experimental results show that the proposed method can reduce memory usage of the KV caches to only ∼20% when compared to Full KV inference while achieving nearly lossless performance.

Original languageEnglish
Title of host publicationMain Conference
EditorsOwen Rambow, Leo Wanner, Marianna Apidianaki, Hend Al-Khalifa, Barbara Di Eugenio, Steven Schockaert
PublisherAssociation for Computational Linguistics (ACL)
Pages8897-8907
Number of pages11
ISBN (Electronic)9798891761964
StatePublished - 2025
Externally publishedYes
Event31st International Conference on Computational Linguistics, COLING 2025 - Abu Dhabi, United Arab Emirates
Duration: 19 Jan 202524 Jan 2025

Publication series

NameProceedings - International Conference on Computational Linguistics, COLING
ISSN (Print)2951-2093

Conference

Conference31st International Conference on Computational Linguistics, COLING 2025
Country/TerritoryUnited Arab Emirates
CityAbu Dhabi
Period19/01/2524/01/25

Fingerprint

Dive into the research topics of 'ZigZagKV: Dynamic KV Cache Compression for Long-context Modeling based on Layer Uncertainty'. Together they form a unique fingerprint.

Cite this