Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference

Harry Dong, Xinyu Yang, Zhenyu Zhang, Zhangyang Wang, Yuejie Chi +1 more
2/14/2024
cs.LGcs.AI

Official code: hdong920/LESS (53 stars, last commit 2024-05-13).

Abstract

Many computational factors limit broader deployment of large language models. In this paper, we focus on a memory bottleneck imposed by the key-value (KV) cache, a computational shortcut that requires storing previous KV pairs during decoding. While existing KV cache methods approach this problem by pruning or evicting large swaths of relatively less important KV pairs to dramatically reduce the memory footprint of the cache, they can have limited success in tasks that require recollecting a majority of previous tokens. To alleviate this issue, we propose LESS, a simple integration of a (nearly free) constant sized cache with eviction-based cache methods, such that all tokens can be queried at later decoding steps. Its ability to retain information throughout time shows merit on a variety of tasks where we demonstrate LESS can help reduce the performance gap from caching everything, sometimes even matching it, all while being efficient. Relevant code can be found at https://github.com/hdong920/LESS.

View on arXivView PDF

Code Implementations(1)

hdong920/LESSOfficial100%
534Shell, PythonJan 27, 20242 years ago

Cite this paper

@article{dong2024more,
  title  = {Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference},
  author = {Harry Dong and Xinyu Yang and Zhenyu Zhang and Zhangyang Wang and Yuejie Chi and Beidi Chen},
  year   = {2024},
  eprint = {2402.09398},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.09398v2},
  journal = {ICML 2024 2024}
}

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/2402.09398.svg)](https://codeofpaper.com/paper/2402.09398)

Discussion