PipeRAG: Fast Retrieval-Augmented Generation via Algorithm-System Co-design
Authors:
- Wenqi JiangWJWenqi Jiang
- Shuai ZhangSZShuai Zhang
- Boran HanBHBoran Han
- Jie WangJWJie Wang
- Bernie WangBWBernie Wang
- Tim KraskaTKTim Kraska
Preprint
Abstract
Retrieval-augmented generation (RAG) can enhance the generation quality of large language models (LLMs) by incorporating external token databases. However, retrievals from large databases can constitute a substantial portion of the overall generation time, particularly when retrievals are periodically performed to align the retrieved content with the latest states of generation. In this paper, we introduce PipeRAG, a novel algorithm-system co-design approach to reduce generation latency and enhance generation quality. PipeRAG integrates (1) pipeline parallelism to enable concurrent retrieval and generation processes, (2) flexible retrieval intervals to maximize the efficiency of pipeline parallelism, and (3) a performance model to automatically balance retrieval quality and latency based on the generation states and underlying hardware. Our evaluation shows that, by combining the three aforementioned methods, PipeRAG achieves up to 2.6$\times$ speedup in end-to-end generation latency while improving generation quality. These promising results showcase the effectiveness of co-designing algorithms with underlying systems, paving the way for the adoption of PipeRAG in future RAG systems.Keywords
All Related Versions
This publication has 17 references indexed in Scilit:
- Chameleon: A Heterogeneous and Disaggregated Accelerator System for Retrieval-Augmented Language ModelsProceedings of the VLDB Endowment, 2024
- Internet-Augmented Dialogue Generation2022
- Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpus2021
- Leveraging Passage Retrieval with Generative Models for Open Domain Question Answering2021
- End-to-End Training of Neural Retrievers for Open-Domain Question Answering2021
- Dense Passage Retrieval for Open-Domain Question Answering2020
- Billion-Scale Similarity Search with GPUsIEEE Transactions on Big Data, 2019
- Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World GraphsIEEE Transactions on Pattern Analysis and Machine Intelligence, 2018
- Approximate nearest neighbor algorithm based on navigable small world graphsInformation Systems, 2014
- Product Quantization for Nearest Neighbor SearchIEEE Transactions on Pattern Analysis and Machine Intelligence, 2010