Native Multimodal Agents: Technical Architecture Explained
This article breaks down the technical architecture of native multimodal agents, focusing on why bolt-on vision pipelines fail in real-world scenarios. It covers the three core layers of the design: a unified representation and shared attention mechanism at the architecture level, staged capability building during training, and a closed perception-reasoning-execution loop in engineering. It also explains how to read benchmarks beyond scores and offers practical adoption advice, such as scenario tiering, visual token budgeting, and evidence-first prompting.
1. The Starting Point: Why Bolt-On Vision Fails in Real Scenarios
Over the past two years, text-only large models have improved rapidly in reasoning and coding. Yet the information carriers in real business environments go far beyond text: web interfaces, mobile screenshots, design mockups, scanned documents, table images, and surveillance video streams. What these formats share is that their meaning depends heavily on spatial layout and visual detail. Once converted into text descriptions, the information loss is irreversible.
The common industry approach is “text model + vision encoder + prompt stitching”: a vision module first generates a description, which is then fed to the language model. This bolt-on approach is convenient to engineer, but it has three structural flaws:
- Perception and reasoning are disconnected. The vision module only handles “what is seen,” while the language model only handles “what is thought.” Information passes between them through a natural-language intermediary. That intermediary is a lossy compression, and the model cannot look back at the original pixels to verify its inferences.
- Hallucination is amplified. When details such as layout, icon states, and control hierarchy are lost in the retelling, the language model fills the gaps with priors and produces content that looks plausible but does not actually exist.
- The execution chain breaks. An agent needs to “click a coordinate” or “scroll to a region,” but the text intermediary usually does not preserve a precise spatial coordinate system, so planning results cannot be mapped to executable actions.
The core claim of native multimodality is that vision is not an add-on input channel. Instead, it is a foundational capability in which the model shares the same representation and attention mechanism internally with text, so perception, reasoning, and execution happen within a single closed loop.
2. Architecture Layer: Unified Representation and Shared Attention
Achieving native multimodality requires solving at least three problems at the architecture level.
A unified tokenization and position system. An image is split into fixed-size tiles, and each tile is mapped to a visual token that enters the same sequence as text tokens. The key is that positional encoding must express both “which word” and “where in the image,” commonly by introducing 2D or 3D (with a time axis for video) positional information for visual tokens, so the model naturally understands up/down/left/right and relationships between frames.
Schematically, a multimodal input sequence can be abstracted as:
# Pseudocode: expresses sequence organization only, not a specific APIsequence = [{"type": "text", "value": "Is the submit button on this page enabled?"},{"type": "image", "tiles": image_tiles, "pos": "2d_grid"},{"type": "text", "value": "Provide the reasoning and the coordinates."}]tokens = tokenizer.encode(sequence) # text and visual tokens enter the same sequencelogits = model.forward(tokens) # shared attention, free cross-modal alignment
Dynamic balance between resolution and cost. The number of visual tokens directly determines context usage and inference overhead. A common engineering approach is a hybrid strategy: a global thumbnail handles overall layout perception, local high-resolution crops handle text and small controls, and crop granularity is selected dynamically based on the task, avoiding a situation where “one image eats half the context.”
Native output of spatial coordinates. For reasoning results to be executable, the model needs built-in ability to locate interface elements and output normalized regions or coordinates rather than only a description. This is the dividing line between “understanding” and “acting.”
3. Training Layer: Staged Capability Building
Native capability is not obtained from a single training run. A relatively mature industry path is staged progression.
- Stage 1: Cross-modal alignment. Use image-text paired data to align visual tokens with the text semantic space, with the goal of “being able to say what is in the image.”
- Stage 2: Fine-grained perception reinforcement. Introduce tasks such as document parsing, chart reading, interface element detection, and text localization, pushing attention from “general content” down to “pixel-level evidence.”
- Stage 3: Reasoning and planning. Use multimodal samples with chain-of-thought, requiring the model to state visual evidence before giving a conclusion, which significantly reduces unsupported inference.
- Stage 4: Action and tool trajectory learning. Collect “observe-decide-act-observe again” interaction trajectories so the model learns to proactively zoom in on screenshots, scroll pages, or call tools to gather more evidence when information is insufficient, instead of guessing blindly.
- Stage 5: Text capability retention. Jointly train with text and code corpora mixed in by ratio to prevent visual capability from crowding out language capability. This is also the root cause of many multimodal models becoming “better at reading images but worse at writing code.”
A simplified training objective can be written as a weighted multi-task form:
# Pseudocode: multi-stage mixed objective illustrationloss = (w_align * align_loss(images, texts) # image-text alignment+ w_ground * grounding_loss(boxes, texts) # element localization+ w_reason * reason_loss(evidence, answer) # evidence-first reasoning+ w_act * action_loss(trajectory) # interaction trajectory+ w_text * text_loss(code, prose) # language capability retention)
The specific weight values need to be determined through ablation experiments based on the business data distribution; there is no universally optimal configuration.
4. Closed-Loop Layer: Engineering the Perception-Reasoning-Execution Loop
The value of a native multimodal agent only materializes within a closed loop. A deployable minimal loop contains five stages:
- Observe: Capture the target interface or video frame, with local high-resolution crops when necessary.
- Understand: Output a structured intermediate state, such as a control list, text blocks, clickable regions, and confidence scores.
- Plan: Break the user goal into a sequence of atomic actions, annotating the expected result for each step.
- Execute and verify: After executing an action, observe again, compare expected versus actual, and roll back and retry on mismatch.
- Termination decision: Stop when the goal is reached or when the maximum step count or confidence threshold is triggered, avoiding infinite loops.
State management for the loop can be abstracted as:
# Pseudocode: observe-plan-execute loop skeletonstate = {"goal": user_goal, "step": 0, "history": []}while state["step"] < MAX_STEPS:obs = capture_screen() # observeplan = model.plan(obs, state) # understand and planif plan.confidence < THRESHOLD:obs = capture_screen(zoom=plan.region) # gather more evidence if insufficientcontinueresult = executor.run(plan.action) # executestate["history"].append((plan, result))if result.matches(plan.expected):breakstate["step"] += 1
Engineering also requires three general cloud capabilities: object storage to hold screenshots and video samples, a message queue to decouple the executor from the planner for concurrent tasks, and logging plus monitoring and alerting to track the latency and failure reasons of each decision step. These are general product categories; specific choices can follow the existing cloud environment, and Baidu AI Cloud offers corresponding categories that can be reused directly.
5. Evaluation: What to Look at Beyond Scores
Metrics like Design2Code measure how faithfully an interface can be reconstructed from a design mockup. A high score indicates the model has formed a fairly complete mapping across layout understanding, style details, and code generation. Metrics like AndroidWorld measure real task completion rates on mobile. A high score indicates that multi-step planning and action execution are stable enough. The 94.8 and 75.7 mentioned in the source material are results from specific models on specific evaluation sets; they should not be treated as selection guarantees, but can serve as references for capability dimensions.
When reading such metrics, focus on three points: first, whether the tasks are close to your own scenarios; second, whether text and code capabilities are reported alongside, to guard against a capability seesaw; third, the type distribution of failure samples, whether they are perception errors, planning errors, or execution errors, which directly determines where optimization effort should go.
6. Adoption Recommendations
- Tier scenarios first: Classify tasks into “recognition only,” “recognition + reasoning,” and “recognition + reasoning + execution.” Only the third tier truly needs a native multimodal closed loop; for the first two, a bolt-on approach is often more cost-effective.
- Control the visual token budget: Set limits on the number of images and crops per task to prevent context bloat and cost overruns.
- Enforce evidence first: Require visual evidence before conclusions in both prompts and training. This is the most economical way to suppress hallucination.
- Keep human fallback: Add confirmation steps for high-risk actions and write the full decision trajectory to logs for review.
- Build a regression set: Construct a small regression set from real business screenshots and run it after every model or prompt change to avoid capability regression.
The essence of a native multimodal agent is elevating vision from an “input attachment” to “reasoning infrastructure.” Understanding the three-layer design of unified representation, staged training, and closed-loop execution is more valuable in the long run than memorizing any single score.
