Open-Source Multimodal LLM Architecture Evolution and On-Device Deployment Explained
A practical walkthrough of how the latest open-source multimodal LLM family evolved its architecture, what each key mechanism does, and what it costs engineering teams. It compares three generations of the design (previous generation, on-device transition version, and the new generation) across attention, KV cache sharing, embeddings, encoders, and MoE routing, then breaks down Per-Layer Embeddings (PLE), cross-layer KV cache sharing, heterogeneous multimodal attention, and sparse Mixture of Experts with example code. It also covers model-size-to-hardware matching, quantization and KV memory estimation based on producer layers, a four-step inference engine adaptation path, and a four-dimension evaluation baseline.
1. Why the New Generation of Open-Source Multimodal LLMs Is Worth Attention
Recent public materials have put a new family of open-source multimodal LLMs in front of developers. The goal is not simply to ship a bigger language model, but to cover a continuous range of scenarios — from phones, wearables, and lightweight PCs to desktop workstations and server-side inference. Based on an aggregated view of public information, the family spans roughly 2B, 4B, 12B, and 26B-A4B. Note that this article does not treat unverified details as established fact: every specific parameter count, layer count, expert count, and similar figure is presented as a composite example from public sources. For actual deployment, always defer to the official model card, paper, or release notes.
For individual developers and enterprise technical teams, whether a new model family is worth the investment usually comes down to three questions. First, is there a meaningful capability improvement? Second, will it run stably on the target hardware? Third, can the existing inference frameworks, quantization schemes, and toolchain adopt it at low cost? What makes a new model family interesting is not only the shift in parameter count, but a change in the combination of architectural mechanisms. Extending from on-device small models to server-class models is not a simple proportional scale-up; it carries mechanisms that were validated on-device into desktop and server settings, then recombines them according to each hardware tier.
So the focus of this article is not simply whether the model “feels good to use,” but three more concrete questions: What is actually new in this architecture? What engineering challenges do the new mechanisms introduce? How should you choose and evaluate a model across different hardware and scenarios?
2. How the Three Architecture Generations Actually Differ
To understand this generation, comparing it only with the immediately preceding generation is not enough. Between the previous generation and the new one sits a transition version aimed at on-device hardware. That transition version was the first to introduce key mechanisms such as Per-Layer Embeddings (PLE) and cross-layer KV cache sharing, and it validated the feasibility of these designs under the limited compute available on mobile devices. The new generation inherits and extends those ideas.
The table below organizes the typical differences across three generations along architectural dimensions, for engineering evaluation reference:
| Feature | Previous generation | On-device transition version | New-generation example |
|---|---|---|---|
| Attention mechanism | Hybrid attention | Hybrid attention | Hybrid attention |
| KV cache | Independent per layer | Cross-layer shared, ~10 layers | Cross-layer shared, ~18–20 layers |
| Embeddings | Shared embedding | PLE, injected directly after lookup | PLE with projection or fusion after lookup |
| QKV normalization | Q/K Norm | Q/K/V Norm | Q/K/V Norm, attention_scale can be set to 1.0 |
| V projection | Separate v_proj |
Separate v_proj |
Some models use K=V with no separate v_proj |
| KV head count | Uniform | Uniform | May be heterogeneous per layer |
| Vision encoder | SigLIP ViT | MobileNetV5 | SigLIP ViT plus a pooling layer |
| Audio support | None | Convolutional encoder | Industrial-grade speech encoder example |
| Mixture of Experts (MoE) | None | None | 26B-A4B example: 128 experts, Top-8 routing |
| Distinctive mechanisms | None | Alternating update layers, learned residual blocks, activation sparsity | K=V, heterogeneous KV heads, dual rotary position embeddings, and more |
From an inheritance perspective, the new generation can be split into three parts. The first part is inherited from the on-device transition version: Per-Layer Embeddings, cross-layer KV cache sharing, hybrid attention, QKV normalization, and native multimodal support. These mechanisms originally existed to break the capability ceiling of small-parameter models. The second part targets desktop and server scaling: the number of layers participating in KV cache sharing increases, and the vision and audio encoders are better suited to complex inputs. The third part is newly introduced heterogeneity — for example, some models drop the separate V projection, KV head counts differ across layers, text and images use rotary position embeddings at different scales, and large-parameter regimes add sparse mixture of experts.
The core idea of the new generation, then, is not simply to chase larger parameter counts. It is to take the design language validated on-device and systematically re-architect it around different hardware constraints.
3. Breaking Down the Key Mechanisms: What Is New and What Is Hard
3.1 Per-Layer Embeddings (PLE): Reallocating the Parameter Budget
A conventional Transformer decoder uses a single global embedding table. A token is looked up once, producing a hidden state that serves as the input to the first layer, and all subsequent layers compute from that state. The problem is that large vocabularies and multilingual capability substantially inflate the embedding matrix. For on-device models with only about two billion parameters or fewer, this overhead is especially pronounced.
PLE — Per-Layer Embeddings — takes a different approach: maintain a separate, smaller embedding table for each layer. Each table is looked up at the input of its corresponding layer and injected into that layer’s hidden state. The benefits show up in several ways. Parameters are spread across layers, making per-layer activated parameters easier to control. Lookup operations can be interleaved with per-layer computation, reducing the memory-bandwidth pressure of loading a large weight block all at once. And different layers can carry different information: lower layers lean toward word forms and local features, while higher layers lean toward semantics and task-relevant information.
In the on-device transition version, PLE vectors may be added directly onto the hidden state. The new generation may add a projection or fusion step, making the injection more controllable. The sketch below illustrates the mechanism:
import torchdef ple_forward(hidden, layer_idx, token_ids, ple_tables, layer_scale=1.0, ple_proj=None):# hidden: [batch, seq, hidden_dim]# token_ids: [batch, seq]# ple_tables: list[Tensor], one table per layer, shaped [vocab_size, ple_dim]ple = ple_tables[layer_idx][token_ids] # [batch, seq, ple_dim]# Optional: apply the per-layer projection matrixif ple_proj is not None and ple_proj[layer_idx] is not None:ple = ple_proj[layer_idx](ple)return hidden + layer_scale * ple
There are several adaptation points an inference engine has to handle. When loading weights, the engine must parse the “per-layer embedding table” structure rather than loading a single global embedding. Quantization error will not accumulate across all layers the way it does with a shared embedding, because each table is used only by its corresponding tokens. The compute graph now contains a new operator combination — “embedding lookup plus projection” — so you need to confirm the backend has an efficient implementation. And if the engine keeps embeddings in fast storage and swaps them in on demand, PLE distributes those swap-in operations across every layer, so caching and prefetch policies need adjusting.
3.2 Cross-Layer KV Cache Sharing: More Layers From Less Cache
During autoregressive decoding, every token needs the Keys and Values of previous tokens. Those tensors are stored in the KV Cache. Its memory footprint can be approximated as:
KV memory (bytes) ≈ 2 × producer layers × kv_heads × head_dim × sequence length × batch size × bytes per element
The factor of 2 accounts for the two tensors, K and V. The key point here is not the “total number of layers” but the number of “KV producer layers” — the layers that actually compute and write K and V. Sharing lets a subset of layers skip computing and storing their own K and V, reusing the result from an earlier layer instead. The on-device transition version shares roughly 10 layers; the new-generation example extends this to about 18–20 layers. A higher sharing ratio yields more visible memory savings with long sequences.
The more complete sketch below shows KV cache sharing:
def shared_group_of(layer_idx, groups):for group in groups:if layer_idx in group:return group[0]raise ValueError(f"layer {layer_idx} not found in any KV group")class SharedKVCache:def __init__(self, producer_layers, groups=None):# producer_layers: layers that actually compute K/Vself.producer_layers = set(producer_layers)if groups is None:# By default each producer layer forms its own group; consumer layers# can be assigned explicitly via groupsgroups = {i: (i,) for i in self.producer_layers}self.groups = groupsself.kv = {i: None for i in self.producer_layers}def set(self, layer_idx, k, v):if layer_idx in self.producer_layers:self.kv[layer_idx] = (k, v)# Consumer layers do not write again, to avoid memory inflationdef get(self, layer_idx):if layer_idx in self.kv and self.kv[layer_idx] is not None:return self.kv[layer_idx]producer = shared_group_of(layer_idx, self.groups.values())return self.kv[producer]def estimated_bytes(self, kv_heads, head_dim, seq_len, batch, dtype_bytes):# Estimate memory by producer layers, not total layersreturn (2* len(self.producer_layers)* kv_heads* head_dim* seq_len* batch* dtype_bytes)
The adaptation challenge for engines is that KV cache entries no longer map one-to-one onto layers: the engine must identify which layers are producers and which are consumers. The sharing scope may also stack with mechanisms such as sliding-window attention and attention scaling. In the memory estimation formula, the cache layer count must be replaced by the producer layer count, or you will over- or under-estimate memory needs. Sharing also narrows the tolerance for cache layout errors: if one layer writes incorrectly or is skipped, the error can propagate to every consumer layer.
3.3 Multimodal and Heterogeneous Attention: Unified Modeling of Vision, Audio, and Text
The new generation natively supports image and audio input, which means an on-device device can handle multiple task types with a single model. Its multimodal portion typically consists of three encoder components: a vision encoder, an audio encoder, and a unified projection interface.
The vision encoder is commonly structured as a vision Transformer backbone plus a pooling layer. The pooling layer aggregates visual features into a more compact representation, reducing the number of visual tokens fed into the language model. More visual tokens mean more compute and more KV cache overhead in the prefill stage, so controlling the visual token count is an important lever for on-device multimodal inference performance.
The audio encoder places more emphasis on completing speech recognition and semantic understanding under limited compute. Visual and audio features are projected, then fed into the language model together with the text token sequence. Architectural unification also means the inference engine needs separate preprocessing paths and resource budgets for each modality.
Meanwhile, several heterogeneous designs appear in the attention layers. Some models use K=V, where Key and Value share one projection result and the separate v_proj matrix is eliminated. Some models use different KV head counts per layer, so cache layout and attention operators must support per-layer configuration. Text and images may use dual rotary position embeddings at different scales, because image tokens are usually laid out on a two-dimensional grid, whose positional regularities differ from a one-dimensional text sequence. In addition, details such as QKV normalization and attention_scale fixed at 1.0 matter for numerical stability, and engine operators must align exactly — otherwise post-quantization accuracy can degrade noticeably.
3.4 Sparse Mixture of Experts: The Trade-Off Behind 26B-A4B
In the example configuration, 26B-A4B uses a Mixture of Experts structure. Total parameters are about 26B, configured with 128 experts, and each token is routed to only 8 of them, so a single inference pass activates roughly 4B parameters. The value is twofold: a larger total parameter count carries knowledge capacity, while a smaller activated parameter count keeps per-inference compute under control.
MoE also comes with clear costs. First, all expert weights must stay resident in memory. On consumer-grade GPUs or memory-constrained devices, loading and swapping expert weights can offset the benefit of fewer activated parameters. Second, routing imbalance overloads some experts while others sit idle, hurting throughput. Third, the inference framework needs capabilities such as expert parallelism and on-demand loading before sparsity translates into real gains. For these reasons, 26B-A4B is better suited to a memory-rich single-card server than to on-device hardware.
4. Hardware Selection, Quantization, and KV Memory: What to Prepare
Different configurations combine mechanisms differently, so their hardware requirements differ too. The table below gives a general matching approach:
| Configuration | Typical positioning | Architectural characteristics | Suggested hardware and use cases |
|---|---|---|---|
| ~2B on-device | Phones, wearables | PLE plus KV sharing, optimized for low power | Mobile NPU or CPU; offline assistants, notification summaries, real-time voice interaction |
| 4B class | Mid-range phones, lightweight PCs | A balance between on-device and desktop | Mobile NPU or entry-level discrete GPU; local Q&A, simple multimodal tasks |
| 12B class | Mainstream desktop | More complete vision and audio encoders | Consumer GPU or high-spec PC; document understanding, image-text Q&A |
| 26B-A4B | Server | 128 experts, Top-8 routing, ~26B total / ~4B activated | Data-center GPU; high-concurrency chat, code generation, batch content processing |
It is worth emphasizing that the specific mechanism combination of each configuration should follow the official release. In engineering practice, “read the model definition” should be the first step of deployment rather than assuming all configurations share an identical structure.
4.1 Quantization and KV Memory: Details That Are Easy to Miss
On-device deployment almost always involves quantization. Models using PLE and shared KV cache need particular attention on two points.
First, the precision of the per-layer embedding tables. There are many PLE tables, each small. If the same quantization strategy is applied to every table, error can compound across the injections at each layer. In practice, keeping higher precision for the PLE lookup portion and quantizing only the projection matrices to low bit-widths often keeps memory under control with little accuracy loss.
Second, KV cache quantization. After sharing, there are fewer caches in total, which makes the precision of each one more important. A common compromise is per-channel quantization for K while keeping V at higher precision, balancing memory against accuracy.
Memory estimation should also be based on producer layers. Using 20 producer layers, 8 KV heads, head_dim of 128, sequence length 8192, batch size 1, and FP16 storage:
KV memory ≈ 2 × 20 × 8 × 128 × 8192 × 1 × 2 bytes≈ 640 MiB
This uses FP16 with 2 bytes per element and counts only KV producer layers. If you reuse the older “estimate by total layers” formula, the estimate comes out substantially larger, which tends to push concurrency limits too low.
4.2 A General Path for Adapting Inference Frameworks
Faced with a new architecture, a reusable adaptation flow can be summarized in four steps:
- Parse the model definition: read the per-layer structure, including KV producer layers, per-layer KV head counts, whether a V projection exists, and the number and dimension of PLE tables, so you avoid hard-coded assumptions.
- Build the compute graph: wire PLE injection, shared KV reads, and heterogeneous attention in as distinct operators, and confirm the backend has a high-performance implementation for each.
- Calibrate quantization: first run an accuracy comparison on a small sample, then gradually widen the low-bit quantization scope.
- Load test and tune: fix input length and batch size, measure first-token latency, decode throughput, and peak memory, then optimize against the bottlenecks you find.
The code below works together with the ple_forward and SharedKVCache shown earlier to sketch the basic deployment flow:
import torch# Placeholder functions; replace them with real attention and FFN operators in deploymentdef attention_placeholder(hidden, cache):return hiddendef ffn_placeholder(hidden):return hiddenmodel_cfg = {"layers": [{"kv_shared": False},{"kv_shared": True},],"num_kv_heads": 8,"head_dim": 128,"ple_tables": [torch.zeros(100, 16), torch.zeros(100, 16)],"ple_proj": [None, None],}hidden = torch.zeros(1, 1, 16)token_ids = torch.zeros(1, 1, dtype=torch.long)producers = [ifor i, layer in enumerate(model_cfg["layers"])if not layer.get("kv_shared", False)]cache = SharedKVCache(producer_layers=set(producers))for idx, layer in enumerate(model_cfg["layers"]):hidden = ple_forward(hidden,idx,token_ids,model_cfg["ple_tables"],layer_scale=1.0,ple_proj=model_cfg["ple_proj"],)hidden = attention_placeholder(hidden, cache=cache)hidden = ffn_placeholder(hidden)
4.3 Evaluation: How Do You Decide Whether a Model Is Usable?
When judging whether a model is usable, it helps to establish an evaluation baseline across four dimensions.
First, capability. Public benchmarks show general ability, while your own business datasets validate vertical task performance. Multimodal models should additionally evaluate subtasks such as OCR, chart understanding, speech recognition, and image-text Q&A individually.
Second, performance. Separate prefill from decoding. First-token latency is driven mainly by prefill, and differences are pronounced with long text and image inputs. Decode throughput is affected by memory bandwidth and KV cache size.
Third, resources. Track peak memory, power draw, and thermals. For on-device hardware, also watch for performance decay under sustained operation.
Fourth, engineering cost. This includes model conversion time, quantization accuracy loss, compatibility with existing inference frameworks, and whether the deployment pipeline stays maintainable.
For practical evaluation, common tooling such as lm-evaluation-harness, OpenCompass, and VLMEvalKit can help build baselines. Text tasks can start with a command like:
lm_eval --model hf --model_args pretrained=your_model --tasks mmlu,gsm8k --batch_size 8
Multimodal tasks require a custom inference script, and you should consistently record metrics such as input resolution, visual token count, audio duration, and output length. When comparing models with different architectural mechanisms, parameter count alone is not enough, because designs such as KV cache sharing and MoE sparse activation make models with “the same parameter count” behave very differently in real memory and compute terms. Evaluations should be run on the same hardware, with the same quantization precision and the same input length.
5. Making End-to-Cloud Deployment Work
For teams planning to adopt this generation of models, three areas are worth pushing on.
First, keep light tasks on-device and heavy tasks in the cloud. On-device models suit privacy-sensitive, low-latency, offline-available scenarios such as local summarization, intent recognition after voice wake-up, and notification triage. Cloud models suit complex reasoning, long-document processing, and high-concurrency serving. The two can connect through a unified interface layer and route by task complexity.
Second, make model structure parsing part of the deployment process. Because the mechanism combination of the new generation varies by configuration, it is worth adding a structure validation step to the deployment pipeline that automatically checks whether KV producer layers, PLE tables, modality encoders, and similar settings match the inference engine’s assumptions, surfacing problems early.
Third, build observability. For cloud deployments, use the containers, logging, and monitoring capabilities available on mainstream cloud platforms to continuously track first-token latency, throughput, memory usage, and error rates, and let data drive tuning.
6. Conclusion
The value of the new generation of open-source multimodal LLMs lies not only in larger parameters and stronger capability, but also in the clear architectural evolution path it demonstrates: first solve the usability problem of small models on-device with mechanisms such as PLE and KV cache sharing, then extend those mechanisms to desktop and server, and adapt to different hardware conditions with designs such as heterogeneous KV heads, dual rotary position embeddings, and sparse mixture of experts.
For developers, this is both an opportunity and a challenge. The opportunity is that the barrier to on-device multimodal interaction drops further, giving new model foundations to offline assistants, real-time voice, and image-text understanding. The challenge is that inference engines need finer-grained structural awareness — the assumption that “one engine fits all models” is breaking down. Before committing, teams are advised to run a small-scale validation with their own business data, focusing on three metrics: quantization accuracy, memory usage, and first-token latency, and then decide whether to scale up deployment.
