paper-with-me

홈 › Papers

XKV: Personalized KV Cache Memory Reduction for Long-Context LLM Inference

2024-12-08 · Weizhuo Li, Zhigang Wang, Yu Gu, Ge Yu

Recently the generative Large Language Model (LLM) has achieved remarkable success in numerous applications. Notably its inference generates output tokens one-by-one, leading to many redundant computations. The widely-used KV-Cache framework makes a compromise between time and space complexities. However, caching data generates the increasingly growing memory demand, that can quickly exhaust the limited memory capacity of the modern accelerator like GPUs, particularly in long-context inference tasks. Existing studies reduce memory consumption by evicting some of cached data that have less important impact on inference accuracy. But the benefit in practice is far from ideal due to the static cache allocation across different LLM network layers. This paper observes that the layer-specific cached data have very different impacts on accuracy. We quantify this difference, and give experimental and theoretical validation. We accordingly make a formal analysis and shows that customizing the cache size for each layer in a personalized manner can yield a significant memory reduction, while still providing comparable accuracy. We simulate the cache allocation as a combinatorial optimization problem and give a global optimal solution. In particular, we devise a mini- and sampling-based inference over a lightweight variant of the LLM model, so as to quickly capture the difference and then feed it into the personalized algorithms. Extensive experiments on real-world datasets demonstrate that our proposals can reduce KV cache memory consumption by 61.6% on average, improve computational efficiency by 2.1x and then increase the throughput by up to 5.5x.

📄 PDF Abstract BibTeX arXiv:2412.05896

Code (0)

등록된 구현이 없습니다.

Tasks

Combinatorial OptimizationComputational EfficiencyLarge Language Model

Similar Papers 제목 키워드 기반

EpiCache: Episodic KV Cache Management for Long-Term Conversation on Resource-Constrained Environments

2025-09-22 · Minsoo Kim, Arnav Kundu, Han-Byul Kim, Richa Dixit 외 arxiv

Modern large language models (LLMs) extend context lengths to millions of tokens, enabling coherent, personalized responses grounded in long conversational history. However, the Key-Value (KV) cache grows linearly with t…

Conversational Question Answering

RocketKV: Accelerating Long-Context LLM Inference via Two-Stage KV Cache Compression

2025-02-19 · Payman Behnam, Yaosheng Fu, Ritchie Zhao, Po-An Tsai 외

Transformer-based Large Language Models rely critically on KV cache to efficiently handle extended contexts during the decode phase. Yet, the size of the KV cache grows proportionally with the input length, burdening bot…

GPU

MEDA: Dynamic KV Cache Allocation for Efficient Multimodal Long-Context Inference

2025-02-24 · Zhongwei Wan, Hui Shen, Xin Wang, Che Liu 외

Long-context Multimodal Large Language Models (MLLMs) that incorporate long text-image and text-video modalities, demand substantial resources as their multimodal Key-Value (KV) caches grow with increasing input lengths,…

LeanK: Learnable K Cache Channel Pruning for Efficient Decoding

2025-08-04 · Yike Zhang, Zhiyuan He, Huiqiang Jiang, Chengruidong Zhang 외 arxiv

Large language models (LLMs) enable long-context tasks but face efficiency challenges due to the growing key-value (KV) cache. We propose LeanK, a learning-based method that prunes unimportant key (K) cache channels by l…

Locret: Enhancing Eviction in Long-Context LLM Inference with Trained Retaining Heads on Consumer-Grade Devices

2024-10-02 · Yuxiang Huang, Binhang Yuan, Xu Han, Chaojun Xiao 외

Scaling the input context length of a large language model (LLM) incurs a significant increase in computation cost and memory footprint to maintain the attention key-value (KV) cache. Existing KV cache compression method…

GPULanguage ModelingLanguage ModellingLarge Language Model+1