Open-Source LLM Spec Tiers Explained: Edge Deployment and Architecture Analysis
A recent release from a major open-source LLM family shipped several sizes at once: a large dense model, a smaller Mixture-of-Experts (MoE) model that activates only part of its parameters per token, and two small models tuned for the edge, each trading off between lower memory footprint and stronger multimodal capability. This article treats that multi-size lineup as a case study, unpacking the engineering logic across three layers—architecture, modality inputs, and long-context mechanisms—and closing with practical advice on model selection, evaluation, and fine-tuning for on-device deployment.
Recently, a major open-source LLM family shipped several sizes at once: a dense model with the largest parameter count, and from the same family an MoE model with slightly fewer total parameters that activates only part of them per token. There were also two small models optimized specifically for the edge, trading off between lower memory footprint and stronger multimodal capability.
Around this release, the developer community’s attention converged on three points: why the specs are divided this way, why benchmark results and real experience diverge, and what preparation edge deployment requires in advance. Rather than evaluating a single product, this article treats this kind of “multi-size matrix” as a research sample, unpacking the engineering logic behind it across three layers—architecture design, modality inputs, and long-context mechanisms—and closing with practical advice on selection, evaluation, and fine-tuning.
1. The Spec Matrix: Tiering by Hardware Constraints
Releasing several sizes at once is fundamentally a response to the fragmentation of inference hardware. From flagship phones to embedded dev boards and desktop workstations, available memory ranges from a few GB to tens of GB, memory bandwidth can differ by more than an order of magnitude, and power and thermal budgets vary just as widely. No single size can serve all of these scenarios at once.
More importantly, every tier in the matrix shares the same tokenizer and training pipeline. In practice, when developers move a model up or down in size across different devices, prompts, system instructions, and post-processing logic rarely need to be rewritten—and the same fine-tuning data and tool-calling conventions carry over across tiers.
From the public information, this generation’s matrix can be divided into four tiers:
| Tier | Parameter scale | Typical deployment | Main constraint |
|---|---|---|---|
| Flagship dense | ~30B | Multi-GPU workstations, cloud inference services | Memory capacity and compute throughput |
| Mid-size sparse | ~26B (total params) | Single-GPU workstations, cloud inference services | Memory capacity |
| Edge efficient | ~4B | High/mid-end phones, PCs, dev boards | Memory, latency, power |
| Edge lightweight | ~2B | Low-memory devices, always-on background services | Memory footprint, sustained power |
On the edge, memory bandwidth often affects decode speed more than raw compute. During decoding, generating each token requires reading the bulk of the weights from memory into the compute units once. So for small edge models, parameter count isn’t the only metric that matters—it also matters whether the weights can stay resident in cache, whether peak memory stays within the system budget, and how much sustained power the device draws over long runs.
According to the documentation, both edge models support text, image, and video input while staying lightweight, and the lightweight tier also adds native audio input. That maps neatly onto the typical shape of an on-device agent: a user speaks a sentence or snaps a photo to trigger a task, rather than switching back and forth between apps.
2. Dense vs. MoE: Activated Parameters Drive Compute, Total Parameters Drive Memory
Let me clear up a common misconception first: parameter count and compute cost are not the same thing.
- Dense models: every token passes through all parameters, so the compute per token (FLOPs) is roughly proportional to the total parameter count.
- Mixture-of-Experts models: each layer holds multiple parallel feed-forward experts, and a lightweight router picks a few experts per token. The total parameter count is the sum over all experts, but each token uses only a fraction of them.
So the defining trait of an MoE model is “large total parameters, small activated parameters”: total parameters determine memory footprint, while activated parameters determine the compute and latency of a single inference.
This also explains a seemingly counterintuitive pattern. In typical same-size comparisons, an MoE model’s total parameter count is often higher than a dense model of the same tier. This generation’s matrix does the opposite: the mid-size sparse model has fewer total parameters than the flagship dense model. From an engineering standpoint, the more plausible explanation is that the two architectures were given different roles.
The dense flagship carries the “capability ceiling” and “knowledge base” role. As a high-quality base, it suits complex reasoning, long-document understanding, and serving as a high-quality teacher signal for distilling smaller models later. Starting from a ~30B dense base for domain fine-tuning means no routing to design and no load balancing to handle—the training and inference pipelines are simpler, which is friendlier to small and mid-sized teams with limited resources.
The sparse model carries the “cost-effectiveness” role. With total parameters held down to ~26B, activating only part of them lets actual compute drop to roughly the level of a small-to-mid dense model. That brings three benefits: lower per-token latency on the same hardware, more requests able to share the same set of weights, and more controllable cost per unit of compute. The tradeoff is that all expert weights must stay resident in memory, which naturally conflicts with an edge device’s memory budget.
| Dimension | Dense model | MoE model |
|---|---|---|
| Compute | Proportional to total params | Proportional to activated params only |
| Memory | Depends on total params | Depends on total params (all experts resident) |
| Latency stability | Fairly stable, low variance across requests | Affected by routing distribution and expert-parallel communication |
| Quantization & deployment | Mature tooling, well-supported operators | Watch for precision loss with expert-granularity quantization |
| Edge fit | Fully deployable on a single device | High memory pressure, usually better suited to servers |
| Fine-tuning difficulty | Uniform parameter updates, simple flow | Must also train and align the router |
| Typical role | Capability ceiling, knowledge base | High concurrency, low latency, cost efficiency |
To decide where a model belongs, don’t look at total parameters alone—look at whether activated parameters and memory footprint match the target hardware. Drop an MoE model straight into a phone and you’ll often find it “runs fine but won’t fit.” The MoE forward pass’s routing can be abstracted as follows:
# Conceptual pseudocode for MoE routing, illustrative of the compute flow onlydef moe_layer_forward(x, experts, router, top_k=2):# x: hidden states of shape (tokens, hidden)scores = router(x) # score each expert for every tokenweights, indices = scores.topk(top_k) # each token selects only top_k expertsweights = softmax(weights)# Key: each token passes through only the selected experts, compute ≈ top_k / total expertsexpert_outs = stack([experts[i](x) for i in range(len(experts))])gathered = gather(expert_outs, indices)return weighted_sum(gathered, weights)
3. Native Multimodal Input: The Edge Voice Pipeline Starts Cutting Layers
In a traditional on-device voice assistant, voice interaction is often a cascaded pipeline:
Microphone → VAD (voice activity detection) → ASR (speech recognition) → Intent understanding / task execution → TTS (speech synthesis)
This chain has at least three problems:
- Too many components: each stage is a separate model that must be versioned and maintained independently, and their memory footprints stack up.
- Error accumulation: ASR recognition errors propagate downstream, and later stages struggle to correct them.
- Information loss: once converted to plain text, non-semantic cues—tone, pauses, background sounds—are lost. And those cues are exactly what’s needed to gauge a user’s mood or detect whether they’ve interrupted themselves.
Once audio becomes a native modality input, speech is first turned into representations by an audio encoder, then enters the decoder alongside text tokens. This yields three gains:
- Shorter chain: the system can grasp references and pauses within a single utterance, cutting a “transcribe first, then understand” round trip.
- Lower memory: there’s no longer a need to keep a separate speech-recognition model resident.
- More complete context: images and videos work the same way—when a user asks a question with a photo, there’s no need to first convert the scene into a text description before handing it to the model.
Inside the model, different modalities are usually first mapped into the same latent space, then interleaved into a unified sequence by some rule:
[System] You are a device assistant...[Audio] <audio tokens...>[Image] <image tokens...> # resolution configurable[User] Help me organize what I just said into a to-do list[Assistant] ...
In practice, you can organize multimodal messages with a unified content structure:
# Example: organizing multimodal input into a unified message structurerequest = {"system": "You are a device assistant. Complete tasks based on the user's speech and images, and return results as JSON.","messages": [{"role": "user","content": [{"type": "audio", "data": audio_bytes, "sample_rate": 16000},{"type": "image", "data": image_bytes},{"type": "text", "text": "Based on what I just said, help me list what I need to buy"},],}],"max_tokens": 256,"temperature": 0.2,}
Note that native audio input has a length limit (on the order of tens of seconds, per the official description). Beyond that, you need chunked processing, or you convert long recordings to text locally with a lightweight speech recognizer first. But this fallback path remains optional: high-frequency scenarios like short commands and photo-based questions can be handled entirely by a single model. Which modalities are supported, and the constraints on resolution and audio duration, should follow the official documentation for the specific tier—smaller models usually have narrower capability boundaries.
4. Long Context: Dual RoPE and Per-Layer Embeddings
4.1 Dual RoPE: Local via Sliding Windows, Global via Scaled Positions
Rotary Position Embedding (RoPE) is the prevailing positional-encoding scheme in mainstream LLMs today. It injects positional information by rotating the 2D subspaces of the query (Q) and key (K) vectors, so attention scores naturally depend on the relative distance between two tokens. A model’s maximum trained rotation span is limited, and extrapolating directly to longer sequences degrades performance noticeably.
This generation uses a “local–global” alternating layered structure in the decoder:
- Sliding-window attention layers: each token attends only to a fixed-length recent window, so local syntax and short-range dependencies get covered repeatedly. Compute drops from O(n²) to about O(n·w) (w = window size), and long-context decoding only needs to maintain a KV cache for tokens within the window.
- Global attention layers: a few layers retain global attention, letting key information aggregate directly across chapters and avoiding long-range dependencies being diluted as they pass layer by layer.
- How positional encoding fits in:
- Sliding-window layers use standard RoPE, encoded by relative position within the window—a small value range with a stable distribution.
- Global layers use proportional RoPE (p-RoPE), which multiplies the position index by a factor greater than 1 before encoding. The position numbering is scaled up, effectively mapping long-range relationships back into the range the model saw during pretraining.
Illustrative code makes this intuitive:
import mathdef rope_angles(position_index, head_dim, base=10000.0, scale=1.0):"""Return the rotation angle for each 2D subspace; scale is the proportional factor."""half = head_dim // 2inv_freq = [1.0 / (base ** (2 * i / head_dim)) for i in range(half)]# The proportional factor scales the position index: p-RoPE and standard RoPE differ only by this termscaled_pos = position_index * scalereturn [scaled_pos * f for f in inv_freq]# Example: proportional position of the 20000th global-layer token# p-RoPE with factor 4 maps position 20000 to an equivalent position 80000print(rope_angles(20000, head_dim=128, scale=4.0)[:3])# Standard RoPE encodes position 20000 directlyprint(rope_angles(20000, head_dim=128, scale=1.0)[:3])
The 4.0 in the example only illustrates the usage; the actual factor is determined during training. The KV cache for global attention layers still grows linearly with sequence length, which is one of the main memory bottlenecks in long-context edge deployment:
def kv_cache_bytes(num_layers, num_kv_heads, head_dim, seq_len, batch=1, dtype_bytes=2):# Each token needs to cache both a Key and a Value per layerreturn 2 * num_layers * num_kv_heads * head_dim * seq_len * batch * dtype_bytes# Example parameters (not any real model config):# 30 layers, 4 KV heads, head dim 128, context 8192, batch 1, BF16 weightsprint(kv_cache_bytes(30, 4, 128, 8192) / (1024 ** 3)) # ~0.46 GB
This shows that during edge deployment, managing the KV cache is often trickier than the weights themselves. Common techniques include: quantizing the KV cache to a lower bit width; using PagedAttention-style paged management to reduce fragmentation; and, for short conversations, truncating or rolling off the earliest turns directly.
4.2 Per-Layer Embeddings: Let Every Layer Pull Conditioning on Demand
In a standard Transformer, each token gets a single embedding vector at the input. From then on, no matter how many layers it passes through, the identity signal carried by that vector stays fixed. This effectively demands that the initial embedding “pack in” everything all downstream layers might ever need, right at the start. As layers and context grow, this signal keeps getting overlaid and diluted by other computations in the residual stream, making it hard for deep layers to precisely retrieve certain fine-grained features.
Per-Layer Embedding (PLE) adds a parallel low-dimensional conditioning path alongside the trunk:
- A conditioning encoder much smaller than the trunk (which can be a shallow model or an independent embedding table) processes the input tokens to produce a compact contextual representation.
- A projection matrix generates a dedicated small vector for each decoder layer.
- Within the corresponding decoder layer, that vector is added to the trunk hidden state before entering attention and feed-forward computation.
Conceptual pseudocode:
# Conceptual structure of the conditioning encoder (details vary by implementation)class PerLayerEmbedding:def __init__(self, vocab_size, embed_dim, num_layers, trunk_dim):self.embed = Embedding(vocab_size, embed_dim) # low-dimensional token embedding# One projection per decoder layer: low-dim conditioning space → trunk hidden spaceself.proj = [Linear(embed_dim, trunk_dim) for _ in range(num_layers)]def forward(self, token_ids):cond = self.embed(token_ids)return [proj(cond) for proj in self.proj]# Injection point inside a decoder layerdef decoder_layer(x, layer_idx, cond_vec):x = x + cond_vec # inject this layer's dedicated conditioning vectorx = x + attention(norm(x))x = x + feed_forward(norm(x))return x
The essence of this design is to combine “token identity signals” with “context-aware signals” and distribute them on demand. Each layer no longer has to repeatedly search a long initial embedding for the information it needs—it directly receives a conditioning vector matched to that layer’s computation. This also has direct value for the edge: compared with per-layer embeddings that often run into the hundreds of dimensions, a low-dimensional conditioning path adds far fewer extra parameters and much less memory overhead.
Of course, PLE isn’t free: the conditioning encoder itself takes memory, and the projection layers add compute steps. On devices with extremely tight resources, whether to enable it—and at what dimensionality—requires a real tradeoff between capability and latency.
5. Evaluation: Beyond Leaderboards, Let Your Own Task Set Decide
Some developers have observed that this generation’s flagship trails other same-size models slightly in public comparisons, yet feels clearly better in their own testing. This “leaderboard vs. experience mismatch” is common with LLMs, mainly for these reasons:
- Skewed benchmarks: public benchmarks cover only limited problem types and domains, which may not match your real task distribution.
- Scoring-method differences: exact match, contains-match, or a judge-model score can lead to different conclusions—open-ended Q&A especially.
- Sensitivity to prompt style: the same model can perform very differently under different prompt templates, decoding parameters, and whether chain-of-thought is enabled.
- End-to-end experience: actual experience also depends on context management, tool calls, post-processing, and front-end interaction—not just the base model itself.
- Subjective factors: response speed, time to first output, and answer tone all affect perception.
So a more reliable approach is to build a small, repeatable evaluation set for your own business:
import time# Example: rerun the same set of cases with the same decode parameters on every iterationdef evaluate(runtime, cases, tokenizer):results = []for case in cases:t0 = time.perf_counter()out = runtime.generate(case["prompt"])latency = (time.perf_counter() - t0) * 1000results.append({"id": case["id"],"task": case["task"], # extraction / classification / multi-turn / long-doc / image / tool call"passed": case["checker"](out),"output_tokens": len(tokenizer.encode(out)),"ttft_ms": None, # if a streaming API is available, measure time-to-first-token separately"latency_ms": round(latency, 1),})summary = summarize(results) # per-task pass rate, P50/P95 latency, average output lengthreturn results, summary
Three things to watch when evaluating:
- Cases should closely match the real distribution and cover edge cases—long inputs, accented speech, blurry images, over-long recordings.
- Decoding parameters should stay consistent with what will ship to production.
- Fix the random seed on each iteration, and record the model version and inference configuration.
Beyond correctness, it’s worth tracking per-token latency, time to first token (TTFT), peak memory, and device temperature rise in parallel—these are what actually determine the edge user experience.
6. Edge Deployment Checklist
- Divide by memory: take “device available memory − system and foreground-app reservation,” then divide by the per-token weight-read volume to roughly estimate the model’s decode-speed ceiling on the target device.
- Quantize in stages: weight quantization (e.g., INT8, INT4) mainly affects memory footprint and decode bandwidth; KV cache quantization mainly affects the memory peak under long context. Different layers have different sensitivity to quantization error, so a sensitivity analysis can guide mixed-precision configuration.
- Control resident overhead: small models suit always-on listening or intent routing, waking the large model only when needed—balancing response speed against power.
- Guarantee structured output: for scenarios like tool calls and form filling, use constrained decoding or post-hoc validation to keep JSON format stable.
import jsonfrom jsonschema import validateSCHEMA = {"type": "object","properties": {"action": {"enum": ["search", "calc", "reply"]},"args": {"type": "object"},},"required": ["action", "args"],}def safe_parse(raw: str, default):"""Example: if the runtime lacks constrained decoding, validate and retry at the application layer."""try:obj = json.loads(raw)validate(instance=obj, schema=SCHEMA)return objexcept Exception:return default
- Cloud fallback and cascading: for complex tasks, let the on-device small model handle intent recognition and parameter extraction first, then decide whether to call a cloud large model; on the cloud side, you can also configure object storage to save conversation records, and use logging services and monitoring alerts to track latency and error rates. On a cloud platform such as Baidu AI Cloud, these general-purpose cloud capabilities can be combined as needed to host model training, inference, and operations.
- Versioning, canary, and monitoring: on-device model upgrades are hard to control, so you need model version identifiers and a canary strategy, plus continuous collection of desensitized evaluation samples on representative inputs—so you can catch quality regressions from quantization or version updates early.
7. Fine-Tuning: Turning a Strong Base into a Domain Model
Using the ~30B dense flagship as a base for domain fine-tuning is a cost-effective choice. Before starting, make one judgment:
- If the model lacks knowledge (e.g., internal company docs, latest policies), prefer to fill the gap with Retrieval-Augmented Generation (RAG);
- If it lacks capability and style (e.g., a specific output format, domain terminology, industry phrasing), then consider fine-tuning.
For organizing data, you can use the general messages role structure to arrange instructions, examples, and expected outputs into conversation samples:
sample = {"messages": [{"role": "system", "content": "You are a support-ticket assistant. Output fixed JSON."},{"role": "user", "content": "The device keeps rebooting and won't connect to the network."},{"role": "assistant", "content": '{"category": "hardware", "urgency": "high"}'},]}
Parameter-efficient fine-tuning is the first choice for resource-constrained teams—for example, Low-Rank Adaptation (LoRA) and its quantized variant QLoRA:
- Freeze the base weights and train only the low-rank matrices injected into each layer;
- Training memory demand drops sharply, and adapters are small, pluggable, and easy to version.
If the same business needs to run on both phones and servers, there’s a more economical path: use the flagship model to generate high-quality answers on real business data, then distill an on-device small model from them. In a multi-size matrix, all tiers share the tokenizer and instruction format, so instruction fine-tuning data synthesized by the flagship model can also be used directly to continue training the smaller models, reducing repeated annotation.
Before launch, it’s recommended to run an A/B evaluation between the base and fine-tuned models following the ideas in Section 6, to confirm the gains come from the training data itself rather than changes to prompts or decoding parameters.
8. Conclusion
Back to the original question: how should you evaluate this kind of multi-size open-source model?
- The spec tiers rest on clear hardware logic: the dense flagship pursues the capability ceiling, the sparse model pursues cost-effectiveness, and the edge small models exist for memory and power.
- The real differences hide in architectural details: sliding-window attention, proportional RoPE, and per-layer embeddings together support long context and edge-friendliness.
- Evaluation must return to your own tasks: a leaderboard represents only an average score under one distribution; business results need to be spoken for by your own data.
My advice for developers:
- First determine the tier based on device memory, latency requirements, and task type;
- Do a side-by-side comparison with a small, self-owned evaluation set;
- On the edge, get quantization, KV cache management, and structured output solid;
- Then use fine-tuning or distillation to polish a general base into a business model.
Model capabilities are still evolving fast, and specs and architectures will keep changing. Building a reproducible evaluation and deployment pipeline is the most reliable way to keep up with that change.
