MatKV: Trading Compute for Flash Storage in LLM Inference
On the map: Retrieval-augmented generation → RAG pipeline design and evaluation
Abstract (arXiv)
We observe two major trends in LLM-based generative AI: (1) inference is becoming the dominant factor in terms of cost and power consumption, surpassing training, and (2) retrieval augmented generation (RAG) is becoming prevalent. When processing long inputs in RAG, the prefill phase of computing the key-value vectors of input text is energy-intensive and time-consuming even with high-end GPUs. Thus, it is crucial to make the prefill phase in RAG inference efficient. To address this issue, we propose MatKV, a scheme that precomputes the key-value vectors (KVs) of RAG objects (e.g., documents), materializes them in inexpensive but fast and power-efficient flash storage, and reuses them at inference time instead of recomputing the KVs using costly and power-inefficient GPU. Experimental results using Hugging Face's Transformers library across state-of-the-art GPUs and flash memory SSDs confirm that, compared to full KV computation on GPUs, MatKV reduces both inference time and power consumption by half for RAG workloads, without severely impacting accuracy in the question-answering task. Furthermore, we demonstrate that MatKV enables additional optimizations in two ways. First, a GPU can decode text while simultaneously loading the materialized KVs for the next instance, reducing load latency. Second, since decoding speed is less sensitive to GPU performance than KV computation, low-end GPUs can be leveraged for decoding without significantly compromising speed once the materialized KVs are loaded into GPU memory. These findings underscore MatKV's potential to make large-scale generative AI applications more cost-effective, power-efficient, and accessible across a wider range of tasks and hardware environments.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in RAG pipeline design and evaluation, one of 15 directions in Retrieval-augmented generation. Builds on 26 of its 49 references that are in the map. First posted on arXiv 20 Dec 2025.
Builds on
26 of 49 references.
Closest ancestors · 1
Same direction, newest first
- 2024CRAG -- Comprehensive RAG Benchmark7 Jun
Other references · 25
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,259
- 2024Evaluating Very Long-Term Conversational Memory of LLM Agentscited by 800
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
13 more
- 2024Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Servecited by 507
- 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 255
- 2024InfiniGen: Efficient Generative Inference of Large Language Models with Dynamic KV Cache Managementcited by 242
- 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Servingcited by 199
- 2024A Survey on Efficient Inference for Large Language Modelscited by 197
- 2024MiniCache: KV Cache Compression in Depth Dimension for Large Language Modelscited by 122
- 2024RAGCache: Efficient Knowledge Caching for Retrieval-Augmented Generationcited by 97
- 2024TurboRAG: Accelerating Retrieval-Augmented Generation with Precomputed KV Caches for Chunked Textcited by 60
- 2024D'ej`aVu: KV-cache Streaming for Fast, Fault-tolerant Generative LLM Servingcited by 48
- 2024LLM Inference Serving: Survey of Recent Advances and Opportunitiescited by 46
- 2025RocketKV: Accelerating Long-Context LLM Inference via Two-Stage KV Cache Compressioncited by 41
- 2024Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Taskscited by 38
- 2024LayerKV: Optimizing Large Language Model Serving with Layer-wise KV Cache Managementcited by 16
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Can I Buy Your KV Cache?cited by 0
- 2026TempoKV: Timely Staging of LLM KV Caches for Memory-Semantic Flashcited by 0
- 2026TempoKV: Timely Staging of LLM KV Caches for Memory-Semantic Flash28 Sep 2026
- 2026Can I Buy Your KV Cache?11 Jun 2026
Similar, not cited
Close in wording, no citation either way
- 2024SwiftKV: Fast Prefill-Optimized Inference with Knowledge-Preserving Model Transformation
- 2025Taming the Titans: A Survey of Efficient LLM Inference Serving
- 2026LLM Inference in a Flash!
- 2026HybridGen: Efficient LLM Generative Inference via CPU-GPU Hybrid Computing
- 2023Splitwise: Efficient generative LLM inference using phase splitting
- 2024NEO: Saving GPU Memory Crisis with CPU Offloading for Online LLM Inference
- 2026FlashInfer-Bench: Building the Virtuous Cycle for AI-driven LLM Systems
- 2024MiniKV: Pushing the Limits of LLM Inference via 2-Bit Layer-Discriminative KV Cache