SeKV: Resolution-Adaptive KV Cache with Hierarchical Semantic Memory for Long-Context LLM Inference
Amirhossein Abaskohi, Giuseppe Carenini, Peter West, Yuhang He
Abstract
Large language models increasingly operate over long contexts, where the KV cache grows linearly with sequence length and dominates memory during decoding. Token eviction discards entries permanently, and semantic compression fixes each unit's resolution at prefill, so detail that becomes relevant later cannot be recovered. We propose SeKV, a resolution-adaptive KV cache built around a trained zoom-in mechanism that decides at decode time which compressed spans to restore to token resolution. SeKV segments the context at high-surprisal positions, keeps anchor tokens and span summaries on GPU, and offloads low-rank factors of each span's keys and values to CPU. Lightweight per-head routers select query-relevant spans, which are reconstructed with a learned per-span rank. The cache is lossy but non-evicting: every span stays in attention, coarse or reconstructed. The base LLM stays frozen, and the router adds under 0.1% parameters. Across five backbones and four benchmarks at a 10% GPU-resident KV budget, SeKV outperforms every method that fixes resolution at prefill, improving over the strongest semantic baseline by 2.9 points (5.5% relative). It matches exact-recall offloading caches on LongBench and InfiniteBench and trails on synthetic exact retrieval, while transferring 3 times less data per decoding step than ShadowKV and using the least total memory among the methods we profile. At 128K context, it halves peak GPU memory and cuts total memory by one third relative to full KV caching.
Create a lesson
Related papers
LongCat Recall Sparse Attention: Co-Designing Key Organization and Retrieval for Long-Context Inference
Shared title terminologycs.CLHao Zhang, Bin Xiao, Kefeng Zhang
MATCH: Modulating Attention via In-Context Retrieval for Long-Context Transformers
Shared title terminologycs.CLLinrui Ma, Chun Hei Lo, Xinyu Wang et al.
MERIT: Experience-Guided Memory for Long-Horizon Persona-Specific Persuasive Dialogue
Shared title terminologycs.CLRohan Kirti, Akash Ghosh, Pratik Amrit et al.
ContextFact: Remembering Facts in Context for Long-Term Conversational Agents
Shared title terminologycs.CLJiayu Huang, Yichao Cai, Xinyu Li et al.
CompLLM: Compression for Long Context Q&A
Shared title terminologycs.CLGabriele Berton, Jayakrishnan Unnikrishnan, Son Tran et al.
Dynamic Bidirectional Pattern Memory: A Production-Scale Empirical Characterisation of Inference-Time Gating in Clinical NLP
Shared title terminologycs.CLAli H. Lazem, William Teahan