Bridging the Reference Gap in Multimodal Reasoning with Spatial Markers

    This article examines the Reference Gap in multimodal reasoning, where models identify objects correctly but lose track of them across multi-step inference. It explains how marker-based chain-of-thought inserts explicit box and point markers into the reasoning trace to anchor language references to spatial coordinates. The article covers the three-stage architecture with visual compression, the data construction strategies required to make markers effective, evaluation dimensions beyond final accuracy, and a minimal integration loop for production systems.

    1. The Problem: Why Complex Visual Reasoning Gets It Right but Thinks Wrong

    A common failure mode shows up in real multimodal applications: single-point recognition works fine, but the model loses focus in the later stages of multi-step reasoning. Ask a model to count a dense crowd, trace the endpoint of a curve, or decide whether a maze is passable, and it will often describe the opening steps correctly before confusing objects, missing counts, double-counting, or reversing spatial relationships.

    The root cause is not weak visual perception. It is the lack of a stable binding between the language reasoning chain and the image entities. The industry generally summarizes this as the Reference Gap.

    The process is analogous to how a person behaves when walking through a maze or counting dense objects: they naturally point at a location with a finger to reduce cognitive load and stay logically consistent. The finger does not perform recognition; it performs anchoring, fixing an abstract “it,” “this,” or “next” to a concrete spatial coordinate. Abstracting this mechanism into the model’s reasoning process is the core idea behind marker-based chain-of-thought.

    2. Core Idea: Spatial Markers as Precise Pointers Between Language and Image

    The key design of this framework is to insert explicit spatial markers into the chain-of-thought, so every reasoning step carries a verifiable spatial reference instead of relying on natural-language pronouns alone.

    • Box markers: written into the chain-of-thought with the structure “reference start + target placeholder + reference end + box sequence + box end.” The placeholder stands for the referenced object, and the box sequence provides one or more normalized coordinate rectangles.
    • Point markers: replace the target placeholder with a point sequence to express center points, keypoints, or trajectory sample points.

    Illustrative representation (pseudo-markers, used only to show the structure):

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

    This design delivers three engineering benefits. First, references are materialized as coordinates, so later reasoning steps can repeatedly cite the same marker and avoid reference drift. Second, markers can be verified programmatically, making it easy to determine automatically whether the model pointed at the wrong object. Third, the marker sequence itself forms an intermediate supervision signal, making long-chain reasoning failures traceable and attributable.

    3. Architecture: Three-Stage Multimodal Design and Visual Compression

    This class of solution typically follows the classic three-stage structure rather than an end-to-end raw multimodal approach:

    1. Visual encoder: an in-house visual backbone that supports arbitrary-resolution input, avoiding the small-object loss caused by fixed-size cropping.
    2. Visual compression mechanism: an attention-based compression mechanism that reduces the key-value cache of visual tokens by several times at the end of encoding, significantly amortizing sequence-length cost at high resolution.
    3. Language model backbone: a sparsified language model with a small number of activated parameters (a large gap between total and activated parameters), carrying long chains of thought while keeping inference cost controllable.

    The engineering implication is clear: the token explosion caused by high resolution is the main cost source for long-chain visual reasoning, and the compression ratio together with the activated parameter count determines the usable budget per inference. In practice, treat “resolution, compression ratio, chain-of-thought length” as a coupled set of parameters to stress-test together, rather than tuning each one in isolation.

    4. Data Construction: The Decisive Factor for Marker-Based Chains

    Whether the framework succeeds depends on training data that teaches the model when to point, where to point, and how to use the marker afterward. Four data construction paths can be summarized:

    • Rewriting detection and localization data: convert existing box annotations into box-marker chains so the model learns to lock onto objects with boxes.
    • Rewriting point and keypoint annotations: convert them into point-marker chains to serve counting and keypoint localization.
    • Synthetic long-chain data: procedurally generate tasks such as mazes, curve tracking, and dense counting, automatically producing intermediate markers and final answers so that markers align strictly with reasoning steps.
    • Cleaning and aligning web-collected data: filter out samples with unreliable coordinates or inconsistent references, otherwise reference drift is amplified directly.

    Pretraining usually mixes open-source datasets with web-collected data at a scale of trillions of tokens. In practice, apply a dual filter of “marker validity check + answer consistency check,” and retain a portion of marker-free samples to prevent the model from becoming overly dependent on markers.

    5. Capability Boundaries and Common Pitfalls

    Objectively, this class of framework shows the clearest gains on counting, localization, and step-by-step spatial deduction, but it can still be unstable on tasks that require global geometric constraints or very many composite reasoning steps. Common pitfalls include treating markers as output decoration rather than reasoning anchors, misaligning markers with steps in the training data, and evaluating only final-answer accuracy while ignoring marker hit rate and duplication rate.

    Recommended evaluation dimensions: final-answer accuracy, marker localization hit rate, duplicate marker rate, reference drift distance, average chain-of-thought length, and end-to-end latency.

    6. Implementation: Integrating Marker-Based Reasoning into a Business System

    To build similar capability in your own system, the following minimal loop is a practical reference:

    1. Input layer: unify arbitrary-resolution preprocessing and coordinate normalization, and define the coordinate-system convention clearly.
    2. Inference layer: constrain the model to emit structured markers, and use schema validation to block invalid coordinates.
    3. Validation layer: deduplicate markers and check consistency, triggering a second inference pass when necessary.
    4. Observability layer: use logging services and monitoring alerts to track marker hit rate, chain length, and latency.
    5. Resource layer: offload visual features and intermediate results to object storage, and schedule batch evaluation elastically through a container platform.

    On Baidu AI Cloud, these stages can map to combinations of general cloud product categories: object storage for samples and features, a container platform for batch evaluation, and logging plus monitoring alerts to support a quality dashboard. This upgrades the system from “able to point” to “pointing accurately, measurably, and with regression coverage.”