OjaKV: Context-Aware Online Low-Rank KV Cache Compression
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
The expanding long-context capabilities of large language models are constrained by a significant memory bottleneck: the key-value (KV) cache required for autoregressive generation. This bottleneck is substantial; for instance, a Llama-3.1-8B model processing a 32K-token prompt at a batch size of 4 requires approximately 16GB for its KV cache, a size exceeding the model's weights. While KV-cache compression via low-rank projection is a promising direction, existing methods rely on a static, offline-learned subspace that performs poorly under data distribution shifts. To overcome these limitations, we introduce OjaKV, a novel framework that integrates a strategic hybrid storage policy with online subspace adaptation. First, OjaKV recognizes that not all tokens are equally important for compression; it preserves the crucial first and most recent tokens in full-rank, maintaining high-fidelity anchors for attention. Second, for the vast majority of intermediate tokens, it applies low-rank compression by incrementally adapting the projection basis using Oja's algorithm for online principal component analysis. This adaptation involves a comprehensive update during prompt prefilling and lightweight periodic updates during decoding, ensuring the subspace remains aligned with the evolving context. Crucially, our framework is fully compatible with modern attention modules like FlashAttention. Experiments demonstrate that OjaKV maintains or even improves zero-shot accuracy at high compression ratios. In particular, OjaKV achieves its strongest gains on very long-context benchmarks that require complex reasoning, highlighting the importance of online subspace adaptation in dynamically tracking context shifts. These results establish our hybrid framework as a practical, plug-and-play solution for memory-efficient long-context inference without requiring model fine-tuning.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 21 of its 37 references that are in the map. First posted on arXiv 25 Sep 2025.
Builds on
21 of 37 references.
Closest ancestors · 8
Same direction, newest first
- 2025ReCalKV: Low-Rank KV Cache Compression via Head Reordering and Offline Calibration30 May
- 2024ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference28 Oct
- 2024MatryoshkaKV: Adaptive KV Compression via Trainable Orthogonal Projection16 Oct
- 2024Eigen Attention: Attention in Low-Rank Space for KV Cache Compression10 Aug
- 2024Keep the Cost Down: A Review on Methods to Optimize LLM' s KV-Cache Consumption25 Jul
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
- 2024SnapKV: LLM Knows What You are Looking for Before Generation22 Apr
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun
Other references · 13
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 637
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 591
- 2025MathArena: Evaluating LLMs on Uncontaminated Math Competitionscited by 297
- 2023Using an LLM to Help With Code Understandingcited by 228
- 2024Lessons from the Trenches on Reproducible Evaluation of Language Modelscited by 179
- 2024RL on Incorrect Synthetic Data Scales the Efficiency of LLM Math Reasoning by Eight-Foldcited by 99
- 2024MedSyn: LLM-based Synthetic Medical Text Generation Frameworkcited by 19
1 more
Built on by
Citing papers per year: 2026: 7.
7 papers.
- 2026Attention Sink in Transformers: A Survey on Utilization, Interpretation, and Mitigationcited by 11
- 2026eOptShrinkQ: Near-Lossless KV Cache Compression Through Optimal Spectral Denoising and Quantizationcited by 2
- 2026LOCKS: Page-Local Compact Key Summaries for Efficient Long-Context Decodingcited by 1
- 2026ZoomR: Memory Efficient Reasoning through Multi-Granularity Key Value Retrievalcited by 0
- 2026VarRate: Training-Free Variable-Rate KV Cache Compression for Long-Context LLMscited by 0
- 2026PuzzleKV: Page-Wise Low-Rank Decomposition for KV Cache Compressioncited by 0
- 2026TierKV: Long-Context On-Device LLMs via Predictive Multi-Tier KV Cachingcited by 0
- 2026TierKV: Long-Context On-Device LLMs via Predictive Multi-Tier KV Caching18 Sep 2026
- 2026PuzzleKV: Page-Wise Low-Rank Decomposition for KV Cache Compression24 Aug 2026
- 2026LOCKS: Page-Local Compact Key Summaries for Efficient Long-Context Decoding27 Jul 2026
- 2026VarRate: Training-Free Variable-Rate KV Cache Compression for Long-Context LLMs16 Jul 2026
- 2026ZoomR: Memory Efficient Reasoning through Multi-Granularity Key Value Retrieval13 Apr 2026
- 2026Attention Sink in Transformers: A Survey on Utilization, Interpretation, and Mitigation11 Apr 2026
- 2026eOptShrinkQ: Near-Lossless KV Cache Compression Through Optimal Spectral Denoising and Quantization6 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2026One Size Does Not Fit All: Token-Wise Adaptive Compression for KV Cache
- 2026DynaCalKV: Key-Value Cache Compression via Head Grouping and Adaptive Rank Allocation
- 2026GRKV: Global Regression for Training-Free KV Cache Compression in Long-Context LLMs
- 2026BELT : BEhavior-Aligned Low-Rank KV Cache Compression with Learned Top-k Rank Allocation
- 2026A JoLT for the KV cache: Near-Lossless KV Cache Compression via Joint Rank-bit Allocation
- 2025SALS: Sparse Attention in Latent Space for KV cache Compression
- 2025KVCompose: Efficient Structured KV Cache Compression with Composite Tokens
- 2026EchoKV: Efficient KV Cache Compression via Similarity-Based Reconstruction