ActiveMem: Dynamic Latent Memory Trees for Long-Horizon Agents

Song-Li Wu, Jingyi Wang, Zhaocheng Du, Weinan GanarXiv 2026

TL;DR

ActiveMem introduces a hierarchical "Latent Memory Tree" that allows LLM agents to organize their experiences into structured, dependency-aware branches rather than flat lists. By optimizing this memory topology through reinforcement learning, the framework enables small, open-weight models to outperform massive proprietary systems in long-horizon reasoning while using significantly less context.

What Problem Does This Paper Address?

As Large Language Model (LLM) agents are tasked with increasingly complex, multi-step goals (like planning a multi-city trip or conducting deep research), they rely on external memory to keep track of their progress. However, most current systems use "flat" memory—essentially a long list of past actions or summaries.

This leads to two major failures:

  1. Context Fragmentation: The agent loses the logical "thread" of a multi-step plan because it retrieves isolated fragments of history.
  2. Cross-Task Leakage: The agent might retrieve semantically similar but procedurally irrelevant information. For example, while trying to book a flight, it might accidentally retrieve and follow steps from a previous hotel-booking task, leading to a "workflow mismatch."
Figure 1: Comparison between Flat Memory and ActiveMem. (a) Flat memory methods retrieve disparate context fragments and mixed workflows from a flat pool based on simple similarity, leading to context fragmentation and cross-task leakage (e.g., blindly applying hotel booking steps to a flight workflow). (b) ActiveMem organizes context using a structured memory pool with a tree hierarchy. It enforces task isolation to filter out irrelevant domains and preserves causal chains mapping to the HTML/UI, enabling the agent to accurately plan domain-specific steps and execute the correct transfer flight action.

Methods

The authors propose ActiveMem, which replaces flat buffers with a Hierarchical Latent Memory Tree (HLMT).

  • Structured Representation: Instead of raw text, ActiveMem stores experiences as compressed latent embeddings in a tree. Nodes represent reusable subtasks, and edges capture the causal dependencies between them.
  • Dual-Head Controller: A lightweight, learnable controller manages the memory. One head generates a "latent injection"—a soft prompt prepended to the LLM’s hidden states to guide its reasoning. The other head predicts "tree actions" (inserting new nodes or updating existing ones) to evolve the memory structure in real-time.
  • Reinforcement Learning (GRPO): The system is trained using Group Relative Policy Optimization. This allows the agent to learn which memory structures lead to successful task completion without needing a massive "Critic" model, making the training process more efficient.
  • Dynamic Maintenance: To prevent the tree from growing indefinitely, ActiveMem performs "Deferred Execution" at the end of episodes, pruning low-utility nodes and fusing redundant ones based on environmental feedback.

Datasets

The researchers evaluated ActiveMem across nine diverse benchmarks spanning five core domains:

  • Web Search & QA: TriviaQA, PopQA, and FEVER.
  • Embodied Action: ALFWorld and ScienceWorld.
  • Mathematical Reasoning: GSM8K and MATH.
  • Scientific Reasoning: GPQA.
  • Code Generation: KodCode and BigCodeBench.
  • Web Navigation: WebShop (used for long-horizon proficiency testing).

Key Insights and Ideas

  • Causal Decoupling: By using a tree, the agent can "d-separate" irrelevant branches. If the agent is in a "Flight Booking" branch of the tree, the "Hotel Booking" nodes are topologically unreachable, effectively eliminating cross-task interference.
  • Quadratic Variance Reduction: The authors provide a mathematical proof showing that optimizing over the macroscopic depth of a memory tree (rather than the microscopic level of individual tokens) reduces the variance of the RL estimator quadratically. This makes training much more stable for long-horizon tasks.
  • Procedural Abstraction: Unlike standard RAG (Retrieval-Augmented Generation) which focuses on what facts to retrieve, ActiveMem focuses on how to proceed. It abstracts the underlying procedural logic, allowing for impressive zero-shot generalization across different types of tasks.

Key Results

ActiveMem demonstrated a "cross-scale leapfrogging" capability, where smaller models equipped with this memory structure outperformed much larger ones.

  • Performance: ActiveMem-30B achieved a score of 72.8 on the GAIA benchmark, surpassing proprietary models like Claude 4-Sonnet (68.3) and matching OpenAI o3 (70.5).
  • Efficiency: In complex 16-objective tasks, ActiveMem used only 27.1% of the peak tokens and 29.3% of the inference time required by a standard 14B parameter baseline.
  • Generalization: When trained on one dataset (e.g., GSM8K) and tested on others (e.g., MATH or KodCode), ActiveMem showed significantly less performance decay than standard fine-tuning or flat-memory baselines.
Figure 5: The generalization study.

Limitations and Future Work

While ActiveMem shows great promise, the authors note a few areas for further exploration:

  • Initial Traversal: The tree is currently initialized with a virtual root; exploring more sophisticated ways to seed the memory for entirely new domains could be beneficial.
  • Computational Overhead: Although inference is faster, the initial RL training phase remains computationally intensive.
  • Multi-Agent Collaboration: The current framework is designed for a single agent; extending these latent trees to be shared or negotiated between multiple agents is a suggested future direction.

Summary updated

BibTeX
@misc{wu2026activemem,
  author = {Song-Li Wu and Jingyi Wang and Zhaocheng Du and Weinan Gan},
  title = {{ActiveMem: Dynamic Latent Memory Trees for Long-Horizon Agents}},
  year = {2026},
  eprint = {2609.33244},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.33244},
}
Figure