pySpatial: Generating 3D Visual Programs for Zero-Shot Spatial Reasoning

Zhanpeng Luo, Ce Zhang, Silong Yong, Cunxi Dai, Qianwei Wang +4 more
3/1/2026
cs.CV

No official code found. Best implementation: Zhanpeng1202/pySpatial (33 stars, last commit 2026-03-17).

Abstract

Multi-modal Large Language Models (MLLMs) have demonstrated strong capabilities in general-purpose perception and reasoning, but they still struggle with tasks that require spatial understanding of the 3D world. To address this, we introduce pySpatial, a visual programming framework that equips MLLMs with the ability to interface with spatial tools via Python code generation. Given an image sequence and a natural-language query, the model composes function calls to spatial tools including 3D reconstruction, camera-pose recovery, novel-view rendering, etc. These operations convert raw 2D inputs into an explorable 3D scene, enabling MLLMs to reason explicitly over structured spatial representations. Notably, pySpatial requires no gradient-based fine-tuning and operates in a fully zero-shot setting. Experimental evaluations on the challenging MindCube and Omni3D-Bench benchmarks demonstrate that our framework pySpatial consistently surpasses strong MLLM baselines; for instance, it outperforms GPT-4.1-mini by 12.94% on MindCube. Furthermore, we conduct real-world indoor navigation experiments where the robot can successfully traverse complex environments using route plans generated by pySpatial, highlighting the practical effectiveness of our approach.

View on arXivView PDF

Code Implementations(1)

[ICLR 26] pySpatial: Generating 3D Visual Programs for Zero-Shot Spatial Reasoning

332Shell, PythonAug 21, 20257 months ago
3dvagentspatial-reasoning

Similar Papers

Cite this paper

@article{luo2026pyspatial,
  title  = {pySpatial: Generating 3D Visual Programs for Zero-Shot Spatial Reasoning},
  author = {Zhanpeng Luo and Ce Zhang and Silong Yong and Cunxi Dai and Qianwei Wang and Haoxi Ran and Guanya Shi and Katia Sycara and Yaqi Xie},
  year   = {2026},
  eprint = {2603.00905},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.00905v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.00905.svg)](https://codeofpaper.com/paper/2603.00905)

Discussion