Natively Multimodal Agents: Architecture, Training, and Engineering Practices
Many multimodal AI systems bolt a vision module onto a text model, which causes semantic loss, error accumulation, and fragmented tooling. This article explains why natively multimodal agents—where images and video are first-class inputs unified with text in the same token space—outperform that approach. It covers the unified architecture design, a four-stage training strategy that preserves text and code capabilities, closed-loop perception–reasoning–action execution with explicit observation and action spaces, multi-dimensional evaluation, production engineering practices, and common pitfalls to avoid.
1. The Starting Problem: Why “Bolted-On” Multimodality Fails
Real-world business information comes in far more forms than text: web UIs, mobile screenshots, design mockups, scanned documents, and monitoring footage. If you take the conventional “text-only LLM + separate vision module” pipeline—where the vision model outputs a description and the text model reasons over that description—the approach has three structural flaws.
First, semantic loss. Any visual description compresses information. Pixel-level details such as widget hierarchy, spacing, state colors, and cursor position are lost in the retelling, so downstream reasoning works only from second-hand information.
Second, error accumulation. In a multi-stage chain, errors at each stage are amplified downstream with no rollback mechanism, ultimately producing hallucinated outputs that “look plausible but are actually wrong.”
Third, fragmented tooling. Perception, reasoning, and execution modules are typically maintained by different teams with different frameworks. Without a unified representation of action and observation spaces, the closed loop struggles to converge.
The core claim of native multimodality: vision is not a plugin but a first-class input modality, with architecture, training, and tooling designed together from the ground up.
2. Architecture: Compressing Images and Video into the Same Token Space
The first principle of the native approach is unified sequence representation. Text tokens, image patch tokens, and video frame tokens are mapped into the same embedding space and processed by a single Transformer backbone, where attention naturally performs cross-modal alignment. In practice, four things need careful handling:
- Visual encoding and projection: The vision encoder extracts local and global features, which a projection layer aligns to the language model’s dimension. The projection layer should not be too deep, or fine-grained information will be weakened.
- Dynamic resolution and tiling: A fixed low resolution sacrifices the readability of text and icons. Dynamic tiling—splitting the image into sub-tiles at the original aspect ratio, plus a global thumbnail—balances the token budget against detail.
- Temporal compression: Video cannot be encoded frame by frame in full. The common approach is keyframe sampling combined with feature-level merging of adjacent frames, preserving motion information while controlling sequence length.
- Positional encoding extension: 2D image positions and 1D text positions need a unified encoding scheme with support for long-context extrapolation, or high-resolution inputs will hit the context ceiling quickly.
3. Training: Balancing Capability Acquisition and Capability Retention
The biggest engineering risk in native multimodality is not failing to learn vision—it’s learning vision while losing text and code capability. A workable training plan proceeds in four stages:
- Alignment pretraining: Train the projection layer and backbone on large-scale image-text, interleaved image-text, and video-subtitle data to establish stable cross-modal mappings.
- Multi-task supervised fine-tuning: Mix general visual QA, document understanding, chart parsing, UI element grounding, and operation-trajectory prediction. Trajectory data should follow a uniform “observation–thought–action” three-part format so the model learns structured output.
- Preference alignment: Optimize preferences along dimensions such as “is the chosen action reasonable” and “does the task end prematurely,” which noticeably reduces ineffective clicks and idle loops.
- Capability retention: At every stage, replay sufficient pure-text and code corpora, and monitor text benchmark metrics. If regression appears, adjust the data mixture ratio first rather than adding more visual data.
There is no universal magic number for data ratios. Determine them through small-scale ablation experiments based on your business distribution, with “no text capability regression” as a hard constraint.
4. Closed-Loop Execution: Let the Model See, Think, and Act by Itself
The value of a natively multimodal agent only shows up in a closed loop. Both observation space and action space must be explicitly abstracted: the observation side unifies into screenshots plus structured state (e.g., a list of interactive elements); the action side converges into a finite set—click, type, scroll, navigate back, invoke tool, finish—avoiding the parsing ambiguity of free-text actions.
# Pseudocode: perception–reasoning–execution loopdef run_agent(task, env, model, max_steps=20):history = [system_prompt(), user(task)]for _ in range(max_steps):obs = env.observe() # screenshot + structured element statehistory.append(encode(obs)) # vision tokens and text tokens in one sequenceaction = model.parse(model.generate(history))if action.type == "finish":return action.payloadresult = env.execute(action) # click/type/scroll/tool callhistory.append(summarize(result)) # observation compression to limit context growthraise RuntimeError("step budget exhausted")
Three critical details: observation compression (diff unchanged frames and keep only changed regions), step budgets (to prevent infinite loops), and failure rollback (when there is no progress over consecutive steps, roll back to the last stable state and change strategy).
5. Evaluation: Multiple Dimensions, Not a Single Score
A single leaderboard cannot describe agent capability. Cover at least four dimensions: design-to-code fidelity (structure, styling, responsiveness), mobile UI operation success rate (cross-app, long-horizon tasks), document and chart understanding accuracy, and text/code capability retention. Also report process metrics: average steps, proportion of ineffective actions, and task timeout rate. Evaluation sets must be deduplicated and checked for contamination against training data, or the conclusions are not credible.
6. Engineering Checklist for Production
- Cost control: Set budget caps on visual tokens, tiered by task type; cache frequently repeated screenshots; combine batching and quantization to improve throughput.
- Observability: Persist each step’s observation summary, model output, and action result in structured form; connect to logging services and alerting with thresholds based on task success rate and step-count distribution.
- Elastic deployment: Run inference services on a container platform with autoscaling for traffic fluctuation; store large media assets and trajectory data in object storage.
- Security governance: Mask sensitive information in screenshots by default (account numbers, amounts, ID numbers); enforce least privilege for tool calls; require human confirmation for high-risk actions (payments, deletions, outbound messages); keep full audit trails.
7. Common Pitfalls
First, blindly chasing high resolution until visual tokens fill the entire context. Second, skipping text-capability regression tests. Third, designing an overly open action space. Fourth, accepting only success rate as the criterion while ignoring steps and cost. The way to avoid all of these is to understand “native” as unified architecture and training, not simply attaching a vision encoder.
In summary, the real barrier for natively multimodal agents lies in training data ratios and closed-loop engineering, not in any single model capability. Following the path above, you can achieve a controllable balance among fidelity, operation success rate, and text capability.
