Attention in Space: Functional Roles of VLM Heads for Spatial Reasoning
Organizations: The University of Melbourne · Australian National University · Fudan University · Monash University
Abstract
Despite remarkable advances in large Vision-Language Models (VLMs), spatial reasoning remains a persistent challenge. In this work, we investigate how attention heads within VLMs contribute to spatial reasoning by analyzing their functional roles through a mechanistic interpretability lens. We introduce CogVSR, a dataset that decomposes complex spatial reasoning questions into step-by-step subquestions designed to simulate human-like reasoning via a chain-of-thought paradigm, with each subquestion linked to specific cognitive functions such as spatial perception or relational reasoning. Building on CogVSR, we develop a probing framework to identify and characterize attention heads specialized for these functions. Our analysis across diverse VLM families reveals that these functional heads are universally sparse, vary in number and distribution across functions. Notably, spatially specialized heads are fewer than those for other cognitive functions, highlighting their scarcity. We propose methods to activate latent spatial heads, improving spatial understanding. Intervention experiments further demonstrate their critical role in spatial reasoning: removing functional heads leads to performance degradation, while emphasizing them enhances accuracy. This study provides new interpretability driven insights into how VLMs attend to space and paves the way for enhancing complex spatial reasoning in multimodal models.
Figures & tables
| Main / Image | Subquestion | Answer | Cognitive Function Label |
|---|---|---|---|
| Main Question: Judge whether the text is true or false: “The dog is facing the horse.” Main Answer: True. | 1. Which animals appear in the image? | A dog and a horse. | High-level Visual Perception |
| 2. Where is the dog located relative to the horse? | The dog is on the right and the horse is on the left. | Spatial Perception, High-level Visual Perception | |
| 3. Which way is the dog’s head oriented? | The dog’s head is facing left. | Spatial Perception, High-level Visual Perception | |
| 4. Is the direction the dog is facing pointed toward the horse’s position? | Yes. | Relational Reasoning | |
| 5. Based on the dog’s orientation toward the horse, is the statement “The dog is facing the horse” true or false? | True. | Decision Making |
| Model | Inter_Head | Spatial Functions | Other Functions | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Spatial | Relational | Low-Level | High-Level | Info | Recall | Math | Decision | ||||||||||
| llm | acc | llm | acc | llm | acc | llm | acc | llm | acc | llm | acc | llm | acc | llm | acc | ||
| Intern2B | random | 61.37 | 56.82 | 63.25 | 58.13 | 65.48 | 60.91 | 69.72 | 64.35 | 71.19 | 66.04 | 69.87 | 64.11 | 59.44 | 54.27 | 64.03 | 58.76 |
| cognitive | 37.92 | 34.37 | 31.56 | 26.88 | 13.43 | 18.21 | 34.27 | 28.65 | 39.82 | 33.17 | 37.11 | 31.49 | 23.68 | 18.02 | 21.54 | 16.43 | |
| Intern8B | random | 72.84 | 68.12 | 74.33 | 69.57 | 76.05 | 71.44 | 81.26 | 76.09 | 83.17 | 78.03 | 81.92 | 76.48 | 73.66 | 68.40 | 77.41 | 72.05 |
| cognitive | 46.39 | 42.07 | 52.84 | 48.51 | 36.12 | 31.76 | 59.73 | 53.28 | 65.04 | 58.69 | 62.91 | 56.33 | 49.82 | 44.15 | 46.37 | 40.88 | |
| Model | Input | Spatial | Relational | ||
|---|---|---|---|---|---|
| llm | acc | llm | acc | ||
| Intern2B | Original | 61.37 | 56.82 | 63.25 | 58.13 |
| +BBox | 65.84 | 58.94 | 64.95 | 62.39 | |
| +Mask | 59.70 | 59.80 | 66.82 | 56.47 | |
| +BBox+Mask (Ours) | 71.82 | 68.64 | 70.12 | 67.04 | |
| Llama90B | Original | 86.21 | 82.07 | 88.03 | 83.92 |
| Dataset | Inter_Head | Intern8B | Qwen7B | Llama11B |
|---|---|---|---|---|
| VSR | before | 64.35 | 62.47 | 65.82 |
| after | 24.13 | 21.76 | 17.94 | |
| Spatial457 | before | 41.23 | 38.71 | 32.18 |
| after | 14.97 | 12.43 | 9.86 | |
| SpatialEval | before | 47.92 | 45.33 | 39.61 |
| after | 20.08 | 18.57 | 15.19 |
| Model | Inter_Head | In Domain | Out of Domain | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Spatial | Relational | Low | High | Info | Recall | Math | Decision | VSR | Spatial457 | SpatialEval | 3DSRBench | ||
| Qwen7B | before | 80.04 | 82.11 | 84.39 | 88.27 | 90.02 | 88.39 | 82.76 | 86.51 | 62.47 | 38.71 | 45.33 | 34.16 |
| after | 81.89 | 83.76 | 84.10 | 90.63 | 92.41 | 90.92 | 82.90 | 87.74 | 63.72 | 39.15 | 45.81 | 34.95 | |
| Llama11B | before | 74.95 | 76.68 | 78.37 | 83.29 | 85.06 | 83.64 | 75.92 | 79.18 | 65.82 | 32.18 | 39.61 | 28.87 |
| after | 75.62 | 77.40 | 79.10 | 83.75 | 86.20 | 83.10 | 75.40 | 79.65 | 66.91 | 32.40 | 39.90 | 29.40 | |
| Intern8B | before | 72.84 | 74.33 | 76.05 | 81.26 | 83.17 | 81.92 | 73.66 | 77.41 | 64.35 | 41.23 | 47.92 | 36.58 |
| Token_use | Spatial(llm) | Spatial(acc) | Relational(llm) | Relational(acc) |
|---|---|---|---|---|
| first | 70.42 | 72.54 | 75.28 | 66.46 |
| last | 84.33 | 83.26 | 78.54 | 70.18 |
| full | 67.46 | 59.28 | 70.28 | 63.33 |
| top-k | 57.69 | 53.42 | 63.85 | 59.57 |
| Dataset | InternVL3-2B | InternVL3-8B | Qwen2.5VL-7B | Qwen2.5VL-3B | LLaMA3.2-11B | LLaMA3.2-90B |
|---|---|---|---|---|---|---|
| CogVSR | 78.74 | 75.88 | 82.15 | 84.22 | 89.64 | 83.44 |
| Cognitive Skill | Count | Percentage |
|---|---|---|
| Spatial Perception | 1,026 | 27.29% |
| High-level Visual Perception | 941 | 25.03% |
| Relational Reasoning | 576 | 15.32% |
| Decision Making | 498 | 13.25% |
| Knowledge Recall | 272 | 7.24% |
| Information Extraction and Understanding | 198 | 5.27% |
Visual Spatial Reasoning
Visual spatial reasoning studies how AI systems infer geometry, object relations, viewpoints, and physical change from images and video.
See all 251 papers