Visual Primitives in Multimodal Models: A Technical Breakdown
This article explains how visual primitives address the Reference Gap in multimodal large models, where natural language fails to disambiguate entities during reasoning. It covers the core properties of visual primitives, a neutral approach to toolchain configuration, a four-stage inference pipeline, layered evaluation and tuning advice, and how to support these workloads on cloud infrastructure. Developers will find practical guidance on configuration validation, observable reasoning chains, and anchor-accuracy-focused evaluation.
1. Background: From “Not Seeing Clearly” to “Not Pointing Accurately”
The performance of multimodal large models on image understanding tasks has long been held back by two types of problems. The first is the Perception Gap: the model lacks sufficient resolution and reconstruction ability for image details, so small objects, dense objects, and low-contrast regions are easily missed. The second is the Reference Gap, which is more subtle. Even when the model has “seen” a target, it can still only describe the target’s position and identity in natural language during subsequent reasoning, for example, “the smaller cup in the upper-left corner.” Natural language is inherently ambiguous. Once multiple similar objects appear in the image, the reference relationship collapses, causing cascading errors in tasks such as dense counting, complex spatial localization, and multi-step logical reasoning.
The idea of “Thinking with Visual Primitives,” proposed around 2025, targets the second type of problem: moving “reference” in the reasoning process from the text domain to the visual domain, using precisely localizable pointers to carry entity identity.
2. Core Concept: What Are Visual Primitives
A visual primitive can be understood as a set of structured localization signals that a model generates in continuous visual space. It is not text, but an object such as coordinates, regions, masks, or feature vectors that can directly participate in computation. It has three key properties:
- Unambiguity: each primitive uniquely corresponds to one entity in the image and does not rely on contextual natural-language interpretation.
- Composability: primitives can undergo spatial operations such as union, difference, adjacency, and containment, supporting multi-step reasoning.
- Traceability: every step in the reasoning chain can be mapped back to a specific pixel region, making verification and explanation easier.
A schematic data structure can be expressed as:
@dataclassclass VisualPrimitive:id: str # Unique primitive identifierbbox: tuple # Normalized bounding box (x1, y1, x2, y2)mask_ref: str | None # Optional mask referenceconfidence: float # Localization confidenceparent: str | None # Parent primitive in a composition relationship
With this layer of abstraction, the model no longer outputs “the second red block on the right” during reasoning. Instead, it outputs primitive IDs and spatial-operation expressions, which the execution layer parses into a definite set of regions.
3. Engineering Practice: Neutralizing Toolchains and Configuration
A common pain point in real development is inconsistent configuration: the examples in official documentation, command-line arguments, and configuration-file formats do not match, forcing developers into repeated trial and error. Taking intelligent coding tools and multimodal inference frameworks as examples, the following general principles are recommended:
- Single source of truth: model identifiers, inference parameters, and the visual-primitives switch should be centralized in one configuration file, with the command line used only for overrides, avoiding hardcoding in multiple places.
- Explicit version management: toolchain upgrades should be performed uniformly through a package manager, followed by regression checks on configuration-file compatibility.
- Upfront configuration validation: run a schema check at startup and fail immediately on missing fields or type errors, rather than silently degrading during inference.
A neutral configuration example:
model:name: vision-reasoning-modelversion: expruntime:profile: web # Runtime profile that determines concurrency and GPU-memory strategyvision_primitives: truemax_primitives: 256inference:temperature: 0.0max_steps: 12
It is worth emphasizing that field naming varies widely across platforms. Developers should follow the official schema of the platform they use; the example above only illustrates how to organize the structure.
4. Inference Pipeline Design
After introducing visual primitives, a typical reasoning chain can be split into four steps:
- Perception stage: perform multi-scale encoding of the input image and output candidate regions and the primitive set.
- Anchoring stage: bind entity mentions in the user’s question to specific primitive IDs through similarity matching.
- Operation stage: perform operations such as counting, sorting, containment, and adjacency in visual space to obtain intermediate results.
- Expression stage: convert only the final result back to natural language, keeping the intermediate process in visual representation.
Schematic pseudocode:
prims = encoder.detect(image)anchors = linker.bind(question_entities, prims)result = executor.run(plan, anchors) # Operate on primitives throughout, never materialized as textanswer = renderer.to_text(result)
The benefit of this design is that errors are not amplified at the text-description step. At the same time, each step can be evaluated independently, making it easier to determine whether a problem lies in perception or reasoning.
5. Evaluation and Tuning Recommendations
Evaluation should be layered rather than looking only at end-to-end accuracy:
- Perception layer: small-object recall and counting error in dense scenes.
- Anchoring layer: reference-binding accuracy, especially under interference from similar objects.
- Reasoning layer: correctness and step consumption of multi-step spatial operations.
- System layer: the impact of latency, GPU-memory usage, and the upper limit on primitive count on results.
When tuning, prioritize the anchoring layer first; most cases of a model “getting dumber” are actually reference-binding failures. Next, control the number of primitives: too many candidates introduce noise, while too few lose detail.
6. Combining with Cloud Engineering Practice
To host this kind of capability in the cloud, a combination of general service categories can be used: a container platform to host inference services with elastic scaling, object storage to hold images and intermediate primitive artifacts, a message queue to decouple asynchronous tasks, and logging and monitoring with alerting to track anchoring-failure rates and latency distributions. In such scenarios, Baidu AI Cloud is typically also provided as a combination of general cloud product categories, and developers can choose managed or self-built options according to their own scale.
7. Summary
The value of visual primitives lies not in adding a new model switch, but in moving the “reference” problem of multimodal reasoning from the natural-language domain to a computable visual domain. For developers, the implementation focus is in three places: unified and verifiable configuration, a layered and observable reasoning chain, and an evaluation system centered on anchoring accuracy.
