Visual Primitives for Chain-of-Thought: A Practical Guide to Multimodal Spatial Reasoning
This article explains why multimodal models often identify objects correctly yet fail at precise spatial queries, and how emitting spatial primitives such as points and bounding boxes at every reasoning step turns vague references into verifiable anchors. It covers the reference gap, the three roles of coordinates (disambiguation, verifiability, traceability), architecture trade-offs under a low visual budget, training data construction and consistency gates, a three-stage training pipeline, evaluation metrics beyond final accuracy, engineering deployment practices, and known limitations with future directions.
1. Where the Problem Starts: Why Multimodal Models See but Cannot Point Accurately
Progress in image understanding for multimodal large models is easy to observe, yet these models still fail frequently whenever a task requires precise spatial manipulation. A typical pattern: the model can state that the image contains “a cat, a ball, and several cups,” but as soon as the question becomes “what is the third-largest red object from left to right,” the answer starts to waver.
The root cause is not that the visual encoder cannot see clearly. It is that the medium carrying spatial information through the reasoning chain is too imprecise. Natural language is a highly compressed, context-dependent representation. A phrase like “the big one on the left” expands its range of possible referents rapidly as the number of targets grows, occlusion increases, and scale differences shrink. The model is then forced to re-guess which object is meant at every step. This uncertainty accumulates along the chain and produces attention drift: an early step locks onto the wrong target, the following steps all revolve around that wrong object, and the final output reads fluently but is disconnected from the facts in the image.
The industry abstracts this phenomenon as the Reference Gap: there is no stable, verifiable mapping channel between language concepts and pixel coordinates. As long as that channel is missing, spatial reasoning can only rely on probabilistic guessing, and stability is out of reach.
2. The Core Idea: Turning Coordinates into Anchors During Reasoning
The key move of the new paradigm is to have the model emit spatial primitives, point coordinates or bounding boxes, in sync with every step of the chain of thought. Coordinates no longer appear only in the final answer; they are written out explicitly as intermediate outputs of reasoning and serve three purposes.
First, disambiguation. When the model writes down the coordinates of a candidate region, the referent is uniquely determined and later steps no longer need to re-resolve the natural language phrase. Second, verifiability. Coordinates are structured data and can be checked for consistency against image facts, for example whether a box goes out of bounds, whether a point falls inside the target, or whether two boxes overlap abnormally. This provides an automatable error signal for the reasoning process. Third, traceability. When a conclusion is wrong, developers can pinpoint which specific step failed to anchor, instead of facing a natural language explanation that cannot be decomposed.
This is closely analogous to human behavior: pointing with a finger while counting, or drawing a line along the path while solving a maze. Externalized spatial markers convert a fuzzy internal mental process into an observable and interventable sequence of actions.
3. Architecture View: Capability Trade-offs Under a Low Visual Budget
Much of the engineering value of such frameworks comes from trading minimal visual overhead for stable spatial capability. The design usually develops along three lines.
The first is multi-level compression of visual information. Representations of adjacent visual units contain substantial redundancy. Aggregating the key-value caches of several visual entries into a single entry layer by layer can significantly reduce memory and bandwidth pressure during long-sequence inference. It is worth stressing that a higher compression ratio is not always better: it must match the spatial resolution the task requires, because over-compression flattens the information of small objects and densely adjacent targets.
The second is how the reasoning chain is coupled with visual primitives. A common approach extends the action space of the language model with coordinate output, making “output a point” and “output a box” first-class citizens on par with generating text, rather than a bolt-on detection module. The benefit is end-to-end trainability; the cost is that training data must cover both language reasoning and precise coordinate annotation.
The third is concentrating capability under a compact parameter budget. Instead of spreading the budget evenly across all capabilities, it is better to reinforce counting, localization, and spatial relations in a targeted way. This explains why such models are not necessarily superior at general description yet can be competitive on specific spatial benchmarks.
4. Data Construction: The Invisible Battlefield That Sets the Ceiling
Embedding coordinates into the reasoning chain demands far more from data than conventional image-text alignment. One usable training sample must contain at least the original image, the question, the step-by-step reasoning text, the spatial primitive referenced at each step, and the final answer. The construction pipeline typically has four stages.
Image collection / filtering-> Object annotation (point + box + instance id)-> Chain-of-thought synthesis (question templates x spatial relation graph)-> Consistency validation (coordinate legality / reference uniqueness / answer derivability)
The stage most likely to go out of control is chain-of-thought synthesis. If templates are simply concatenated by a program, the model learns the surface pattern of “write a box, then write the answer” without understanding why that box was chosen. Mitigations include introducing composite questions that require multi-step anchoring (first localize a reference object, then localize the target based on relative relations), adding distractors so that a wrong anchor necessarily leads to a wrong answer, and keeping a small number of manually refined samples to calibrate the naturalness of the language.
Consistency validation is best implemented as a mandatory gate in the pipeline, covering at least: whether coordinates fall within the image bounds, whether a point lies inside the segmentation region of the corresponding instance, whether the coordinates of the same instance id are self-consistent within one chain, and whether the final answer can be derived from the anchors already given. If any check fails, the sample is discarded and rebuilt, so that dirty data does not harden wrong patterns into the weights.
5. Training Pipeline: Injecting Spatial Capability in Stages
The recommended training path has three stages, each with a single objective, which makes problems easier to localize.
# Illustrative: organizing objectives for staged training (not a specific implementation)stage1 = dict(task="grounding", data="image+text+box", loss="coord_l1 + text_ce")stage2 = dict(task="chain", data="image+question+steps", loss="text_ce + coord_l1")stage3 = dict(task="preference", data="good_chain/bad_chain", loss="rank_loss")
The first stage does only basic grounding, letting the model map language phrases to coordinates stably. The second stage introduces multi-step reasoning and penalizes deviation of intermediate anchors, avoiding the pseudo-correctness of “right answer, wrong process.” The third stage uses preference alignment to suppress redundant description and unfounded guessing, encouraging every anchoring step to have a clear necessity. A common failure mode in practice is skipping the first stage and training long chains directly, which leaves the model talking its way through in language instead of localizing with coordinates.
6. Evaluation: Do Not Look Only at Final Answer Accuracy
Final answer accuracy can mask process defects. It is advisable to run at least four kinds of metrics in parallel: anchoring accuracy (how well intermediate coordinates match the ground-truth boxes), reference uniqueness (whether the same phrase always points to the same instance within a chain), process derivability (whether the answer follows logically from the anchors), and visual budget (the number of visual entries consumed to complete the same task). Dense-scene counting and spatial relation judgment should be mandatory test items, because these two task types are the most sensitive to referential ambiguity.
7. Engineering Deployment: Keeping Uncertainty in a Cage
When integrating this capability into a business system, start with offline batch processing to validate the benefit, then roll out gradually. On the engineering side, the capabilities to prepare include object storage for accumulating samples and results, a container platform to host inference workloads and handle scaling, a message queue to chain multi-step calls, and logging plus monitoring and alerting services that cover latency and failure rate. If general-purpose cloud resources are used, it is advisable to add a post-processing validation layer for coordinate output that intercepts out-of-bounds values, abnormal overlaps, and reference conflicts before anything is returned to the user.
For teams planning to build a comparable solution in-house, the general-purpose combination of capabilities that Baidu AI Cloud offers across model training, inference deployment, and data governance is worth looking at, in order to lower the pipeline cost from data construction to online serving.
8. Known Limitations and Directions for Evolution
The first limitation is the tension between compression and precision: once visual entries are heavily merged, the resolution of small objects and densely adjacent targets drops. The second is training data cost, since high-quality step-by-step coordinate annotation is hard to obtain fully automatically. The third is cross-domain generalization, as changes in annotation style and scene distribution significantly affect anchoring stability. The fourth is the boundary of interpretability: correct coordinates do not mean correct semantic relations, so consistency constraints at the language level are still required. Viable directions include adaptive compression that dynamically retains resolution according to task needs, bringing the validator into the training loop to form self-correction, and extending spatial primitives to richer geometric forms to support reasoning about occlusion and hierarchical structure.
9. Summary
Promoting coordinates from “part of the answer” to “part of the reasoning” is a key shift for multimodal spatial reasoning in engineering terms: it replaces vague natural language references with structured intermediate outputs, making the reasoning chain verifiable, traceable, and optimizable. For developers, the focus of implementation is not model selection itself but three engineering details: data consistency gates, staged training design, and post-processing validation of outputs.
