用空间图结构记忆任务,让大模型多步对话更靠谱
Task Memory Engine: Spatial Memory for Robust Multi-Step LLM Agents
- 用动态任务图替代线性上下文,追踪任务依赖和意图变化
- 在4个场景中消除100%幻觉,在27轮对话中减少66.7%幻觉
- 无需微调即可部署,适合个人助手与企业自动化场景
大型语言模型在多步交互中常出现幻觉、重复动作或误解用户修正,根源在于缺乏持久记忆来追踪演变的目标与任务依赖。我们提出任务记忆引擎(TME),一种模块化内存控制器,无需微调即可将现有LLM转化为具备修订感知能力的鲁棒代理。TME采用基于图的结构化记忆框架,替代扁平化上下文,支持一致的多轮推理。不同于线性拼接和ReAct提示法,TME构建动态任务图(树或有向无环图),映射用户输入到子任务,关联历史上下文,并实现依赖关系追踪的修订。其任务表示与意图管理(TRIM)组件建模任务语义与用户意图,确保准确理解。在旅行规划、烹饪、会议安排和购物车编辑四个多轮场景中,TME在三个任务中完全消除幻觉和误解,在27轮用户交互中使幻觉减少66.7%,误解减少83.3%,优于ReAct。TME模块化设计支持即插即用部署与领域定制,适用于个人助手与企业自动化。我们开源了TME的代码库、基准测试与组件,助力研究人员构建可靠的大模型代理。其可扩展架构填补了复杂交互场景下代理性能的关键空白。
原文摘要 · Abstract (English)
Large Language Models (LLMs) falter in multi-step interactions -- often hallucinating, repeating actions, or misinterpreting user corrections -- due to reliance on linear, unstructured context. This fragility stems from the lack of persistent memory to track evolving goals and task dependencies, undermining trust in autonomous agents. We introduce the Task Memory Engine (TME), a modular memory controller that transforms existing LLMs into robust, revision-aware agents without fine-tuning. TME implements a spatial memory framework that replaces flat context with graph-based structures to support consistent, multi-turn reasoning. Departing from linear concatenation and ReAct-style prompting, TME builds a dynamic task graph -- either a tree or directed acyclic graph (DAG) -- to map user inputs to subtasks, align them with prior context, and enable dependency-tracked revisions. Its Task Representation and Intent Management (TRIM) component models task semantics and user intent to ensure accurate interpretation. Across four multi-turn scenarios-trip planning, cooking, meeting scheduling, and shopping cart editing -- TME eliminates 100% of hallucinations and misinterpretations in three tasks, and reduces hallucinations by 66.7% and misinterpretations by 83.3% across 27 user turns, outperforming ReAct. TME's modular design supports plug-and-play deployment and domain-specific customization, adaptable to both personal assistants and enterprise automation. We release TME's codebase, benchmarks, and components as open-source resources, enabling researchers to develop reliable LLM agents. TME's scalable architecture addresses a critical gap in agent performance across complex, interactive settings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。