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, tree-structured 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 for multi-turn dialogue understanding and document question answering show that MemTree significantly enhances performance in scenarios that demand structured memory management.
翻译:近年来,大语言模型的上下文窗口已显著提升,但有效的长期记忆管理仍面临挑战。我们提出MemTree算法,该算法利用动态的树状结构记忆表征来优化信息的组织、检索与整合,其机制类似于人类的认知图式。MemTree以层次化方式组织记忆,每个节点封装聚合的文本内容、对应的语义嵌入向量,并在树的不同深度上呈现变化的抽象层级。我们的算法通过计算并比较新信息与已有信息的语义嵌入,动态调整记忆结构,从而增强模型的上下文感知能力。相较于传统依赖扁平查找表的记忆增强方法,这一方法使MemTree能够更有效地处理复杂推理和长程交互任务。在多轮对话理解和文档问答基准上的评估表明,MemTree在需要结构化记忆管理的场景中显著提升了性能。