Entropy-Guided KV Caching for Efficient LLM Inference

Citations

WEB OF SCIENCE

3
Citations

SCOPUS

3

초록

Large language models (LLMs), built upon Transformer architectures, have demonstrated remarkable performance in a wide range of natural language processing tasks. However, their practical deployment-especially in long-context scenarios-is often hindered by the computational and memory costs associated with managing the key-value (KV) cache during inference. Optimizing this process is therefore crucial for improving LLM efficiency and scalability. In this study, we propose a novel entropy-guided KV caching strategy that leverages the distribution characteristics of attention scores within each Transformer layer. Specifically, we compute the entropy of attention weights for each head and use the average entropy of all heads within a layer to assess the layer's contextual importance. Higher-entropy layers-those exhibiting broader attention dispersion-are allocated larger KV cache budgets, while lower-entropy (sink-like) layers are assigned smaller budgets. Instead of selecting different key-value tokens per head, our method selects a common set of important tokens per layer, based on aggregated attention scores, and caches them uniformly across all heads within the same layer. This design preserves the structural integrity of multi-head attention while enabling efficient token selection during the prefilling phase. The experimental results demonstrate that our approach improves cache utilization and inference speed without compromising generation quality. For example, on the Qwen3 4B model, our method reduces memory usage by 4.18% while preserving ROUGE score, and on Mistral 0.1v 7B, it reduces decoding time by 46.6%, highlighting entropy-guided layer analysis as a principled mechanism for scalable long-context language modeling.

키워드

LLM; KV cache; transformer; LLM inference optimization; attention entropy; memory-efficient caching
제목
Entropy-Guided KV Caching for Efficient LLM Inference
저자
Kim, Heekyum; Jung, Yuchul
DOI
10.3390/math13152366
발행일
2025-07
유형
Article
저널명
MATHEMATICS
권
13
호
15

파일 다운로드

Thumbnail