提出OP-RAG机制,让RAG在长文本问答中表现更优
In Defense of RAG in the Era of Long-Context Language Models
- 保留检索结果顺序的RAG新方法,提升信息相关性
- 检索段落数增加时,答案质量先升后降,呈倒U型曲线
- 在关键点上用更少token达到比长上下文模型更好的效果
为克服早期大模型的上下文长度限制,检索增强生成(RAG)曾是基于上下文回答生成的可靠方案。近期长上下文大模型的出现使模型能处理更长文本序列,导致RAG吸引力下降。已有研究显示长上下文模型在长文本应用中显著优于RAG。然而,本文认为长上下文模型因信息焦点分散,可能降低答案质量。为此,本文重新审视了长上下文场景下的RAG,提出一种保持顺序的检索增强生成(OP-RAG)机制。实验表明,随着检索段落数量增加,答案质量先上升后下降,形成倒U形曲线;存在性能最优的“甜点”区间,此时OP-RAG以远少于长上下文模型所需的token数实现更高答案质量。在多个公开基准上的广泛实验验证了该方法的优势。
原文摘要 · Abstract (English)
Overcoming the limited context limitations in early-generation LLMs, retrieval-augmented generation (RAG) has been a reliable solution for context-based answer generation in the past. Recently, the emergence of long-context LLMs allows the models to incorporate much longer text sequences, making RAG less attractive. Recent studies show that long-context LLMs significantly outperform RAG in long-context applications. Unlike the existing works favoring the long-context LLM over RAG, we argue that the extremely long context in LLMs suffers from a diminished focus on relevant information and leads to potential degradation in answer quality. This paper revisits the RAG in long-context answer generation. We propose an order-preserve retrieval-augmented generation (OP-RAG) mechanism, which significantly improves the performance of RAG for long-context question-answer applications. With OP-RAG, as the number of retrieved chunks increases, the answer quality initially rises, and then declines, forming an inverted U-shaped curve. There exist sweet points where OP-RAG could achieve higher answer quality with much less tokens than long-context LLM taking the whole context as input. Extensive experiments on public benchmark demonstrate the superiority of our OP-RAG.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。