[论文解读] Walking Down the Memory Maze: Beyond Context Limit through Interactive Reading
MemWalker 将长文本视为交互任务,其中一个 LLM 构建段落摘要的记忆树并在其中导航以回答查询,在不进行微调的情况下超过固定上下文的限制。
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.
研究动机与目标
- 研究在不扩展 LLM 固定上下文窗口的情况下,如何进行长上下文问答。
- 提出一种两阶段方法:从长文本构建记忆树并对其进行导航以回答查询。
- 在长上下文问答数据集上,将 MemWalker 与 recurrence、retrieval 和 full-context 基线进行比较。
- 评估互动式阅读和工作记忆如何影响可解释性和导航可靠性。
提出的方法
- Two-stage MemWalker 流水线:(1)通过将文本分块为片段并递归地总结成树来构建记忆树;(2)导航:LLM 在树中遍历以回答查询。
- 采用带有 triage 和 leaf 提示的零-shot 提示以控制导航操作并确保可解析输出。
- 工作记忆机制在遍历过程中存储并携带已访问节点的信息,以保持连贯性。
- 以推理为基础的导航:在选择行动之前,先给出自然语言的推理理由。
- 评估使用 Stable Beluga 2 (70B) 作为基础 LLM,并与 full-context、recurrence 和 retrieval 基线进行比较。
- 记忆树参数包括每个父节点的 max_t 节点数以及按数据集调整的分段大小。
实验结果
研究问题
- RQ1交互式基于记忆的阅读是否能够在不对模型进行微调的情况下实现超越固定上下文窗口的长上下文问答?
- RQ2MemWalker 与 recurrence 和 retrieval 基线在长上下文问答任务上的对比如何?
- RQ3推理提示和工作记忆对导航准确性与错误恢复有何影响?
主要发现
| QuALITY | SummScreenFD | GovReport |
|---|---|---|
| 67.4 / 73.6 | 67.3 / 64.5 | 59.4 / 60.4 |
| 70.1 / 72.5 | 64.7 / 63.1 | 50.5 / 50.0 |
| 56.7 / 64.8 | 62.7 / 62.7 | 59.4 / 56.3 |
- MemWalker 在 QuALITY、SummScreenFD 和 GovReport 的长上下文问答任务中优于 recurrence 与 retrieval 基线。
- 在长上下文场景中,MemWalker 超越了开放的长上下文模型和部分全上下文基线,尤其是在文本长度超过原始模型上下文时。
- 具备强推理能力的 LLM(例如 Stable Beluga 2 70B)从有理由的导航中获益,提升准确性;较弱的模型在被强制进行推理时可能表现下降。
- 工作记忆显著提升性能,移除时性能显著下降。
- MemWalker 展现出从偏离的导航路径回退和恢复的能力,在各数据集上保持相当的恢复率。
- 仅通过记忆树读取长文本的子集通常就足以回答问题,凸显了阅读效率。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。