arXiv:2610.41389cs.CVOct 2026

Manuscript Offprint

arXiv:2610.41389

Parse Before You Execute: Efficient Spatial Reasoning with Executable Primitives

Xiwei Liu, Yulong Li, Xinling Zhuang, Xuhui Li, Yichen Li, Haolin Yang, Zhixiang Lu, Yutong Xie

ABSTRACT

Spatial reasoning in Vision-Language Models (VLMs) has increasingly benefited from tool-integrated pipelines that ground computation in explicit geometry. However, existing systems often compile queries into relatively open-ended artifacts, such as code, task constraints, tool plans, or gathered evidence, leaving what must be resolved before execution under-specified. This can lead to unnecessary tool acquisition and iterative refinement, while still producing plausible reasoning traces from incomplete spatial commitments. We identify this failure mode as under-committed query compilation. To address it, we propose PEPS, a training-free agentic paradigm Parsing Executable Primitives for Spatial reasoning under a typed FESM schema over Frame, Entity, State, and Metric. PEPS follows a parse-before-execute principle: the Parser commits each query to a compact set of executable requirements; the Executor selectively grounds the required primitives through fixed geometric APIs and deterministic computation; and the Verifier checks execution sufficiency, enabling early termination or targeted repair. Extensive experiments across challenging spatial reasoning benchmarks show that PEPS consistently improves reasoning accuracy while substantially reducing refinement rounds, API cost, and end-to-end latency over strong tool-integrated baselines. These results demonstrate that explicit requirement commitment can make tool-integrated spatial reasoning not only more reliable, but also more execution-efficient. Source code is available at https://github.com/Xiwei-web/PEPS.

1 INTRODUCTION

Spatial reasoning is rarely a matter of exhaustively describing everything in a scene. Cognitive studies suggest that humans reason about space in a question-driven way, selecting the scene structure that is relevant to the task at hand (Tversky, 1991; Byrne & Johnson-Laird, 1989). Someone moving a sofa through a doorway, for instance, needs the doorway width, the sofa's largest dimension, and whether it can be tilted, while many other visual details are irrelevant. This observation suggests a useful design principle for spatial reasoning systems: before perception tools are invoked or geometric computation begins, a spatial reasoning system should first commit to what the query actually requires it to know.

Recent spatial reasoning systems have made substantial progress by moving part of the reasoning process out of unconstrained VLM inference and into explicit tools Surfs et al. (2023); Gupta & Kembhavi (2023); Jia et al. (2025). Prior work has shown the value of offloading geometric computation to deterministic modules Luo et al. (2026); Chen et al. (2025), expanding or adapting tool use through APIs Marsili et al. (2025); Wu et al. (2025b), and curating sufficient evidence for downstream reasoning Guo et al. (2025). Together, these advances suggest that reliable spatial reasoning depends not only on stronger models, but also on how perception, computation, and evidence acquisition are organized. Yet existing systems determine what is needed through open-ended plans, programs, formalizations, or iterative evidence requests. When the required information is not committed before execution, the agent may acquire unnecessary evidence, invoke redundant tools, or repeatedly refine an initially incomplete reasoning trajectory.

The missing piece is therefore not only another tool, but an explicit interface between the query and its execution. In existing spatial reasoning systems, the artifact compiled from a query, whether

*Corresponding author.

Figure

Figure 1: Plausible but incomplete requirement commitments can mislead spatial reasoning.

free-form code, a natural-language formalization, a tool-selection plan, or an information set, often remains in an open output space Marsili et al. (2025); Luo et al. (2026); Chen et al. (2025). Such artifacts may specify how to proceed without explicitly committing to what must be resolved before execution. As a result, a system can produce a plausible execution trace even when the required spatial commitments are wrong or incomplete. Figure 1 illustrates this failure mode: the tools are sufficient and the geometry is correct, yet execution fails because the query is compiled into the wrong requirements. We call this under-committed query compilation. Beyond correctness, such incomplete commitments also create computational redundancy: missing requirements must be discovered downstream through additional acquisition, replanning, or refinement.

We therefore follow a simple principle: parse before you execute. Rather than asking a VLM to freely generate what to do next, we first compile the query into a compact set of executable spatial primitives retrieved from a predefined library. Each primitive specifies one requirement that must be resolved before deterministic computation, such as which reference frame should be used, which entities must be grounded, which geometric states must be acquired, and which measurable relation should be computed. We organize these requirements into a four-part schema, FESM: Frame, Entity, State, and Metric. This typed interface makes the execution boundary explicit: only required primitives need to be instantiated, while unresolved requirements can be identified and repaired without restarting an open-ended reasoning process. Parsing therefore serves not only as an inspectable commitment, but also as a mechanism for selective execution and early termination.

We instantiate this principle in PEPS, a multi-agent framework for Parsing Executable Primitives for Spatial Reasoning. The Parser commits each query to a compact FESM requirement set. The Executor selectively grounds the required primitives through geometric APIs and deterministic computation, reusing available results whenever possible. The Verifier checks whether the resulting answer is fully supported by the query, visual evidence, and execution trace; sufficiently supported traces terminate immediately, while rejected traces receive typed feedback that distinguishes missing-slot failures from genuine primitive gaps. This compile-execute-verify design targets both reasoning reliability and execution efficiency by avoiding unnecessary acquisition and repeated refinement. We evaluate PEPS on MMSI-Bench Yang et al. (2025c), ViewSpatial-Bench Li et al. (2025), and OMNI3D-Bench Marsili et al. (2025). PEPS consistently improves spatial reasoning performance across different VLM backbones and, compared with the strongest iterative tool-integrated baseline, reduces API cost by 15.0-23.5% and mean end-to-end latency by 32.3-38.2%, with 83.0-93.0% of queries terminating after a single round. Our contributions are threefold:

1 We characterize under-committed query compilation as a failure mode in tool-integrated spatial reasoning, where plausible intermediate artifacts may leave query-required spatial commitments unresolved. This motivates making query-to-requirement commitment explicit before execution.

2 We introduce PEPS, a parse-before-execute framework, and FESM, a typed interface over Frame, Entity, State, and Metric. Compact executable primitives enable selective tool execution, deterministic computation, typed failure repair, and early termination rather than open-ended iterative acquisition.

3 Extensive experiments show that explicit requirement commitment yields consistent gains across benchmarks and VLM backbones. Beyond accuracy improvements, PEPS reduces API cost, refinement rounds, and end-to-end latency over iterative tool-integrated baselines. Further analyses show that primitive parsing also benefits existing agentic pipelines as a committed-compilation front end.

Figure

Figure 2: Overall Paradigm. The Parser retrieves Frame, Entity, State, and Metric primitives from the query. The Executor grounds them with a fixed geometric toolbox and deterministic code, producing a candidate answer and trace. The Verifier outputs <Decision>, <Score>, and <Feedback>; rejected candidates are refined, and high-scoring accepted ones are stored for reference.