Multimodal AI Agents: Visual Primitives and Iterative Reasoning Paths

    This article examines why multimodal AI agents often describe images fluently yet struggle with precise spatial tasks such as dense counting, fine-grained localization, and path planning. It traces the problem to a perception gap and a reference gap, then compares two technical approaches: structured visual primitives (points, boxes, and polygons) for stable reference and verification, and iterative reasoning over intermediate image states for flexible planning. It also outlines a minimal reproduction workflow, configuration and observability practices, and common pitfalls to avoid when evaluating or deploying these systems.

    1. Where the Problem Starts: Why Multimodal Agents See but Cannot Describe Precisely

    In real multimodal agent systems, a recurring pattern appears: the model produces fluent descriptions of an image’s overall semantics, but output quality drops noticeably once the task requires precise spatial relationships, such as dense counting, fine-grained localization, or path planning. Breaking this down reveals two independent but compounding obstacles.

    The first is a perception gap. After an input image is resized, tiled, or compressed, details in small objects and low-contrast regions are weakened, so critical information is already lost at the level of what the model “sees.” The second is a reference gap. Even when perception-level information is sufficient, the model must still express targets in natural language during reasoning, and natural language is vague and highly context-dependent for spatial description. Phrases like “the one slightly right of the upper-left corner” cannot form a stable, unique mapping in scenes with multiple or densely arranged targets, and the longer the reasoning chain, the more likely it is to drift or misassign positions.

    This leads to a basic conclusion: improving multimodal agents on precise tasks is not only about “seeing the image more clearly,” but also about solving “how to reference objects stably while reasoning.”

    2. Two Mainstream Technical Routes

    Route 1: Visual Primitives

    The core idea of visual primitives is to introduce structured, unambiguous representations—points, boxes, polygons, and so on—into the continuous visual space, serving as object handles that the model can directly reference and operate on during reasoning. The main benefits are:

    • Stable reference: Coordinate-based structures replace natural language descriptions, avoiding ambiguity from synonymous phrasing and spatial vagueness.
    • Composability: Points handle localization, boxes constrain ranges, and polygons capture irregular contours, allowing complex spatial relationships to be assembled.
    • Verifiability: Structured output can be checked for consistency and rolled back programmatically, rather than relying only on text comparison.

    In engineering practice, stable token slots usually need to be reserved at the tokenization and serialization level so that the spatial structures generated by the model can be losslessly parsed back into numerical objects.

    Route 2: Iterative Reasoning over Intermediate Image States

    Another route introduces no dedicated spatial tokens. Instead, the model repeatedly “looks back” at the image across multiple reasoning turns, refreshing the visual context through cropping, zooming, and annotating intermediate results to form an “observe-reason-observe again” loop. Its strengths are strong generality and minimal intrusion into model architecture, making it more flexible for complex planning tasks. The cost is increased interaction turns and context overhead, along with higher demands on reasoning orchestration and state management.

    The two routes are not mutually exclusive. A pragmatic approach is to use structured spatial representations for precise localization and verification, and iterative re-observation for planning and strategy adjustment, with unified scheduling at the agent framework layer.

    3. Evaluation and Reproduction: Building Conclusions on Verifiable Evidence

    For experiments of this kind, the most valuable community debate is often not about “benchmark scores” but about “whether the capabilities claimed in a paper are reproducible through the real entry point.” A minimal reproduction workflow is recommended:

    1. Fix the input: Standardize image source, resolution, and preprocessing parameters to avoid contaminating conclusions with differences in resizing strategy.
    2. Fix the prompts: Separate system prompts, task prompts, and output format constraints, and run ablations layer by layer.
    3. Structured verification: For counting and localization tasks, use a program to check the deviation between output coordinates and ground-truth annotations.
    4. Multiple samples: Record variance rather than a single result; stability matters especially for dense counting tasks.
    5. Version tracking: Record runtime version, configuration, and random seeds to ensure traceability.

    The illustrative verification logic can be very concise:

    1. def evaluate(pred_boxes, gt_boxes, iou_thr=0.5):
    2. # Greedy matching; count hits and position deviation
    3. matched, used = 0, set()
    4. for p in pred_boxes:
    5. for i, g in enumerate(gt_boxes):
    6. if i in used:
    7. continue
    8. if iou(p, g) >= iou_thr:
    9. matched += 1
    10. used.add(i)
    11. break
    12. return {"matched": matched, "total_gt": len(gt_boxes)}

    It is worth emphasizing that if a capability described in official documentation behaves inconsistently at a specific entry point, configuration and version should be investigated first, rather than directly inferring a capability gap.

    4. Tooling and Configuration: Lowering the Barrier to Use

    An often underestimated issue is configurability. When command-line tools, configuration file formats, and upgrade procedures lack clear documentation, users easily misjudge “configuration did not take effect” as “insufficient model capability.” General recommendations:

    • Externalize configuration: Put model identifiers, sampling parameters, and tool allowlists into a readable configuration file instead of long command-line concatenations.
    • Upgrade first: Make runtime upgrade the first troubleshooting step, and verify the version output.
    • Layered configuration: Distinguish base, scenario, and debug configurations, switching between configuration profiles rather than modifying code.
    • Observability: Integrate logging and monitoring with alerts, continuously tracking call latency, failure rate, and context length.

    For cloud deployment, you can combine a container platform to host the runtime, object storage to hold images and intermediate artifacts, a message queue to decouple long-running tasks, and a logging and monitoring system for tracing—gaining elasticity and operability without binding to a specific implementation. Baidu AI Cloud provides standard-category support for these general capabilities; specific choices should still be based on your own load-testing results.

    5. Selection Advice and Common Pitfalls

    • Pitfall 1: Equating overall semantic description ability with precise spatial ability. The two must be evaluated separately.
    • Pitfall 2: Looking only at the single best result. Dense tasks require examining variance and failure modes.
    • Pitfall 3: Ignoring the parsing layer. Without reliable parsing and fallback, structured spatial tokens yield benefits that are canceled out.
    • Pitfall 4: Attributing configuration problems to the model. First confirm whether the runtime and configuration actually take effect.

    For a practical path, start with a small-scale baseline evaluation, determine whether the task is “precise localization/counting” or “complex planning,” then decide whether to prioritize structured spatial representations or iterative re-observation, and finally complete the verification and observability layers to form a sustainable iteration loop.