KVzip: Query-Onafhankelijke KV-Cachecompressie met Contextreconstructie
KVzip: Query-Agnostic KV Cache Compression with Context Reconstruction
May 29, 2025
Auteurs: Jang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee, Sangdoo Yun, Hyun Oh Song
cs.AI
Samenvatting
Transformer-gebaseerde grote taalmodellen (LLM's) slaan context op als sleutel-waarde (KV) paren tijdens inferentie. Naarmate de contextlengte toeneemt, nemen de KV-cachegroottes toe, wat leidt tot aanzienlijke geheugenoverhead en verhoogde aandachtslatentie. Dit artikel introduceert KVzip, een query-agnostische KV-cache-evictiemethode die effectief hergebruik van gecomprimeerde KV-caches mogelijk maakt bij diverse queries. KVzip kwantificeert het belang van een KV-paar door het onderliggende LLM te gebruiken om originele contexten te reconstrueren uit gecachete KV-paren, waarna paren met een lager belang worden verwijderd. Uitgebreide empirische evaluaties tonen aan dat KVzip de KV-cachegrootte met 3-4 keer reduceert en de FlashAttention-decoderinglatentie met ongeveer 2 keer verlaagt, met verwaarloosbaar prestatieverlies bij taken zoals vraag-antwoord, retrieval, redeneren en codebegrip. Evaluaties omvatten diverse modellen zoals LLaMA3.1-8B, Qwen2.5-14B en Gemma3-12B, met contextlengtes tot 170K tokens. KVzip overtreft aanzienlijk bestaande query-aware KV-evictiemethoden, die te lijden hebben onder prestatieverlies zelfs bij een cachebudgetratio van 90% in multi-query scenario's.
English
Transformer-based large language models (LLMs) cache context as key-value
(KV) pairs during inference. As context length grows, KV cache sizes expand,
leading to substantial memory overhead and increased attention latency. This
paper introduces KVzip, a query-agnostic KV cache eviction method enabling
effective reuse of compressed KV caches across diverse queries. KVzip
quantifies the importance of a KV pair using the underlying LLM to reconstruct
original contexts from cached KV pairs, subsequently evicting pairs with lower
importance. Extensive empirical evaluations demonstrate that KVzip reduces KV
cache size by 3-4times and FlashAttention decoding latency by approximately
2times, with negligible performance loss in question-answering, retrieval,
reasoning, and code comprehension tasks. Evaluations include various models
such as LLaMA3.1-8B, Qwen2.5-14B, and Gemma3-12B, with context lengths reaching
up to 170K tokens. KVzip significantly outperforms existing query-aware KV
eviction methods, which suffer from performance degradation even at a 90% cache
budget ratio under multi-query scenarios.