Constructing coherent spatial memory in LLM agents through graph rectification
Puzhen Zhang, Xuyang Chen, Yu Feng, Yuhan Jiang, Liqiu Meng
TL;DR
The paper tackles the problem of maintaining coherent spatial memory in long-horizon text-based navigation by enabling LLM-driven, incremental graph construction with robust, history-aware repair. It introduces LLM-MapRepair, a modular framework comprising conflict detection, error localization, and a version-controlled graph history, augmented by an Edge Impact Score to prioritize low-risk repairs and mitigate cascading inconsistencies. A formal localization pipeline (minimal conflicting path pairs, LCA, candidate edge extraction, and scoring) and a CRG-based prioritization objective drive targeted, interpretable repairs, with a commit-based Version Control system enabling rollback and causal tracing. Experiments on a refined MANGO dataset show that combining Version Control with Edge-Impact Ranking improves repair efficiency and robustness, especially against long-range error propagation, demonstrating the value of introspective, history-aware mechanisms for maintaining coherent spatial memory in LLM agents. The work advances practical spatial reasoning in language-driven agents and informs future knowledge-graph–based navigation systems by integrating incremental mapping with explicit error management.
Abstract
Given a map description through global traversal navigation instructions (e.g., visiting each room sequentially with action signals such as north, west, etc.), an LLM can often infer the implicit spatial layout of the environment and answer user queries by providing a shortest path from a start to a destination (for instance, navigating from the lobby to a meeting room via the hall and elevator). However, such context-dependent querying becomes incapable as the environment grows much longer, motivating the need for incremental map construction that builds a complete topological graph from stepwise observations. We propose a framework for LLM-driven construction and map repair, designed to detect, localize, and correct structural inconsistencies in incrementally constructed navigation graphs. Central to our method is the Version Control, which records the full history of graph edits and their source observations, enabling fine-grained rollback, conflict tracing, and repair evaluation. We further introduce an Edge Impact Score to prioritize minimal-cost repairs based on structural reachability, path usage, and conflict propagation. To properly evaluate our approach, we create a refined version of the MANGO benchmark dataset by systematically removing non-topological actions and inherent structural conflicts, providing a cleaner testbed for LLM-driven construction and map repair. Our approach significantly improves map correctness and robustness, especially in scenarios with entangled or chained inconsistencies. Our results highlight the importance of introspective, history-aware repair mechanisms for maintaining coherent spatial memory in LLM agents.
