Visual Primitives vs. Thinking with Images: Two Approaches to Multimodal Reasoning
Multimodal models often recognize objects in images but fail at counting, localization, and relational reasoning. This article examines two technical routes to bridge this gap: visual primitives (structured geometric outputs like boxes and points) and thinking with images (iterative visual operations during inference). It compares their trade-offs, discusses evaluation methodologies, and offers engineering considerations for deployment.
1. Background: Seeing Is Not the Same as Reasoning
When a multimodal model processes an image, it typically follows two stages. A vision encoder converts pixels into feature vectors, and a language model then reasons over those features to produce text output. Many failures do not originate in the encoding stage. Models often identify the objects present in a scene, yet still miscount them, mislocate them, or misjudge their relative positions.
Researchers describe this as a second‑order problem beyond the initial perception gap. Even when the encoder retains sufficient information, the reasoning stage may fail to reliably reference it. One explanation is the reference gap: when the model uses natural language to describe “the third person in a red coat on the left,” the description itself is ambiguous. Subsequent reasoning must repeatedly reconstruct the referent from the language description, and each step can drift further from the original image. The more objects or the denser the scene, the faster ambiguity accumulates, causing counting and localization to break down.
2. Route One: Visual Primitives
The visual‑primitives approach forces the model to output structured geometric elements—points, boxes, polygons—with explicit coordinates as part of its reasoning. Each geometric element corresponds to a definite region in the image, acting as an unambiguous pointer. Downstream reasoning can directly use these coordinates without re‑describing the object in words.
Implementing this route typically requires three components:
- Reserved tokens in the vocabulary to wrap coordinate sequences (e.g.,
<box>,<point>,<polygon>). - Training data containing coordinate annotations so the model learns when to output these tokens.
- A decoder that can parse these tokens and map normalized coordinates back to the original pixel space.
The following format is only illustrative and does not represent any specific implementation interface:
<point>x,y</point><box>x1,y1,x2,y2</box><polygon>x1,y1;x2,y2;x3,y3</polygon>
Coordinates are usually normalized to a 0–1 range to decouple annotations from image resolution. A parsing example is shown below:
import reBOX_PATTERN = re.compile(r"<box>([\d.]+),([\d.]+),([\d.]+),([\d.]+)</box>")def parse_boxes(text: str, img_w: int, img_h: int):boxes = []for m in BOX_PATTERN.finditer(text):x1, y1, x2, y2 = map(float, m.groups())# Model output is untrusted data; clip to valid range firstx1, x2 = (min(max(v, 0.0), 1.0) for v in (x1, x2))y1, y2 = (min(max(v, 0.0), 1.0) for v in (y1, y2))boxes.append((x1 * img_w, y1 * img_h, x2 * img_w, y2 * img_h))return boxes
This code illustrates a key principle: before any model output enters a program, it must pass format validation and numerical clipping. Otherwise, out‑of‑bounds coordinates can directly cause errors in downstream cropping or drawing.
3. Route Two: Thinking with Images
The “thinking with images” approach takes a different path. During reasoning, the model can actively invoke image operations—such as cropping a region, zooming in on details, rotating, or annotating and then re‑observing—and append each resulting visual observation to the context. The image becomes a reusable working material that can be re‑examined at every reasoning step.
The advantage of this route is that it reuses general‑purpose capabilities. Cropping, scaling, and annotation are mature image‑processing operations with simple interfaces that are easy to port across models and runtime environments. The cost is that each observation adds to the number of reasoning steps and increases context length. The model must also learn when to observe and which region to observe; a poor decision can lead to repeated ineffective lookups.
4. Comparing the Two Routes
| Dimension | Visual Primitives | Thinking with Images |
|---|---|---|
| Referencing method | Explicit coordinates directly bound to objects | Local images combined with natural language |
| Counting & localization | Structured output, suited for precise localization | Depends on the number of crops and zooms |
| Reasoning cost | Adds geometric tokens to the output | Multiple observation rounds; context grows quickly |
| Training requirement | Needs coordinate‑annotated data | Needs to learn when to invoke visual operations |
| Engineering integration | Requires a parser and coordinate mapping | Reuses image‑processing toolchains |
| Interpretability | Coordinates can be drawn directly onto the original image for verification | Each crop/step can be replayed |
The two routes are not mutually exclusive. A real‑world system can embed coordinate output inside the thinking‑with‑images framework: first zoom in to localize a target region, then emit a geometric token for precise positioning.
5. Evaluating Visual Reasoning Capabilities
Results from public demos and online experiences sometimes differ from what is described in research papers. Possible causes include inference parameters, image preprocessing, resolution, and version differences. Therefore, evaluation should follow a fixed, reproducible protocol. The recommended steps are:
- Build a fixed test set covering subtasks such as counting, relative position, maze path‑finding, and fine‑grained attributes.
- Control input conditions—test the same image at different resolutions and compression qualities.
- Check the consistency between answers and coordinates. Require the model to output both a textual conclusion and a coordinate, then verify that the coordinate actually falls on the corresponding object.
- Report statistics by failure type, not just an average score. For example, bucket counting errors by object count; this usually reveals how error increases with object density.
- Sample multiple times and report variance, avoiding conclusions drawn from a single run.
Maze‑navigation tasks are especially suitable for automatic evaluation. The path can be expressed as an ordered sequence of coordinates, and a program can check whether the path is connected, does not pass through walls, and reaches the goal—more reliable than human visual inspection.
6. Engineering Considerations for Deployment
In agentic or coding‑assistant scenarios, images often come from screenshots, design mockups, or error screens. The following practices are recommended:
- Encapsulate image processing as tools that are dispatched by the runtime framework, rather than letting the model directly compose low‑level commands.
- Pass tool parameters in a structured format and validate value ranges on the server side to prevent out‑of‑bounds or unauthorized operations.
- Treat both image content and model output as untrusted data. Text appearing inside an image may be injected instructions; it should be processed as data and never used directly as an action directive.
- Set a maximum number of reasoning rounds and a timeout to prevent the thinking‑with‑images loop from spinning indefinitely.
- Log every crop region and coordinate at each step to facilitate post‑hoc debugging and issue tracing.
7. Conclusion
Visual primitives and thinking with images address the reference problem from two complementary directions: precise pointing and active observation. When selecting a route, clarify the task characteristics first. If the core requirement is counting and localization, explicit geometric output is more direct. If the task depends on reading fine details and performing multi‑step checks, the flexibility of thinking with images offers an advantage. Regardless of the chosen route, the final judgment should be based on reproducible evaluation results.
