Visual Primitives for Multimodal Models: Bridging the Perception and Reference Gaps in Visual Reasoning
This article examines visual primitives as a technical approach to visual reasoning in multimodal models. It explains two core failure modes—the perception gap and the reference gap—and compares coordinate-based visual primitives with natural-language description and image-based reasoning workflows. It also covers configuration and debugging practices for agent toolchains, evaluation methods for testing whether visual primitives are active, and a best-practice checklist for developers building multimodal agents.
1. Introduction: From “Seeing Images” to “Seeing Clearly and Referring Accurately”
Over the past year, multimodal large models have shifted from demonstrating basic image recognition toward reliably performing counting, localization, navigation, and planning in complex visual scenes. In practice, developers often run into a familiar pattern: a model performs well in a demo environment, but after moving to a web interface or an agent environment, dense-object counting drifts, maze path planning fails, and localization of complex objects becomes unstable. These issues are not simply a matter of the model “not seeing.” They are systems engineering problems involving how visual information is encoded, how it is referenced, and how it is carried reliably through a reasoning chain.
This article uses the general technical concept of visual primitives as its core and discusses two typical approaches to visual reasoning in multimodal models. Combined with configuration and evaluation practices for agent toolchains, it presents a reusable analysis framework.
2. Root Causes: The Perception Gap and the Reference Gap
2.1 Perception Gap
The perception gap occurs when a model receives image input, but the features extracted by the visual encoder are insufficient to support fine-grained recognition. Typical symptoms include missed small objects, blurred boundaries in dense scenes, and information loss in low-contrast regions. Common engineering remedies include increasing input resolution, using tiled encoding, and introducing multi-scale feature fusion.
2.2 Reference Gap
Even when perception is solved, a model can still fail because the reasoning stage continues to rely on natural language to describe objects in an image. Natural language is inherently ambiguous when it comes to reference:
- Expressions like “the one on the left” or “the few near the top” lack unique coordinates.
- During dense counting, language cannot reliably maintain the state of “already counted” versus “not yet counted.”
- In multi-step planning, an object referenced in the previous step can be rebound in the next step, causing logical drift.
The reference gap, therefore, comes down to this: visual space is continuous, while language symbols are discrete and fuzzy, and there is no stable mapping between the two.
3. Approach Comparison: Continuous Visual Pointers vs. Natural-Language Description
3.1 The Visual Primitives Approach
The core idea of visual primitives is to introduce unambiguous pointers into continuous visual space, anchoring targets directly with structured geometric objects. Common primitive types include:
- Point: marks a center position or a key anchor.
- Polygon: outlines the boundary of an irregular region.
- Box: quickly frames a candidate target.
At the vocabulary level, these schemes typically introduce paired structured markers, such as start and end markers for points, polygons, and boxes. Instead of outputting “the one in the upper-left corner,” the model outputs a set of coordinate-based primitives, which an external execution layer then parses into concrete operations. The advantages are:
- Unique reference: coordinates serve as identity, avoiding language ambiguity.
- Maintainable state: counting tasks can be completed by deduplicating the primitive set.
- Composability: points, boxes, and polygons can be chained into planning paths or region partitions.
Illustrative representation (not a specific interface):
Input: image + task instructionModel output:<point>(x1, y1)<polygon>(x2,y2)(x3,y3)...<box>(x4,y4,x5,y5)Execution layer: parse primitives -> deduplicate/sort/concatenate paths -> return structured results
3.2 The “Thinking with Images” Approach
Another common approach is to have the model repeatedly invoke image operations during reasoning, such as cropping, zooming, annotating, and re-inputting. This is closer to the human process of “looking and gesturing at the same time.” It integrates easily with agent toolchains in engineering terms, but places higher demands on tool-call stability, context-length management, and error recovery mechanisms.
3.3 Engineering Trade-offs Between the Two Approaches
- If the task centers on dense counting and precise coordinate localization, visual primitives offer greater stability in reference.
- If the task centers on multi-step exploration and environment interaction, thinking with images combined with a toolchain is more flexible.
- Production systems often adopt a hybrid strategy: use primitives for precise anchoring and tool calls for exploration and verification.
4. Configuration and Debugging in Agent Toolchains
4.1 The Trouble Caused by Inconsistent Configuration Entry Points
In real-world multimodal agent deployments, the first obstacle developers encounter is often not model capability but unintuitive configuration: official documentation examples that do not match command-line parameters, configuration file formats not explained in a prominent place, and old configurations breaking after an upgrade. These issues can significantly raise the cost of trial and error.
Recommended engineering practices:
- Confirm the toolchain version first, then read the configuration instructions for that version.
- Centralize parameters such as the model identifier and runtime mode into a unified configuration file rather than scattering them across the command line.
- Add a “configuration validation” step to continuous integration to catch missing fields or invalid values early.
Illustrative configuration (generic format, not a specific product):
{"model": "vision-reasoning-exp","profile": "web","runtime": {"max_image_tiles": 8,"enable_visual_primitives": true}}
4.2 Inconsistent Results Caused by Version Drift
When the same model behaves differently across entry points (demo environment, web interface, agent), common causes include different image preprocessing parameters, different context truncation strategies, different tool-call permissions, and different system prompts. During evaluation, variables must be held fixed and investigated one by one, rather than attributed directly to the model itself.
5. Evaluation Methods: Verifying Whether Visual Primitives Actually Work
5.1 Design Decidable Tasks
- Dense counting: given an image containing many objects of the same type, compare the output count against manual annotation.
- Maze navigation: given a start and end point, evaluate path connectivity and step count.
- Region localization: require the output of a target’s bounding box or polygon, and compute the intersection-over-union (IoU).
5.2 Inspect the Output Structure
If the output contains structured geometric markers that can be parsed into a set of coordinates, the primitive pathway is active. If the output is only natural-language description, it more likely follows a pure language-reference path.
5.3 Ablation Comparison
Fix the image and prompt, then enable and disable the primitive capability separately, and observe changes in counting error, localization IoU, and planning success rate. This quantifies the actual benefit of the technical approach.
6. Best-Practice Checklist
- Prioritize preprocessing: high resolution, tiled encoding, and contrast enhancement are often more effective than switching models.
- Structure references: for tasks involving coordinates, require structured output.
- Externalize state: hand counting and planning state to the execution layer, avoiding having the model “do mental math” in language.
- Consolidate the toolchain: unify the configuration entry point, lock versions, and add automated validation.
- Close the evaluation loop: build a repeatable fixed test set and continuously track version drift.
7. Conclusion
The value of visual primitives lies not in replacing language, but in providing a stable “addressing system” for visual reasoning. Only when a model shifts from “describing a scene in language” to “referring to a scene by coordinates” do dense counting, precise localization, and multi-step planning become engineering-viable. For developers, understanding the boundary between the perception gap and the reference gap, and mastering configuration and evaluation debugging methods, is what helps avoid detours when deploying multimodal agents.
