Abstract
3D visual grounding (3DVG) is challenging due to the need to understand complex 3D spatial relations. While supervised approaches have achieved superior performance, they are constrained by the scarcity and high annotation costs of 3D vision-language datasets. Training-free approaches based on Large Language Models (LLMs) and Vision-Language Models (VLMs) eliminate the need for large-scale training data, but they often incur prohibitive grounding time and token costs or provide unsatisfactory accuracy. To address these challenges, we introduce Language-to-Space Programming (LaSP), a novel method for training-free 3D visual grounding. LaSP utilizes LLM-generated code to analyze 3D spatial relations among objects, supported by a pipeline that evaluates and optimizes the code automatically. Experimental results demonstrate that LaSP achieves 52.9% accuracy on the Nr3D benchmark, ranking among the best training-free methods while substantially reducing grounding time and token costs.
Introduction
3D Visual Grounding (3DVG) involves locating a specific object in a 3D scene based on a natural language description. Traditional methods rely on massive, expensively annotated datasets. To circumvent this, researchers have explored training-free methods using LLMs. However, current approaches face a significant trade-off: agent-based methods are accurate but slow and expensive due to high token consumption, while visual programming methods are fast but struggle with the nuances of 3D spatial relationships. LaSP bridges this gap by shifting from "reasoning in text" to "reasoning via generated code."
Methodology
The core innovation of LaSP is the generation of Python-based spatial relation encoders. Instead of asking an LLM to find an object directly, the system prompts the LLM to write code that calculates matching scores for specific spatial relations.
Offline Code Generation & Optimization
- Code-as-Encoder: The LLM generates Python classes (e.g.,
Above,Near,Between) that take 3D bounding boxes as input and output a matching score. - Automatic Test Suites: To ensure reliability, the system uses a small set of examples to test the generated code. If the code fails, the error message is fed back to the LLM for iterative optimization.
Online Grounding Pipeline
During inference, a referring utterance is parsed into a symbolic JSON expression. An executor then runs the optimized Python code to calculate spatial scores across all candidate objects. For final disambiguation (e.g., distinguishing between two identical chairs), a VLM like GPT-4o analyzes 2D crops of the candidates.
Key Results
LaSP was evaluated on the Nr3D, Sr3D, and GRScenes benchmarks. It achieved a state-of-the-art 52.9% accuracy on Nr3D among training-free methods, even surpassing some early supervised models.
Beyond accuracy, LaSP offers significant efficiency gains. Compared to leading agent-based methods like VLM-Grounder, LaSP is approximately 6.5x faster (7.7s vs. 50.3s per query) and uses 60% fewer tokens. Furthermore, the encoders optimized on Nr3D achieved 90% accuracy on the GRScenes dataset, demonstrating robust generalization across different 3D environments.
Discussion and Conclusion
LaSP demonstrates that LLMs are more effective at writing geometry-heavy code than performing numerical reasoning in text. By generating precise tools (code) rather than just text-based answers, LaSP captures the "fuzzy" nature of human language more accurately than manually crafted functions.
Despite its success, LaSP remains dependent on the quality of underlying 3D object detectors and can struggle with highly complex linguistic structures like ordinal relations. Future work will focus on enriching scene representations and extending the optimization framework to handle more recursive instructions. Overall, LaSP provides a balanced and efficient solution for zero-shot 3D visual grounding.
Summary updated