Spatial Query Execution as Verifiable Rewards for Multi-step Spatial Reasoning

Jiyoon Pyo, Dongwon Jung, Zekun Li, Nayeon Kim, Muhao Chen, Yao-Yi ChiangarXiv 2026

It’s late, you’re tired, and you’ve probably spent a good portion of your life looking for something—keys, a remote, a specific file—that was "under the blue folder, next to the laptop, but behind the coffee mug." To us, that’s a simple spatial chain. To a Large Vision-Language Model (LVLM), it’s a nightmare.

While today’s AI is startlingly good at recognizing what is in an image, it remains surprisingly clumsy at understanding where things are in relation to each other, especially when those relations stack up. A new paper introduces FARON, a framework designed to give these models a much-needed lesson in geometry.

TL;DR

FARON (Fully Automated Reasoning Over spatial relatioNs) uses a spatial database engine to generate "perfect" synthetic 2D and 3D scenes and the complex SQL queries needed to solve them. By training models on these step-by-step geometric "traces" and using the database's deterministic answers as a verifiable reward for reinforcement learning, the authors significantly boost the spatial reasoning of AI without needing a single human-annotated image.

What Problem Does This Paper Address?

Current AI models usually learn about space from human-annotated datasets. But humans are expensive and, frankly, a bit imprecise. Most datasets use bounding boxes—simple rectangles drawn around objects.

The problem? Bounding boxes are "leaky." If you have two overlapping triangles, their bounding boxes might overlap even if the triangles themselves don't touch. This makes it nearly impossible for a model to learn the difference between "near," "touching," and "overlapping" with any real precision. Furthermore, most datasets only provide the final answer, not the "thinking" required to get there. If a question requires five steps of logic, and the model gets the first step wrong, it’s just guessing for the rest of the way.

Methods

The authors decided to stop relying on messy real-world data and built a "geometry teacher" instead. The FARON pipeline works in four main stages:

  1. Synthetic Scene Generation: The system creates 2D maps (with points, lines, and polygons) and 3D scenes (with simple geometric shapes). Because these are synthetic, the system knows the exact mathematical coordinates of every edge and vertex.
  2. Spatial Program Execution: Instead of asking a human for the answer, FARON writes a spatial SQL query (using PostGIS). For a question like "Which point is within the polygon that is inside P2?", the database executes a multi-step plan to find the exact answer.
  3. Trace Verbalization: These database execution steps are converted into natural language "reasoning traces." An LLM (Qwen3) is used to paraphrase these into conversational English so the model can learn to "think out loud."
  4. Two-Stage Training:
    • SFT (Supervised Fine-Tuning): The model is taught to output the reasoning trace before the final answer.
  5. RLVR (Reinforcement Learning with Verifiable Rewards): Using a technique called GRPO, the model is rewarded when it gets the answer right. Because the answer comes from a deterministic database query, the reward is "verifiable"—there’s no ambiguity about whether the model was right or wrong.
Figure 1: Overview of the FARON pipeline, from synthetic scene generation and spatial query execution to reasoning-trace supervision and verifiable reward training.

Datasets

  • FARON-Internal: A new dataset of 23,800 questions generated from 2,199 2D scenes and 1,256 3D scenes.
  • External Benchmarks: To prove the model actually learned reasoning (and didn't just memorize the synthetic data), they tested it on five external benchmarks: CV-Bench, BLINK, SpatialEval, FRIEDA, and MultiHop-Spatial.

Key Insights and Ideas

  • Geometry over Boxes: By using exact boundary polygons instead of bounding boxes, the authors eliminated the "visual noise" that confuses models. This allows the model to learn the true mathematical nature of spatial relations.
  • The Power of the "Trace": Teaching the model to show its work (the reasoning trace) was far more effective than just giving it the answer. It forces the model to maintain "intermediate constraints"—essentially keeping track of the "blue folder" before it looks for the "keys."
  • Verifiable Rewards: In many AI tasks, "correctness" is subjective. In geometry, it isn't. Using a database as a ground-truth judge for Reinforcement Learning (RL) allowed the model to self-correct and refine its logic.

Key Results

The results were striking, particularly as the complexity of the questions increased.

  • Multi-Step Mastery: On 5-step reasoning problems, the FARON-Reason model (trained with traces) outperformed a model trained only on answers by 10.34 percentage points.
  • RL Gains: Adding the Reinforcement Learning (GRPO) stage provided an additional 4.06 percentage point boost on those same complex 5-step questions.
  • Generalization: The training "transferred" beautifully to real-world benchmarks. For example, on SpatialEval, one model (InternVL3-2B) saw a massive 24.34 percentage point improvement over its base version without ever seeing a single SpatialEval training example.
Table showing that FARON-Reason significantly outperforms the base model and answer-only versions, especially on complex 5-step tasks.

Limitations and Future Work

While FARON is a powerful "geometry bootcamp," it has its limits:

  • Visual Simplicity: The synthetic scenes use basic shapes (cubes and polygons). Real-world objects have much more complex "semantics" (e.g., a chair has a "front" and a "back" that aren't just about coordinates).
  • Perception vs. Reasoning: The authors acknowledge that if the model fails to identify the object in the first place, the reasoning trace can't save it.
  • Future Directions: The team suggests extending FARON to more realistic 3D environments (like Objaverse) and exploring "embodied" perspectives—teaching a model to reason about space from the point of view of a robot moving through a room.

Summary updated

Abstract

Large vision-language models (LVLMs) remain unreliable on spatial reasoning problems that require composing grounded relations across multiple objects. Yet, scaling reasoning supervision is challenging since human-annotated visual datasets often rely on fixed relational annotations and coarse object localization, making it difficult to obtain precise intermediate reasoning states across diverse spatial configurations and complexities. We introduce FARON (Fully Automated Reasoning Over spatial relatioNs), a framework that executes spatial queries to provide both execution-grounded reasoning supervision and verifiable outcome rewards. Rather than relying on existing annotated data, FARON constructs synthetic 2D and 3D scenes with explicit geometries, enabling configurable object arrangements, spatial relations, and multi-step compositions. Deterministic query execution yields intermediate sets and final answers, providing precise supervision without manual relation annotation. Our pipeline converts intermediate states into natural-language reasoning traces for supervised fine-tuning (SFT), while the execution-derived answers provide verifiable rewards for reinforcement learning with verifiable rewards (RLVR). Controlled experiments show that trace-based SFT improves multi-step spatial reasoning over final-answer supervision and that subsequent group relative policy optimization (GRPO) provides further gains. The resulting models also demonstrate transfer across external spatial reasoning benchmarks and multiple LVLM backbones without benchmark-specific fine-tuning. These results show the potential of using spatial query execution as a unified, flexible source of reasoning supervision and verifiable outcome rewards for multimodal spatial reasoning.
BibTeX
@misc{pyo2026spatial,
  author = {Jiyoon Pyo and Dongwon Jung and Zekun Li and Nayeon Kim and Muhao Chen and Yao-Yi Chiang},
  title = {{Spatial Query Execution as Verifiable Rewards for Multi-step Spatial Reasoning}},
  year = {2026},
  eprint = {2611.26787},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26787},
}
Figure