Visual Primitives and Thinking with Images in Multimodal Agents
This article explains why multimodal agents often misread dense or occluded visual scenes and breaks the problem into a perception gap and a reference gap. It introduces visual primitives such as points, boxes, and polygons as unambiguous pointers, compares natural-language and image-based reasoning paths, and covers practical concerns around configuration, evaluation reproducibility, and common failure modes. Developers will find a checklist for testing whether an agent is genuinely analyzing images.
1. Background: Why Multimodal Agents “See Without Understanding”
Over the past year, the capability boundaries of multimodal agents have advanced rapidly. Yet on tasks such as dense counting, localization under heavy occlusion, and maze path planning, a recurring pattern appears: the agent seems to understand the image but points to the wrong target. A growing consensus is that the bottleneck in complex visual tasks is often not image resolution itself, but the information loss that occurs when a model converts visual information back into natural language.
The problem can be split into two layers:
- Perception Gap: After an input image is resized, tiled, and encoded, information about small objects and fine textures is compressed, so the model has not physically seen everything.
- Reference Gap: Even when the model sees clearly, it still describes targets in natural language within its reasoning chain, using phrases like “the third person from the left” or “the block near the exit.” Such expressions are inherently ambiguous in dense scenes, and the logic tends to break down once the reasoning expands.
These two layers are fundamentally different. The former can be mitigated with higher input fidelity, more sensible image tiling, and multi-scale fusion. The latter requires changing the medium of reasoning so that the process directly operates on objects in visual space rather than routing through text.
2. Technical Approach: Visual Primitives and Thinking with Images
2.1 Core Idea of Visual Primitives
Visual primitives are structured expressions that act as unambiguous pointers in continuous visual space. A common approach is to describe targets with a small set of geometric primitives: points, bounding boxes, and polygons. Their key value lies in:
- Unique reference: One primitive corresponds to a definite region in the image coordinate system, independent of natural-language context.
- Composability: Multiple primitives can express spatial relations such as “same row,” “adjacent,” or “occluded portion.”
- Verifiability: Primitives can be projected back onto the image to form visual intermediate results, supporting both human and automated evaluation.
At the vocabulary level, such schemes typically appear as a set of special tokens that wrap coordinate sequences for points, boxes, and polygons. The structure is illustrated below (for illustration only, not any specific product interface):
<point> x,y </point><box> x1,y1,x2,y2 </box><polygon> x1,y1 x2,y2 x3,y3 </polygon>
When the model outputs these primitives during reasoning, it is effectively working within a loop of “view the image, point at the image, then reason further.” This is what is commonly called thinking with images.
2.2 Engineering Differences Between the Two Paths
| Dimension | Natural-Language Description | Visual Primitives / Thinking with Images |
|---|---|---|
| Reference precision | Context-dependent; ambiguous in dense scenes | Coordinate-level unique reference |
| Reasoning-chain readability | High | Medium; requires visualization support |
| Evaluation reproducibility | Low difficulty | Higher difficulty; depends on rendering and coordinate alignment |
| Toolchain requirements | Low | High; requires image annotation and projection capability |
It is worth stressing that the two paths are not mutually exclusive. In engineering practice, a hybrid strategy is more common: use primitives first for localization and counting, then use natural language to state conclusions and explanations.
3. Implementation in Agent Frameworks
3.1 Configuration and Reproducibility
Multimodal agents are typically delivered as command-line tools or AI coding tools, with settings spread across configuration files, environment variables, and launch parameters. A common pain point is that official documentation examples do not match the local version, so “configured as documented” does not take effect. A reusable troubleshooting order is:
- Confirm the tool version: upgrade to a version that matches the documentation to avoid missing new model identifiers in older releases.
- Confirm configuration source precedence: command-line arguments > environment variables > configuration file, and make the override relationship explicit.
- Confirm model identifier spelling: model names are often written into configuration as strings and are case- and hyphen-sensitive.
- Lock down the configuration: commit a known-good configuration to version control to avoid drift across the team.
Illustrative configuration (pseudocode, structure only):
profile: webmodel: vision-agent-expimage:max_side: 1536tile: trueprimitives:enable: truetypes: [point, box, polygon]
3.2 Evaluation Reproducibility: Why It Works in a Paper but Not on the Web
The phenomenon mentioned in the original discussion—the same task performing inconsistently across different entry points—is very typical in engineering. Common causes include:
- Different input preprocessing: The web entry point may compress images or crop the long side, causing small targets to be lost.
- Different system prompts: Different entry points use different prompts and tool sets, so the model’s available “pointing” capability differs.
- Different decoding parameters: Differences in temperature and maximum output length can significantly affect the stability of primitive coordinates.
- Staged rollout: Experimental features may be enabled only for a small traffic share.
Therefore, reproducing an experiment requires fixing the “four essentials”: input image, preprocessing parameters, prompt, and decoding parameters. Without any one of them, results are not comparable.
3.3 Stability and Failure Modes
The visual-primitive path is not a silver bullet. Common failure modes include:
- Coordinate drift: In long images, y-axis scaling error accumulates and boxes shift as a whole.
- Primitive degradation: The model outputs empty or repeated primitives when uncertain.
- Relation misjudgment: The model can localize a single target but still errs on relations such as “adjacent” or “same row.”
- Invisible projection: Primitives land outside the image, indicating inconsistent coordinate-system conventions.
Corresponding engineering mitigations:
1. Unify the coordinate-system convention (top-left origin, pixel coordinates, normalized or not) and state it explicitly in the prompt;2. Validate primitives: clip to range, deduplicate, and filter by minimum area;3. Render primitives back onto the image as an intermediate result for secondary verification;4. Log the full call chain to support regression comparison.
4. Practical Advice: Evaluating Whether a Multimodal Agent Is “Really Looking”
An actionable checklist for developers:
- Design minimal discriminative probe tasks: one set each for dense counting, occluded localization, and path planning—small sample size but strong discriminative power.
- Fix inputs and parameters for A/B comparison: same image, same prompt, toggling only whether primitive capability is enabled.
- Introduce objective metrics: counting accuracy, localization IoU, and path executability rate, rather than relying on subjective impression alone.
- Visualize intermediate results: draw primitives back onto the image; manually spot-checking 20 images is enough to reveal systematic bias.
- Build a regression set: freeze failure samples and rerun them automatically after version upgrades.
On the infrastructure side, it is advisable to store images and intermediate results in object storage, decouple inference and evaluation tasks with a message queue, host reproducible evaluation environments on a container platform, and track success rate and latency fluctuations through logging and monitoring with alerting. These general capabilities can substantially reduce the engineering cost of multimodal evaluation.
5. Conclusion
The next stage of competition among multimodal agents will hinge not only on “larger parameters and sharper images” but on whether the medium of reasoning is structured. Visual primitives offer an approach that turns the reference problem into coordinates, and thinking with images brings that approach into the agent’s execution loop. For developers, what truly needs to be mastered is: a clear coordinate-system convention, a reproducible evaluation method, validation and projection of primitive outputs, and a stable configuration and regression mechanism. Getting these fundamentals solid is what enables interpretable, comparable, and continuously improvable results on hard tasks such as dense counting, complex localization, and path planning.
