KV Admission: Learning What to Write for Efficient Long-Context Inference

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Huang, Yen-Chieh, Hsiu, Pi-Cheng, Fang, Rui, Chen, Ming-Syan
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914284929286144
author Huang, Yen-Chieh
Hsiu, Pi-Cheng
Fang, Rui
Chen, Ming-Syan
author_facet Huang, Yen-Chieh
Hsiu, Pi-Cheng
Fang, Rui
Chen, Ming-Syan
contents Long-context LLM inference is bottlenecked by the quadratic attention complexity and linear KV cache growth. Prior approaches mitigate this via post-hoc selection or eviction but overlook the root inefficiency: indiscriminate writing to memory. In this paper, we formalize KV cache management as a causal system of three primitives: KV Admission, Selection, and Eviction. We instantiate KV Admission via Write-Gated KV (WG-KV), a lightweight mechanism that learns to predict token utility before cache entry. By filtering out low-utility states early to maintain a compact global cache alongside a sliding local cache, WG-KV reduces memory usage by 46-68% and delivers 3.03-3.70x prefill and 1.85-2.56x decode speedups on Llama and Qwen models, while maintaining compatibility with FlashAttention and Paged-KV systems. These results demonstrate that learning what to write is a principled and practical recipe for efficient long-context inference. Code is available at https://github.com/EMCLab-Sinica/WG-KV.
format Preprint
id arxiv_https___arxiv_org_abs_2512_17452
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle KV Admission: Learning What to Write for Efficient Long-Context Inference
Huang, Yen-Chieh
Hsiu, Pi-Cheng
Fang, Rui
Chen, Ming-Syan
Machine Learning
Artificial Intelligence
Long-context LLM inference is bottlenecked by the quadratic attention complexity and linear KV cache growth. Prior approaches mitigate this via post-hoc selection or eviction but overlook the root inefficiency: indiscriminate writing to memory. In this paper, we formalize KV cache management as a causal system of three primitives: KV Admission, Selection, and Eviction. We instantiate KV Admission via Write-Gated KV (WG-KV), a lightweight mechanism that learns to predict token utility before cache entry. By filtering out low-utility states early to maintain a compact global cache alongside a sliding local cache, WG-KV reduces memory usage by 46-68% and delivers 3.03-3.70x prefill and 1.85-2.56x decode speedups on Llama and Qwen models, while maintaining compatibility with FlashAttention and Paged-KV systems. These results demonstrate that learning what to write is a principled and practical recipe for efficient long-context inference. Code is available at https://github.com/EMCLab-Sinica/WG-KV.
title KV Admission: Learning What to Write for Efficient Long-Context Inference
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2512.17452