Skip to main content
QUICK REVIEW

[论文解读] Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG

Bowen Jin, Jinsung Yoon|arXiv (Cornell University)|Oct 8, 2024
Scientific Computing and Data ManagementDecision Sciences被引用 3
一句话总结

本文研究了在增加检索段落数量时,长上下文检索增强生成(RAG)系统性能下降的问题,识别出'难负样本'是关键原因。提出了一种无需训练的检索重排序方法,以及两种RAG专用微调方法——隐式鲁棒性微调和显式推理微调,展示了在多个基准测试中显著的性能提升,其中最佳方法相比基础模型准确率最高提升12.7%。

ABSTRACT

Retrieval-augmented generation (RAG) empowers large language models (LLMs) to utilize external knowledge sources. The increasing capacity of LLMs to process longer input sequences opens up avenues for providing more retrieved information, to potentially enhance the quality of generated outputs. It is plausible to assume that a larger retrieval set would contain more relevant information (higher recall), that might result in improved performance. However, our empirical findings demonstrate that for many long-context LLMs, the quality of generated output initially improves first, but then subsequently declines as the number of retrieved passages increases. This paper investigates this phenomenon, identifying the detrimental impact of retrieved "hard negatives" as a key contributor. To mitigate this and enhance the robustness of long-context LLM-based RAG, we propose both training-free and training-based approaches. We first showcase the effectiveness of retrieval reordering as a simple yet powerful training-free optimization. Furthermore, we explore training-based methods, specifically RAG-specific implicit LLM fine-tuning and RAG-oriented fine-tuning with intermediate reasoning, demonstrating their capacity for substantial performance gains. Finally, we conduct a systematic analysis of design choices for these training-based methods, including data distribution, retriever selection, and training context length.

研究动机与目标

  • 探究在增加检索段落数量时,尽管召回率提高,长上下文RAG系统性能为何会下降。
  • 识别出强检索器引入的'难负样本'是长上下文大语言模型性能下降的主要原因。
  • 开发无需训练和基于训练的方法,以增强对噪声和无关检索内容的鲁棒性。
  • 评估数据分布、检索器选择和上下文长度等设计选择对RAG专用微调的影响。
  • 证明将RAG专用微调与通用SFT数据结合,可在保持通用能力的同时提升RAG性能。

提出的方法

  • 检索重排序:通过将高分文档置于输入序列的开头和末尾,重新组织检索到的段落,以缓解'中间丢失'注意力问题。
  • 隐式鲁棒性微调:在包含噪声或难负样本的查询-段落对上微调大语言模型,以提升通用鲁棒性,无需显式相关性标注。
  • 显式相关性微调:在微调过程中引入中间推理步骤,使大语言模型先识别相关信息,再生成答案,从而增强相关性判别能力。
  • 训练数据规模扩展:评估从5k到200k样本的RAG专用数据性能,显示数据规模越大,准确率提升越稳定。
  • 混合微调:将RAG专用数据与通用SFT数据(如UltraChat)结合,以在提升RAG性能的同时保持通用能力。
  • 系统性消融实验:评估检索器强度、训练上下文长度和数据分布对微调效果的影响。

实验结果

研究问题

  • RQ1在长上下文RAG系统中,增加检索段落数量是否能持续提升性能?
  • RQ2来自强检索器的'难负样本'在多大程度上会降低长上下文RAG中大语言模型的生成质量?
  • RQ3检索重排序能否缓解长上下文大语言模型中的注意力效率问题?
  • RQ4隐式微调在提升对噪声检索内容的鲁棒性方面有多有效?
  • RQ5在微调过程中增加中间推理步骤是否能显著提升相关性识别和最终输出质量?

主要发现

  • 在长上下文RAG任务中,性能随检索段落数量增加而先提升后下降,峰值出现在30个段落时,表明召回率与噪声之间存在权衡。
  • 更强的检索器可能引入更多有害的'难负样本',导致性能下降程度超过弱检索器。
  • 检索重排序通过减少对中等排名、无关段落的关注,平均提升性能达4.2%。
  • 采用中间推理步骤的显式相关性微调取得最高性能增益,在TriviaQA和HotpotQA上相比基础模型准确率最高提升12.7%。
  • 将RAG专用微调数据从5k扩展到200k样本,性能持续提升,在NQ数据集上准确率从0.5805提升至0.6176。
  • 将RAG专用微调数据与通用SFT数据结合,可在保持通用能力(如MT-Bench得分)的同时提升RAG性能,NQ准确率从0.5687提升至0.6033。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。