COLING 2025main0 citations

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

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.

BibTeX
@inproceedings{zhong-etal-2025-zigzagkv,
    title = "{Z}ig{Z}ag{KV}: Dynamic {KV} Cache Compression for Long-context Modeling based on Layer Uncertainty",
    author = "Zhong, Meizhi  and
      Liu, Xikai  and
      Zhang, Chen  and
      Lei, Yikun  and
      Gao, Yan  and
      Hu, Yao  and
      Chen, Kehai  and
      Zhang, Min",
    editor = "Rambow, Owen  and
      Wanner, Leo  and
      Apidianaki, Marianna  and
      Al-Khalifa, Hend  and
      Eugenio, Barbara Di  and
      Schockaert, Steven",
    booktitle = "Proceedings of the 31st International Conference on Computational Linguistics",
    month = jan,
    year = "2025",
    address = "Abu Dhabi, UAE",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.coling-main.596/",
    pages = "8897--8907"
}
ZigZagKV: Dynamic KV Cache Compression for Long-context Modeling based on Layer Uncertainty · COLING 2025