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

通过内循环查询机制增强大语言模型的长上下文性能

Enhancing Long Context Performance in LLMs Through Inner Loop Query Mechanism

Futurewei Technologies Inc(未来微科技公司);University of Southern California(南加州大学)

Yimin Tang, Yurong Xu, Ning Yan, Masood Mortazavi

AI总结:

本文提出内循环记忆增强树检索(ILM-TR)方法,通过基于中间发现的迭代内循环查询和短期记忆机制改进检索增强生成,在 M-NIAH 和 BABILong 等长上下文测试中取得更好性能。

摘要:

Transformer 的计算复杂度随输入规模呈二次方增长,这限制了大语言模型(LLMs)在训练和推理中的输入上下文窗口大小。与此同时,基于检索增强生成(RAG)的模型通过使用检索系统过滤不必要的信息,能够更好地处理更长的上下文。然而,大多数 RAG 方法仅基于初始查询进行检索,对于需要更深层推理的复杂问题可能效果不佳。我们提出了一种新方法,内循环记忆增强树检索(ILM-TR),该方法涉及内循环查询,不仅基于查询问题本身,还基于中间发现。在推理时,我们的模型从 RAG 系统中检索信息,整合来自长文档在不同抽象层级上的数据。基于检索到的信息,LLM 生成文本并存储在一个名为短期记忆(STM)的区域中,然后利用这些文本制定下一个查询。该检索过程重复进行,直到 STM 中的文本收敛。我们的实验表明,基于 STM 的检索相比传统的检索增强 LLM 有所改进,特别是在长上下文测试中,如 Multi-Needle In A Haystack(M-NIAH)和 BABILong。

英文摘要:

Transformers have a quadratic scaling of computational complexity with input size, which limits the input context window size of large language models (LLMs) in both training and inference. Meanwhile, retrieval-augmented generation (RAG) besed models can better handle longer contexts by using a retrieval system to filter out unnecessary information. However, most RAG methods only perform retrieval based on the initial query, which may not work well with complex questions that require deeper reasoning. We introduce a novel approach, Inner Loop Memory Augmented Tree Retrieval (ILM-TR), involving inner-loop queries, based not only on the query question itself but also on intermediate findings. At inference time, our model retrieves information from the RAG system, integrating data from lengthy documents at various levels of abstraction. Based on the information retrieved, the LLM generates texts stored in an area named Short-Term Memory (STM) which is then used to formulate the next query. This retrieval process is repeated until the text in STM converged. Our experiments demonstrate that retrieval with STM offers improvements over traditional retrieval-augmented LLMs, particularly in long context tests such as Multi-Needle In A Haystack (M-NIAH) and BABILong.

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

↑