Spatial Referring in Multimodal Visual Reasoning: How Spatial Markers Anchor the Chain of Thought
This article explains why complex multimodal visual reasoning tends to lose focus, and how spatial referring addresses the problem. It covers the core "reference gap" behind object confusion, repeated counting, and inverted spatial relations; a three-stage architecture built around a visual encoder, an alignment layer, and a language model backbone; a structured marker protocol that lets the model emit bounding boxes and points directly inside its reasoning chain; data construction principles for reasoning-to-referring alignment; and engineering practices for the inference stage, including format validation, coordinate normalization, self-consistency, and observability. It closes with the framework's current limitations and possible improvements.
1. Background: Why Complex Visual Reasoning Loses Focus
In real deployments of multimodal large models, simple image captioning and single-object recognition are no longer the main bottleneck. What actually caps model capability is multi-step visual reasoning in complex scenes: counting dense crowds, tracing the endpoint of a curve, judging path connectivity, or comparing the spatial relations among several candidate regions. These tasks share three traits: long reasoning chains, many objects involved, and deeply nested spatial relations.
A pattern is widely observed in practice: the model often identifies the target correctly at the start of reasoning, but as the chain of thought advances, it gradually starts confusing objects, counting the same object twice, missing detections, and reversing spatial relations. The underlying cause can be summarized as a “reference gap”: every referring expression in the language reasoning process (such as “this one,” “that one,” or “the rightmost”) lacks a strong binding to physical image coordinates, so the model loses its anchor during multi-step derivation.
When humans face the same kind of problem, they instinctively point, circle, and gesture, using external actions to reduce cognitive load. Abstracting that mechanism to the model level gives the core idea discussed here: embed spatial markers as precise pointers between language and vision directly inside the chain of thought.
2. Core Framework: A Three-Stage Architecture with Spatial Marker Embedding
2.1 The Classic Three-Stage Architecture
Approaches of this kind typically reuse a mature three-stage multimodal architecture rather than an end-to-end native multimodal structure:
- Visual encoder: a vision backbone that accepts arbitrary input resolutions, avoiding the detail loss caused by fixed-size cropping. To control long-sequence overhead, a key-value cache compression mechanism can be added at the output, compressing visual tokens by a multiple factor, which substantially lowers inference cost while preserving high-resolution perception.
- Connector and alignment layer: maps the compressed visual representations into the semantic space of the language model.
- Language model backbone: a sparse structure with a large total parameter count but a small number of activated parameters per pass, balancing quality and throughput.
The benefit of this division of labor is engineering controllability: the vision side focuses on resolution and compression ratio, the language side focuses on reasoning and planning, and the two sides are decoupled through a token protocol.
2.2 How Spatial Markers Enter the Chain of Thought
The key design is a structured marker protocol that lets the model “output coordinates” directly while generating reasoning text. An illustrative example of the protocol shape (format demonstration only):
Reasoning step: locate the target first<|ref|>the rightmost pedestrian<|/ref|><|box|>[[x1,y1,x2,y2],[x3,y3,x4,y4]]<|/box|>Then determine whether this target intersects the boundary ...
For point markers, a sequence of point coordinates replaces the target placeholder:
<|point|>[[x1,y1],[x2,y2]]<|/point|>
This has three engineering implications:
- Alignable: coordinates are the only unambiguous anchor between vision and language.
- Verifiable: downstream rules or tools can check whether coordinates are out of bounds or duplicated.
- Traceable: every “pointing” action in the reasoning chain is explicitly recorded, making it easy to locate where an error occurred.
3. Data Construction: The Factor That Decides Success
The marker protocol itself is not complicated; the hard part is data. Without large-scale, high-quality “reasoning-to-referring” alignment data, the model only learns the output format and never learns to point correctly. In practice, data is usually built from three sources:
- Open-source annotated datasets: provide basic bounding box and point annotations.
- Web collection and automatic annotation: expand long-tail and dense scenes.
- Programmatic synthetic data: use controllable scene generators to mass-produce combined tasks such as counting, paths, occlusion, and mirroring, with ground-truth coordinates generated automatically.
Data construction should follow several principles:
- Strict co-distribution of coordinates and text: referring expressions must appear immediately adjacent to their coordinates, so the model does not pick up the bad habit of “finishing the sentence and appending coordinates afterward.”
- Sufficient negative samples: include cases such as “target does not exist” and “target is occluded” to suppress hallucinated coordinates.
- Difficulty stratification: bucket data by object count, occlusion ratio, and number of reasoning steps to enable curriculum-style training.
- Format consistency: brackets, separators, and numeric precision in markers must be globally uniform, otherwise generation stability breaks.
The pre-training stage generally reuses existing corpora and collected data and consumes a large volume of tokens; instruction tuning then solidifies the full chain of “look at the image, point, reason, answer.”
4. Engineering Practices for the Inference Stage
Even when a model has spatial marker capability, deployment still requires supporting engineering constraints; otherwise online behavior fluctuates noticeably. The following are recommended on the serving side:
- Upfront format validation: parse generated markers syntactically, and trigger resampling immediately on invalid coordinates.
- Coordinate normalization: use relative coordinates uniformly to avoid scale drift across inputs of different resolutions.
- Multi-candidate self-consistency: sample the same question multiple times and take the result with the most concentrated coordinate distribution.
- Step-level caching: reuse the key-value cache of the visual encoding to reduce the cost of follow-up questions.
- Observability: log the coordinates and confidence of each pointing step, and combine logging services with monitoring and alerting to locate regressions.
For a cloud implementation, object storage can hold images and intermediate artifacts, a container platform can host the inference service, a message queue can absorb traffic spikes, and a logging and monitoring system can track long-tail failure samples, forming a closed iteration loop.
5. Limitations and Directions for Improvement
It should be stated objectively that this kind of framework is not a universal solution. Complex spatial logical reasoning, such as multi-constraint path connectivity and dense scenes requiring global counting, remains a weak spot. The reasons include: coordinate precision is constrained by the resolution and compression ratio of the visual encoder; the longer the chain of thought, the more easily early anchors are diluted; and synthetic data differs from the real distribution.
Possible improvements include adaptive compression instead of a fixed compression factor, an explicit “look-back” mechanism during reasoning to re-anchor, an external rule engine to verify counting tasks, and routing to different reasoning budgets by task type. Overall, treating spatial markers as first-class citizens of the chain of thought is currently the most direct way to mitigate the reference gap, and its real value lies in moving multimodal reasoning from “vague description” toward something “locatable and verifiable.”
