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

检索遇上长上下文大型语言模型

Retrieval meets Long Context Large Language Models

NVIDIA(英伟达)

Peng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee, Chen Zhu, Zihan Liu, Sandeep Subramanian, Evelina Bakhturina, Mohammad Shoeybi, Bryan Catanzaro

AI总结:

本文对比并结合检索增强与长上下文 LLM,证明检索能以更低计算显著提升不同上下文窗口模型,最佳检索增强 Llama2-70B-32k 在九项任务上优于 GPT-3.5 等模型。

摘要:

近年来,扩展大型语言模型(LLM)的上下文窗口正变得流行,而利用检索增强 LLM 的解决方案已存在多年。自然的问题是:i)检索增强与长上下文窗口相比,哪一个更适合下游任务?ii)能否将两种方法结合,以兼得两者的优势?在本研究中,我们通过使用两个最先进的预训练 LLM(即一个专有的 43B GPT 和 Llama2-70B)研究这两种解决方案来回答这些问题。或许令人惊讶的是,我们发现,具有 4K 上下文窗口的 LLM 在生成时使用简单的检索增强,便可在长上下文任务上取得与通过位置插值微调的 16K 上下文窗口 LLM 相当的性能,同时所需计算量大幅减少。更重要的是,我们证明无论 LLM 扩展后的上下文窗口大小如何,检索都能显著提升其性能。我们的最佳模型——具有 32K 上下文窗口的检索增强 Llama2-70B——在包括问答、基于查询的摘要和上下文少样本学习任务在内的九项长上下文任务的平均得分上优于 GPT-3.5-turbo-16k 和 Davinci003。它还以明显优势优于无检索的 Llama2-70B-32k 基线,同时生成速度快得多。本研究为从业者在 LLM 的检索增强与长上下文扩展之间进行选择提供了通用洞见。

英文摘要:

Extending the context window of large language models (LLMs) is getting popular recently, while the solution of augmenting LLMs with retrieval has existed for years. The natural questions are: i) Retrieval-augmentation versus long context window, which one is better for downstream tasks? ii) Can both methods be combined to get the best of both worlds? In this work, we answer these questions by studying both solutions using two state-of-the-art pretrained LLMs, i.e., a proprietary 43B GPT and Llama2-70B. Perhaps surprisingly, we find that LLM with 4K context window using simple retrieval-augmentation at generation can achieve comparable performance to finetuned LLM with 16K context window via positional interpolation on long context tasks, while taking much less computation. More importantly, we demonstrate that retrieval can significantly improve the performance of LLMs regardless of their extended context window sizes. Our best model, retrieval-augmented Llama2-70B with 32K context window, outperforms GPT-3.5-turbo-16k and Davinci003 in terms of average score on nine long context tasks including question answering, query-based summarization, and in-context few-shot learning tasks. It also outperforms its non-retrieval Llama2-70B-32k baseline by a margin, while being much faster at generation. Our study provides general insights on the choice of retrieval-augmentation versus long context extension of LLM for practitioners.

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

↑