Abstract
SpatialLM is a multimodal large language model (LLM) designed for 3D indoor scene modeling. By treating architectural layouts and object detection as a code-generation task, the model represents structural elements and furniture as Python-like scripts. Trained on a massive new synthetic dataset of professional interior designs, SpatialLM achieves state-of-the-art performance in layout estimation and competitive results in 3D object detection within a single, unified framework.
Introduction
Understanding 3D indoor environments—identifying the placement of walls, doors, and furniture—is a foundational challenge for applications in augmented reality and embodied robotics. Traditionally, researchers have addressed these tasks using "specialist" models: separate architectures for layout estimation and 3D object detection. These approaches often suffer from architectural rigidity, making them difficult to adapt to new object classes, and are limited by the scarcity of high-quality, human-authored 3D structural annotations.
SpatialLM aims to bridge this gap by leveraging the reasoning and coding capabilities of LLMs to create a "generalist" model for 3D space. By treating 3D modeling as a language task, the framework provides an interpretable and editable representation of indoor scenes.
Methods
The core innovation of SpatialLM is its structured representation. Instead of predicting raw coordinates or voxels, the model generates a Python script using @dataclass definitions. This approach allows for clear hierarchical relationships; for example, a wall is defined as a line segment with a height, and a door is explicitly linked to a specific wall_id.
The architecture follows a standard "Encoder-MLP-LLM" pipeline:
- 3D Encoder: The model utilizes Sonata (a variant of Point Transformer V3), which processes raw 3D point clouds (XYZ + RGB) into high-dimensional feature embeddings.
- Projector: A two-layer MLP aligns these 3D features with the LLM’s word embedding space.
- LLM Backbone: The authors fine-tune Qwen2.5-0.5B, a lightweight but capable open-source LLM, to generate the scene scripts.
- Quantization: To handle continuous 3D coordinates, space is quantized into 1,280 discrete "bins," allowing the LLM to predict locations as integer tokens.
Crucially, the authors found that a single-stage training schedule—where the encoder, projector, and LLM are all trained simultaneously—yielded the best results, ensuring the encoder learns features specifically useful for the LLM's spatial reasoning.
Datasets
The paper introduces the SpatialLM dataset, a large-scale synthetic collection designed to overcome data scarcity. It consists of 12,328 distinct scenes containing 54,778 individual rooms. Unlike typical procedurally generated datasets, these scenes are sourced from professional interior designs, ensuring realistic furniture layouts and architectural logic. The dataset includes over 403,000 walls, 123,000 doors, and 412,000 object instances across 59 categories. The model was also evaluated on real-world benchmarks, including Structured3D for layouts and ScanNet for object detection.
Key Insights and Results
By treating 3D scenes as scripts, SpatialLM becomes inherently interpretable and editable. A user can manually tweak the generated Python code to move a wall or change a furniture category, and the 3D scene updates accordingly. Furthermore, the model demonstrates "zero-shot" capabilities, such as semantic label completion, where it can infer object labels from bounding boxes based solely on spatial context.
Performance Evaluation
- Layout Estimation: On the Structured3D benchmark, SpatialLM achieved an F1-score of 94.3 (at [email protected]), significantly outperforming previous state-of-the-art models like RoomFormer (83.4) and SceneScript (90.4).
- 3D Object Detection: On ScanNet, it reached an F1-score of 65.6, matching the performance of specialist models like V-DETR.
- Real-World Generalization: The model demonstrated an impressive ability to handle noisy point clouds reconstructed from simple hand-held phone videos, proving its robustness beyond synthetic training data.
Conclusion
SpatialLM represents a significant step toward generalist 3D spatial understanding. While a performance gap remains when moving from synthetic data to real-world scans without fine-tuning, the model's ability to reason about 3D space as a language task opens new avenues for interactive scene modeling. Future work will focus on expanding to open-vocabulary detection and integrating 3D Visual Question Answering (VQA) to further exploit the LLM’s reasoning capabilities.
Summary updated