[论文解读] RQ-RAG: Learning to Refine Queries for Retrieval Augmented Generation
RQ-RAG 训练一个7B Llama2 模型来改写、分解并区分查询,以用于检索增强生成,在单跳QA上达到SOTA,并在多跳QA上取得显著提升。
Large Language Models (LLMs) exhibit remarkable capabilities but are prone to generating inaccurate or hallucinatory responses. This limitation stems from their reliance on vast pretraining datasets, making them susceptible to errors in unseen scenarios. To tackle these challenges, Retrieval-Augmented Generation (RAG) addresses this by incorporating external, relevant documents into the response generation process, thus leveraging non-parametric knowledge alongside LLMs' in-context learning abilities. However, existing RAG implementations primarily focus on initial input for context retrieval, overlooking the nuances of ambiguous or complex queries that necessitate further clarification or decomposition for accurate responses. To this end, we propose learning to Refine Query for Retrieval Augmented Generation (RQ-RAG) in this paper, endeavoring to enhance the model by equipping it with capabilities for explicit rewriting, decomposition, and disambiguation. Our experimental results indicate that our method, when applied to a 7B Llama2 model, surpasses the previous state-of-the-art (SOTA) by an average of 1.9\% across three single-hop QA datasets, and also demonstrates enhanced performance in handling complex, multi-hop QA datasets. Our code is available at https://github.com/chanchimin/RQ-RAG.
研究动机与目标
- 通过解决用户查询中的歧义和复杂性,激发改进检索增强生成的必要性。
- 开发一个训练框架,使能够进行显式的查询改写、分解和消歧。
- 创建一个数据集和训练方案,教会模型改进查询并有效地使用检索到的文档。
- 在多个问答基准上展示相对于先前SOTA方法的经验性提升。
提出的方法
- 构建一个数据集,将原始输入-输出对转换成包含改进操作和检索文档的序列(rewrite、decompose、disambiguate)。
- 使用 ChatGPT 自动化标注,以生成改写后的查询和有上下文依据的答案。
- 以自回归目标训练一个7B Llama2模型,使最大化 p(y|q1,d1,...,x)。
- 实现一种树形解码采样策略,包含三种轨迹选择方法:基于困惑度、基于置信度、基于集成。
- 通过跟踪是否任一轨迹给出正确答案来评估潜在上限。
实验结果
研究问题
- RQ1模型如何学习改写、分解和消歧查询,以改善检索增强生成?
- RQ2改写后的查询轨迹是否在单跳和多跳任务上比基线提高QA性能?
- RQ3在RAG中,哪些数据源和采样策略能带来最佳查询改进效果?
- RQ4查询改进轨迹在回答复杂问题方面的潜在上限是多少?
主要发现
- RQ-RAG 在单跳QA任务上超越 Self-RAG 和 SAIL,在 ARC_C、POPQA、OBQA 的平均提升为 1.9%,超过先前的 SOTA 基线。
- 在多跳QA任务上,RQ-RAG 相对于强基线获得显著的平均提升 22.6%,即便使用更小的 7B 主干也超越 Chain-of-Thought/Chain-of-Note 方法。
- 基于检索上下文重新生成答案(不保留原始答案的任何部分)相较于保留原始答案的部分,带来更高的提升。
- RQ-RAG 展示了对推理阶段数据源的鲁棒性,当使用 DuckDuckGo、Wikipedia 或 Bing 作为检索源时,性能方差很小,与某些基线不同。
- 该方法显示出很高的潜在上限,表明若选择正确的轨迹,系统可以达到显著更高的准确度。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。