MoE Open-Source Multimodal Models: Understanding Total Parameters and Activated Parameters
Mixture-of-Experts models separate total model capacity from per-token compute. This guide explains sparse routing, activated parameters, long-context attention, multimodal capabilities, memory estimation, deployment trade-offs, and the practical checks required before selecting an open-source multimodal MoE model.
1. Why Mixture-of-Experts Architectures Matter
As large language models grow, dense architectures face a direct trade-off: every token uses the model’s full parameter set. More parameters therefore mean more computation for every generated token. On consumer GPUs and edge devices, dense models with tens of billions of parameters often require too much memory while delivering lower throughput and higher latency.
Mixture-of-Experts (MoE) architectures address this trade-off. An MoE model contains many expert subnetworks, but only a small subset of them processes each token. The model retains the knowledge capacity associated with a large parameter count while keeping per-token computation closer to that of a smaller model.
For example, an open-source multimodal MoE model with approximately 25B total parameters and 4B activated parameters may generate text at a speed close to that of a 4B dense model, while offering a higher capability ceiling. The central value of MoE is that it separates overall model capacity from the cost of each computation.
2. Sparse Activation and Gated Routing
In each Transformer layer, or in selected layers, an MoE model replaces the conventional feed-forward network with multiple parallel expert networks. A gating network scores the experts, selects the top-K experts, and runs computation only on them. The remaining experts are not involved in that forward pass.
A common configuration contains 128 experts, activates 8 of them for each token, and adds one shared expert that processes every token to capture general-purpose features. The following code illustrates the routing process:
import torchdef moe_forward(x, experts, gate, top_k=8, shared_expert=None):# x: [tokens, hidden], with one row per tokenlogits = gate(x) # [tokens, num_experts]probs = logits.softmax(dim=-1)weights, idx = probs.topk(top_k, dim=-1) # Select top-K experts and weights for each tokenweights = weights / weights.sum(dim=-1, keepdim=True) # Some models normalize the routing weightsout = torch.zeros_like(x)for k in range(top_k):for e in range(len(experts)):mask = idx[:, k] == e # Find tokens routed to expert eif mask.any():out[mask] += weights[mask, k].unsqueeze(-1) * experts[e](x[mask])if shared_expert is not None:out = out + shared_expert(x) # The shared expert processes every tokenreturn out
This is a logical illustration rather than production inference code. Real inference frameworks batch expert computation and use gather and scatter operations instead of nested loops to improve GPU utilization.
The activation ratio also requires careful interpretation. It cannot be estimated simply as 8 divided by 128. Activated parameters include three components:
- The selected experts
- The shared expert
- Non-expert parameters, such as attention layers and embeddings, that participate in every forward pass
The larger each expert is, the higher the activated-parameter ratio tends to be. When comparing activation ratios, use the officially reported activated parameter count rather than looking only at the number of selected experts.
3. What Total Parameters and Activated Parameters Control
MoE models are commonly described using two parameter counts, and each one affects different resource requirements:
- Total parameter count determines memory usage. All expert weights generally need to remain in GPU memory, even when a particular expert is not used for the current token.
- Activated parameter count determines the computation required per token and broadly influences the upper bound of decoding speed.
In model names, “A” refers to activated parameters. For example, “25B-A4B” indicates approximately 25B total parameters and about 4B parameters activated for each token.
The speed advantage also has conditions. During decoding, a significant amount of time is spent reading weights. For a single request, each token reads only the weights of the activated experts, so the advantage can be substantial. During batched inference, however, different tokens may be routed to different experts. A single batch can cover most or all experts, making the amount of weight data that must be read closer to the full parameter set. The speed advantage may therefore shrink.
When selecting an inference server configuration, benchmark the model using the target batch size and request distribution.
4. Long Context and Attention Design
Some models claim support for contexts as long as 256K tokens. To support such lengths efficiently, models generally avoid applying full global attention at every layer. A common design combines global attention layers with sliding-window attention layers: a global attention layer is inserted periodically, while the other layers attend only to a nearby window of approximately 1,024 tokens.
This design reduces computation for long sequences and slows the growth of the KV cache. Periodic global-attention layers preserve long-range dependencies. Performance on long-context retrieval tests, such as needle-in-a-haystack tests at around 128K tokens, depends heavily on this architecture.
The advertised context length is an architectural limit, not necessarily the length that can be used reliably in production. The practical limit also depends on available memory, long-sequence support in the inference framework, and the complexity of the task.
5. Multimodal Input and Supported Tasks
Modern open-source multimodal models generally support interleaved text and image inputs, allowing text and images to appear in the same conversation. A typical pipeline uses a vision encoder to divide an image into patches and convert them into a sequence of visual tokens. A projection layer maps those tokens into the language model’s embedding space, after which they are concatenated with text tokens and processed by the main model.
Common task categories include:
- Document and PDF parsing: Layout understanding, table reconstruction, and OCR. Test scanned documents, rotated text, and complex tables during model selection.
- Chart understanding: Reading values and trends from bar charts and line charts. Use charts with known values for spot checks and compare the model’s output against the ground truth.
- Object detection and referring localization: Answering questions such as “Where is the red object in the image?” Confirm whether the model returns coordinates or only a textual description.
- Screen and interface understanding: Identifying interface elements for agent-based automation.
- Handwriting recognition: Performance can vary significantly for non-printed text, so test representative samples from your own use case.
Vendor benchmark scores describe performance on public datasets only. Before production deployment, validate the model on application-specific data.
6. Built-In Reasoning, Multilingual Support, and Function Calling
Newer models commonly support built-in reasoning. The model generates an intermediate reasoning process before producing a final answer. This can help with multi-step tasks such as mathematics and programming.
Reasoning is usually controlled through a chat template or a model parameter. It can be disabled for low-latency scenarios and enabled when accuracy is more important. Reasoning increases the number of output tokens, latency, and cost, so deployment requires a trade-off between quality and efficiency.
For multilingual use, model providers commonly report pretraining data covering more than 100 languages. Support for major languages is generally more stable. This can enable cross-language retrieval and translation without separate fine-tuning for every language, and Chinese prompts can also produce stable results. Performance for less widely represented languages varies and should be tested separately.
Function calling allows a model to return a structured tool-call request. The application executes the tool and sends the result back to the model. Tool parameters should be described with a standard JSON Schema. For example:
{"type": "function","function": {"name": "get_weather","description": "Get the weather for a city on a specified date","parameters": {"type": "object","properties": {"city": {"type": "string", "description": "City name, such as Beijing"},"date": {"type": "string", "format": "date", "description": "Date in YYYY-MM-DD format"}},"required": ["city", "date"]}}}
The exact tool-definition format depends on the framework, and field names may differ slightly between inference engines. Consult the documentation for the selected framework before integration. Tool arguments generated by the model must also be validated by the application and should never be executed without validation.
7. Estimating GPU Memory Requirements
Many deployment mistakes come from treating weight size as the model’s total memory requirement. A practical estimate can be made in three steps.
Step 1: Estimate Weight Memory
- Weight memory ≈ total parameters × bytes per parameter
- BF16/FP16: 2 bytes per parameter; 25.2B parameters require approximately 50GB
- INT8: 1 byte per parameter; approximately 25GB
- INT4: approximately 0.5 bytes per parameter, but quantization scales and related metadata add overhead, so actual usage is slightly above 12.6GB
Step 2: Estimate KV Cache Memory
- KV cache ≈ 2 × number of layers × number of KV heads × head dimension × context length × batch size × bytes per element
The longer the context and the higher the concurrency, the more memory the KV cache consumes. Sliding-window attention can reduce this cost, but the actual benefit depends on the model implementation.
Step 3: Reserve Runtime Overhead
Activations, the framework’s CUDA context, memory fragmentation, and other runtime components also consume GPU memory. For long-context or high-concurrency workloads, reserving several gigabytes to more than 10GB of additional memory is common.
The weight estimates above are therefore only theoretical lower bounds. Before choosing a GPU, run a test with the target context length and batch size.
8. Deployment Scenarios and a Selection Checklist
Different deployment scenarios require different decisions:
- Mobile and edge devices: The full MoE parameter set still needs to reside in GPU memory or system memory, which can make direct deployment difficult. A smaller dense model from the same family or more aggressive quantization may be more practical. Evaluate the latency cost if experts are offloaded to system memory.
- Single-GPU workstations: An MoE model with approximately 4B activated parameters may offer a reasonable balance between capability and speed, provided the GPU can hold all weights together with the KV cache.
- Server-side batched inference: Check whether the inference engine supports expert parallelism and load balancing. Uneven expert utilization can reduce throughput, so benchmark with a realistic request distribution.
Before selecting a model, verify the following:
- Use the total parameter count to estimate memory, and reserve additional space for the KV cache and runtime overhead.
- Use the activated parameter count to estimate single-request speed, then validate it with the actual batch size.
- Confirm that the target context length can run reliably within the available memory rather than relying only on the model’s advertised limit.
- Test multimodal performance on your own documents, charts, interface screenshots, and other representative samples.
- Check the inference framework’s support for MoE, the selected quantization format, and multimodal inputs.
- During concurrency testing, examine latency distribution rather than average latency alone.
9. Open-Source Licenses and Production Considerations
Many mainstream open-source models use permissive licenses such as Apache 2.0, which generally allow commercial use, retraining, and redistribution. However, copyright notices and license texts may need to be preserved. Always follow the license file published with the model, since individual models may impose different conditions.
In addition to licensing, check the cutoff date of the training data, which determines how current the model’s built-in knowledge is. Also review the model’s update cadence and whether the provider offers distillation and fine-tuning tools. These factors affect long-term maintenance costs.
10. Summary
MoE architectures use sparse activation to maintain a large total parameter count while keeping per-token computation relatively low. The two parameter figures answer different deployment questions:
- Total parameters: Can the available memory hold the model?
- Activated parameters: What level of per-token computation and decoding speed should be expected?
Before making a final decision, benchmark the model with the target context length, batch size, concurrency, and representative application data. Paper-based parameter and memory estimates can narrow the candidate list, but real measurements are necessary for deployment.
