atlas

Research map / Architectures and efficiency / Attention and transformers

CAKE: Cascading and Adaptive KV Cache Eviction with Layer Preferences

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: KV cache eviction and compression

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CAKE, a KV cache eviction method that allocates per-layer cache budgets from spatial attention entropy and temporal attention variance, applies cascading layer-wise prefill management, and uses a mean-plus-variance eviction indicator.

Problem

KV cache eviction under fixed memory budgets typically assigns uniform cache sizes across layers, ignoring that layers have different spatial and temporal attention patterns, which hurts performance under tight memory.

Approach

Measure each layer's cache preference via the product of attention entropy (spatial dispersion) and column variance (temporal shift) over a recent observation window, normalize these scores into per-layer budgets, and perform budget-constrained eviction in a cascading manner during prefill so peak memory stays bounded; the eviction indicator adds mean and variance of attention per token.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Llama2-7B-Chat · LongBench, 128Laverage score: 28.20 -> 29.29Helped
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Llama2-7B-Chat · LongBench, 1024Laverage score: 32.55 -> 32.98Helped
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Llama3.1-8B-Instruct · LongBench, 128Laverage score: 42.53 -> 43.39Helped
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Llama3.1-8B-Instruct · LongBench, 1024Laverage score: 47.95 -> 48.13Helped
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Mistral-7B-Instruct-v0.3 · LongBench, 128Laverage score: 35.81 -> 37.33Helped
use preference-prioritized adaptive cache allocation instead of the strongest reported baselineCAKE on Mistral-7B-Instruct-v0.3 · LongBench, 1024Laverage score: 42.18 -> 42.69Helped
use CAKE instead of full cacheMistral-7B-Instruct-v0.3 with FlashAttention-2 · 128K contextdecoding speedup: over 10×Helped
use CAKE instead of full cacheMistral-7B-Instruct-v0.3 with FlashAttention-2 · 128K contextpeak memory usage reduction: 48.63%Helped
add preference-prioritized adaptive allocation rather than uniform, pyramid-shaped, or random allocation (ablation)CAKE on Llama2-7B-Chat · LongBench, 128LperformanceHelped
add the mean-plus-variance eviction indicator rather than mean-only, variance-only, or multiplicative combination (ablation)CAKE on Llama2-7B-Chat · LongBench, 128LperformanceHelped
use mean attention instead of variance-only token scoring (ablation)CAKE on Llama2-7B-Chat · LongBench, 128LperformanceHelped
use a multiplicative mean-and-variance indicator instead of an individual metric (ablation)CAKE on Llama2-7B-Chat · LongBench, 128LperformanceHurt

Surprising findings

Limitations

Experimental setup

Datasets: LongBench

Benchmarks: LongBench NeedleBench

Metrics: average score peak memory decoding latency

Baselines: StreamingLLM H2O TOVA SnapKV PyramidKV

Builds on: SnapKV PyramidKV H2O FlashAttention-2

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy