LAVa: Layer-wise KV Cache Eviction with Dynamic Budget Allocation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Shen, Yiqun, Yuan, Song, Zhang, Zhengze, Wang, Xiaoliang, Jiang, Daxin, Cam-Tu, Nguyen
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909783268786176
author Shen, Yiqun
Yuan, Song
Zhang, Zhengze
Wang, Xiaoliang
Jiang, Daxin
Cam-Tu, Nguyen
author_facet Shen, Yiqun
Yuan, Song
Zhang, Zhengze
Wang, Xiaoliang
Jiang, Daxin
Cam-Tu, Nguyen
contents KV Cache is commonly used to accelerate LLM inference with long contexts, yet its high memory demand drives the need for cache compression. Existing compression methods, however, are largely heuristic and lack dynamic budget allocation. To address this limitation, we introduce a unified framework for cache compression by minimizing information loss in Transformer residual streams. Building on it, we analyze the layer attention output loss and derive a new metric to compare cache entries across heads, enabling layer-wise compression with dynamic head budgets. Additionally, by contrasting cross-layer information, we also achieve dynamic layer budgets. LAVa is the first unified strategy for cache eviction and dynamic budget allocation that, unlike prior methods, does not rely on training or the combination of multiple strategies. Experiments with benchmarks (LongBench, Needle-In-A-Haystack, Ruler, and InfiniteBench) demonstrate its superiority. Moreover, our experiments reveal a new insight: dynamic layer budgets are crucial for generation tasks (e.g., code completion), while dynamic head budgets play a key role in extraction tasks (e.g., extractive QA). As a fully dynamic compression method, LAVa consistently maintains top performance across task types. Our code is available at https://github.com/MGDDestiny/Lava.
format Preprint
id arxiv_https___arxiv_org_abs_2509_09754
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LAVa: Layer-wise KV Cache Eviction with Dynamic Budget Allocation
Shen, Yiqun
Yuan, Song
Zhang, Zhengze
Wang, Xiaoliang
Jiang, Daxin
Cam-Tu, Nguyen
Machine Learning
Artificial Intelligence
KV Cache is commonly used to accelerate LLM inference with long contexts, yet its high memory demand drives the need for cache compression. Existing compression methods, however, are largely heuristic and lack dynamic budget allocation. To address this limitation, we introduce a unified framework for cache compression by minimizing information loss in Transformer residual streams. Building on it, we analyze the layer attention output loss and derive a new metric to compare cache entries across heads, enabling layer-wise compression with dynamic head budgets. Additionally, by contrasting cross-layer information, we also achieve dynamic layer budgets. LAVa is the first unified strategy for cache eviction and dynamic budget allocation that, unlike prior methods, does not rely on training or the combination of multiple strategies. Experiments with benchmarks (LongBench, Needle-In-A-Haystack, Ruler, and InfiniteBench) demonstrate its superiority. Moreover, our experiments reveal a new insight: dynamic layer budgets are crucial for generation tasks (e.g., code completion), while dynamic head budgets play a key role in extraction tasks (e.g., extractive QA). As a fully dynamic compression method, LAVa consistently maintains top performance across task types. Our code is available at https://github.com/MGDDestiny/Lava.
title LAVa: Layer-wise KV Cache Eviction with Dynamic Budget Allocation
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2509.09754