arXiv:2511.13371cs.AI2025-11被引 1

分析大模型如何解决空间导航,发现探索数据催生地图式认知,而目标导向训练则依赖路径记忆。

Cognitive Maps in Language Models: A Mechanistic Analysis of Spatial Planning

  • 通过探索性数据训练,模型学会构建自洽的空间坐标系,形成类认知地图
  • 在中间层出现突变,对历史方向信息的依赖骤降,实现长距离推理
  • 适合研究模型内在机制与具身智能,尤其关注训练方式如何塑造认知策略

大语言模型如何解决空间导航任务?我们通过在网格环境中训练GPT-2模型,考察三种空间学习范式:被动探索(觅食模型——预测随机行走步数)、目标导向规划(在结构化哈密顿路径上生成最短路径,即SP-Hamiltonian),以及用探索数据微调的混合模型(SP-随机游走)。结合行为、表征与机制分析,发现两种根本不同的学习算法。觅食模型发展出稳健的、类似‘认知地图’的空间表征;因果干预显示,它将空间信息整合为自洽的坐标系统,其对历史方向标记的依赖在中间层出现尖锐相变,显著下降。该模型还采用适应性分层推理机制,短上下文使用低级启发式,长上下文切换至地图式推理。相比之下,目标导向模型始终依赖显式方向输入,各层均未脱离路径依赖。混合模型虽在泛化上优于母模型,仍保持路径依赖策略。结果表明,变压器中空间智能存在于一个谱系上,从由探索数据塑造的可泛化世界模型,到针对目标优化的启发式策略。本文提供这一泛化-优化权衡的机制解释,并强调训练方式对策略涌现的关键影响。

原文摘要 · Abstract (English)

How do large language models solve spatial navigation tasks? We investigate this by training GPT-2 models on three spatial learning paradigms in grid environments: passive exploration (Foraging Model- predicting steps in random walks), goal-directed planning (generating optimal shortest paths) on structured Hamiltonian paths (SP-Hamiltonian), and a hybrid model fine-tuned with exploratory data (SP-Random Walk). Using behavioural, representational and mechanistic analyses, we uncover two fundamentally different learned algorithms. The Foraging model develops a robust, map-like representation of space, akin to a 'cognitive map'. Causal interventions reveal that it learns to consolidate spatial information into a self-sufficient coordinate system, evidenced by a sharp phase transition where its reliance on historical direction tokens vanishes by the middle layers of the network. The model also adopts an adaptive, hierarchical reasoning system, switching between a low-level heuristic for short contexts and map-based inference for longer ones. In contrast, the goal-directed models learn a path-dependent algorithm, remaining reliant on explicit directional inputs throughout all layers. The hybrid model, despite demonstrating improved generalisation over its parent, retains the same path-dependent strategy. These findings suggest that the nature of spatial intelligence in transformers may lie on a spectrum, ranging from generalisable world models shaped by exploratory data to heuristics optimised for goal-directed tasks. We provide a mechanistic account of this generalisation-optimisation trade-off and highlight how the choice of training regime influences the strategies that emerge.

认知地图空间推理机制分析语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。