FreqDepthKV: Frequency-Guided Depth Sharing for Robust KV Cache Compression in Long-Context LLM Inference
Summary
FreqDepthKV is an inference-time cache compression method designed to address the memory and bandwidth limitations of KV caches in long-context Large Language Models. It factorizes adjacent-layer KV states into shared low-frequency depth components and sparse high-frequency residuals. A lightweight online probe adaptively assigns attention heads to shared-depth, residual-depth, or exact cache modes based on their contribution to reconstruction-sensitive attention logits, allowing the compression policy to adapt without retraining. This approach preserves task accuracy across long-context question answering, needle retrieval, summarization, and code generation benchmarks. FreqDepthKV achieves a 3.9x effective compression ratio, reducing peak KV memory to 6.2 GB, improving decoding throughput to 70.4 tokens/s, and lowering TTFT to 2.06 seconds with a 32k-token prefill window.
Key takeaway
For Machine Learning Engineers and AI Scientists struggling with KV cache memory and bandwidth constraints in long-context LLMs, FreqDepthKV offers a compelling solution. You should consider implementing this method to achieve a 3.9x effective compression ratio and significantly boost decoding throughput to 70.4 tokens/s, while preserving critical task accuracy across diverse benchmarks. This can lead to more efficient and cost-effective deployment of large models.
Key insights
FreqDepthKV robustly compresses KV caches in long-context LLMs via frequency-guided depth sharing and adaptive attention head assignment.
Principles
- Aggressive KV cache compression can degrade accuracy.
- Layer-specific evidence is crucial for retrieval and reasoning.
- Adaptive compression policies improve robustness without retraining.
Method
FreqDepthKV factorizes adjacent-layer KV states into shared low-frequency depth components and sparse high-frequency residuals. An online probe assigns attention heads to shared-depth, residual-depth, or exact cache modes based on attention logits.
In practice
- Reduce KV memory footprint by 3.9x.
- Improve decoding throughput to 70.4 tokens/s.
- Maintain accuracy on long-context tasks like code generation.
Topics
- Long-Context LLMs
- KV Cache Compression
- Inference Optimization
- Attention Mechanisms
- Memory Efficiency
- Deep Learning Performance
Best for: AI Engineer, AI Architect, MLOps Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.