Reproduce “TurboRAG: Accelerating Retrieval-Augmented Generation with Precomputed KV Caches for Chunked Text” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Songshuo Lu, Hua Wang, Yutian Rong, Zhi Chen, Yaohua Tang
TurboRAG, developed by Moore Threads AI, significantly reduces inference latency in Retrieval-Augmented Generation (RAG) systems by precomputing and storing key-value (KV) caches for document chunks offline. This approach achieves up to 9.4x faster time-to-first-token while maintaining comparable accuracy to conventional RAG systems by addressing attention and position ID inconsistencies.
Key insights
- An "Independent Attention" mask prevents inappropriate cross-attention between different document chunks, maintaining document independence.
- The "Reordered Positions" approach resolves position ID inconsistency by creating a monotonically increasing sequence across concatenated document KV caches.
- Fine-tuning a pre-trained language model with instruction learning data incorporating the new attention patterns and position ID handling is essential to prevent accuracy degradation.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.