Why Multimodal Models Need Visual Primitives
This article explains why many multimodal models still fail on tasks such as dense counting, locating similar objects, and fine-grained spatial reasoning, even when image resolution is adequate. The core issue is the Reference Gap: natural language references drift during multi-step reasoning. Visual primitives address this by introducing stable, unambiguous pointers into the reasoning chain. The article also covers practical engineering guidance, including environment self-checks, parameterized configuration, tiling strategies, output constraints, result verification, and a three-layer evaluation approach across perception, reference, and task accuracy.
1. Where the Problem Starts: A Configuration Detail That Exposes Toolchain Maturity
When developers first integrate multimodal capabilities, the first obstacle is often not model quality but toolchain consistency. A typical scenario: the configuration example in the official documentation does not match the format that actually takes effect locally. A user edits the configuration file as documented, but the capability stays disabled. What actually works is upgrading the command-line tool to a specified version and then selecting the runtime mode through startup parameters. This kind of friction is not technically complex, but it raises the barrier to trying the capability and makes developers doubt the reliability of everything that follows.
From an engineering perspective, this points to a general principle: any developer-facing capability release should ship three things together — a version-pinned tool, a reproducible configuration sample, and an environment check script that can be validated automatically. In Baidu AI Cloud’s multimodal product practice, deliverables are likewise organized as a version declaration, a minimal runnable example, and a self-check command, so that documentation and implementation do not drift apart.
2. Capability Boundaries: From “Not Seeing Clearly” to “Not Pointing Accurately”
Failures of multimodal models on image tasks fall roughly into two categories.
The first is the Perception Gap: the model never actually parses the details in the image. Resolution, tiling strategy, and how much information the visual encoder retains all affect this layer.
The second is the Reference Gap, which is more hidden and more critical. Even if the model has “seen” the scene clearly, as long as it can only refer to targets in natural language during reasoning, it will break down logically on tasks such as dense counting, locating multiple objects of the same kind, and judging fine-grained spatial relationships. The reason is that natural language reference is inherently ambiguous: expressions like “the one on the left” or “the second one near the edge” drift across contexts. Once a reference shifts in a long reasoning chain, every subsequent step fails with it.
3. How Visual Primitives Work
The core idea of visual primitives is to establish an unambiguous pointer for each object in continuous visual space. Instead of compressing a target into a sentence of natural language, the target exists in coordinate or feature space in a form that is computable, comparable, and composable, so that every step in the reasoning chain can refer back precisely to the same entity.
It helps to think of this as introducing variable references into the reasoning process, rather than passing values every time:
# Natural language reference: the meaning drifts"Compare the size of the red square on the left with the red square above it"# Primitive reference: stable reference, traceablep1 = locate(shape=rect, color=red, rank_from_left=1)p2 = locate(shape=rect, color=red, rank_from_top=1)result = compare_area(p1, p2) # p1/p2 keep the same target across the whole reasoning chain
This design brings three direct benefits. Counting changes from estimation to enumerating and then taking the cardinality. Localization can output stable coordinates instead of vague descriptions. And intermediate results of multi-step reasoning can be verified and rolled back, which significantly reduces error accumulation.
4. Engineering Practice: Configuration, Invocation, and Tuning
At the general engineering level, the recommended order is as follows.
- Environment self-check. Pin the tool version, get the text-only pipeline working first, then enable visual capabilities, so that configuration problems are not mistaken for model problems.
- Parameterized configuration. Put the model identifier, image input method, resolution limit, and output granularity into a separate configuration file, and distinguish environments through environment variables. Example:
{"model": "vision-capable-default","image": { "max_side": 1536, "tiling": true },"output": { "primitives": true, "return_coords": true }}
- Resolution and tiling strategy. For scenes with dense small targets, raise the effective resolution first and combine it with tiled inference, then globally deduplicate and merge the tiled results.
- Prompt and output constraints. Require the model to explicitly output the target list and coordinates rather than only a conclusion, so the output can be validated programmatically.
- Result review. For counting tasks, run a second consistency check (for example, comparing the sum of tiled counts against the global count) and trigger re-inference when they disagree.
5. Evaluation Methods and Common Pitfalls
Evaluation should be split into three layers of metrics: the perception layer (whether there are missed or false detections), the reference layer (whether the same entity keeps the same reference across the reasoning chain), and the task layer (the final accuracy of counting or localization). Watching only the task layer makes it easy to misdiagnose a reference problem as “the model is not strong enough.”
Common pitfalls include attributing errors caused by insufficient resolution to reasoning ability, using a single natural language description as a reference while expecting stable output, and ignoring tool version differences when comparing results across environments that are not reproducible.
6. Conclusion
The reliability of multimodal capability comes half from how deeply the model parses visual information, and half from whether references stay stable during reasoning. Visual primitives provide exactly the infrastructure the latter needs. For developers, the most reliable path to a usable multimodal application is to get the toolchain and configuration solid first, then organize evaluation across the three layers of perception, reference, and task. When deploying on Baidu AI Cloud, this can be closed into a loop from data ingestion to regression testing by combining general capabilities such as object storage, container platforms, log services, and monitoring and alerting.
