MiniKV: Pushing the Limits of LLM Inference via 2-Bit Layer-Discriminative KV Cache
Sharma, Akshat, Ding, Hangliang, Li, Jianping, Dani, Neel, Zhang, Minjia
–arXiv.org Artificial Intelligence
How to efficiently serve LLMs in practice has become exceptionally challenging due to their prohibitive memory and computation requirements. In this study, we investigate optimizing the KV cache, whose memory footprint poses a critical bottleneck in LLM inference, especially when dealing with long context tasks. To tackle the challenge, we introduce MiniKV, a KV cache optimization method that simultaneously preserves long context task accuracy while significantly reducing KV cache size via a novel 2-bit layer-discriminative KV cache. More importantly, we develop specialized CUDA kernels to make MiniKV compatible with FlashAttention. Experiments on a wide range of long context tasks show that MiniKV effectively achieves 86% KV cache compression ratio while recovering over 98.5% of accuracy, outperforming state-of-the-art methods while achieving excellent measured system performance improvements. On a separate line of research, researchers have studied selective KV methods, where the LLM model selects a small Large language models (LLMs) have exhibited unique capabilities subset of KV states based on their importance (Zhang et al., such as instruction following, commonsense reasoning, 2023; Xiao et al., 2023b; Ge et al., 2023; Liu et al., 2023b). O proposes to dynamically keep a subset OpenAI, 2023).
arXiv.org Artificial Intelligence
Nov-27-2024
- Country:
- North America
- Dominican Republic (0.04)
- Canada (0.04)
- United States
- Louisiana > Orleans Parish
- New Orleans (0.04)
- Illinois > Champaign County
- Urbana (0.04)
- Hawaii > Honolulu County
- Honolulu (0.04)
- Louisiana > Orleans Parish
- Europe
- North Macedonia (0.04)
- United Kingdom > England
- Greater London > London (0.04)
- Italy > Tuscany
- Florence (0.04)
- Germany > Bavaria
- Upper Bavaria > Munich (0.04)
- North America
- Genre:
- Research Report
- New Finding (0.48)
- Promising Solution (0.34)
- Research Report
- Industry:
- Government > Regional Government (0.93)
- Technology: