arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.19463cs.SEcs.AI
收藏

理解检索增强生成系统的基本设计决策

Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systems

Fudan University(复旦大学);East China Normal University(华东师范大学);Shanghai Innovation Institute(上海创新研究院);The University of Tokyo(东京大学);Macau University of Science and Technology(澳门科学理工学院);Concordia University(Concordia大学);University of Alberta(阿尔伯塔大学);The University of Tokyo, Japan(日本东京大学)

Shengming Zhao, Yuchen Shao, Yuheng Huang, Jiayang Song, Zhijie Wang, Chengcheng Wan, Lei Ma

AI总结:

本文通过系统实验,研究了RAG部署中的三个关键决策(是否部署、检索量、知识集成方式),揭示了任务和模型依赖的优化策略,为实践者提供基于证据的指导。

摘要:

检索增强生成(RAG)已成为增强大型语言模型(LLM)能力的关键技术。然而,实践者在做出RAG部署决策时面临重大挑战。尽管现有研究优先考虑算法创新,但在理解决定RAG成功的基本工程权衡方面仍存在系统性空白。我们首次对三个通用的RAG部署决策进行了全面研究:是否部署RAG、检索多少信息以及如何有效集成检索到的知识。通过在三个LLM和六个数据集(涵盖问答和代码生成任务)上的系统实验,我们揭示了关键见解:(1)RAG部署必须高度选择性,即使有完美文档,可变召回阈值和失败模式也会影响多达12.6%的样本。(2)最优检索量表现出任务依赖性:问答任务呈现通用模式(5-10个文档最优),而代码生成需要针对场景的优化。(3)知识集成有效性取决于任务和模型特性,代码生成从提示方法中显著受益,而问答任务改进甚微。这些发现表明,通用的RAG策略是不够的。有效的RAG系统需要基于任务特性和模型能力的上下文感知设计决策。我们的分析为实践者提供了基于证据的指导,并为原则性RAG部署建立了基础见解。我们的代码、数据和工件公开于https://github.com/ShengmingZ/RAG_Benchmark_Code_QA。

英文摘要:

Retrieval-Augmented Generation (RAG) has emerged as a critical technique for enhancing large language model (LLM) capabilities. However, practitioners face significant challenges when making RAG deployment decisions. While existing research prioritizes algorithmic innovations, a systematic gap persists in understanding fundamental engineering trade-offs that determine RAG success. We present the first comprehensive study of three universal RAG deployment decisions: whether to deploy RAG, how much information to retrieve, and how to integrate retrieved knowledge effectively. Through systematic experiments across three LLMs and six datasets spanning question answering and code generation tasks, we reveal critical insights: (1) RAG deployment must be highly selective, with variable recall thresholds and failure modes affecting up to 12.6\% of samples even with perfect documents. (2) Optimal retrieval volume exhibits task-dependent behavior QA tasks show universal patterns (5-10 documents optimal) while code generation requires scenario-specific optimization. (3) Knowledge integration effectiveness depends on task and model characteristics, with code generation benefiting significantly from prompting methods while question answering shows minimal improvement. These findings demonstrate that universal RAG strategies prove inadequate. Effective RAG systems require context-aware design decisions based on task characteristics and model capabilities. Our analysis provides evidence-based guidance for practitioners and establishes foundational insights for principled RAG deployment. Our code, data and artifacts are publicly available at https://github.com/ShengmingZ/RAG_Benchmark_Code_QA.

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

↑