[论文解读] Context Tuning for Retrieval Augmented Generation
本文提出上下文调优(Context Tuning),一种用于检索增强生成(RAG)的新型组件,通过主动检索模糊或不完整查询的上下文信息,提升工具检索和规划器的准确性。通过结合数值、类别和使用行为信号,并采用轻量级的 RRF-LambdaMART 模型,该方法在上下文检索的 Recall@K 上实现 3.5 倍的提升,在规划器准确率上提高 11.6%,甚至优于基于 GPT-4 的检索系统。
Large language models (LLMs) have the remarkable ability to solve new tasks with just a few examples, but they need access to the right tools. Retrieval Augmented Generation (RAG) addresses this problem by retrieving a list of relevant tools for a given task. However, RAG's tool retrieval step requires all the required information to be explicitly present in the query. This is a limitation, as semantic search, the widely adopted tool retrieval method, can fail when the query is incomplete or lacks context. To address this limitation, we propose Context Tuning for RAG, which employs a smart context retrieval system to fetch relevant information that improves both tool retrieval and plan generation. Our lightweight context retrieval model uses numerical, categorical, and habitual usage signals to retrieve and rank context items. Our empirical results demonstrate that context tuning significantly enhances semantic search, achieving a 3.5-fold and 1.5-fold improvement in Recall@K for context retrieval and tool retrieval tasks respectively, and resulting in an 11.6% increase in LLM-based planner accuracy. Additionally, we show that our proposed lightweight model using Reciprocal Rank Fusion (RRF) with LambdaMART outperforms GPT-4 based retrieval. Moreover, we observe context augmentation at plan generation, even after tool retrieval, reduces hallucination.
研究动机与目标
- 解决传统 RAG 在处理隐含或描述不充分查询时的局限性,此类查询因缺少上下文导致语义搜索失败。
- 设计一种上下文调优组件,通过检索相关上下文信号,同时提升工具检索与计划生成的性能。
- 独立且组合地实证评估多种上下文检索方法,包括思维链(CoT)增强与微调模型。
- 证明微调检索模型可消除对 CoT 增强的需求,减少输入长度的同时保持性能。
- 表明在计划生成过程中进行上下文增强可降低幻觉现象,即使工具已被正确检索。
提出的方法
- 提出上下文调优作为预检索模块,在工具检索前主动检索并排序上下文信号——包括数值、类别和习惯性使用模式。
- 采用轻量级检索模型,结合 LambdaMART 用于学习排序,以及倒数排名融合(RRF)以聚合来自多种检索信号的结果。
- 采用混合检索策略:基于语义相似度和使用模式检索上下文项,再利用学习到的相关性得分进行重排序。
- 同时应用零样本思维链(CoT)增强与微调的检索模型,以评估上下文对检索与规划性能的影响。
- 通过上下界分析评估端到端规划器准确率,有无上下文调优,以隔离上下文对幻觉与正确性的影响。
- 使用合成用户档案与角色设定,模拟真实世界 RAG 场景,同时保护隐私。

实验结果
研究问题
- RQ1上下文调优能否显著提升 RAG 中对描述不充分或需上下文查询的检索性能?
- RQ2微调检索模型是否可消除对基于 CoT 的查询增强的需求?
- RQ3在计划生成过程中进行上下文增强,如何影响幻觉与规划器准确率?
- RQ4轻量级检索模型能否在上下文检索中超越基于大型语言模型(如 GPT-4)的检索系统?
- RQ5不同上下文信号——数值、类别和使用行为——对检索有效性的相对贡献如何?
主要发现
- 与标准语义搜索相比,上下文调优使上下文检索的 Recall@K 提升了 3.5 倍。
- 在上下文调优下,工具检索的 Recall@K 提升了 1.5 倍,证明其在下游规划中的有效性。
- 经上下文调优的规划器在 AST 基准上的计划准确率达到 85.24%,较标准 RAG 式规划器提升 11.6%。
- 所提出的 RRF-LambdaMART 模型在上下文检索中优于基于 GPT-4 的检索系统,在最佳设置下达到 98.24% 的 NDCG@K。
- 微调检索模型可减少对 CoT 增强的依赖,因为微调模型结合 CoT 仅带来微小性能增益,远低于仅使用微调模型的效果。
- 即使在工具被正确检索的前提下,计划生成过程中的上下文增强仍使幻觉降低 64%(从 2.59 降至 0.93),相较于下界表现。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。