Solving the Reference Gap in Multimodal Reasoning with Spatial Markers

    This article examines why multimodal models often describe a single image accurately yet fail during multi-step reasoning, a problem caused by the Reference Gap where each reference in a reasoning chain lacks a unique, stable anchor in the image. It explains a framework that embeds spatial markers, such as bounding boxes and points, directly into the chain of thought, outlines a typical three-stage architecture, and details the data construction and evaluation practices needed to make spatial grounding reliable. Readers will learn how to measure reference consistency, tune common failure modes, and prioritize data quality before reasoning depth.

    1. Background: Why Multimodal Reasoning Sees Clearly but Points Wrong

    A recurring pattern in real-world multimodal applications is that a model can describe a single image accurately, yet its answer quality drops sharply once it enters multi-step reasoning, such as counting a dense crowd, deciding whether a maze is connected, or tracking the endpoint of a curve. The errors are usually not a failure to see, but a failure to point at the right object midway through: missed counts, repeated counts, confusion between similar targets, and inconsistent spatial relationships.

    This can be abstracted as a Reference Gap: every reference in a language reasoning chain needs a unique, stable anchor in the image coordinate system. When that anchor is missing or drifts, the longer the reasoning chain, the more severely errors accumulate. When humans count dense objects or probe a maze, they instinctively gesture with a finger to reduce cognitive load. Abstracting that behavior into the model’s reasoning process means having the model output locatable spatial coordinates while it thinks.

    2. Core Idea: Writing Spatial Markers into the Chain of Thought

    The key design of this framework is to use spatial markers as precise pointers between language and vision, embedded directly into the chain of thought to enable “point and reason at the same time.”

    • Box form: wrap the target name in placeholders, followed by multiple groups of normalized box coordinates, supporting one reference mapped to multiple instances.
    • Point form: replace the placeholder with multiple groups of point coordinates, suitable for localization tasks such as keypoints, endpoints, and centers.

    An illustrative marker structure is shown below (coordinates are normalized relative values, expressing format only):

    1. <|ref|> target placeholder <|/ref|>
    2. <|box|> [[x1,y1,x2,y2], [x3,y3,x4,y4], ...] <|/box|>
    3. <|point|> [[x1,y1], [x2,y2], ...] <|/point|>

    The value of this design lies in three points. First, coordinates become first-class citizens of the reasoning chain, so the model can “look back” at where it is pointing at every step. Second, references are made explicit, reducing ambiguity from pronouns and omissions. Third, coordinates can serve as an intermediate supervision signal, making training and debugging easier.

    3. Typical Architecture: Three Stages Rather Than End-to-End Native Multimodal

    From an engineering reproducibility standpoint, such systems typically adopt the classic three-stage structure rather than a native multimodal model trained from scratch:

    1. Vision encoder: use a vision backbone that supports arbitrary resolution, avoiding destructive cropping for aspect ratio and scaling; under high compression, an attention compression mechanism can further compress the key-value cache of visual tokens, significantly reducing sequence length and memory usage.
    2. Cross-modal alignment layer: project visual features into the language space, where the trade-off between compression rate and detail retention matters, and dense small-object scenarios are especially sensitive.
    3. Language model: adopt a sparse-activation parameter configuration (large total parameters, small activated parameters per pass), preserving strong multi-step reasoning ability while keeping inference cost controllable.

    It should be emphasized that the above is a general industry architecture paradigm; specific compression ratios and parameter scales are implementation details of each vendor and should not be assumed as fixed conclusions in a solution design.

    4. Data Construction: The Real Difficulty That Determines Success

    The framework itself is not complex; the difficulty lies in teaching the model “when to point, where to point, and how many to point at.” Data construction can follow these layers:

    • Pre-training stage: rely mainly on existing public datasets and web-collected data, aiming to build a basic “language description to spatial coordinate” alignment, which typically requires a large token budget.
    • Instruction tuning stage: construct multi-step reasoning samples with coordinate annotations, covering counting, localization, path judgment, chart reading, and other tasks, while ensuring coordinate consistency (the coordinates of the same reference must not drift across the entire chain).
    • Hard-example reinforcement stage: specifically add difficult samples such as dense small objects, occlusion, mixed similar categories, and long-chain reasoning.

    A minimal usable sample organization example:

    1. {
    2. "image": "scene.jpg",
    3. "question": "How many people wearing red are in the image?",
    4. "reasoning_with_pointer": [
    5. "First locate candidate targets <|ref|>people wearing red<|/ref|><|box|>[[0.12,0.30,0.20,0.55]]<|/box|>",
    6. "Expand one by one <|point|>[[0.31,0.42],[0.48,0.44]]<|/point|>",
    7. "After deduplication, the count is 3"
    8. ],
    9. "answer": "3"
    10. }

    5. Evaluation and Tuning: Turning “Pointing Wrong” into a Quantifiable Metric

    It is recommended to split evaluation into two layers: answer accuracy and reference consistency. The latter can be measured by the match between coordinates and annotated boxes, the repeated counting rate, and the coordinate drift rate. Common tuning practices include preserving more visual-side resolution, reducing overly aggressive token compression, enforcing “locate before counting” in the reasoning chain, and performing segmented verification for long chains.

    The author has observed that underperformance on complex spatial logical reasoning is often not because the framework is ineffective, but because visual details are lost during compression, long-chain spatial samples are insufficient in the training data, or the coordinate normalization convention is inconsistent with the input resolution at inference time.

    6. Implementation Recommendations

    To reproduce similar capabilities in your own business, you can first build training and inference pipelines on a container platform, use object storage to manage image-text samples, and use logging services and monitoring alerts to track reference consistency metrics; on the model serving side, use batching and caching optimizations to control cost. The general cloud infrastructure offerings from Baidu AI Cloud can serve as an optional foundation for hosting such multimodal experiments and deployments. The overall route is: solve the reference anchor first, then discuss reasoning depth; make data consistency solid first, then pursue longer chains of thought.