Building Native Multimodal Agents: A Technical Path from Unified Representation to Closed-Loop Execution
This article explains why bolt-on vision pipelines struggle in real business scenarios and how native multimodal agents address those limits through architecture, training, tooling, and evaluation. It covers unified input spaces and shared context windows, addressable UI state, a four-stage training progression with trajectory data construction, verification tools that feed execution results back into perception, layered evaluation metrics, common pitfalls, and a practical "closed loop first, scale later" rollout approach.
1. Why Bolt-On Vision Pipelines Fall Short in Real Business Scenarios
In real business settings, a large share of critical information exists visually: web interfaces, mobile screenshots, design mockups, scanned documents, table images, and surveillance feeds. If a system relies only on a text model and bolts on an external vision module that recognizes first and describes second, the result is a typical bolt-on architecture. The problem is not that any single module lacks capability; it is that information is repeatedly compressed and lossily converted as it moves between modules.
Bolt-on architectures usually have three structural defects. First, perception and reasoning are disconnected: the vision module emits discrete labels or short text, so the reasoning side never receives fine-grained information such as spatial layout, hierarchy, or control state. Second, errors accumulate: a recognition mistake enters the reasoning chain as settled fact, and later steps cannot trace back and correct it. Third, the execution loop is missing: even when the model “understands” the screen, it struggles to map that understanding into a verifiable sequence of operations.
This is why the industry is shifting toward a native multimodal approach: bring images, video, and text into one representation and modeling system so that perception, reasoning, and execution share the same context and form a closed loop. Native does not mean simply attaching a vision encoder to a language model. It is the result of co-designing architecture, training objectives, data construction, and tooling.
2. Architecture: Unified Representation and Shared Context
The first design goal is a unified input space. A common approach splits visual signals into a sequence of tiles, encodes them, and projects them into a latent space with the same dimensionality as text token embeddings, so the backbone can model everything without distinguishing the modality of origin. The critical detail is that the projection layer and positional encoding must preserve 2D spatial information; otherwise the model loses the facts that matter most in interfaces and documents, such as above/below, left/right, alignment, and containment.
The second layer is a shared context window. Interface understanding and document parsing often require seeing multiple images, long text instructions, and a history of prior actions at the same time. If the context is split by hard boundaries, the model cannot perform cross-image comparison or track state. In engineering practice, hierarchical context management is common: recent high-resolution detail is kept intact, distant content is compressed into structured summaries, and traceable reference anchors are retained.
The pseudocode below is illustrative only. It expresses the data flow and does not correspond to any specific API:
# Unified multimodal input: text instruction + multiple UI screenshots + action historytokens = build_prompt(instruction, history_actions)visual = encode_tiles(screenshots, keep_layout=True) # preserve 2D layoutctx = merge_to_shared_space(tokens, visual) # project into the same latent spaceplan = policy_model.plan(ctx) # produce a high-level planaction = policy_model.act(ctx, plan) # produce an executable action
The third layer is addressable state. In multi-step tasks an agent must know which page it is on and which controls have already been tried. Converting interface elements into a structured list with unique identifiers, and having the model reference those identifiers when emitting actions, significantly reduces coordinate drift and repeated clicks.
3. Training: Staged Objectives and Data Construction
Native capability comes from the training paradigm, not from stacking modules. A relatively mature approach progresses through four stages.
Stage one is alignment pretraining: interleaved image-text corpora teach basic image-to-text correspondence, with emphasis on fine-grained description and region grounding rather than vague whole-image summaries. Stage two is document and interface specialization: tasks such as layout analysis, reading-order recovery, table structure recovery, and control hierarchy recognition push the model to emit structured output instead of free text. Stage three is reasoning reinforcement: construct questions that require multiple observations to answer, for example “locate the entry point, then judge the state, then give the operation,” and train the model to record intermediate evidence explicitly before stating a conclusion. Stage four is closed-loop execution fine-tuning: train on observe-plan-act-feedback trajectories so the model learns to roll back and switch paths when it fails.
Data construction is the most underestimated part. High-quality trajectories must satisfy three conditions: actions are reproducible, states are decidable, and failures are attributable. A hybrid strategy of synthetic environments plus real sampling is common practice: synthetic environments cover long-tail interfaces at low cost, while real sampling calibrates distribution bias. To keep the model from learning surface shortcuts, training samples should include negatives, meaning invalid actions and wrong paths, with failure reasons clearly labeled.
A reusable trajectory sample structure:
{"task": "Convert a table in the document into structured data and write it back","steps": [{"obs": "page_3", "evidence": "header spans two merged rows", "action": "select_table(anchor=T12)"},{"obs": "page_3", "evidence": "merged cells shift the columns", "action": "retry", "reason": "column_span_mismatch"}],"result": {"status": "success", "verified_by": "schema_check"}}
4. Tooling: Letting Execution Results Constrain Perception
The key to the loop is verifiability. If no validation signal follows an action, the model cannot tell whether it understood correctly. In engineering terms, an agent should be equipped with three general capabilities: a structured parsing tool that turns layout into a checkable intermediate representation; a validator that compares output against schema constraints; and logging plus monitoring to accumulate failure samples.
Validation logic is best expressed up front as decidable conditions, such as field types, required fields, numeric ranges, and cross-image consistency:
def verify(result, schema):errors = []for field, rule in schema.items():if rule.required and result.get(field) in (None, ""):errors.append(f"missing:{field}")elif not rule.check(result.get(field)):errors.append(f"invalid:{field}")return errors # an empty list means pass; otherwise feed back to the model for retry
On the deployment side, a combination of general cloud capabilities works well: object storage for screenshots and trajectory samples, a message queue to smooth peaks and chain asynchronous execution tasks, a container platform to host elastically scaling inference services, and logging plus monitoring with alerting to track success rate and latency distribution. This supports both batch offline evaluation and online interactive tasks.
5. Evaluation and Common Pitfalls
Evaluation must be layered, or the conclusions will be misleading. The first layer is perception metrics, focused on region grounding and structure recovery accuracy. The second is reasoning metrics, focused on evidence completeness and conclusion correctness in multi-step tasks. The third is execution metrics, focused on task completion rate, average number of steps, and rollback rate. The fourth is regression metrics, ensuring that gains in multimodal capability do not visibly degrade text-only and code capabilities, a point that is often overlooked.
There are four common pitfalls. One is treating recognition accuracy as equivalent to task completion rate, ignoring state tracking and failure recovery. Two is letting context expand without limit, which dilutes critical detail and raises cost while lowering returns. Three is missing negatives and failure attribution, which leaves the model brittle in real environments. Four is optimizing single-step actions without optimizing total step count, producing long and inefficient execution chains.
6. Implementation Recommendations
To build similar capability in your own business, proceed with “closed loop first, scale later.” Start with a narrow scenario that can be validated automatically, such as form filling or document field extraction, and get the four steps of observe, act, verify, and feed back working end to end. Then expand interface types and task complexity step by step. Finally, introduce offline batch evaluation and online canary releases, using real failure samples to drive data iteration. Baidu AI Cloud can provide a stable engineering foundation for such closed-loop systems through general capabilities including container platforms, object storage, logging, and monitoring with alerting, while the core competitiveness on the model side still depends on whether unified representation design, training data quality, and the validation mechanism genuinely close the loop.
