paper-with-me

홈 › Papers

KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environments

2025-04-21 · Junyoung Park, Dalton Jones, Matthew J Morse, Raghavv Goel, Mingu Lee, Chris Lott

We demonstrate that geometrically distinctive keys during LLM inference tend to have high attention scores. Based on the phenomenon we propose KeyDiff, a training-free KV cache eviction method based solely on key similarity. Unlike other KV cache eviction methods, KeyDiff can process arbitrarily long prompts within strict resource constraints and efficiently generate responses. We provide a theoretical basis for KeyDiff by relating key diversity with attention scores. These results imply KeyDiff can efficiently identify the most important tokens to retain. Notably KeyDiff does not rely on attention scores, allowing the use of optimized attention mechanisms like FlashAttention. Under a strict memory allowance, we demonstrate the effectiveness of KeyDiff for the Llama and Qwen model families by observing a performance gap of less than 0.04% with 8K cache budget ($\sim$23% KV cache reduction) from the non-evicting baseline on LongBench for Llama 3.1-8B and Llama 3.2-3B. We also observe near baseline performance for Deepseek-R1-Distill-Llama-8B on the Math500 reasoning benchmark and decrease end-to-end inference latency by up to 30% compared to the other token-eviction methods.

📄 PDF Abstract BibTeX arXiv:2504.15364

Code (0)

등록된 구현이 없습니다.

Tasks

8k

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 설명 없음
LLaMA LLaMA is a collection of foundation language models ranging from 7B to 65B parameters. It is based on the transformer architecture with various improvements that were…

Similar Papers 제목 키워드 기반

ManifoldKV: Training-Free KV Cache Compression via Euclidean Outlier Detection

2026-02-09 · Debajyoti Datta, Trishala Neeraj, Bibek Paudel, Vyom Sharma 외 arxiv

Long-context inference is constrained by KV-cache memory, which grows linearly with sequence length; KV-cache compression therefore hinges on reliably selecting which past tokens to retain. Most geometry-based eviction m…

Outlier Detection

Sigmoid Attention as a Better Substrate for Learned KV Cache Eviction

2026-08-24 · Isaac, Li arxiv

Learned KV-cache eviction often faces a soft-to-hard mismatch: during training, differentiable gates typically attenuate token contributions, whereas inference saves memory only when KV entries are physically removed. We…

NestedKV: Nested Memory Routing for Long-Context KV Cache Compression

2026-05-26 · Hong Chen, Xiang Liu, Yubo Gao, Yuxuan Fan 외 arxiv

Long-context language models are limited by the memory footprint of the key-value (KV) cache. Existing training-free KV compression methods usually rank tokens by one importance signal -- attention, recency, layer-wise a…

Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction

2026-05-10 · Ngoc Bui, Hieu Trung Nguyen, Arman Cohan, Rex Ying arxiv

The key-value (KV) cache is a major bottleneck in long-context inference, where memory and computation grow with sequence length. Existing KV eviction methods reduce this cost but typically degrade performance relative t…

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

2024-08-07 · Yilong Chen, Guoxia Wang, Junyuan Shang, Shiyao Cui 외

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 main…