Visual Referencing in Multimodal Reasoning: From Language Description to Precise Localization

    Multimodal large models excel at basic image understanding tasks but often struggle with precise counting, spatial localization, and multi-step path planning. This article explores the underlying challenges, specifically the perception gap and the reference gap. It analyzes two primary technical approaches—visual primitives and thinking with images—and provides insights into performance discrepancies, systematic evaluation methods, and practical engineering recommendations for building robust visual reasoning systems.

    1. Background: Seeing Images Does Not Mean Accurate Reasoning

    Multimodal large models can handle common tasks such as image description, question answering, and text recognition. However, in scenarios requiring precise counting, spatial localization, or multi-step path planning, the model’s output often deviates. The same model may exhibit noticeably different performance across different APIs and prompt formats.

    These issues cannot simply be attributed to “unclear images.” In engineering practice, the problem must be decomposed: Is the input image fully encoded? Can the model unambiguously reference specific objects in the image during the reasoning process? Is the final output consistent with the reasoning process?

    Understanding these steps is a prerequisite for evaluating and utilizing multimodal models.

    2. Two Key Concepts: Perception Gap and Reference Gap

    When discussing visual reasoning failures, the industry often distinguishes between different levels of causes using two concepts.

    2.1 Perception Gap

    The perception gap refers to the inability of the visual encoder to extract features sufficient for the task. Typical symptoms include missing small objects, losing fine textures, and unrecognizable text in low-resolution images.

    Common strategies to address the perception gap include:

    • Increasing input resolution or adopting dynamic patch encoding;
    • Using a stronger visual encoder;
    • Cropping and zooming in on key regions before inputting them.

    2.2 Reference Gap

    The reference gap occurs when the model has “seen” the image content but cannot unambiguously point to a specific object during reasoning. When a model relies solely on natural language to describe the image—for instance, “the third person in blue from the left”—the description might correspond to multiple entities, breaking the reasoning chain.

    Dense counting tasks are particularly vulnerable to this issue. The model needs to mark each counted object individually. If marking relies only on language descriptions, duplicate counting and omissions are almost inevitable.

    The difference between these two gaps is that the former is solved by improving the ability to “see,” while the latter is solved by changing the way to “point.”

    3. Two Main Technical Approaches

    3.1 Visual Primitives: Pointing Directly to Regions with Structured Markers

    The idea behind visual primitives is to have the model output structured spatial markers—such as point coordinates, bounding boxes, or polygons—as references to specific locations in the image. These markers appear alongside natural language, forming an unambiguous “pointer.”

    The following is an illustrative format to explain the structure of such output; it is not the actual syntax of any specific model:

    1. There are 3 targets in this image.
    2. Target 1: <box>0.12, 0.30, 0.25, 0.58</box>
    3. Target 2: <box>0.40, 0.28, 0.52, 0.60</box>
    4. Target 3: <box>0.71, 0.33, 0.83, 0.61</box>

    The advantages of this approach are:

    • Each reference corresponds to a unique spatial location, reducing duplicate counting;
    • Localization results can be directly used for subsequent geometric calculations, such as determining overlap or distance;
    • The output can be parsed and validated programmatically.

    The trade-off is that the training data must extensively include coordinate annotations, and the stability of the coordinate representation depends on training quality.

    3.2 Image Chain of Thought: Repeatedly Manipulating Images During Reasoning

    Another approach is often referred to as “thinking with images.” During reasoning, the model invokes image operations like cropping, zooming, rotating, and annotating, feeding the processed intermediate images back into the model to gradually gather evidence.

    A typical workflow is as follows:

    1. The model reads the original image and makes a preliminary judgment.
    2. It crops and zooms in on the questionable areas.
    3. It draws markers on the new image for the identified objects.
    4. Based on the annotated image, it completes the counting or localization and provides the conclusion.

    The advantages of this approach are:

    • No need to change the model’s output format; highly compatible;
    • Intermediate results can be manually inspected;
    • More intuitive judgment of detailed regions.

    The disadvantages include an increased number of reasoning steps, leading to higher latency and cost, and the potential introduction of errors at each step.

    3.3 Comparison of the Two Approaches

    Dimension Visual Primitives Image Chain of Thought
    Referencing Method Structured spatial markers Natural language plus image operations
    Counting Reliability Depends on marker stability Depends on image processing quality at each step
    Inference Latency Primarily single-pass generation Multi-round calls, higher latency
    Training Data Requirements Requires extensive coordinate annotations Lower annotation requirements
    Explainability Markers can be directly parsed Intermediate images can be directly viewed
    Engineering Complexity Requires parsing and validation Requires orchestrating image operation workflows

    The two approaches are not mutually exclusive. In practical systems, structured markers can be used for key steps, supplemented by image operations for complex regions.

    4. Why the Same Model Performs Inconsistently

    In practice, developers often find a gap between the results shown in official documentation or papers and their own tests. Common reasons include:

    • Input Processing Differences: Different APIs may handle image scaling, compression, and patching strategies differently, directly affecting detail recognition.
    • Prompt Template Differences: The wording of the prompt, whether coordinates are required in the output, and whether the output format is restricted can all alter the model’s reasoning path.
    • Sampling Parameter Differences: Settings like temperature and maximum output length affect the stability of counting tasks.
    • Task Distribution Differences: The benchmark test sets in papers often differ in style, resolution, and background complexity from actual business images.
    • Version Differences: Versions of the same product line released at different times may have shifting capability boundaries.

    Therefore, during evaluation, the complete call conditions must be recorded, including input preprocessing, prompt templates, parameters, and model versions. Without this information, results are difficult to reproduce and compare.

    5. How to Systematically Evaluate Visual Reasoning Capabilities

    It is recommended to design test sets from the following task categories, each covering different difficulty levels:

    • Counting Tasks: Stratified from few to many targets, including occlusions and dense arrangements;
    • Spatial Relationship Tasks: Determining left/right, up/down, containment, and adjacency relationships;
    • Path Planning Tasks: Providing steps from start to finish in a grid or maze image;
    • Fine-grained Localization Tasks: Requiring the output of the target’s location or region and checking the overlap with the annotated box.

    Below is an example of a general evaluation framework for batch running tests and calculating accuracy:

    1. import json
    2. from dataclasses import dataclass
    3. @dataclass
    4. class Case:
    5. image_path: str
    6. question: str
    7. expected: int
    8. def run_counting_eval(cases, call_model, repeat=3):
    9. """Repeatedly calls the model on counting samples to calculate accuracy and stability."""
    10. results = []
    11. for case in cases:
    12. answers = []
    13. for _ in range(repeat):
    14. raw = call_model(case.image_path, case.question)
    15. try:
    16. answers.append(int(raw.strip()))
    17. except ValueError:
    18. answers.append(None)
    19. correct = sum(a == case.expected for a in answers)
    20. results.append({
    21. "image": case.image_path,
    22. "expected": case.expected,
    23. "answers": answers,
    24. "accuracy": correct / repeat,
    25. })
    26. return results
    27. if __name__ == "__main__":
    28. cases = [Case("img/crowd_01.png", "How many people are in this picture?", 25)]
    29. def call_model(image_path, question):
    30. # Replace with the actual model call here; input preprocessing and parameters must be recorded
    31. return "25"
    32. report = run_counting_eval(cases, call_model)
    33. print(json.dumps(report, ensure_ascii=False, indent=2))

    When evaluating, also note the following:

    • The same sample should be sampled multiple times to observe the variance of the results, rather than looking only at a single run.
    • For counting or localization tasks, keep a manual review step to spot-check whether the model output aligns with the ground truth annotations.
    • The sample size must be sufficiently large and cover all difficulty levels to avoid drawing conclusions based on a few cases.
    • The evaluation report should note the test conditions for reproducibility.

    6. Engineering Implementation Recommendations

    6.1 Perform Structured Validation on Output

    If the model output contains coordinates or markers, parsing and range checks should be performed on the program side. For example, check whether the coordinates are between 0 and 1, whether the top-left of the box is less than the bottom-right, and whether the same object is recorded multiple times. Invalid outputs should trigger a retry or fallback mechanism.

    6.2 Add Secondary Verification for Critical Tasks

    For error-prone tasks like counting and localization, a dual-path verification approach can be adopted: one path provides the answer directly from the model, while the other cross-checks using image annotation or traditional vision algorithms. If the two disagree, it routes to manual review.

    6.3 Control Inference Costs

    The image chain of thought approach involves multiple calls. Set a maximum number of iterations and a timeout to prevent the reasoning process from expanding indefinitely. For simple tasks, prioritize single-pass generation.

    6.4 Manage Dependencies and Configurations

    A common issue when integrating a model is that the toolchain or client version does not match the official documentation. The following practices are recommended:

    • Rely on the latest version of the official documentation and record the version numbers used;
    • Manage configurations centrally, distinguishing the priority among command-line arguments, configuration files, and environment variables;
    • Review changelogs before upgrading dependencies and verify in a test environment first;
    • Do not configure production environments based solely on third-party tutorials or steps.

    7. Conclusion

    The visual reasoning capability of multimodal models depends on three layers: perception quality, referencing method, and reasoning workflow. Visual primitives resolve referencing ambiguity through structured markers, while the image chain of thought supplements evidence through multi-round image operations. Both approaches have their trade-offs.

    When selecting a solution, developers should make judgments based on task type, latency requirements, and cost budget, and verify the effectiveness through systematic evaluation. Completing output validation, secondary verification, and configuration management before going live can significantly reduce the risk of errors in visual reasoning tasks.