arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.15319cs.CLcs.AI
收藏

LongRAG:利用长上下文大语言模型增强检索增强生成

LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs

University of Waterloo(滑铁卢大学)

Ziyan Jiang, Xueguang Ma, Wenhu Chen

AI总结:

本文提出LongRAG框架,通过将检索单元扩展为4K token的长单元并配合长阅读器,在不训练的情况下显著提升检索增强生成性能,在NQ和HotpotQA上达到与全训练SoTA相当的水平。

摘要:

在传统的RAG框架中,基本检索单元通常较短。常见的检索器如DPR通常处理100词的维基百科段落。这种设计迫使检索器在大型语料库中搜索“针”单元。相比之下,阅读器只需要从较短的检索单元中生成答案。这种不平衡的“重”检索器和“轻”阅读器设计可能导致次优性能。短小、分块单元中上下文信息的丢失可能增加在检索阶段引入困难负样本的可能性。此外,阅读器可能无法充分利用大语言模型(LLMs)近期进展的能力。为了缓解这种不平衡,我们提出了一个新框架LongRAG,由一个“长检索器”和一个“长阅读器”组成。在两个基于维基百科的数据集NQ和HotpotQA上,LongRAG通过将相关文档分组,将整个维基百科语料库处理为4K token的单元。通过增大单元大小,我们显著减少了单元总数。这大大减轻了检索器的负担,仅使用少量(少于8个)顶部单元即可获得强大的检索性能。无需任何训练,LongRAG在NQ上实现了62.7%的EM,在HotpotQA上实现了64.3%的EM,与(完全训练的)SoTA模型相当。此外,我们在两个非维基百科数据集Qasper和MultiFieldQA-en上进行了测试。LongRAG将每个单独文档处理为一个(长)单元,而不是将其分块为更小的单元。通过这样做,我们在Qasper上实现了25.9%的F1分数,在MultiFieldQA-en上实现了57.5%的F1分数。我们的研究为将RAG与长上下文大语言模型相结合的未来路线图提供了见解。

英文摘要:

In traditional RAG framework, the basic retrieval units are normally short. The common retrievers like DPR normally work with 100-word Wikipedia paragraphs. Such a design forces the retriever to search over a large corpus to find the `needle' unit. In contrast, the readers only need to generate answers from the short retrieved units. The imbalanced `heavy' retriever and `light' reader design can lead to sub-optimal performance. The loss of contextual information in the short, chunked units may increase the likelihood of introducing hard negatives during the retrieval stage. Additionally, the reader might not fully leverage the capabilities of recent advancements in LLMs. In order to alleviate the imbalance, we propose a new framework LongRAG, consisting of a `long retriever' and a `long reader'. In the two Wikipedia-based datasets, NQ and HotpotQA, LongRAG processes the entire Wikipedia corpus into 4K-token units by grouping related documents. By increasing the unit size, we significantly reduce the total number of units. This greatly reduces the burden on the retriever, resulting in strong retrieval performance with only a few (less than 8) top units. Without requiring any training, LongRAG achieves an EM of 62.7% on NQ and 64.3% on HotpotQA, which are on par with the (fully-trained) SoTA model. Furthermore, we test on two non-Wikipedia-based datasets, Qasper and MultiFieldQA-en. LongRAG processes each individual document as a single (long) unit rather than chunking them into smaller units. By doing so, we achieve an F1 score of 25.9% on Qasper and 57.5% on MultiFieldQA-en. Our study offers insights into the future roadmap for combining RAG with long-context LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑