Overview
The Weighted Memory Tree (WMT) is introduced as a hierarchical memory system designed to enhance the performance of large language model (LLM) agents in multi-step tasks. It addresses challenges associated with growing execution histories, such as increased inference cost and the degradation of reasoning quality due to outdated, irrelevant, or misleading information. WMT organizes execution into a structured hierarchy of tasks, subtasks, and actions, assigning a dynamic retention score to each memory. This system incorporates event-based updates and selection-based decay to revise these scores, enabling it to preserve useful information, fold completed trajectories, suppress low-utility content, and maintain access to folded context.
Research Context
LLM agents have demonstrated capabilities in solving complex, multi-step tasks that necessitate planning, tool utilization, and access to external information. However, as the execution histories for these tasks expand, they introduce several limitations. These limitations include an increase in inference cost and a potential degradation in reasoning quality. This degradation stems from the exposure of the reasoning process to information that is either outdated, irrelevant, or misleading within the agent's memory. Existing memory approaches for LLM agents typically focus on organizing or compressing execution histories. Nevertheless, these approaches are noted to offer limited mechanisms for actively deciding which specific memories should remain active and influence the agent's ongoing reasoning.
Approach
The Weighted Memory Tree (WMT) system was developed as a hierarchical memory architecture. Its primary function is to organize an LLM agent's execution history. This organization follows a structured hierarchy, classifying memory elements into tasks, subtasks, and individual actions. A core feature of WMT is the assignment of a dynamic retention score to each memory unit within this hierarchy. The scores are subject to two primary update mechanisms:
- Event-based updates: These adjustments to memory scores occur in response to specific events during the agent's operation.
- Selection-based decay: This mechanism modifies scores based on selection criteria, allowing less useful memories to diminish in prominence over time.
These mechanisms enable WMT to perform several functions: it preserves useful information, systematically folds completed trajectories, suppresses content identified as having low utility, and ensures continued access to context that has been folded. The WMT system was evaluated using the GAIA-Text benchmark. The LLM agents employed in this evaluation included Qwen3-8B, Gemma 4 E4B, and Llama-3.1-8B. The experimental design included both ablations and memory-poisoning experiments to assess the system's robustness and effectiveness against irrelevant or unreliable information.
Findings
The evaluation of the Weighted Memory Tree (WMT) system yielded several quantitative and qualitative findings:
- Accuracy Improvement: Compared to a baseline of linear memory, WMT improved the average accuracy of LLM agents by 9.97 percentage points.
- Prompt-Token Usage Reduction: WMT reduced prompt-token usage by 32.8% relative to linear memory.
- Unreliable Information Management: Memory-poisoning experiments indicated that WMT limits both the persistence and the propagation of unreliable information within the agent's memory.
These results collectively suggest that the effectiveness of long-horizon agent memory is less dependent on the sheer volume of information stored and more dependent on the mechanisms for deciding which information should remain active and accessible to the agent.
Why This Matters
This research suggests that effective long-horizon agent memory depends less on storing more information than on deciding which information should remain active. This approach has implications for managing inference cost and mitigating the degradation of reasoning quality in LLM agents when confronted with extensive execution histories, outdated, irrelevant, or misleading information.