Native Multimodal Agents: Unified Vision Encoding and Cluster Parallel Orchestration

    This article explains why native multimodal models — which fuse vision and language from pre-training rather than bolting a vision encoder onto a finished text model — are replacing the language-first paradigm. It breaks down the three-stage unified architecture (vision feature extraction, cross-modal projection alignment, and unified language-backbone modeling), the two key vision-encoder design choices (native-resolution patch packing and full weight sharing between images and video), and a phased decoupled-encoder training pipeline. It then covers moving from single-agent reasoning to cluster-level parallel orchestration, including serial latency bottlenecks, three parallel topologies, and core implementation concerns such as tool idempotency, minimal shared context, and recoverable failures. Finally, it offers a four-layer evaluation framework, deployment and operations essentials, and a practical implementation checklist.

    Why the “Language-First, Vision Bolt-On” Paradigm Is Being Replaced

    The conventional recipe for building multimodal models has been a two-stage process: first train a capable text-only language model, then attach a vision encoder, freeze both sides, and train only one or two projection layers in between. This path is low-risk engineering-wise and lets you reuse existing assets quickly, but it carries a structural flaw — the language capability is already “locked in” before vision is connected, and the way visual signals get injected is confined to the narrow channel of the projection layer.

    The problems that follow are very common in real projects:

    • Capabilities trade off against each other. Once you loosen the learning rate during joint fine-tuning, gradients from visual data overwrite existing language representations, producing clear regressions in language reasoning and code generation; tighten it, and the vision side won’t learn.
    • Fine-grained information is lost to compression. Forcing image patches into a small number of vectors isomorphic to text tokens quantizes away layout structure, small fonts, and chart ticks first; no amount of later modeling recovers them.
    • Data mixing ratios are hard to tune. The sampling ratio between image-text pairs and pure text requires repeated trial and error, with little interpretable basis for adjustment.
    • Modality conflict. The two modalities have inherently different optimal optimization step sizes, effective learning rates, and gradient scales; forcing them into one training pipeline makes loss curves prone to oscillation.

    The native-fusion idea promotes vision from a “bolt-on input” to a “first-class citizen”: feed text and image/video corpora in parallel during pre-training, let the global reasoning ability on the language side constrain the semantic abstraction of visual representations, while letting concrete observations on the vision side strengthen grounding on the language side — forming bidirectional reinforcement rather than one-way adaptation.

    The Three-Stage Pipeline of a Unified Architecture

    Regardless of implementation specifics, this class of model can be abstracted into three stages, and the key is that all three share the same semantic space and the same optimization objective.

    1. Vision feature extraction. Images and videos are split into patches and encoded into a sequence of visual tokens. This layer is only responsible for “seeing clearly” and outputs scale- and position-dependent fine-grained representations.

    2. Cross-modal projection alignment. A lightweight multi-layer perceptron maps visual tokens into the language model’s embedding dimension. It carries the “translation” duty between modalities and is also the module most in need of anti-overfitting measures in mid-training.

    3. Unified modeling by the language backbone. Projected visual tokens are concatenated with text tokens into one unified sequence and fed into the language backbone for end-to-end autoregressive modeling. The backbone is usually a Mixture-of-Experts (MoE) structure; the benefit is keeping per-token activation manageable even at very large total parameter counts — which matters especially for multimodal scenarios, where the number of visual tokens is typically several to dozens of times that of text.

    Here is a schematic of the forward pass:

    1. def forward(messages, images=None, video_frames=None):
    2. text_ids = tokenize(messages)
    3. # 1) Vision side: keep native resolution, pack patches into a 1D sequence, no resize/crop
    4. vis_feats = []
    5. for img in images or []:
    6. patches = to_patches(img, patch_size=14) # aspect ratio preserved as-is
    7. vis_feats.append(vision_encoder(patches))
    8. # 2) Images and videos share the same encoder weights: every 4 frames form one spacetime volume
    9. for group in chunk(video_frames or [], size=4):
    10. spacetime = stack(group).flatten(0, 1) # fold time dimension into sequence dimension
    11. vis_feats.append(vision_encoder(spacetime))
    12. # 3) Projection alignment + sequence concatenation, then into the unified language backbone
    13. vis_embeds = projector(vis_feats)
    14. txt_embeds = text_embedding(text_ids)
    15. seq, mask, pos = merge_with_position(txt_embeds, vis_embeds)
    16. return language_backbone(seq, mask, pos)

    Worth noting is merge_with_position: once visual tokens are inserted into the sequence, positional encoding must be redesigned, otherwise the model can’t distinguish “there was an image before this text” from “this text itself.” A common approach is to assign each image block a continuous but independent range of positions, and to restrict visual tokens in the attention mask so they can only attend to tokens within the same sample.

    Two Key Design Choices for the Vision Encoder

    Native Resolution and Variable Inputs

    Traditional preprocessing forces any input to a fixed side length, then crops it into several sub-images. This hurts most for scenarios where information density is concentrated locally — documents, tables, UI screenshots, engineering drawings — because once text is scaled down, recognition difficulty rises non-linearly.

    A more reasonable approach is patch packing: after cutting a single image into patches, flatten them directly into a 1D sequence with no geometric transformation. This yields three direct benefits:

    • Any aspect ratio and resolution is supported as-is; long screenshots and portrait documents are no longer cropped;
    • Visual information is lossless before encoding, and OCR and fine-grained localization tasks benefit most;
    • Sequence length becomes a tunable “precision knob” — when higher precision is needed, just raise that sample’s token budget.

    The cost is equally clear: the number of patches grows quadratically with resolution, and attention cost rises accordingly. Engineering must pair this with inter-sample mask isolation (pack multiple short samples in one batch but don’t let attention cross samples), dynamic token-budget allocation, and hierarchical downsampling on the vision side to keep memory and throughput in check.

    Full Weight Sharing Across Images and Videos

    The most common implementation of video understanding adds a dedicated module or branch for the temporal dimension, which brings a double burden of training and maintenance. A more economical approach extends the patch-packing idea from the spatial to the temporal dimension: take several consecutive frames to form a spacetime volume, jointly flatten and pack the 2D patches of multiple frames, and hand them to the same encoder to jointly model spatial and temporal attention.

    The value of this design is a single knowledge-transfer path — image understanding transfers directly to video with no need to align two representations; and the model has only one set of vision weights and one set of inference operators, significantly lowering the complexity of deployment and quantization. The tradeoff is the length of the frame group: too large a group gives a better temporal receptive field but memory and latency rise linearly, so long videos still require outer-level segmented sampling and temporal compression.

    A Decoupled-Encoder Training Pipeline

    Native joint training is not as simple as “mixing two kinds of data into the same dataloader.” The real difficulty is load imbalance: the language backbone is a sparse-expert structure while the vision encoder is a dense network, and their compute and communication characteristics differ greatly, so a single parallel pipeline easily produces severe waiting bubbles.

    A route that has proven relatively stable is phased decoupling:

    1. Alignment phase. Freeze the backbone and encoder, train only the projection layer, and use small-to-medium image-text pairs to quickly pull the two modality spaces into the same coordinate system.
    2. Vision-augmentation phase. Unfreeze the vision encoder, mixing in a certain proportion of pure-vision tasks (detection, chart understanding, document parsing) as “replay” to prevent the vision side from regressing during language-capability training.
    3. Joint phase. Fine-tune end-to-end at a small learning rate, adjusting the sampling ratio of language and vision data in a closed loop based on validation-set performance rather than fixing it by experience.

    Supporting engineering discipline includes: strictly aligning checkpoint versions of the vision encoder and backbone and recording data-mixing-ratio snapshots; layered learning rates rather than a single global one; running a fixed regression set after each phase so that “capability regression” becomes an observable metric rather than an incident discovered after the fact.

    From a Single Agent to Agent Cluster Parallel Orchestration

    Where the Latency Bottleneck of Serial Execution Lies

    The most common form of a single agent is an alternating “reason–act” loop: the model thinks a step, calls a tool, reads back the result, and thinks about the next step. This chain is fully serial, with end-to-end latency roughly equal to “number of model calls × per-call latency + number of tool round trips × per-tool latency.” When a task involves retrieval, database queries, running tests, and comparing multiple sources, the number of steps easily reaches dozens, and what the user perceives is a long unresponsive period.

    Worse is context bloat: the observation of each step is appended to the context, so later calls get slower and more expensive, forming a positive feedback loop of latency.

    Three Usable Parallel Topologies

    Topology Use case Main risk
    Fan-out/fan-in Sub-tasks are mutually independent, e.g., batch processing of similar files, parallel research across multiple sources Result merging and conflict resolution at the aggregation stage
    Pipeline Stages have sequential dependencies, but different samples can be advanced in an interleaved manner Upstream errors amplifying downstream
    Hierarchical delegation (orchestrator–executor) The top layer plans and makes trade-offs, and the lower layers execute independently Orchestrator context pressure, loss of control over delegation granularity

    What really caps the upside isn’t how much parallelism you open up, but the quality of task decomposition. Decompose too finely and scheduling and aggregation overhead eats the parallel gains; decompose too coarsely and it can’t be parallelized at all. Following the general rule of parallel speedup: the serial fraction sets the speedup ceiling, so the highest-priority action is always to first identify and compress the non-parallelizable segment of the chain (usually the final adjudication and write operations).

    Core Implementation of the Orchestration Framework

    1. async def run_cluster(task, spec, max_parallel=8):
    2. subgoals = await planner.split(task) # decompose into weakly-dependent subgoals
    3. sem = asyncio.Semaphore(max_parallel) # adaptive parallelism + tool-side rate limiting
    4. async def run_one(sg):
    5. async with sem:
    6. for attempt in range(3): # retry only on retryable errors
    7. try:
    8. return await executor(single_agent)(sg)
    9. except TransientError:
    10. await asyncio.sleep(2 ** attempt)
    11. return Failure(sg, reason="exhausted")
    12. batches = group_by_dependency(subgoals) # parallel within a layer, serial across layers
    13. results = []
    14. for layer in batches:
    15. results += await asyncio.gather(*(run_one(s) for s in layer))
    16. return await reducer.merge(results) # consistency checks and conflict resolution

    When implementing parallel orchestration, a few things matter more than “opening up concurrency”:

    • Tool idempotency. The premise of parallel retries is that repeated execution has no side effects; write-type tools must carry an idempotency key or be turned into a single-writer queue.
    • Minimizing shared context. Sub-agents should share only necessary facts (a shared blackboard / structured results) rather than the entire conversation history, otherwise the context-bloat problem scales proportionally.
    • Making the merge strategy explicit. When multiple sub-tasks return conflicting conclusions, there must be a clear adjudication rule (priority, confidence, secondary verification); you can’t default to “concatenate all results.”
    • Recoverable failures. Any single sub-task failing shouldn’t waste the whole cluster run; partial results need to be persisted with resumable checkpoints.
    • Scenarios not suited to parallelism. Strong sequential dependencies, shared mutable state, external services with explicit rate limits, and operations requiring global consistency — forcing parallelism here only turns consistency problems into hard-to-debug intermittent failures.

    How to Validate: What Evaluation Dimensions Should Cover

    Reporting a single leaderboard score is not enough to judge a system-level capability like a “multimodal agent,” so it’s best to organize evaluation in four layers:

    • Perception layer: document and table parsing, chart reading, UI screenshot understanding, fine-grained localization — directly testing whether the native-resolution design actually works.
    • Reasoning layer: code generation and repair, mathematical derivation, cross image-text evidence synthesis.
    • Tool layer: function-call correctness, parameter-construction correctness, exception recovery, redundant-call rate.
    • System layer: end-to-end task success rate, P50/P95 latency, per-task token and cost consumption, human-intervention rate.

    System-layer metrics are often what the business truly cares about. The same model may have close success rates under serial and parallel orchestration, but P95 latency and cost can differ by several times; this gain must be quantified separately, or it gets buried in accuracy numbers.

    Deployment and Operations Essentials

    • Inference side: elastic containers absorb traffic peaks, with dynamic batching and KV-cache reuse enabled; capacity planning must reserve headroom specifically for visual tokens, which are the main source of latency and memory usage.
    • Storage and traffic: put images, videos, and long documents in object storage, run task queues through a message queue for peak shaving, and avoid pushing large objects directly through the application layer.
    • Observability: integrate logging and monitoring/alerting, and trace the call chain of every agent step (which step timed out, which tool errored, which sub-task was executed repeatedly). When deploying on Baidu AI Cloud, these capabilities can be combined on demand as general-purpose infrastructure components, with no need to build them in-house.
    • Cost optimization: cache visual features for frequently recurring images, dynamically adjust resolution and parallelism by task value, and write the budget explicitly into the orchestration strategy rather than cutting it after the fact.

    Implementation Checklist

    1. First confirm whether the business bottleneck is latency or accuracy — the optimization levers are completely different, and mixing them often means meeting neither.
    2. Don’t take the shortcut of uniform scaling for visual preprocessing; document and UI scenarios are extremely sensitive to resolution.
    3. When training or fine-tuning a multimodal model, always keep a pure-language regression set to prevent one-way capability regression.
    4. Before moving to cluster orchestration, refactor tools for idempotency; otherwise concurrency turns intermittent failures into data errors.
    5. Build the evaluation set to match the real business distribution and include the long tail, while keeping a human baseline — otherwise you can’t distinguish “the model got stronger” from “the problems got easier.”
    6. Put latency, cost, and success rate on the same dashboard, and close the loop on any architecture change with these three metrics.