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.


翻译:检索增强生成(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 公开。

0
下载
关闭预览

相关内容

【SIGIR2025教程】动态与参数化检索增强生成
专知会员服务
17+阅读 · 2025年7月14日
检索增强生成(RAG)与推理的协同作用:一项系统综述
专知会员服务
34+阅读 · 2025年4月27日
视觉中的检索增强生成与理解:综述与新展望
专知会员服务
24+阅读 · 2025年4月6日
多模态检索增强生成的综合综述
专知会员服务
44+阅读 · 2025年2月17日
定制化大型语言模型的图检索增强生成综述
专知会员服务
38+阅读 · 2025年1月28日
图检索增强生成研究进展
专知会员服务
38+阅读 · 2024年11月5日
检索增强生成系统中的可信度:综述
专知会员服务
44+阅读 · 2024年9月18日
《大型语言模型中基于检索的文本生成》综述
专知会员服务
60+阅读 · 2024年4月18日
「基于通信的多智能体强化学习」 进展综述
基于模型的强化学习综述
专知
42+阅读 · 2022年7月13日
探索(Exploration)还是利用(Exploitation)?强化学习如何tradeoff?
深度强化学习实验室
13+阅读 · 2020年8月23日
强化学习与文本生成
微信AI
41+阅读 · 2019年4月4日
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
【干货】强化学习在生成对抗网络文本生成中扮演的角色(下)
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
0+阅读 · 13分钟前
定向能反无人机系统最新发展动态
专知会员服务
3+阅读 · 今天13:50
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
2+阅读 · 今天13:33
相关VIP内容
【SIGIR2025教程】动态与参数化检索增强生成
专知会员服务
17+阅读 · 2025年7月14日
检索增强生成(RAG)与推理的协同作用:一项系统综述
专知会员服务
34+阅读 · 2025年4月27日
视觉中的检索增强生成与理解:综述与新展望
专知会员服务
24+阅读 · 2025年4月6日
多模态检索增强生成的综合综述
专知会员服务
44+阅读 · 2025年2月17日
定制化大型语言模型的图检索增强生成综述
专知会员服务
38+阅读 · 2025年1月28日
图检索增强生成研究进展
专知会员服务
38+阅读 · 2024年11月5日
检索增强生成系统中的可信度:综述
专知会员服务
44+阅读 · 2024年9月18日
《大型语言模型中基于检索的文本生成》综述
专知会员服务
60+阅读 · 2024年4月18日
相关基金
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员