# On-Device Multimodal Open-Source LLMs: Architecture and Selection Guide
Open-source LLMs are shifting from the cloud to phones, embedded boards, and home workstations. This article explains how to choose among the model sizes typically offered by an on-device family: dense models around 31B, MoE models around 26B, and efficient models of about 4B and 2B parameters. It covers their architectures, including dense versus MoE routing, native text, image, video, and audio input for on-device agents, the dual RoPE setup for long context (standard RoPE in sliding-window layers and scaled p-RoPE in global layers), and Per-Layer Embeddings (PLE). It closes with a five-step evaluation checklist.
1. Why On-Device LLMs Are Gaining Momentum
Over the past two years, the main arena for open-source LLMs has been shifting from the cloud to the device. The reasons are straightforward: on-device inference can significantly reduce network latency, protect user privacy, and remain usable without connectivity. It also avoids the ongoing cost of cloud inference calls. Still, fitting a model into a phone, an embedded development board, or a home workstation means making careful trade-offs between a model’s capability ceiling and its resource footprint.
A mature on-device open-source model family usually ships several parameter sizes at once, forming a ladder from large to small. Understanding the architectural differences behind these sizes is the prerequisite for making the right choice.
2. Matching Parameter Tiers to Deployment Goals
A typical on-device model family includes the following tiers:
- Mid-to-large dense models (around 31B parameters): These target professional workstations or hosts with plenty of memory and pursue the highest possible capability. They make good general-purpose base models or starting points for fine-tuning.
- Mid-size MoE models (around 26B parameters): These have a sizable total parameter count, but each forward pass activates only a subset of experts. They balance capacity with inference cost.
- Efficient small models (around 4B and 2B parameters): These target memory- and power-sensitive scenarios such as phones and edge devices. They emphasize enough capability combined with minimal resource usage.
Here is a counterintuitive pattern that often goes unnoticed. By industry convention, MoE models usually have a larger total parameter count than dense models of comparable capability, since they contain multiple experts. Yet in some model families, the dense size is larger than the MoE size.
One plausible explanation is that the two architectures play different roles. MoE models serve as the cost-performance option: sparse activation lets them approach a much larger effective capacity at low latency and low bandwidth. Dense models set the capability ceiling: they trade densely stacked parameters for stable, predictable, high-quality output. The exact intent is of course up to each model’s authors. The more important engineering point is to decide on the deployment goal first and then work backward to a model size, rather than chasing parameter counts for their own sake.
3. Architectural Trade-offs: Dense vs. MoE
Understanding these two architectures is the foundation for evaluating an on-device model’s performance and cost.
Dense models
In a dense architecture, every token passes through all of the network’s parameters. This brings a fixed computation path, good hardware friendliness, and predictable inference behavior. The downside is that parameter and compute costs grow linearly with model size.
MoE models
A Mixture-of-Experts (MoE) architecture introduces a router that dynamically selects a few experts to process each token, leaving the rest inactive. As a result, the model can hold a large total parameter capacity while keeping the number of parameters activated per forward pass small.
# Simplified pseudocode for MoE routinglogits = router(x) # [batch, seq, num_experts]weights, expert_ids = topk(softmax(logits), k=2) # Each token activates only k expertsout = 0for expert, w in zip(expert_ids, weights):out = out + w * experts[expert](x) # Sparse compute: accumulate only selected experts
The key engineering challenge with MoE is load balancing. If routing persistently favors a few experts, it wastes memory and creates inference hotspots. Training therefore typically pairs the model with an auxiliary loss (a load-balancing loss) that constrains the routing distribution. During on-device inference, the focus shifts to the peak memory used by activations.
4. Native Multimodal Input: A Key Capability for On-Device Agents
Modern on-device models generally accept three input types: text, images (at variable resolutions), and video. More valuable still, some of the efficient small models natively support audio input and can accept short speech clips of a certain length (e.g., about 30 seconds).
This matters a great deal for on-device AI agents. In a traditional pipeline, enabling a device to “understand” a user typically requires attaching a separate speech recognition (ASR) model. That model first transcribes speech into text, which is then passed to the language model. This approach adds three kinds of cost: extra model memory, latency from serial inference, and the complexity of integrating multiple models.
With native audio input, on-device devices can handle simple speech tasks end to end without an external ASR model. This greatly simplifies the deployment architecture and makes lightweight agents on low-resource devices a reality. Such capabilities are not aimed at complex reasoning. Instead, they target high-frequency, simple tasks on the device.
5. Long-Context Design: The Dual RoPE Configuration
Reliable handling of very long contexts hinges on positional encoding. Rotary Position Embedding (RoPE) injects positional information by rotating the Query and Key vectors during attention computation. Long contexts, however, face a core conflict: local attention needs high-resolution positional discrimination, while global attention needs positional representations that can extrapolate over long distances.
One approach worth noting is the dual RoPE configuration:
- Sliding-window layers (local attention) use standard RoPE: Each token attends only to its neighbors within a fixed window. Complexity drops from O(n²) to O(n·w), preserving precise positional discrimination over short distances.
- Global attention layers use proportional/scaled RoPE (p-RoPE): Scaling the positional frequencies allows the global layers to extrapolate stably to longer sequences.
# Simplified pseudocode for dual RoPEif layer.is_sliding_window:q, k = apply_rope(q, k, base=theta_standard, pos=local_positions)attn = sliding_window_attention(q, k, v, window=w) # Local: high precision at short rangeelse: # Global layersq, k = apply_rope(q, k, base=theta_scaled, pos=global_positions)attn = full_attention(q, k, v) # Global: extrapolates over long range
This layered design, precise locally and extensible globally, lets the model capture long-range dependencies while keeping computation under control.
6. Per-Layer Embeddings (PLE): Injecting Token Information on Demand
In a standard Transformer, each token receives a single embedding vector on entering the network. This means the model must pack into that initial embedding all the information that later layers might need. As the network gets deeper, some token-level details that shallow layers cannot perceive may already have been diluted.
Per-Layer Embeddings (PLE) address this problem by introducing a parallel, low-dimensional conditioning path:
- In addition to the main embedding, the model maintains a low-dimensional codebook that generates a small conditioning vector for each token.
- Each layer’s dedicated up-projection maps that vector into a conditioning signal, which is injected into every decoder layer.
- This combines token-identity signals with context-aware signals, so each layer can obtain token-specific information when it needs it, rather than having everything crammed into the initial embedding.
# Simplified pseudocode for Per-Layer Embeddingsbase_emb = token_embedding(token_ids) # Main embeddingple_codes = ple_embedding(token_ids) # Low-dimensional codebook, shaped [batch, seq, d_ple]h = base_embfor idx, layer in enumerate(layers):layer_cond = layer.ple_upproj[idx](ple_codes) # Per-layer up-projection to a conditioning signalh = layer(h, cond=layer_cond)
Memory efficiency is important here. Naively storing a full-dimensional embedding table for every layer multiplies the parameter count by the number of layers, which is something on-device models simply cannot afford. Instead, PLE stores the per-layer embeddings in a low-dimensional, factorized form and recovers the conditioning signals through a small up-projection in each layer. This delivers the benefit of per-layer token information injection at a very small memory cost. The idea was inherited from the previous generation of models and has been refined since. It is an important engineering technique for boosting the expressive power of on-device models within a limited parameter budget.
7. Evaluation and Selection Practices
When evaluating multiple sizes of an on-device open-source model, the following framework is recommended:
- Define the deployment goal first: Determine the target device’s available memory, bandwidth, and power budget. Then work backward to an acceptable model size and precision (e.g., whether quantization is needed).
- Distinguish each model’s role: Treat large dense models as the capability ceiling and fine-tuning base. Treat MoE models as the cost-performance workhorses. Treat efficient small models as the lightweight on-device deployments.
- Validate the multimodal pipeline: If your tasks involve speech, first check whether the model natively supports audio input and whether that lets you skip an external ASR model.
- Stress-test long context: Test with real long documents to see whether the dual RoPE setup stays stable at the sequence lengths you care about and whether positional extrapolation breaks down.
- Check fine-tuning feasibility: Mid-to-large dense models are generally better suited as open-source bases for domain fine-tuning. You can further converge them to vertical tasks using labeled data.
8. Conclusion
The competitiveness of on-device multimodal open-source LLMs lies not in any single parameter metric. It lies in the overall fit between architecture design and deployment goal. The layered dense/MoE design, native multimodal input, the dual RoPE long-context approach, and PLE’s per-layer conditioning together form a systematic design philosophy for resource-constrained devices. For developers, understanding the trade-off logic behind these mechanisms has more long-term value than memorizing any single model. It enables rational selection and fine-tuning decisions in a fast-evolving open-source ecosystem.
