沿着记忆迷宫前行:通过交互式阅读突破上下文长度限制
Walking Down the Memory Maze: Beyond Context Limit through Interactive Reading
AI总结:
针对大语言模型上下文窗口受限、长文本理解困难的问题,提出MemWalker方法,将长文本构建为摘要节点树,让模型作为交互式智能体自主导航检索信息,在长文本问答任务上优于基线方法,同时提升可解释性。
摘要:
大语言模型(LLM)得益于自注意力机制可同时处理并比较所有token的特性,已取得长足发展。但该机制存在一个根本问题——预设的上下文窗口必然是有限的。尽管已有研究尝试通过外推位置嵌入、使用循环机制或选择性检索长序列关键部分等方法扩展上下文窗口,长文本理解仍是一项挑战。我们提出一种替代方案:将LLM视为交互式智能体,通过迭代式提示让其自主决定阅读文本的方式。我们推出MemWalker方法,该方法首先将长上下文处理为一个由摘要节点构成的树结构。接收到查询后,模型会在这棵树中导航以搜索相关信息,待收集到足够信息后再生成回答。在长文本问答任务上,我们的方法性能优于使用长上下文窗口、循环机制和检索式方法的基线模型。研究表明,除了高效阅读的优势外,MemWalker还能通过在交互式阅读过程中展示推理步骤、精准定位与查询相关的文本片段,提升模型的可解释性。
英文摘要:
Large language models (LLMs) have advanced in large strides due to the effectiveness of the self-attention mechanism that processes and compares all tokens at once. However, this mechanism comes with a fundamental issue -- the predetermined context window is bound to be limited. Despite attempts to extend the context window through methods like extrapolating the positional embedding, using recurrence, or selectively retrieving essential parts of the long sequence, long-text understanding continues to be a challenge. We propose an alternative approach which instead treats the LLM as an interactive agent, allowing it to decide how to read the text via iterative prompting. We introduce MemWalker, a method that first processes the long context into a tree of summary nodes. Upon receiving a query, the model navigates this tree in search of relevant information, and responds once it gathers sufficient information. On long-text question answering tasks our method outperforms baseline approaches that use long context windows, recurrence, and retrieval. We show that, beyond effective reading, MemWalker enhances explainability by highlighting the reasoning steps as it interactively reads the text; pinpointing the relevant text segments related to the query.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。