Rule-Compliant Visual Spatial Planning for Multimodal Large Language Models
Organizations: Wangxuan Institute of Computer Technology, Peking University · Yinwang Intelligent Technology Co., Ltd
Abstract
Multimodal large language models (MLLMs) combine linguistic reasoning with visual perception, yet their ability to perform visual spatial planning under explicit or previously unseen rule constraints remains underexplored. This setting requires models to jointly understand spatial layouts, interpret natural-language rules, and plan valid actions accordingly. To address this gap, we introduce RuleMaze, a controllable benchmark in which MLLMs must navigate mazes while obeying natural-language rules of varying complexity. RuleMaze isolates rule-compliant spatial planning by requiring accurate perception, rule interpretation, and constrained action planning. To enable scalable and systematic rule construction, we propose Language-Logic-Function Hybridization, which automatically generates natural-language rules and translates them into logical representations and executable validators, eliminating manual rule engineering. To improve rule following and generalization, we introduce Disentangled Multimodal Planning (DMP), which separates perception, execution, and rule verification through interpretable reasoning primitives. By disentangling these components, DMP facilitates systematic generalization to more complex and previously unseen rules, while providing transparent intermediate planning traces. Experiments demonstrate that DMP substantially improves rule compliance and planning success compared to end-to-end textual planning baselines. Overall, RuleMaze establishes a principled benchmark for studying grounded and interpretable rule-based spatial planning in MLLMs. Code is available at https://github.com/oceanflowlab/RuleMaze.
Figures & tables
| Category | Tool Name | Inputs | Function Description | Output |
|---|---|---|---|---|
| Perception | LocateStart | Image | Identifies and marks the initial agent position | Image |
| InspectGrid | Image | Identifies semantic symbols at specific cell | Symbol | |
| Execution | ExecuteMove | Image , Action | Updates agent position and visual state | Image |
| Verification | VerifyRule | , , Rule | Checks trajectory compliance with rule | Boolean |
| VerifyEndpoint | Image | Checks if agent has reached the target | Boolean |
| Model | Seen Rule | Unseen Rule | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Easy | Medium | Hard | Avg. | ||||||
| EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | |
| Proprietary Model | ||||||||||
| Gemini 2.5 Pro | ||||||||||
| - Direct | 48.0 | 52.5 | 59.0 | 63.9 | 39.0 | 45.9 | 39.0 | 45.5 | 45.6 | 51.7 |
| - CoT | 47.0 | 52.2 | 64.0 | 67.3 | 46.0 | 51.0 | 44.0 | 49.3 | 51.3 | 55.8 |
| Model | Seen Rule | Unseen Rule | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Easy | Medium | Hard | Avg. | ||||||
| EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | |
| Proprietary Model | ||||||||||
| Gemini 2.5 Pro | ||||||||||
| - Direct | 71.0 | 77.4 | 81.0 | 86.0 | 85.0 | 88.9 | 71.0 | 74.9 | 79.0 | 83.2 |
| - CoT | 74.0 | 81.5 | 86.0 | 88.5 | 80.0 | 83.8 | 70.0 | 76.8 | 78.6 | 83.0 |
| Model | EM (%) | PR (%) |
|---|---|---|
| Direct SFT | 65.3 | 71.4 |
| w/ Coordinates | 69.0 | 73.7 |
| w/ ASCII | 67.0 | 70.6 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | EM (%) | PR (%) |
|---|---|---|
| Gemini-2.5-Pro | 45.6 | 51.7 |
| Gemini-2.5-Pro + DMP-P | 64.0 | 67.6 |
| GPT-5 | 53.5 | 61.3 |
| GPT-5 + DMP-P | 81.4 | 84.1 |
| Qwen2.5-VL-3B | 0.0 | 11.7 |
| Qwen2.5-VL-3B + DMP-P | 0.0 | 17.3 |
| Model | Seen Rule | Unseen Rule | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Easy | Medium | Hard | Avg. | ||||||
| EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | |
| w/o Execution | 63.0 | 63.2 | 50.0 | 53.5 | 34.0 | 36.8 | 30.0 | 33.3 | 38.0 | 41.2 |
| w/o Verification | 91.7 | 92.5 | 94.0 | 94.6 | 78.0 | 79.2 | 70.0 | 73.4 | 80.6 | 82.4 |
| w/o Perception + Verification | 88.5 | 89.3 | 91.0 | 92.0 | 74.0 | 76.1 | 66.0 | 69.5 | 77.0 | 79.1 |
| DMP (Ours) | 98.0 | 98.4 | 95.0 | 96.7 | 88.0 | 91.9 | 87.0 | 89.6 | 90.0 | 92.7 |
| Model | Seen Rule | Unseen Rule | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Easy | Medium | Hard | Avg. | ||||||
| EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | |
| Direct SFT (25%) | 35.0 | 45.6 | 35.0 | 48.7 | 29.0 | 38.2 | 18.0 | 31.1 | 27.3 | 39.3 |
| Direct SFT (50%) | 67.0 | 74.1 | 67.0 | 75.1 | 55.0 | 62.6 | 43.0 | 55.2 | 55.0 | 64.3 |
| Direct SFT (100%) | 95.0 | 95.3 | 72.0 | 76.6 | 65.0 | 69.9 | 58.9 | 67.7 | 65.3 | 71.4 |
| DMP (25%) | 79.0 | 84.4 | 71.0 | 81.1 | 65.0 | 74.9 | 62.0 | 71.5 | 66.0 | 75.8 |
| Model | Seen Rule | Unseen Rule | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Easy | Medium | Hard | Avg. | ||||||
| EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | EM (%) | PR (%) | |
| Direct SFT | 95.0 | 95.3 | 72.0 | 76.6 | 65.0 | 69.9 | 58.9 | 67.7 | 65.3 | 71.4 |
| w/ Coordinates | 97.0 | 97.6 | 77.0 | 82.6 | 68.0 | 70.9 | 62.0 | 67.6 | 69.0 | 73.7 |
| w/ ASCII | 95.0 | 95.0 | 73.0 | 78.3 | 68.5 | 70.7 | 59.5 | 62.8 | 67.0 | 70.6 |
| DMP (Ours) | 98.0 | 98.4 | 95.0 | 96.7 | 88.0 | 91.9 | 87.0 | 89.6 | 90.0 | 92.7 |
| Semantic type | Direction-dependent | History-dependent | Requirement | Prohibition |
|---|---|---|---|---|
| Ratio |
| Connective | if | must | and | or | not | cannot |
|---|---|---|---|---|---|---|
| Avg. count | 0.42 | 0.55 | 0.16 | 0.06 | 0.17 | 0.16 |
| Scenario | Predicate | Semantics | Example |
| RegularMaze | Zone(t, "col") | Cell color at | Zone(t, "blue") |
| Move(t, "dir") | Action at | Move(t-1, "up") | |
| QuestMaze | Seen("item") | Item on path | Seen("key") |
| Moved("dir") | Direction taken | NOT Moved("down") | |
| Count(s, op, v) | Count constr. | Count("food", , 3) | |
| TargetIs(tg) | Goal reached | TargetIs("treasure") |
Multimodal Large Language Models
Multimodal large language models combine language models with image, video, audio, and other inputs for grounded understanding and generation.
See all 1,091 papers