arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.05676cs.CL
收藏

PipeRAG:通过算法-系统协同设计实现快速检索增强生成

PipeRAG: Fast Retrieval-Augmented Generation via Algorithm-System Co-design

ETH Zurich(苏黎世联邦理工学院);Amazon Web Services(亚马逊网络服务);Meta;MIT(麻省理工学院)

Wenqi Jiang, Shuai Zhang, Boran Han, Jie Wang, Bernie Wang, Tim Kraska

AI总结:

针对检索增强生成中定期检索耗时占比高的问题,提出算法-系统协同设计的PipeRAG方法,通过流水线并行、灵活检索间隔和性能模型实现最高2.6倍端到端加速并提升生成质量。

摘要:

检索增强生成(RAG)可通过引入外部词元数据库提升大语言模型(LLM)的生成质量。然而,从大型数据库中检索会占据总生成时间的很大一部分,尤其是当需要定期执行检索以使检索内容与最新生成状态对齐时。本文提出PipeRAG,这是一种新颖的算法-系统协同设计方法,旨在降低生成延迟并提升生成质量。PipeRAG整合了三大核心设计:(1)流水线并行,以实现检索与生成过程的并发执行;(2)灵活检索间隔,以最大化流水线并行的效率;(3)性能模型,可根据生成状态和底层硬件自动平衡检索质量与延迟。我们的评估结果显示,通过结合上述三种方法,PipeRAG在端到端生成延迟上实现了最高2.6倍的加速,同时提升了生成质量。这些亮眼的结果证明了算法与底层系统协同设计的有效性,为PipeRAG在未来RAG系统中的应用铺平了道路。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑