PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
April 24, 20240 citationsOpen Access

Sequence can Secretly Tell You What to Discard

View Full Paper
JDJincheng DaiZHZhuowei HuangHJHaiyun Jiang

Key Points

  • Inference memory usage of KV cache can be reduced by 70% with CORM, maintaining performance.
  • CORM selectively retains key-value pairs based on the similarity of adjacent query vectors in large language models.
  • Assessment involved LLaMA2 series models across six tasks to validate the effectiveness of CORM for inference efficiency limits in LLMs. This optimization helps address the bottleneck issues caused by increasing sequence lengths in inference processes.

Abstract

Large Language Models (LLMs), despite their impressive performance on a wide range of tasks, require significant GPU memory and consume substantial computational resources. In addition to model weights, the memory occupied by KV cache increases linearly with sequence length, becoming a main bottleneck for inference. In this paper, we introduce a novel approach for optimizing the KV cache which significantly reduces its memory footprint. Through a comprehensive investigation, we find that on LLaMA2 series models, (i) the similarity between adjacent tokens' query vectors is remarkably high, and (ii) current query's attention calculation can rely solely on the attention information of a small portion of the preceding queries. Based on these observations, we propose CORM, a KV cache eviction policy that dynamically retains important key-value pairs for inference without finetuning the model. We validate that CORM reduces the inference memory usage of KV cache by up to 70% without noticeable performance degradation across six tasks in LongBench.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Dai et al. (2024) studied this question.

synapsesocial.com/papers/68e6de67b6db643587659f10https://doi.org/10.48550/arxiv.2404.15949
Ask AI
Helpful
Bookmark
Share
View Full Paper