Abstract: 3D visual grounding (3DVG) is challenging due to the need to understand 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 LLMs/VLMs eliminate the need for large-scale training data, but they either incur prohibitive grounding time and token costs or have unsatisfactory accuracy. To address the challenges, we introduce a novel method for training-free 3D visual grounding, namely Language-to-Space Programming (LaSP). LaSP introduces LLM-generated codes to analyze 3D spatial relations among objects, along with a pipeline that evaluates and optimizes the codes automatically. Experimental results demonstrate that LaSP achieves 52.9% accuracy on the Nr3D benchmark, ranking among the best training-free methods. Moreover, it substantially reduces the grounding time and token costs, offering a balanced trade-off between performance and efficiency.
The Performance-Efficiency Gap in 3DVG
3D Visual Grounding (3DVG) involves locating a specific object in a 3D scene based on a natural language description, such as "the chair to the left of the desk." Current solutions generally fall into three categories, each with significant drawbacks:
- Supervised Methods: These require massive datasets of 3D scenes paired with human-annotated text, which are scarce and expensive to produce.
- Training-Free "Agent" Methods: These use LLMs or Vision-Language Models (VLMs) to reason about object coordinates at inference time. While accurate, they require sending massive amounts of scene data to an API for every query, leading to high latency and prohibitive token costs.
- Visual Programming: Earlier attempts used LLMs to write simple programs calling pre-defined functions. These were fast but lacked the nuance to handle complex, nested spatial relationships.
Language-to-Space Programming (LaSP)
To bridge this gap, the authors introduce Language-to-Space Programming (LaSP). Instead of asking an LLM to find the object directly for every query, LaSP prompts the LLM to write the code that performs the spatial reasoning.
Core Components
- Code-as-Encoder: The system prompts an LLM to write Python classes that calculate spatial features (e.g., an
Aboveclass that computes a score for how much object A is above object B). - Iterative Optimization via Test Suites: This "weakly supervised reflection" involves creating small test suites of object triplets. If the generated code fails to distinguish a target from a distractor, the system provides the failure case as feedback. The LLM then reflects on the error and rewrites the code to be more robust.
- Symbolic Execution: At inference time, a semantic parser converts the user's query into a symbolic expression (e.g.,
near(table, chair)). An executor runs the optimized Python code on the scene's bounding boxes to generate matching scores. - Visual Decision Module: To handle visual attributes like color or material that coordinates cannot capture, LaSP uses a VLM (GPT-4o) as a final filter on 2D crops of top candidates.
Key Results and Efficiency
LaSP was evaluated on the Nr3D (Natural Reference in 3D) and Sr3D (Synthetic Reference in 3D) datasets. The results demonstrate that LLM-generated code, when iteratively optimized, can outperform human-written functions by better accounting for mathematical nuances like vector projections.
- Accuracy: LaSP achieved 52.9% accuracy on the Nr3D benchmark, outperforming all other training-free methods.
- Efficiency: Compared to agent-based methods like VLM-Grounder, LaSP reduced grounding time from 50.3 seconds to 7.7 seconds per query.
- Cost: Token usage dropped significantly, from roughly 8k tokens per query in agent methods to 3.1k tokens in LaSP.
- Generalization: Spatial encoders optimized on one dataset transferred to the GRScenes dataset with 90% accuracy, proving the code captures fundamental geometric principles.
Limitations and Future Work
Despite its success, LaSP relies on off-the-shelf 3D detectors; if an object is not detected, it cannot be grounded. The current symbolic parser also struggles with complex ordinal language (e.g., "the third chair from the left") and simplified bounding box representations that ignore object orientation. Future work will focus on enriching scene graphs with functional zones and developing more sophisticated linguistic parsers.
Summary updated