Executable Spatial Predicates: Closing the Gap Between How People Describe Space and What Geometry Code Can Check

People describe space loosely. They say "the chair tucked under the far end of the desk" or "the lamp behind the sofa, from where I'm standing." A robot or 3D tool needs exact geometric arguments instead: coordinates, bounding boxes, reference frames, clearance margins. This is a vocabulary mismatch, the same problem search engines have when a query and the right document share no words, except here the "documents" are geometric predicates. Current language models are surprisingly good at geometry once coordinates are written out for them. MonoSR reports accuracy rising from about 30% to over 90% when ground-truth 3D boxes are supplied as text. Where they fail is in deciding what a vague spatial word should mean geometrically, and in which frame.

We propose to make that decision explicit and checkable. The model translates each spatial phrase into a small executable predicate over a scene of 3D boxes, for example under(a, b, overlap>0.5, gap<0.3m). A geometry engine then reports more than crashes. It reports what the predicate set actually selects: zero objects, three objects, one, or a placement that collides. The model revises its translation of the words using that selection report, much as InteR revises a search query using the documents it retrieved. We evaluate on ScanRefer's hard split, where several similar objects must be told apart by spatial language. We reweight the test items toward the distribution of spatial expressions real users produce, so the result reflects deployment rather than the benchmark's own phrasing habits.

Core Claim

The useful feedback signal for spatial code is the selection outcome of an interpreted description, not a runtime error. When a predicate set picks no referent or several, the scene has told the model that its reading of some word is too strict, too loose, or in the wrong frame. Our claim is that refinement driven by this signal improves spatial reference resolution beyond three alternatives. The first is supplying coordinates and asking directly, as in MonoSR. The second is single-pass geometry code, as in Code as Policies. The third is refinement driven only by tracebacks or self-critique. The gain should concentrate on descriptions with large lexical distance from geometric vocabulary and on perspective-dependent phrases. If it does not concentrate there, the claim is wrong.

This differs from the closest work in specific ways. Code as Policies writes spatial programs with NumPy and Shapely but runs them open-loop and assumes the user's words already fit the API. NESYRO closes the loop with SMT and PDDL checks and exploratory probes, but its predicates are a fixed, pre-declared symbolic vocabulary. Bridging from informal language into that vocabulary is exactly the step it leaves out. CMAG bridges informal descriptions to rigid 3D taxonomies with an iterative VLM verification loop, but it never produces executable geometry. InteR supplies the method we borrow, an alternating loop in which retrieved results refine the query, and moves it from text documents to a geometry engine.

Research Program

The scene representation is a list of labeled 3D boxes. In the main experiments these are ScanNet ground-truth boxes, which separates the language-to-geometry step from perception. MonoSR and Spatial-DISE disagree on how much spatial failure comes from perception (MonoSR) versus reasoning (Spatial-DISE attributes 72.5% of failures to reasoning). Fixing perception lets us measure the reasoning side cleanly. A secondary run replaces the ground-truth boxes with detected boxes to measure how the method holds up when perception is imperfect.

We build a small geometry library of roughly thirty parameterized relations: support, under, behind, between, near, facing, and others. Each relation has explicit thresholds and an explicit reference frame argument: camera, a named object, or a person's pose.

The model, an open-weight code LLM held fixed across all conditions, writes a program in two parts. The first part maps each phrase in the description to relations and thresholds. The second part selects the referent. The executor returns three things: the candidate set after each predicate, any frame or collision conflicts, and which phrase removed the last correct-class candidate, or failed to remove a distractor.

The model then rewrites only the implicated phrase translations. Two mechanisms protect against the degradation and compounding errors reported by Yan et al. and Srivastava et al.. First, a rollback rule keeps the best program found so far, scored by how close its selection is to a single object. Second, the loop stops as soon as exactly one object is selected. We also record how accuracy changes with iteration count, because InteR found that going beyond two rounds added noise.

The selection signal uses no labels. "Exactly one object selected" is available at deployment without knowing which object is correct. The loop can therefore still converge on the wrong unique object, and we measure how often it does.

The context-specific part follows the method of MixEval. We collect a pool of informal spatial instructions written by participants for household scenes. We embed them, and reweight ScanRefer test descriptions by their similarity to that pool. We report both uniform and reweighted scores. The scientific question is whether the methods change rank order between the two weightings, which is the ecological validity gap documented by The Shifted and The Overlooked, here applied to spatial language. The participant pool will be small and demographically narrow, and we state that limitation openly.

Baselines

The naive reference point is direct answering. The same LLM receives the description and the serialized box list and names the referent. This is the MonoSR setup, and it is the strongest simple competitor, because MonoSR shows that text coordinates alone carry most of the benefit on its benchmark. Beating it is the minimum requirement. We will count it as beaten only if our method is clearly ahead on the multiple-similar-objects split, with the margin reported with bootstrap confidence intervals. A tie there would mean the code loop adds nothing beyond serializing coordinates.

The strongest existing method is Code as Policies-style single-pass program synthesis over the same geometry library. We pair it with best-of-N sampling and majority vote over selected referents, where N is set so that total LLM calls and executions match our loop's average budget. This compute-matched version is the fair competitor, since any refinement loop spends extra calls. We will count it as beaten if our method wins at equal call counts.

We also run a NESYRO-style variant. The predicate vocabulary is fixed to closed definitions with default thresholds and a fixed camera frame. The model chooses predicates but cannot reinterpret them, and the loop repairs only logical violations. This isolates whether the gain comes from verification itself or from adapting what a word means.

Two ablations isolate the key ingredient. In the first, the executor returns only tracebacks and empty or non-empty flags, with no per-phrase selection report. In the second, the model self-critiques with no execution, in the spirit of Visualization-of-Thought scratchpads. All conditions share the same LLM, scenes, prompts budget, and a held-out tuning set of 200 descriptions for prompt selection.

For reference numbers, ScanRefer's own end-to-end model reports 18.17% [email protected] on the multiple-similar-objects split and 22.39% overall (ScanRefer). That model uses detected rather than ground-truth boxes, so it is context, not a like-for-like target. We found no reported result on Lacuna for LLM-based reference resolution over ground-truth ScanNet boxes. For perspective-dependent phrases, the external reference points on ViewSpatial-Bench are GPT-4o at 34.98% and the fine-tuned 3B MVSM at 82.09%.

Why not just…?

Why not just serialize the 3D boxes and ask, as MonoSR does? This is the real threat, and the direct-answering baseline tests it head on. MonoSR's gain was measured on its own question set, where many items concern a single object's metric properties. ScanRefer's hard split requires choosing among same-class distractors by relational phrasing, where a single unchecked guess has no way to notice that "under" matched two stools. If direct answering matches our method on that split, we will report that the loop is unnecessary when perception is solved.

Why not just fine-tune a spatial model, like MVSM on ViewSpatial-Bench? Fine-tuning works well in-distribution. MVSM reaches 82.09% from a much weaker base, and Spatial-DISE fine-tuning lifts Qwen2.5-VL-7B from 26.1% to 47.0%. But fine-tuning bakes in the training set's phrasing, and the vocabulary gap we target arises from users' phrasing. We test this by training a comparable model on ScanRefer training descriptions and evaluating it under the user-reweighted mixture. Our expectation is that its advantage shrinks there while ours does not. If it does not shrink, fine-tuning is the better recommendation.

Why not just sample many single-pass programs and vote? Voting fixes random errors but not systematic misreadings. If the model always reads "behind" in the camera frame, every sample agrees, and agrees wrongly. The compute-matched best-of-N baseline settles this. The per-phrase breakdown in our analysis will show whether our gains come from frame-dependent and threshold-dependent words, which is where voting should fail.

Why not just use better dense retrieval to match descriptions to objects? ScanRefer's 18.17% on similar-object disambiguation shows that embedding similarity does not resolve relations. CMAG's semantic-retrieval baseline (33.9 text-to-3D alignment versus 47.0 with scaffolding) points the same way. We include an embedding-matching baseline that scores box captions against the description, mainly to confirm this floor.

Proposed Experiments

The primary experiment is ScanRefer validation with ScanNet ground-truth boxes, scored by referent accuracy and by [email protected] on the unique and multiple-similar splits, under both uniform and user-reweighted weighting. A second experiment uses the perspective-dependent items in ViewSpatial-Bench whose scenes come from ScanNet. Converting their 18 directional labels into relation queries tests whether explicit frame arguments fix the "flip-flopping" between coordinate systems that the benchmark documents. A third experiment repeats the ScanRefer evaluation with detected boxes, to measure how much of the gain survives imperfect perception.

Three checks are decisive. First, the selection-report condition must beat both the traceback-only and self-critique ablations at matched budget; otherwise the central claim fails. Second, gains must grow with the lexical distance between a description and the library's relation names. We measure that distance as the embedding distance from description phrases to relation names, and we plot accuracy gain against it. A flat curve means the method is not addressing vocabulary mismatch. Third, under reweighting, the ranking of methods should differ from the uniform ranking. If it does not, the context-specific lens adds nothing here, and we will say so.

We also report the rate of confident wrong answers, meaning a unique but incorrect object selected, together with accuracy as a function of iteration count up to five rounds. These two measurements tell us whether stopping when one object is selected avoids the plateau and error-compounding failures seen in earlier refinement loops.