A Practical Guide to Visual Primitives for Multimodal Reasoning
This article explains how visual primitives—point coordinates and bounding boxes—can be used as reasoning anchors inside the chain of thought to fix spatial grounding failures in multimodal models. It covers the core idea, a five-stage reasoning pipeline, prompt and output constraints, process-level evaluation metrics, tuning practices, and deployment considerations, including how Baidu AI Cloud can support the required infrastructure. The article also outlines the limitations of the approach and future directions.
1. The Problem: Multimodal Models Can See but Cannot Point Accurately
Multimodal large models keep improving at image understanding, yet their failure modes are highly concentrated in reasoning tasks that require precise spatial relationships. Typical failures include miscounting, reversed left/right or front/back relations, mistakes in occlusion judgments, attention drift in scenes with dense small objects, and cases where the final answer is correct but the reasoning does not match the visual evidence.
The root cause is not entirely the visual encoder. It lies in the expressive power of the reasoning medium. When a chain of thought can only be expressed in natural language, the model must refer to image regions through vague descriptions such as “that big red object on the left.” Such descriptions may align when targets are sparse, but in dense scenes—where similar objects increase in number, appear at similar scales, and sit close together—reference degenerates into an undecidable problem. A single ambiguous reference propagates backward along the chain of thought, so every subsequent step builds on an incorrect spatial premise and errors accumulate.
This is why the industry has begun to treat spatial quantities themselves as reasoning primitives: letting the model emit point coordinates and bounding boxes directly during thinking, upgrading “describe the image” to “locate in the image, then reason.”
2. Core Idea: Promoting Coordinates from Answer Annotation to Reasoning Anchor
In traditional pipelines, coordinates appear only at the output layer, used for detection or annotation as part of the result. The key shift in the new paradigm is moving them earlier: coordinates enter the chain of thought and become the reference handle for each reasoning step.
This is analogous to a person counting with a finger. Each finger movement is bound to one explicit target, so the counting state corresponds strictly to spatial position and cannot drift because two objects look alike. Visual primitives serve the same role: points anchor a single instance, bounding boxes express range, containment, and intersection, and together they form verifiable intermediate states.
This shift brings three direct benefits. First, references become unique, since coordinates eliminate ambiguity by construction. Second, intermediate results become checkable, because every spatial assertion can be verified back against the image. Third, errors become localizable: when a conclusion is wrong, it is possible to tell whether the grounding step or the relational reasoning step failed.
3. Method Breakdown: A Practical Reasoning Pipeline
In engineering terms, the paradigm can be split into five stages that form a closed loop.
- Task parsing: decide whether the question needs spatial evidence, and extract target categories, attribute constraints, and relation types.
- Region localization: output candidate points or bounding boxes as the objects bound by later reasoning.
- Relation construction: compute quantified relations such as containment, intersection, proximity, and alignment from the coordinates.
- Iterative correction: if a relation conflicts with the constraints in the question, return to the localization stage and resample.
- Answer generation: give the answer in natural language, together with the coordinate evidence that supports it.
A schematic chain-of-thought structure looks like this (pseudocode, showing organization only):
question: is the third cup from left to right in the image emptystep1 locate: cup -> [(x1,y1), (x2,y2), (x3,y3), ...]step2 sort_by_x: order = [cup@p1, cup@p3, cup@p2, ...]step3 focus: target = order[2] -> bbox(0.41,0.55,0.52,0.70)step4 verify: no liquid pixels inside(target) region -> empty = trueanswer: yes, based on bbox(0.41,0.55,0.52,0.70)
For engineering, it is advisable to constrain the coordinate format strictly: use a unified normalized range, fix the number of decimal places, and keep point references mapped one-to-one to the IDs of prior steps, so that free-form model output does not break parsing.
4. Designing Prompts and Output Constraints
For coordinates to truly act as anchors, the prompt layer needs three kinds of rules.
First, reference rules. Every reference must carry coordinates or a step ID; unanchored phrases like “that object” are forbidden. Second, granularity rules. Counting and sorting tasks should prefer points, while range and occlusion tasks should prefer bounding boxes, using both when necessary. Third, self-check rules. The model must restate the key coordinates before giving a conclusion and state whether those coordinates are consistent with the constraints in the question.
A reusable constraint snippet:
- All entity references use the format <id>@(x,y) or <id>@bbox(x1,y1,x2,y2)- Coordinates use the top-left origin and are normalized to [0,1]- If a category has more than 5 instances, output the full id list before sorting- The conclusion must cite at least one coordinate as evidence
5. Evaluation and Tuning Recommendations
Evaluation should go beyond final-answer accuracy and add process-level metrics: localization hit rate, reference consistency rate, relation judgment accuracy, and coordinate format validity rate. Common errors fall into four groups: missed detections that lower counts, confusion among same-category objects that scrambles ordering, occlusion that causes wrong attribute judgments, and invalid coordinate formats that break the pipeline. Tuning differs by group: the former cases need higher candidate recall and a second confirmation pass, while the latter need stronger format constraints and more tolerant parsing.
On the data side, it is recommended to build spatially annotated reasoning samples with coordinates, covering dense scenes, occluded scenes, and combinations of multiple relations, with difficulty layered as “single-step localization — multi-step relations — iterative correction.”
6. Engineering Deployment and Practices with Baidu AI Cloud
Putting this paradigm into production requires four general capabilities: a container platform to host inference services and handle elastic scaling; object storage for images and annotation data; a message queue to smooth traffic spikes and chain asynchronous correction tasks; and logging, monitoring, and alerting to track format validity rate, latency, and error distribution. Baidu AI Cloud offers standardized support in these general categories, which lets teams focus their effort on prompt design and the evaluation system.
A three-step rollout is recommended: first validate the effectiveness of coordinate constraints on an offline evaluation set; then bring in online traffic gradually and compare process-level metrics; finally establish an archival mechanism for coordinate evidence so that every conclusion can be traced back to an image region.
7. Limitations and Outlook
The paradigm is not a cure-all. Coordinate stability still degrades for extremely tiny targets, severe occlusion, non-rigid deformation, and cross-image comparison. Coordinate output also increases token consumption and inference latency, so accuracy must be traded off against cost. Promising directions include hierarchical primitives (region—instance—part), coordinate output with confidence scores, and turning spatial assertions into intermediate representations that can be checked automatically, moving multimodal reasoning from “plausible description” to “verifiable evidence.”
