arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.16833cs.CLcs.AIcs.LG
收藏

检索增强生成还是长上下文大语言模型?一项综合研究与混合方法

Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach

Google DeepMind(谷歌DeepMind);University of Michigan(密歇根大学)

Zhuowan Li, Cheng Li, Mingyang Zhang, Qiaozhu Mei, Michael Bendersky

AI总结:

本文系统比较了RAG与长上下文大语言模型,发现资源充足时LC性能更优但RAG成本更低,并提出Self-Route方法通过模型自我反思路由查询,在保持性能的同时显著降低计算成本。

摘要:

检索增强生成(Retrieval Augmented Generation, RAG)一直是大语言模型(Large Language Models, LLMs)高效处理过长上下文的强大工具。然而,近期如 Gemini-1.5 和 GPT-4 等大语言模型展现出直接理解长上下文的卓越能力。我们对 RAG 与长上下文(long-context, LC)大语言模型进行了全面比较,旨在发挥两者的优势。我们使用三个最新的大语言模型,在多个公开数据集上对 RAG 和 LC 进行基准测试。结果表明,在资源充足的情况下,LC 在平均性能上始终优于 RAG。然而,RAG 显著更低的成本仍然是一个明显优势。基于这一观察,我们提出了 Self-Route,这是一种简单而有效的方法,根据模型自我反思将查询路由到 RAG 或 LC。Self-Route 显著降低了计算成本,同时保持了与 LC 相当的性能。我们的研究结果为使用 RAG 和 LC 的大语言模型长上下文应用提供了指导。

英文摘要:

Retrieval Augmented Generation (RAG) has been a powerful tool for Large Language Models (LLMs) to efficiently process overly lengthy contexts. However, recent LLMs like Gemini-1.5 and GPT-4 show exceptional capabilities to understand long contexts directly. We conduct a comprehensive comparison between RAG and long-context (LC) LLMs, aiming to leverage the strengths of both. We benchmark RAG and LC across various public datasets using three latest LLMs. Results reveal that when resourced sufficiently, LC consistently outperforms RAG in terms of average performance. However, RAG's significantly lower cost remains a distinct advantage. Based on this observation, we propose Self-Route, a simple yet effective method that routes queries to RAG or LC based on model self-reflection. Self-Route significantly reduces the computation cost while maintaining a comparable performance to LC. Our findings provide a guideline for long-context applications of LLMs using RAG and LC.

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

↑