Memory

MemWalker

First page
MemWalker
Paper summary

MemWalker treats the LLM as an interactive agent that traverses a tree-structured summary of long text.

Ask this paper

Key points
01

Tree of summary nodes: Preprocesses long context into a hierarchical tree of summary nodes, compressing and structuring the information.

02

Query-driven traversal: Given a query, the LLM traverses the tree through iterative prompting, descending into subtrees that are most relevant to the question.

03

Reasoning-based reading: The traversal decisions are reasoning-based, so the model can explain which part of the document it consulted and why.

04

Explainability bonus: The traversal trace serves as a human-readable explanation of the model's document reading, improving debuggability of long-context QA.

Abstract

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.

Every Monday
Get next week’s papers.
Subscribe on Substack