ACL 2024long13 citations

NACL: A General and Effective KV Cache Eviction Framework for LLM at Inference Time

Yilong Chen, Guoxia Wang, Junyuan Shang, Shiyao Cui, Zhenyu Zhang, Tingwen Liu, Shuohuan Wang, Yu Sun

Abstract

Large Language Models (LLMs) have ignited an innovative surge of AI applications, marking a new era of exciting possibilities equipped with extended context windows. However, hosting these models is cost-prohibitive mainly due to the extensive memory consumption of KV Cache involving long-context modeling. Despite several works proposing to evict unnecessary tokens from the KV Cache, most of them rely on the biased local statistics of accumulated attention scores and report performance using unconvincing metric like perplexity on inadequate short-text evaluation. In this paper, we propose NACL, a general framework for long-context KV cache eviction that achieves more optimal and efficient eviction in a single operation during the encoding phase. Due to NACL’s efficiency, we combine more accurate attention score statistics in Proxy-Tokens Eviction with the diversified random eviction strategy of Random Eviction, aiming to alleviate the issue of attention bias and enhance the robustness in maintaining pivotal tokens for long-context modeling tasks. Notably, our method significantly improves the performance on short- and long-text tasks by 80% and 76% respectively, reducing KV Cache by up to 5× with over 95% performance maintenance. Code available at https://github.com/PaddlePaddle/Research/tree/master/NLP/ACL2024-NACL.

BibTeX
@inproceedings{chen-etal-2024-nacl,
    title = "{NACL}: A General and Effective {KV} Cache Eviction Framework for {LLM} at Inference Time",
    author = "Chen, Yilong  and
      Wang, Guoxia  and
      Shang, Junyuan  and
      Cui, Shiyao  and
      Zhang, Zhenyu  and
      Liu, Tingwen  and
      Wang, Shuohuan  and
      Sun, Yu  and
      Yu, Dianhai  and
      Wu, Hua",
    editor = "Ku, Lun-Wei  and
      Martins, Andre  and
      Srikumar, Vivek",
    booktitle = "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.acl-long.428/",
    doi = "10.18653/v1/2024.acl-long.428",
    pages = "7913--7926"
}
NACL: A General and Effective KV Cache Eviction Framework for LLM at Inference Time · ACL 2024