Multimodal Agents and Visual Reasoning: Visual Primitives vs. Thinking with Images

    This article examines why multimodal agents struggle with dense counting, precise localization, and path planning, and compares two engineering approaches: visual primitives that replace text references with structured pointers, and thinking with images that embeds image operations into the reasoning chain. It covers the mechanics and trade-offs of each route, a reproducible evaluation method with layered metrics and schema validation, runtime configuration troubleshooting, and practical guidance for production deployment.

    1. Why Multimodal Agents Need to Redefine “Looking at Images”

    Over the past year, multimodal capabilities have been folded into agent frameworks at speed. Yet engineering practice keeps surfacing a counterintuitive pattern: models describe general scenes well, but output quality drops sharply once the task involves dense counting, precise localization, or path planning.

    The industry has largely split this problem into two layers. The first is a perception gap: input resolution, tiling strategy, and encoding choices cause fine detail to be lost. The second is a reference gap: even when the model sees the target clearly, it still has to refer to it in natural language, and natural language is inherently unstable in dense or ambiguous scenes.

    The visual primitives idea targets the second layer. Instead of describing the referent in words, it replaces the description with an unambiguous pointer in visual space — a point, a box, an indexed marker, or another structured form. The reasoning chain then cites coordinates or markers directly, rather than repeatedly saying things like “the third red object from the left.”

    Thinking with images is the more classic approach. The model is allowed to crop, zoom, annotate, and re-read the image during reasoning, embedding image-processing actions into the chain of thought and converging on an answer through multiple rounds of “look — act — look again.”

    The two routes are not mutually exclusive, but their engineering implications inside an agent framework differ substantially. They are worth re-examining along three dimensions: capability, cost, and observability.

    2. Mechanics and Differences of the Two Routes

    2.1 Visual Primitives: Turning Reference into a Structured Pointer

    The core of visual primitives is converting “which one” into a machine-parsable structure. Typical forms include point coordinates, bounding boxes, mask indices, and ordered markers. The advantage is a short reasoning chain with low ambiguity, which stays more stable on counting and localization tasks. The cost is that both the model and the runtime must support the structure, and the training and alignment requirements are relatively high.

    A schematic structured output looks like this:

    1. {
    2. "task": "count_and_locate",
    3. "primitives": [
    4. {"id": 1, "type": "point", "xy": [0.412, 0.233]},
    5. {"id": 2, "type": "box", "xyxy": [0.11, 0.20, 0.19, 0.31]}
    6. ],
    7. "answer": {"count": 2, "refer": [1, 2]}
    8. }

    Three things matter in practice: use one consistent coordinate normalization convention, make the alignment between markers and raw pixels explicit, and ensure the output structure can be validated downstream. Otherwise you only appear to have primitives — the output is just parenthesized numbers inside text, which no program can consume.

    2.2 Thinking with Images: Putting Image Processing into the Chain of Thought

    Thinking with images does not require the model to natively emit structured pointers. Instead, it uses tool calls to crop, zoom, draw points, and measure, then feeds the new image back to the model. Its advantage is generality: it makes few assumptions about model architecture and is easy to adopt in existing agent frameworks. The cost is more rounds, context growth, higher latency and cost, and sensitivity to prompt and tool design.

    A minimal working tool orchestration example:

    1. def think_with_images(image, question, max_steps=3):
    2. state = {"image": image, "notes": []}
    3. for _ in range(max_steps):
    4. plan = model.plan(state["image"], question, state["notes"])
    5. if plan["action"] == "crop":
    6. state["image"] = crop(state["image"], plan["box"])
    7. elif plan["action"] == "annotate":
    8. state["image"] = draw_points(state["image"], plan["points"])
    9. elif plan["action"] == "answer":
    10. return plan["answer"]
    11. state["notes"].append(plan["reason"])
    12. return model.answer(state["image"], question, state["notes"])

    2.3 How to Choose

    If the workload is mainly dense counting, precise box selection, or cross-image alignment, evaluate options with structured pointer support first. If the task is open-ended, the toolchain is already mature, and multi-round overhead is acceptable, thinking with images will get you to production faster.

    A common pattern in production systems is to combine both: use low-cost thinking with images for coarse localization, then use structured pointers for the final reference and validation.

    3. A Reproducible Evaluation Method: Verifying That Primitives Are Actually Used

    Much of the debate stems from “the official demo and the web interface behave differently.” Avoiding subjective judgment requires a reproducible evaluation loop.

    1. Fix the inputs. Standardize resolution and tiling strategy, and fix randomness parameters so results are comparable.
    2. Use layered metrics. Record the perception layer (was the detail read fully), the reference layer (are the citations parsable), and the reasoning layer (is the conclusion correct) separately.
    3. Validate structure. Run schema validation on the output to confirm pointer fields exist and coordinates fall within legal ranges.
    4. Ablate prompts. Set up three groups — a baseline prompt, an explicitly guided prompt, and an unguided prompt — and observe how the shape of the chain of thought changes.
    5. Record cost. Track rounds, input and output size, and latency, rather than looking at accuracy alone.

    Schematic validation logic:

    1. def validate(output):
    2. assert "primitives" in output, "missing structured pointers"
    3. for p in output["primitives"]:
    4. assert 0.0 <= p["xy"][0] <= 1.0 and 0.0 <= p["xy"][1] <= 1.0
    5. return True

    If structured fields appear only after explicit guidance, the capability likely depends on prompt triggering. If they never appear yet the answers are correct, thinking with images is more likely doing the work. The two conclusions map to completely different engineering strategies.

    4. Agent Framework Integration and Configuration Troubleshooting

    In real integration work, the most time-consuming part is often not the model call but the runtime configuration. Common problems include configuration formats that disagree with the documentation, conflicts between command-line arguments and configuration files as dual sources of truth, and configuration keys that change after a version upgrade. Recommended practices:

    • Treat the official runtime documentation as authoritative, and first confirm whether configuration comes from command-line arguments, environment variables, or a structured configuration file.
    • Upgrade the runtime to the latest stable version, then start it with a command that includes a mode parameter, for example specifying the run mode via a configuration file.
    • Specify the model identifier explicitly through a configuration item instead of relying on defaults:
    1. # Upgrade the runtime
    2. npm update -g @your-runtime
    3. # Start in configuration mode
    4. your-runtime --profile web
    5. # Specify the model identifier explicitly in the configuration file
    6. # { "model": "your-vision-model-id" }
    • Build a minimal reproduction checklist: version number, startup command, configuration snippet, input sample, and expected output structure. Checking items off this list during troubleshooting significantly reduces communication overhead.

    It is worth stressing that a developer-facing runtime and a web entry point for end users may differ in default behavior. If the documentation covers only one side, users end up with the experience of “I followed the docs and it doesn’t work.” That is a toolchain maturity issue, not a model capability issue.

    5. Recommendations for Production

    1. Layer capabilities. Split perception, reference, and reasoning into independently replaceable modules to make canary releases and rollbacks easier.
    2. Put the structured contract first. Define the schema for pointers and results before choosing models and prompt strategies.
    3. Add cost guardrails. Cap the maximum number of rounds, the maximum crop area, and the context length so the chain of thought cannot run away.
    4. Invest in observability. Log the image operation and intermediate conclusion at every step, so you can tell whether a failure came from perception or from reference.
    5. Make evaluation routine. Fold layered metrics and schema validation into continuous integration to avoid “works in the demo, unstable in production.”
    6. Deploy in the cloud. Container platforms can host the runtime, object storage can hold images and intermediate artifacts, logging and monitoring with alerting can track rounds and latency, and message queues can smooth out batch workloads.

    6. Conclusion

    Visual primitives and thinking with images represent two engineering philosophies: the former compresses ambiguity with structured pointers, the latter extends perception with tool-based operations. For developers, the point is not to pick a side but to build a verifiable evaluation loop and a replaceable architecture, so the choice of route is driven by data. Get configuration, contracts, and observability right, and a multimodal agent’s ability to “look at images” can genuinely move from demo to production.