Retrieval-augmented Generation (RAG) has markedly enhanced the capabilities of Large Language Models (LLMs) in tackling knowledge-intensive tasks. The increasing demands of application scenarios have driven the evolution of RAG, leading to the integration of advanced retrievers, LLMs and other complementary technologies, which in turn has amplified the intricacy of RAG systems. However, the rapid advancements are outpacing the foundational RAG paradigm, with many methods struggling to be unified under the process of "retrieve-then-generate". In this context, this paper examines the limitations of the existing RAG paradigm and introduces the modular RAG framework. By decomposing complex RAG systems into independent modules and specialized operators, it facilitates a highly reconfigurable framework. Modular RAG transcends the traditional linear architecture, embracing a more advanced design that integrates routing, scheduling, and fusion mechanisms. Drawing on extensive research, this paper further identifies prevalent RAG patterns-linear, conditional, branching, and looping-and offers a comprehensive analysis of their respective implementation nuances. Modular RAG presents innovative opportunities for the conceptualization and deployment of RAG systems. Finally, the paper explores the potential emergence of new operators and paradigms, establishing a solid theoretical foundation and a practical roadmap for the continued evolution and practical deployment of RAG technologies.
翻译:检索增强生成(RAG)显著提升了大语言模型(LLM)处理知识密集型任务的能力。应用场景日益增长的需求推动了RAG技术的演进,促使先进检索器、大语言模型及其他互补技术不断融合,进而加剧了RAG系统的复杂性。然而,当前快速发展已超越基础RAG范式,许多方法难以统一于“检索-生成”的线性流程。本文剖析现有RAG范式的局限性,提出模块化RAG框架。通过将复杂RAG系统解耦为独立模块与专用算子,该框架构建了高度可重构的体系。模块化RAG突破传统线性架构,融合路由、调度与融合机制,实现更先进的设计范式。基于广泛研究,本文进一步归纳出线性、条件、分支与循环四类典型RAG模式,并系统解析其实现细节。模块化RAG为RAG系统的架构设计与工程部署开辟了新路径。最后,本文探讨新型算子与范式的发展潜力,为RAG技术的持续演进与实际应用奠定理论基础与实践路线图。