From Human Cognition to Neural Activations: Probing the Computational Primitives of Spatial Reasoning in LLMs
Authors: Jiyuan An, Liner Yang, Mengyan Wang, Luming Lu, Weihua An, Erhong Yang
Organizations: National Language Resources Monitoring and Research Center for Print Media, Beijing Language and Culture University, Beijing, China · School of Information Science, Beijing Language and Culture University, Beijing, China · School of artificial intelligence, Beijing normal university, Beijing, China
As spatial intelligence becomes an increasingly important capability for foundation models, it remains unclear whether large language models' (LLMs) performance on spatial reasoning benchmarks reflects structured internal spatial representations or reliance on linguistic heuristics. We address this question from a mechanistic perspective by examining how spatial information is internally represented and used. Drawing on computational theories of human spatial cognition, we decompose spatial reasoning into three primitives, relational composition, representational transformation, and stateful spatial updating, and design controlled task families for each. We evaluate multilingual LLMs in English, Chinese, and Arabic under single pass inference, and analyze internal representations using linear probing, sparse autoencoder based feature analysis, and causal interventions. We find that task relevant spatial information is encoded in intermediate layers and can causally influence behavior, but these representations are transient, fragmented across task families, and weakly integrated into final predictions. Cross linguistic analysis further reveals mechanistic degeneracy, where similar behavioral performance arises from distinct internal pathways. Overall, our results suggest that current LLMs exhibit limited and context dependent spatial representations rather than robust, general purpose spatial reasoning, highlighting the need for mechanistic evaluation beyond benchmark accuracy.
Figures & tables
Figure 1: From human spatial cognition to spatial representations in large language models.
Figure 2: Illustration of the three spatial task families proposed in this work, with examples shown in English for clarity.
Figure 3: Overview of the proposed framework. We probe intermediate representations of a neural network, extract interpretable features using a sparse autoencoder, and analyze their roles via gradient-based attribution and causal interventions.
Task Family
Train
Test
Difficulty Range
Relational Reasoning
2 000
200
3–10
Orientation Reasoning
2 000
200
2–10
Program Execution
2 000
200
2–10
Total (per language)
6 000
600
–
Total (3 languages)
18 000
1 800
–
Table 1: Dataset statistics across task families. Each task family is constructed in English, Chinese, and Arabic with computational equivalence.
Figure 4: Layer-wise R² scores for spatial variable prediction across three task families (Qwen2.5-7B-Instruct, English). All tasks show mid-layer peaks followed by sharp declines in final layers. Task Family 1 and 3 demonstrate strong representational clarity (R² up to 0.37 and 0.40 respectively), while Task Family 2 shows minimal spatial encoding.
Figure 5: Feature importance versus activation frequency for Task Family 2 (Qwen2.5-7B-Istruct, Chinese). Important features are sparse and not aligned with activation frequency, indicating dissociation between usage and causal contribution.
Figure 6: Intervention effects of spatial features across dimensions (Qwen2.5-7B-Instruct, Task Family 3, English). Bars show the average hidden-state change caused by intervening on spatially selective features, with the dashed line indicating a random-feature baseline.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Task
Lang
MSE
R2
Sparsity
L0
Task 1
EN
0.136
0.9996
0.0025
288.3
ZH
0.798
0.9965
0.0023
268.2
AR
0.252
0.9989
0.0019
219.5
Task 2
EN
0.147
0.9994
0.0026
301.4
ZH
0.823
0.9962
0.0024
276.8
AR
0.268
0.9987
0.0020
227.3
Appendix
Table 4: SAE reconstruction quality and sparsity metrics for Qwen2.5-7B-Instruct. MSE: mean squared error; R2 : explained variance; Sparsity: fraction of active features; L0: average number of active features per sample. Best values per task family in bold.
Multimodal language models (MLLMs) exhibit promising spatial reasoning capabilities, yet the internal mechanisms supporting them remain poorly understood. We uncover S-Space, a linear representation subspace in which object-token representations encode continuous coordinates along horizontal, vertical, and distance axes. Although we identify these axes by differentiating spatial-answer scores with respect to object-token activations, S-Space is intrinsic rather than induced by specific data or prompts, remaining readable under non-spatial questions. We show that S-Space functions as an internal spatial workspace of MLLMs. Perception encodes object locations into it, forming spatial representations that can be directly read out to support accurate spatial judgments. Internal reasoning transforms it for changing viewpoints. Verbal responses selectively access it, evidenced by causal interventions that alter spatial judgments while largely preserving non-spatial responses. Case studies further show that S-Space assigns locations to unseen entities and the observer, and connects physical directions with abstract linguistic meanings, suggesting both the capabilities and limitations of large-scale language training. Finally, we use S-Space as a diagnostic tool for spatial reasoning failures. Direction-word readouts reveal systematic coupling between cardinal and image-relative reference frames. More importantly, a perception-computation decomposition exposes a key bottleneck: MLLMs can form capable spatial representations, yet fall short in the spatial transformations required to reason reliably across viewpoint changes.
Recent large language models (LLMs) often appear to exhibit spatial reasoning ability; however, this capability is largely symbolic, arising from pattern matching over spatial language rather than true geometric reasoning over space. Because LLMs operate on discrete tokens, they lack native support for continuous spatial representations, explicit geometric computation, and structured spatial operators. To address this limitation, we introduce the Spatial Language Model (SLM), the first multimodal LLM that treats location information as a first-class modality and enables geometric spatial reasoning within the model's inference process. SLM directly operates on learned spatial representations rather than textual descriptions of spatial relations. To support effective training, we construct a Spatial Instruction Dataset that aligns spatial representations, atomic geometric operations, and natural language instructions. We further propose a new benchmark named SpatialEval, which is designed to evaluate spatial reasoning across attributes, distance, topology, and relative-position tasks. Extensive experiments show that SLM significantly outperforms existing LLM-based approaches that rely on symbolic reasoning via prompt engineering or textual abstraction, demonstrating the benefits of integrating geometric spatial representations for robust spatial reasoning. Our instruction dataset, evaluation benchmark, model training codes, and models' checkpoints can be found at: \hyperlink{https://github.com/chuchen2017/SLM}{https://github.com/chuchen2017/SLM}.
Chen Chu, Bita Azarijoo, Li Xiong +2
University of Southern California Los Angeles, CA, USA · Emory University Atlanta, GA, USA · Novateur Research Solutions Ashburn, Virginia, USA
Foundation models have shown remarkable performance across diverse tasks, yet their ability to construct internal spatial world models for reasoning and planning remains unclear. We systematically evaluate the spatial understanding of large language models through maze tasks, a controlled testing context requiring multi-step planning and spatial abstraction. Across comprehensive experiments with Gemini-2.5-Flash, GPT-5-mini, Claude-Haiku-4.5, and DeepSeek-Chat, we uncover significant discrepancies in spatial reasoning that challenge assumptions about LLM planning capabilities. Using chain-of-thought prompting, Gemini achieves 80-86% accuracy on smaller mazes (5x5 to 7x7 grids) with tokenized adjacency representations, but performance collapses to 16-34% with visual grid formats, which is a 2-5x difference, suggesting representation-dependent rather than format-invariant spatial reasoning. We further probe spatial understanding through sequential proximity questions and compositional distance comparisons. Despite achieving 96-99% semantic coverage in reasoning traces, models fail to leverage this understanding for consistent spatial computations, indicating that they treat each question independently rather than building cumulative spatial knowledge. Our findings based on the maze-solving tasks suggest that LLMs do not develop robust spatial world models, but rather exhibit representation-specific and prompting-dependent reasoning that succeeds only under narrow conditions. These results have critical implications for deploying foundation models in applications requiring spatial abstraction.
Weijiang Li, Yilin Zhu, Rajarshi Das +1
University of Notre Dame · Columbia University · MQube Cognition