Visual Reference in Multimodal Models: From Language Descriptions to Spatial Grounding

    This article examines why multimodal models can describe images fluently yet struggle with counting, object identification, localization, and multi-step spatial reasoning. It distinguishes perception gaps from reference gaps, introduces structured visual pointers and image-based tool use, and outlines evaluation methods and engineering practices for more reliable visual reasoning.

    1. The Problem: Recognition Does Not Guarantee Accurate Counting

    When multimodal models process images, their overall descriptions are often fluent, while answers to detailed questions can be unstable. Typical examples include counting people in crowded scenes, distinguishing visually similar objects, locating partially occluded targets, and planning paths through maze images that require multi-step spatial reasoning.

    The gap between a model’s performance in official demonstrations and the experience users get through a general-purpose interface can be significant. Differences in input resolution, preprocessing, or sampling parameters may contribute to this gap. In other cases, the reasoning pipeline itself may be unreliable.

    For this reason, visual capabilities should be analyzed by separating two questions:

    1. Can the model see the image clearly?
    2. Is the reasoning result correct?

    2. Two Bottlenecks: The Perception Gap and the Reference Gap

    The perception gap occurs when the vision encoder cannot extract enough information from the image. Small objects, low-resolution regions, and severe occlusion can all lead to information loss. Typical mitigation strategies include increasing the input resolution, processing the image in tiles, or improving the vision encoder.

    The reference gap occurs when the model uses natural language to refer to objects during reasoning. For example, “the third person from the left wearing red” may correspond to multiple candidates in a crowded scene. During a long reasoning chain, the model may also silently switch the object being referenced.

    In counting tasks, the model may count the same person more than once or miss an occluded individual. These errors do not necessarily mean that the model failed to see the image. They may instead result from unstable object references.

    The two bottlenecks require different solutions. The perception gap depends on better visual representations, while the reference gap requires more precise intermediate representations.

    3. Visual Pointers: Replacing Natural-Language References with Structured Coordinates

    The core idea behind visual pointers is to represent objects during reasoning as structured markers in the image coordinate space rather than as natural-language phrases. Common forms include:

    • Points: A set of two-dimensional coordinates representing an object’s center or a key location.
    • Boxes: The coordinates of the top-left and bottom-right corners of a rectangular object region.
    • Polygons: An ordered sequence of vertices for irregularly shaped regions.

    Coordinates are typically normalized by dividing pixel values by the image width or height and mapping them to the range from 0 to 1. This makes the coordinates independent of the input resolution and easier to transfer across images of different sizes.

    The following example illustrates how pointers can be organized in a reasoning trace. The field names are for demonstration purposes only:

    1. from dataclasses import dataclass
    2. from typing import List, Tuple
    3. @dataclass
    4. class BoxRef:
    5. ref_id: int # Globally unique object ID
    6. label: str # Semantic label, such as "person"
    7. box: Tuple[float, float, float, float] # (x1, y1, x2, y2), normalized coordinates
    8. @dataclass
    9. class ReasoningStep:
    10. text: str # Natural-language reasoning for this step
    11. refs: List[BoxRef] # Visual objects referenced or added in this step

    The key design principle is that the same object is referenced by its ID in later steps instead of being described again in natural language. The ID consistently points to the same bounding box, reducing ambiguity.

    Counting can also be converted into a workflow that outputs one box per object and removes duplicates by ID. The final count is then the number of unique boxes.

    4. Thinking with Images: Visual Reasoning Through Tool Calls

    Another approach does not require the model to output coordinate-based reasoning directly. Instead, the model generates requests to manipulate the image, such as cropping a region, enlarging a detail, marking an object, or drawing an auxiliary line. An external program executes the requested operation and returns the processed image to the model as a new input. This approach is often referred to as thinking with images.

    Its advantages include:

    • Intermediate results are images, making it easier for people to inspect what the model saw at each step.
    • Existing image-processing libraries can be reused directly, reducing implementation effort.
    • It can work with models that do not natively support coordinate output.

    The trade-offs are also clear:

    • Each operation requires an additional reasoning and execution round trip, so latency and cost increase with the number of steps.
    • The external orchestrator must handle tool interfaces, parameter validation, and error recovery, increasing system complexity.
    • If the model selects the wrong crop, subsequent reasoning may be systematically misdirected, and the error can be difficult to correct automatically.
    Dimension Visual pointers Thinking with images (tool calls) Pure natural-language descriptions
    Reference stability Relatively high; depends on object IDs Moderate; depends on crop accuracy Relatively low
    Reasoning latency Relatively low Relatively high Relatively low
    Explainability Coordinates can be checked directly Intermediate images can be inspected directly Depends on textual descriptions
    Engineering complexity Requires coordinate parsing and validation Requires tool orchestration and control logic Lowest

    5. How to Evaluate Visual Reasoning

    Evaluation should not rely on a small number of demonstration examples. A fixed test set should be created for each task type and should cover the following dimensions:

    1. Counting: Measure the absolute error between the predicted count and the ground truth, and report results by scene density.
    2. Localization: Calculate the intersection over union (IoU) between predicted and ground-truth boxes, then measure the hit rate at a selected threshold.
    3. Relative position: Measure accuracy for spatial relationships such as “on the left” and “occluded.”
    4. Path planning: For grid or maze images, verify that the proposed path is connected and does not pass through obstacles.

    The IoU can be calculated as follows:

    1. def iou(a, b):
    2. """Calculate the intersection over union of two boxes (x1, y1, x2, y2)."""
    3. ix1, iy1 = max(a[0], b[0]), max(a[1], b[1])
    4. ix2, iy2 = min(a[2], b[2]), min(a[3], b[3])
    5. inter = max(0.0, ix2 - ix1) * max(0.0, iy2 - iy1)
    6. area_a = (a[2] - a[0]) * (a[3] - a[1])
    7. area_b = (b[2] - b[0]) * (b[3] - b[1])
    8. union = area_a + area_b - inter
    9. return inter / union if union > 0 else 0.0

    The following variables should also be controlled during evaluation:

    • Record the input image resolution, format, and preprocessing method to avoid hidden differences between access paths.
    • Fix the random seed or sampling temperature. Run the same sample multiple times and report the distribution of results rather than relying on a single run.
    • Separate model capability from integration-layer capability. The same model may produce different results when accessed through different clients or configurations, so reports should identify the access path and version.

    6. Configuration and Validation in Production

    When integrating multimodal capabilities, several practices are worth following.

    Centralize configuration. Model identifiers, version numbers, and tool parameters should be stored in configuration files or environment variables rather than hard-coded in application code. When tool dependencies are upgraded, their versions should be recorded.