On-Device Multimodal LLMs: Architecture Evolution and Inference Adaptation Explained

    On-device multimodal large models are changing how text, image, and audio understanding and generation run on resource-constrained devices such as phones, tablets, in-car systems, and desktops. To preserve quality within limited memory, compute, and power budgets, designers increasingly adopt non-standard mechanisms—mixed attention, cross-layer KV cache sharing, per-layer embeddings, sparse expert routing, and value-key projection sharing. These innovations raise per-parameter efficiency but break assumptions that mainstream inference engines are built on, sharply increasing the complexity of format conversion, graph export, operator completion, and deployment tuning. Rather than treating any single model in isolation, this article frames these new architectures as a general adaptation problem: it traces their evolution, breaks down the core mechanisms, and offers a reusable engineering methodology for evaluating and adapting the new generation of on-device multimodal open-source models.

    Introduction: Why On-Device Multimodal LLMs Deserve a Fresh Look

    The past two years of open-source large-model development have followed two clear lines. One is steadily scaling up parameter counts to push stronger general reasoning. The other is “pushing capabilities down,” compressing multimodal understanding and generation—for text, images, and even audio—into a footprint that can run on phones, tablets, in-car systems, and desktops.

    To preserve as much quality as possible within limited memory, compute, and power budgets, model designers have started adopting a range of “non-standard” architectural mechanisms: mixed attention, cross-layer KV cache sharing, per-layer embeddings, sparse expert routing, and value-key projection sharing, among others.

    These innovations significantly improve per-parameter efficiency, but they introduce a practical tension: mainstream inference engines often rest on simple assumptions—that every layer is structurally homogeneous, that each layer independently holds its own KV cache, and that a single input embedding is shared globally. Once a model breaks these assumptions, the complexity of format conversion, graph export, operator completion, and deployment tuning rises sharply. So rather than looking at a specific model in isolation, it is better to abstract these new architectures into a general adaptation problem. Using “how to evaluate and adapt the new generation of on-device multimodal open-source models” as the main thread, this article traces the patterns of architectural evolution, breaks down the core mechanisms, and distills a reusable engineering methodology.

    Part 1: The “Three-Stage” Arc of Architectural Evolution

    These model families rarely appear out of nowhere. They typically evolve through three stages: a general dense model → an on-device multimodal transition → a new-generation series. The table below summarizes the direction of capability evolution from a neutral perspective:

    Dimension Early general design On-device transition version New-generation series
    Attention Mixed attention Mixed attention Mixed attention (local + global, dual RoPE)
    KV cache Independent per layer Partial sharing (~10 layers) More sharing (~18–20 layers)
    Embedding scheme Global shared embedding Per-layer embedding (direct lookup injection) Per-layer embedding (lookup + projection fusion)
    QKV normalization Q/K Norm only Q/K/V Norm Q/K/V Norm + attention scaling factor
    Value projection Independent v_proj Independent v_proj Some variants K=V, no independent v_proj
    KV heads Uniform Uniform Heterogeneous KV heads (differ per layer/variant)
    Vision encoding ViT-style image-text alignment encoder Lightweight convolutional vision backbone ViT-style encoder + pooling layer
    Audio encoding None Convolutional + attention hybrid encoder Enhanced convolutional + attention audio encoder
    Sparse experts None None Sparse MoE (Top-k routing)
    Signature mechanism — Alternating upsampling, inter-layer residual blocks, activation sparsity K=V, heterogeneous KV heads, dual RoPE

    From this we can read a clear evolution path. While the new-generation series inherits the transition version’s per-layer embeddings, KV sharing, mixed attention, QKV normalization, and native multimodal capabilities, it also adds more aggressive efficiency techniques: value-key projection sharing, heterogeneous KV heads, dual RoPE positional encoding, and sparse experts. On the spec side, it covers multiple tiers ranging from small on-device parameter sizes to desktop/server-class large models, forming a “one architecture, multiple specs” product matrix.

    Understanding this arc matters: when adapting an inference engine, the graph structure for different tiers and different modality combinations is not always identical, so you cannot rely on a single template to “cover everything.”

    Part 2: Breaking Down the Core Architectural Mechanisms

    2.1 Mixed Attention and Dual RoPE

    Pure global attention makes the KV cache grow linearly with sequence length under long contexts—an on-device burden. Mixed attention works by alternating stacked local window attention (which looks only at nearby tokens, handling local detail and efficiency) with global attention (which spans the full sequence, handling long-range dependencies). To further distinguish the “positional-perception scale” of the two layer types, some designs assign different RoPE base frequencies to local and global layers (so-called “dual RoPE”), making local layers better suited to short-range and global layers better suited to long-range.

    Adaptation point: the inference engine must configure different attention masks and positional-encoding parameters for different layers. It cannot assume “one mask and one RoPE base frequency for the whole model.”

    2.2 Cross-Layer KV Cache Sharing

    This is one of the most on-device-friendly mechanisms. In the traditional structure, every layer maintains its own independent KV cache. In a shared structure, a subset of “consumer layers” directly reuse the K/V computed by a designated “producer layer” and only compute their own Query. This drastically reduces total KV cache size and memory footprint, while slightly lowering compute because the K/V projections are skipped.

    1. def forward(layers, x, kv_cache):
    2. for i, layer in enumerate(layers):
    3. if layer.shares_kv_from is not None:
    4. k, v = kv_cache[layer.shares_kv_from] # reuse the producer layer's K/V
    5. else:
    6. q, k, v = layer.qkv_proj(x)
    7. kv_cache[i] = (k, v) # this layer is a KV "producer"
    8. out = scaled_dot_product_attention(q, k, v)
    9. x = x + layer.mlp(layer.norm1(out))
    10. return x

    The difficulty is that the engine’s KV cache management must support “layer-to-layer” references and clearly identify which layers are producers and which are consumers. Otherwise it either allocates duplicate memory or reads the wrong tensor. When the number of shared layers grows from about 10 to 18–20, this dependency graph becomes more complex and must be statically resolved at graph-conversion time.

    2.3 Per-Layer Embeddings (PLE)

    To improve per-layer expressiveness within a limited parameter budget, per-layer embeddings give each Transformer layer its own embedding lookup table and inject that layer-specific embedding into the layer input, added on top of the globally shared embedding. The new-generation design also introduces “lookup + projection fusion,” using a small projection to map the layer embedding into the hidden dimension before adding it.

    1. h = shared_embedding(input_ids) # global shared embedding
    2. for i, layer in enumerate(layers):
    3. layer_emb = layer.embedding_lookup(input_ids) # layer i's dedicated embedding
    4. h = layer.inject(h + layer.embedding_proj(layer_emb)) # lookup + projection fusion
    5. h = layer.transformer_block(h)

    These embedding tables can be sizable yet participate in little computation, making them an invisible major consumer of on-device memory. When adapting, you must account for them in memory planning and evaluate whether shared storage, on-demand loading, or low-precision storage can reduce the overhead.

    2.4 Normalization and Value Projection Optimization

    For stability, the new generation generally extends normalization to all three of Query, Key, and Value (Q/K/V Norm) and may introduce an attention scaling factor (e.g., set to 1.0) to calibrate the logit scale. For efficiency, some variants adopt K=V binding—the key and value share the same projection tensor, and the independent v_proj is removed to save parameters and compute.

    1. # Simplified illustration of K=V binding: one projection produces both K and V
    2. kv = kv_proj(x)
    3. k, v = kv, kv # no separate v_proj computed

    The adaptation trap is that if the operator library assumes “an independent v_proj must exist” or “the attention scaling factor is fixed at 1/√d,” it will not match the model’s real graph and will cause numerical deviation. During conversion, verify layer by layer the normalization type, scaling factor, and whether projections are bound.

    2.5 Heterogeneous KV Heads

    Grouped-query attention (GQA) already reduces the number of KV heads below the number of Q heads. Heterogeneous KV heads go further, allowing different layers, and even different variants, to use different numbers of KV heads and group sizes. This means the attention operator cannot be described with a single uniform shape template; kernels must adapt dynamically to the actual head count or dispatch across multiple templates. This is one of the easiest places to trip up when reusing one engine across variants.

    2.6 Multimodal Encoding

    Multimodal capability is the core selling point of these models. A typical configuration uses a vision-language alignment encoder (ViT-style) plus a pooling layer to compress image features into the language hidden space; the on-device transition version may use a lighter convolutional vision backbone to reduce compute. On the audio side, a Conformer-style encoder that hybridizes convolution and self-attention often processes acoustic frame features. Adaptation point: vision and audio encoders are often independent subgraphs, and their input preprocessing (image cropping, normalization, mel-spectrogram extraction, etc.) must be strictly aligned with the engine’s input pipeline, or feature misalignment will directly break the output.

    2.7 Sparse Experts (MoE)

    Some larger variants use a mixture of experts (MoE): the total parameter count is very large, but each token is routed by a gating network to only the Top-k experts for computation, balancing “large-model capacity” against “low activated compute.”

    1. gate = softmax(gating(x)) # [tokens, num_experts]
    2. topk_idx, topk_val = topk(gate, k=8) # example: Top-8 routing
    3. out = zeros_like(x)
    4. for idx, w in ...:
    5. out += w * experts[idx](x) # only activate the selected experts

    Adaptation point: the MoE challenge is not any single operator but dynamic, data-dependent routing—expert selection changes with the input and is hard to compile statically. A safer on-device approach is to batch as much as possible, reduce branching, or converge the routing distribution based on empirical data. Also note that expert weights occupy substantial memory, requiring careful memory and quantization strategies.

    Part 3: Key Challenges in Inference Engine Adaptation

    Bringing these mechanisms down to an on-device inference framework concentrates the main difficulties in four areas:

    1. Conversion and export: Per-layer embeddings, K=V binding, heterogeneous KV heads, dual RoPE, and MoE routing all alter the computation-graph topology. If the conversion tool relies on fixed templates, it will easily fail at export time with “operator missing” or “shape mismatch.” It is advisable to prefer toolchains that support graph-level customization and can pass through arbitrary layer configurations.
    2. Operator completion and graph optimization: You need to add or rewrite operators for dynamic routing, cross-layer cache references, and non-uniform attention shapes, and perform operator fusion (e.g., merging QKV normalization, projections, and binding logic) to reduce memory access and launch overhead.
    3. Memory and KV cache management: While KV sharing lowers the total, it requires the cache manager to support inter-layer references; per-layer embedding tables and MoE expert weights are the big memory consumers and must be included in a unified budget with on-demand loading evaluated.
    4. Quantization strategy: Different modules have different sensitivity to precision. Attention projections, per-layer embeddings, and expert weights should each get tailored quantization schemes, and you should stay sensitive to the input distributions of multimodal encoders to avoid post-quantization feature drift.

    Part 4: How to Evaluate: A Practical Set of Dimensions

    For these new models, “is it good to use” should be broken into quantifiable dimensions rather than judged by a single leaderboard:

    • Quality: General benchmarks plus private evaluation sets for the target business scenario; multimodal cases additionally need specialized sets for image QA, OCR, and speech understanding. Focus especially on quality regression before vs. after quantization.
    • Inference efficiency: Measure Prefill (time to first token, TTFT) and Decode (per-token time, TPOT) and throughput separately; on-device cases also need peak memory and power consumption.
    • Multimodal completeness: Whether the vision/audio encoders connect properly, whether feature alignment is accurate, and whether cross-modal output is stable.
    • Adaptation difficulty: Conversion success rate, number of missing operators, and the cost of reusing one engine across specs—often the most realistic cost item in engineering delivery.

    Part 5: Selection and Deployment Recommendations

    1. Match the tier to the device: On-device cases should prioritize small parameter tiers; desktop/server cases can choose large or sparse-expert tiers. First establish the target device’s compute and memory ceiling, then work backward to the tier.
    2. Verify, then migrate: First confirm the model itself is correct on a reference implementation, then migrate layer by layer to the target engine. When you hit numerical deviation, suspect K=V binding, scaling factors, dual RoPE, and heterogeneous KV heads first.
    3. Tune quantization per layer: Design quantization and calibration strategies separately for attention, per-layer embeddings, experts, and multimodal encoders to avoid a “one-size-fits-all” approach.
    4. Cloud hosting and operations: For large-scale deployment, container platforms can host inference services, object storage can manage model files and multimodal assets, and monitoring/alerting and log services can track latency, throughput, and error-rate metrics. General-purpose capabilities from cloud platforms (such as Baidu AI Cloud) can serve as a deployment foundation, supporting elastic scaling and observability.

    Part 6: Conclusion

    The value of the new generation of on-device multimodal large models lies not in any single spec or leaderboard, but in how it pushes the “efficiency-first” design philosophy to a new level: mixed attention, cross-layer KV sharing, per-layer embeddings, heterogeneous KV heads, and sparse experts—each mechanism trades fewer resources for better per-parameter efficiency. For developers, the real capability is not knowing how to use a particular model, but being able to abstract this set of “non-standard architectures” into a general adaptation methodology. Understanding the trade-off behind each mechanism is what lets you stay composed across selection, conversion, quantization, and deployment—making both on-device and cloud inference efficient and robust.