paper-with-me

홈 › Papers

LLMs Know What to Drop: Self-Attention Guided KV Cache Eviction for Efficient Long-Context Inference

2025-03-11 · Guangtao Wang, Shubhangi Upasani, Chen Wu, Darshan Gandhi, Jonathan Li, Changran Hu, Bo Li, Urmish Thakker

Efficient long-context inference is critical as large language models (LLMs) adopt context windows of ranging from 128K to 1M tokens. However, the growing key-value (KV) cache and the high computational complexity of attention create significant bottlenecks in memory usage and latency. In this paper, we find that attention in diverse long-context tasks exhibits sparsity, and LLMs implicitly "know" which tokens can be dropped or evicted at the head level after the pre-filling stage. Based on this insight, we propose Self-Attention Guided Eviction~(SAGE-KV), a simple and effective KV eviction cache method for long-context inference. After prefilling, our method performs a one-time top-k selection at both the token and head levels to compress the KV cache, enabling efficient inference with the reduced cache. Evaluations on LongBench and three long-context LLMs (Llama3.1-8B-Instruct-128k, Llama3-8B-Prolong-512k-Instruct, and Qwen2.5-7B-Instruct-128k) show that SAGE-KV maintains accuracy comparable to full attention while significantly improving efficiency. Specifically, SAGE-KV achieves 4x higher memory efficiency with improved accuracy over the static KV cache selection method StreamLLM, and 2x higher memory efficiency with better accuracy than the dynamic KV cache selection method Quest.

📄 PDF Abstract BibTeX arXiv:2503.08879

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
ADOPT Please enter a description about the method here

Similar Papers 제목 키워드 기반

DropKey

2022-08-04 · Bonan Li, Yinhan Hu, Xuecheng Nie, Congying Han 외

In this paper, we focus on analyzing and improving the dropout technique for self-attention layers of Vision Transformer, which is important while surprisingly ignored by prior works. In particular, we conduct researches…

Human-Object Interaction Detectionimage-classificationImage Classificationobject-detection+1

DropKey for Vision Transformer

2023-01-01 · CVPR 2023 1 · Bonan Li, Yinhan Hu, Xuecheng Nie, Congying Han 외

In this paper, we focus on analyzing and improving the dropout technique for self-attention layers of Vision Transformer, which is important while surprisingly ignored by prior works. In particular, we conduct resear…

Human-Object Interaction Detectionimage-classificationImage Classificationobject-detection+1

What Matters in Transformers? Not All Attention is Needed

2024-06-22 · Shwai He, Guoheng Sun, Zheyu Shen, Ang Li

While scaling Transformer-based large language models (LLMs) has demonstrated promising performance across various tasks, it also introduces redundant architectures, posing efficiency challenges for real-world deployment…

AllMMLU

Self-Attention Limits Working Memory Capacity of Transformer-Based Models

2024-09-16 · Dongyu Gong, Hantao Zhang

Recent work on Transformer-based large language models (LLMs) has revealed striking limits in their working memory capacity, similar to what has been found in human behavioral studies. Specifically, these models' perform…

DecoderPosition

Can I understand what I create? Self-Knowledge Evaluation of Large Language Models

2024-06-10 · Zhiquan Tan, Lai Wei, Jindong Wang, Xing Xie 외

Large language models (LLMs) have achieved remarkable progress in linguistic tasks, necessitating robust evaluation frameworks to understand their capabilities and limitations. Inspired by Feynman's principle of understa…

Math