Technical Architecture and Engineering Practices of Native Multimodal Large Models

    This article explains how native multimodal large models differ from拼接式 approaches, and walks through the key engineering decisions: hybrid attention for long contexts, MoE sparse activation to decouple total and active parameters, million-token context governance, visual self-verification loops, production cost and latency controls, and a five-dimension evaluation framework.

    Technical Architecture and Engineering Practices of Native Multimodal Large Models

    1. From “Bolted-On” Multimodality to Native Multimodality

    Over the past two years, the common industry approach to mixed image-and-text tasks has been to bolt together a vision encoder, a text LLM, and a projection layer: images are first encoded into visual features, then mapped into the language model’s embedding space, where the language model does the unified modeling. This approach is simple to implement, but it has three structural flaws.

    First, modality alignment happens late in training. The representation spaces of the vision branch and the language branch are hard to fuse fully, and fine-grained visual information (UI layout, chart ticks, document formatting) is noticeably lost during the mapping. Second, context handling is inconsistent: visual tokens and text tokens often follow different positional encodings and attention paths, which produces high variance in long-document scenarios. Third, the capability boundary is fixed by the design at assembly time — from day one of training, the model “believes” it mainly processes text.

    The native multimodal route brings text, images, video, and files into a unified token sequence and a unified objective function during pretraining. The model needs no bolt-on vision branch; cross-modal alignment and reasoning happen inside the same parameters and the same attention mechanism. The direct payoff: visual information is no longer “translated” but participates natively in semantic modeling, so performance is more stable on structured visual understanding, layout reconstruction, and chart reading.

    It is worth stressing that native multimodality does not mean “can do anything.” It is still a probabilistic model and its output is still text, so its value lies mainly in “understanding what it sees, stating it accurately, and editing it effectively” — not in replacing deterministic rule engines or database queries.

    2. Hybrid Attention: Balancing Long Context Against Inference Cost

    The first engineering problem native multimodality introduces is sequence length. A high-resolution screenshot, a document of dozens of pages, or a video clip can expand to hundreds of thousands of tokens, while the compute and memory cost of standard global attention grows quadratically with sequence length. Two mitigation paths are widely used — sparse attention and linear attention — and mixing them is currently the more mainstream practice.

    The core idea of sparse attention is “only compute what needs computing.” Common forms include local window attention (each token attends only to a neighboring window), global token attention (a few summary tokens interact with all positions), and block-level sparse patterns. It reduces complexity from O(n²) to roughly O(n·w), where w is the window or block size.

    Linear attention (and various state-space/recurrent formulations) rewrites attention into a state that can be updated recursively, so memory usage during inference is near-constant and throughput advantages are significant on long sequences. The cost is weaker long-range exact retrieval than global attention.

    The conventional configuration for a hybrid architecture: most layers use linear or local window attention to provide “breadth,” while a few layers keep global or sparse-global attention for “exact retrieval.” This division of labor keeps the memory curve manageable even at million-scale context. Illustrative layer-allocation logic (design intent only, not a specific product API):

    1. # Pseudocode: allocation strategy for hybrid attention layers
    2. def build_layers(num_layers, global_every=8):
    3. layers = []
    4. for i in range(num_layers):
    5. if i % global_every == 0:
    6. layers.append(AttentionLayer(kind="sparse_global")) # exact retrieval
    7. else:
    8. layers.append(AttentionLayer(kind="linear_local")) # breadth coverage
    9. return layers

    Three supporting practices are also required in engineering: first, tiered KV cache management, storing and evicting the states of global layers and linear layers separately; second, chunked prefill, to avoid memory spikes when a long document enters all at once; third, an extrapolation strategy for positional encoding, leaving headroom between training length and inference length.

    3. MoE Sparse Activation: Decoupling Total Parameters from Active Parameters

    The second problem for native multimodal models is the tension between capacity and cost. Multimodal understanding needs larger parameter capacity, but online inference is only willing to pay for the part that is actually activated. The Mixture-of-Experts (MoE) architecture is designed for exactly this: the total parameter count is very large, but each token is routed to only a few experts, so active parameters are far smaller than total parameters.

    Take the common industry scale of “roughly 320B total parameters, roughly 18B active.” The meaning is: training and storage must hold all expert weights, while the compute for a single inference pass depends only on the active part. Three conclusions follow directly.

    First, per-unit inference cost drops substantially, making a product direction of “frontier capability at Flash-tier cost” possible. Second, memory and bandwidth become the main bottleneck; loading expert weights and routing communication require careful scheduling, which in engineering usually relies on combining expert parallelism with tensor/pipeline parallelism. Third, layers can be “thinner” and “wider” — trading depth for branch width to gain stronger representation power under the same activation budget.

    For adopters, selection should look at neither total parameters alone nor active parameters alone, but at three observable metrics: cost per token, time to first token (TTFT), and the throughput decay curve under long context.

    4. Million-Scale Context: Capability, Cost, and Governance

    A context window of about 1 million tokens (1048576) is a qualitative change for document-heavy scenarios. Contract review, codebase understanding, meeting notes, and video content analysis can all be handled with a global grasp in a single request, without repeated slicing and summarization.

    But long context is not free. Engineering requires three layers of governance:

    • Input governance: do layout parsing and structured extraction first, converting scans and PDFs into structured text with positional information, reducing wasted tokens.
    • Context orchestration: use a two-stage strategy of “global summary + targeted extraction of key passages,” placing the most relevant evidence where the model’s attention is more reliable.
    • Output governance: require the model to provide citation locations and confidence scores, making human review easier.

    Illustrative context orchestration structure:

    1. [System instructions] role, output format, prohibited actions
    2. [Global summary] structured key points of the whole text (no more than 10% of budget)
    3. [Key evidence] original passages most relevant to the current question (with page/coordinates)
    4. [User question] explicit task and acceptance criteria

    5. The Visual Loop: Letting the Model Check and Improve Its Own Output

    The most engineering-valuable aspect of native multimodality is that visual understanding can enter a “self-verification” loop. Take document and office tasks: after the model generates PPTX, PDF, DOCX, or XLSX content, it can take the rendered result as image input again, check whether the layout overflows, whether charts are misaligned, and whether the font hierarchy is reasonable, then iterate on fixes. This is impossible with traditional text models, because a text model “cannot see” its own layout result.

    A reusable loop:

    1. Generate: the model produces structured content and style descriptions.
    2. Render: headless rendering into images/paged images in a container platform or function-compute environment.
    3. Review: feed the rendered image together with the original requirements into the model, which outputs an issue list (overflow, overlap, contrast, alignment).
    4. Fix: the model rewrites only locally against the issue list, avoiding a full rewrite that causes style drift.
    5. Regress: render and compare again, with a maximum iteration count and exit conditions.

    The same loop applies in code and front-end, game, and 3D scene construction: after the model generates an interface or scene description, visual review is done via screenshots or scene snapshots, then fixes are iterated, significantly improving the first-pass success rate.

    6. Engineering in Production: Cost, Latency, and Stability

    To bring the above capabilities into production, focus on these practices:

    • Tiered routing: simple requests go to small models or cache, complex multimodal requests go to the large model, avoiding runaway cost.
    • Caching: build semantic caches and result caches for repeated questions about the same document; hit rates are usually substantial.
    • Batching and async: offline document batch processing goes through asynchronous queues, online interaction goes through a low-latency channel, with the two using isolated resource pools.
    • Observability: collect TTFT, cost per token, failure rate, and long-context decay via logging services and monitoring/alerting, forming the basis for capacity planning.
    • Security and compliance: multimodal input may carry steganographic instructions or sensitive information, so content moderation and permission checks are needed at the entry point, and sensitive information masking on the output side.

    7. A Selection and Evaluation Framework

    For new model forms combining “native multimodality + sparse activation + long context,” a quantitative evaluation across five dimensions is recommended:

    Dimension Key question How to observe
    Visual granularity Can small text, chart ticks, and layout be read accurately Build a screenshot Q&A set
    Long context Is it still usable beyond 300k tokens Needle-in-a-haystack and cross-passage reasoning
    Cost Cost per token and total cost per task Load-test billing
    Latency TTFT and throughput on long inputs Tiered load testing
    Stability Does it degrade under high concurrency Canary rollout and failure drills

    8. Conclusion

    Native multimodality, hybrid attention, sparse activation, and million-scale context are together moving large models from “text assistant” to an engineering partner that can read, see, and self-check. For developers, the real competitive edge is not chasing a single metric, but embedding model capability into a controllable pipeline: governed input, orchestrated context, verified output, bounded cost. With general cloud capabilities such as the container platform, object storage, message queues, logging services, and monitoring/alerting offered by Baidu AI Cloud, teams can build this loop at relatively low cost and reliably turn frontier model capability into business value.