ICLR2025
From Isolated Conversations to Hierarchical Schemas: Dynamic Tree Memory Representation for LLMs
Alireza Rezazadeh, Zichao Li, Wei Wei, Yujia Bao
Abstract
Recent advancements in large language models have significantly improved their context windows, yet challenges in effective long-term memory management remain. We introduce MemTree, an algorithm that leverages a dynamic, treestructured memory representation to optimize the organization, retrieval, and integration of information, akin to human cognitive schemas. MemTree organizes memory hierarchically, with each node encapsulating aggregated textual content, corresponding semantic embeddings, and varying abstraction levels across the tree's depths. Our algorithm dynamically adapts this memory structure by computing and comparing semantic embeddings of new and existing information to enrich the model's context-awareness. This approach allows MemTree to handle complex reasoning and extended interactions more effectively than traditional memory augmentation methods, which often rely on flat lookup tables. Evaluations on benchmarks such as the Multi-Session Chat (MSC) and MultiHop RAG show that MemTree significantly enhances performance in scenarios that demand structured memory management. Figure 1: MemTree (subset) developed on the MultiHop RAG [18]. MemTree updates its structured knowledge when new information arrives, enhancing inference-time reasoning capabilities of LLMs. Related Work Recent large language models (LLMs), such as , PaLM [3], and LLaMA [19], excel in various natural language processing tasks but struggle with long-term memory and retrieving information from past interactions. Researchers have explored leveraging external memory for longrange reasoning in traditional RNNs [20, 16, 10, 12] . Building on these concepts, recent methods aim to augment LLMs with enhanced memory capabilities.