Native Multimodal Agent Architecture: A Technical Breakdown

    This article explains why bolt-on vision modules tend to drift from on-screen reality and what it takes to build a native multimodal agent instead. It covers the unified sequence modeling approach, the three-stage training pipeline, video and temporal handling, the action loop with tool calls and self-verification, and practical evaluation and deployment considerations, along with common pitfalls to avoid.

    1. The Starting Problem: Why Bolt-On Vision Inevitably Drifts

    In real business scenarios, the primary carrier of information is rarely clean text. It is web interfaces, mobile screenshots, design mockups, scanned documents, surveillance footage, and screen recordings of user actions. No matter how capable a text-only large model is, it can only process text that has been transcribed by an upstream pipeline, and that transcription step itself loses layout, hierarchy, control states, color semantics, and the timing of actions.

    More importantly, the transcription module and the reasoning module are two separate systems, each with its own error rate. The errors cascade and amplify, ultimately showing up as a model that “reasons well” but reaches conclusions that do not match the facts on screen — a form of hallucination.

    “Native multimodal” means vision is not a bolt-on input channel. Instead, it shares the same representation space, the same attention mechanism, the same training objectives, and the same action interface as text. You can self-check whether a system is native against three criteria:

    • Unified representation: do image patches and text tokens enter the same sequence and get processed by the same set of parameters?
    • Unified objectives: do pretraining and post-training jointly cover image-text, video, and text-only tasks, rather than being stitched together in stages?
    • Unified action: can the result of visual understanding directly drive tool calls and environment feedback, forming a closed loop?

    2. Architecture Layer: Unified Sequence Modeling, Not Dual-Tower Stitching

    The mainstream approach is a three-part stack: vision encoder + projection layer + language backbone. But what sets the performance ceiling is the detail.

    1) Visual encoding and tokenization. The input image is split into fixed-size patches, encoded by the vision backbone into a feature sequence, and then mapped into the language model’s embedding space by the projection layer. The core tradeoff here is resolution versus token budget: high resolution makes small text and fine-grained controls legible, but the token count grows quadratically. In engineering practice, dynamic resolution and multi-scale sampling are common — denser sampling over key regions, downsampling over background regions.

    2) Cross-modal consistency of positional encoding. Two-dimensional spatial relationships must be encoded explicitly; otherwise the model struggles to judge relations like “the button is to the right of the input field.” A common approach decomposes 2D coordinates and injects them into the positional encoding, so spatial distance has a comparable scale within attention.

    3) Attention and context length. Both interface understanding and video understanding are long-sequence tasks, and full attention is too costly. Viable options include mixing local window attention with global tokens, cross-layer KV reuse, and sharing repeated frame features across time steps.

    The tensor flow can be understood schematically like this:

    1. # Pseudocode: unified sequence construction
    2. img_tokens = project(vision_encoder(patchify(image))) # [N_img, D]
    3. txt_tokens = embed(tokenize(instruction)) # [N_txt, D]
    4. seq = concat([img_tokens, txt_tokens]) # same embedding space
    5. logits = language_model(seq) # same backbone, same parameters

    3. Training Layer: Three-Stage Alignment and the “Don’t Forget” Tradeoff

    The first stage is cross-modal alignment. The goal is to teach the projection layer to “translate.” Typically both backbones are frozen and only the connecting module is trained, using image-text pairs for coarse alignment.

    The second stage is joint instruction tuning. The backbones are unfrozen, and multimodal instruction data is mixed with text-only instruction data. The ratio is the engineering focus: too high a multimodal share degrades language ability, too low a share leaves visual ability underfit. In practice, a substantial proportion of text and code data is retained to keep logical reasoning and structured output stable.

    The third stage is agent-oriented behavioral training. The data shape shifts from “question answering” to “trajectories”: observe — think — act — feedback. You need to construct positive and negative samples that include failures and recoveries, so the model learns to retry, switch paths, or ask for clarification when the environment reports an error, instead of hard-coding an answer.

    4. Video and Time: Turning “Seeing” into a Process of Understanding

    Video is not a pile of images. Effective approaches usually involve three layers of processing: shot segmentation and keyframe extraction to cut redundancy; inter-frame optical flow or differencing to preserve motion information; and temporal positional encoding so the model can distinguish order and causality. For long recordings, hierarchical summarization works: first generate local descriptions for short segments, then summarize that sequence of descriptions, preserving global structure within a limited context.

    5. The Execution Loop: Tool Calls, Memory, and Self-Verification

    The key to a native agent is the “hand.” A unified action space is usually abstracted into a few primitives: click, type, swipe, wait, read structured results, and call external retrieval or computation tools. Three engineering constraints are recommended to reduce hallucination:

    • Pre-action verification: before executing, compare the target element’s coordinates against its semantic label once; if they disagree, re-observe.
    • Result write-back: after every action, force a new observation to be written in; reasoning from an old screenshot is not allowed.
    • Dual-channel output: the final answer should give both the conclusion and the evidence location (region, frame number, field path) so it can be audited.

    6. Evaluation and Deployment: Look Beyond Metrics to Stability

    Design-mockup-to-code tasks care about structural fidelity and runnability; mobile operation tasks care about task success rate and step efficiency. Both should report variance, not a single best run. For deployment, it helps to place the model in an observable three-stage chain of perceive — decide — act, with logging services and monitoring alerts to pinpoint which stage failed. Large assets go to object storage, asynchronous work is decoupled through a message queue, and inference services scale elastically on a container platform. Baidu AI Cloud is typically composed along these same general categories for this kind of chain.

    7. Common Pitfalls

    One is over-trusting resolution while ignoring token budget and latency. A second is doing only visual question answering without behavioral trajectory training, which produces models that can talk but cannot act. A third is an evaluation set that is disconnected from the real distribution, so offline scores are high but online success rates are low. A fourth is the absence of an evidence write-back mechanism, which lets errors be amplified repeatedly inside the loop.