Mixture of Experts versus Dense Models: The Right Choice
When selecting a language model for production environments, the discussion revolved for years solely around the number of parameters. More parameters meant a smarter model, but also higher operational costs and slower response times. With the rise of Mixture of Experts (MoE) architectures, that linear relationship between model size and compute time has been definitively broken. Where traditional dense models engage every weight in the network for every generated token, MoE models selectively activate only a fraction of their neural network.
This distinction has far-reaching consequences for infrastructure planning, memory requirements, and response times. An MoE model with 45 billion parameters can operate, in terms of compute power, as if it were a compact 12-billion model, but still requires the working memory of a heavyweight. To understand how these mechanisms affect throughput and latency in long-running interactions, the reference guide on how a context window technically works helps clarify the impact on the overall memory profile.
How a dense language model works
A dense transformer model is built monolithically. Every incoming token passes through successive layers consisting of self-attention mechanisms and feed-forward networks (FFN). Within a dense architecture, every single weight in every layer is actively involved in computing the probability distribution for the next token. If a model has 70 billion parameters, all 70 billion parameters are mathematically activated for every generated character or word piece.
This uniform computation makes dense networks extremely predictable in terms of memory bandwidth and compute load. No dynamic routing decisions occur during the forward pass. The hardware runs at full capacity for the entire matrix multiplication, leading to high efficiency at the level of GPU compute units (FLOP utilization). The hardware knows exactly which tensor operations need to be performed, allowing caching and memory access to be optimally tuned.
The fundamental drawback of this dense structure, however, is the linear scalability of compute costs. As a dense model grows larger to master more complex reasoning, multilingualism, or specialized expertise, the compute intensity (FLOPs per token) increases proportionally. This translates directly into higher response times per user and significantly higher energy costs per processed request.
The architecture of Mixture of Experts
Mixture of Experts replaces the classic, bulky feed-forward networks in the transformer layers with multiple parallel sub-networks, referred to as 'experts'. Although the attention layers usually remain shared across the entire network, each layer contains a routing mechanism (the gating network) that determines, per token, which experts are activated.
In a typical MoE configuration, such as a setup with sixteen experts where the best two are selected per token (top-2 routing), the vast majority of experts remain inactive for that specific token. The gating network computes a normalized probability distribution over all available experts and forwards the activation vector only to the selected sub-networks. The final output is a weighted sum of the results from these activated experts.
This creates a crucial distinction between two parameter specifications:
- Total parameters: The full number of weights that must be loaded into memory (VRAM or RAM).
- Active parameters: The number of weights that actually perform matrix multiplications for a single token.
For a detailed analysis of how this dynamic activation reduces operational costs in data centers, the background article on how Mixture of Experts lowers compute costs examines the underlying savings in large-scale inference.
VRAM versus compute power: the asymmetric balance
The biggest misconception about MoE models concerns hardware requirements. An MoE model with 8x7B parameters (such as Mixtral 8x7B) has, thanks to shared layers, a total of roughly 47 billion parameters. During generation, only two experts are engaged per token, resulting in roughly 13 billion active parameters per forward pass.
In terms of generation speed, this model produces tokens at the speed of a 13B dense model. However, to perform that computation, all 47 billion parameters must be permanently present in fast GPU memory. After all, the router can select a different expert for every successive token. If experts had to be dynamically moved from slower system memory into VRAM, throughput would collapse entirely due to memory bus bottlenecks.
When sizing local servers or cloud instances, memory capacity must be calculated based on the total parameter count, while compute capacity (such as Tensor Cores) only needs to be sized for the active parameters. Anyone who wants to precisely calculate how much video memory a specific configuration requires at different precisions can consult the calculation method for converting parameters to VRAM and hardware requirements to prevent incorrect hardware purchasing decisions.
| Architecture type | Total Parameters | Active Parameters | VRAM footprint (FP16) | Compute intensity (FLOPs/tok) |
|---|---|---|---|---|
| Dense Compact | 8 Billion | 8 Billion | ~16 GB | Low (fast) |
| Dense Heavy | 70 Billion | 70 Billion | ~140 GB | High (relatively slow) |
| Sparse MoE (8x7B) | 47 Billion | 13 Billion | ~94 GB | Low-Medium (very fast) |
| Sparse MoE (Large) | 236 Billion | 21 Billion | ~470 GB | Medium (fast) |
Latency, throughput, and batching in production systems
The operational dynamics of MoE differ fundamentally between single-user latency and multi-user throughput. For an individual user, an MoE model delivers superior response times: time-to-first-token and inter-token latency are comparable to a compact model, while answer quality approaches the level of a much larger dense network.
In environments with heavy batching (dozens of simultaneous requests), this picture changes. When a batch of 64 different prompts is processed simultaneously, the routers of different streams send tokens to different experts. Within a single batch, virtually all experts end up being engaged at once. This reduces the compute savings per batch and places heavier demands on memory bandwidth.
Moreover, MoE introduces a complexity called 'expert load imbalance'. If certain experts are statistically chosen more often than others (for example, experts specialized in common grammatical structures or programming languages), a bottleneck arises on specific hardware units. Anyone weighing response speed against total server capacity can consult the article on the balance between model size, latency, and accuracy for practical guidelines on production systems.
Quantization and compression in sparse architectures
Quantization (reducing parameter precision from 16-bit float to 8-bit or 4-bit integers) is a standard technique for running models on smaller hardware. In dense models, this process generally proceeds uniformly: the weights are homogeneously distributed, and outlier activations can be handled consistently across the entire layer.
In MoE models, the network reacts more sensitively to aggressive quantization methods (such as 2-bit or 3-bit quantization). Because individual experts are smaller and represent specific knowledge elements, rounding noise in the weights of a single expert can cause disproportionate quality loss for specific tasks. In addition, the routing network itself is extremely sensitive to precision loss: a small error in routing causes a token to be sent to the wrong expert, resulting in incoherent generations.
In practice, 4-bit and 8-bit quantization (such as AWQ or GGUF) works excellently for MoE, provided the routing mechanism is kept at a higher precision (FP16 or FP32). See the overview on quantization of LLMs on hardware to see how quantization steps work without loss of model stability.
Practical comparison: implementation and routing
To illustrate how a gating mechanism theoretically works compared to a classic dense forward pass, the pseudocode example below shows the routing logic of a top-2 sparse layer:
# Conceptuele routing in een Top-2 Mixture of Experts laag
import torch
import torch.nn as nn
class SparseMoELayer(nn.Module):
def __init__(self, num_experts=8, top_k=2, hidden_dim=4096):
super().__init__()
self.num_experts = num_experts
self.top_k = top_k
self.gate = nn.Linear(hidden_dim, num_experts, bias=False)
self.experts = nn.ModuleList([
nn.Sequential(
nn.Linear(hidden_dim, hidden_dim * 4),
nn.SiLU(),
nn.Linear(hidden_dim * 4, hidden_dim)
) for _ in range(num_experts)
])
def forward(self, x):
# x heeft vorm: [batch_size, seq_len, hidden_dim]
logits = self.gate(x)
weights, indices = torch.topk(torch.softmax(logits, dim=-1), self.top_k)
# Normaliseer top-k gewichten zodat ze optellen tot 1
weights = weights / weights.sum(dim=-1, keepdim=True)
# Bereken uitvoer als gewogen som van geactiveerde experts
output = torch.zeros_like(x)
for k in range(self.top_k):
expert_idx = indices[..., k]
expert_weight = weights[..., k].unsqueeze(-1)
for i, expert in enumerate(self.experts):
mask = (expert_idx == i)
if mask.any():
output[mask] += expert_weight[mask] * expert(x[mask])
return output
Decision matrix: choosing Dense or MoE?
The choice between a dense architecture and a Mixture of Experts model primarily depends on the available hardware architecture, the expected throughput, and the nature of the workloads.
When do you choose a dense model?
- Limited video memory (edge / on-device): If a model needs to run on local workstations with a single consumer GPU or on mobile chips (such as Apple Silicon or laptops with 8-16 GB RAM), an 8B dense model fits easily, while an 8x7B MoE exceeds available memory.
- Uniform, repetitive tasks: For specialized tasks such as classification, extraction, or simple translations, a compact fine-tuned dense model often performs more consistently and predictably.
- Ease of deployment: Dense models are universally supported by every runtime engine without needing specialized kernels for expert parallelism.
When do you choose Mixture of Experts?
- High interaction speed required: If applications require real-time interaction (such as code assistance or interactive chat) and sufficient VRAM is available, MoE delivers the reasoning quality of a large model with the latency of a small model.
- Complex, multilingual, or broad domains: MoE models excel at tasks that combine broad general knowledge with specialized skills (mathematics, programming, multilingualism), because different expert clusters absorb specific patterns during training.
- Optimizing cost per API call: When hosted via API providers, MoE models are significantly cheaper per processed token than equivalently performing dense counterparts, because the provider reserves less hardware compute power per token.
For a broader overview of selection criteria for diverse business applications, the guide on choosing a suitable AI model for a project offers a structured decision tree.
Operational pitfalls and management
Although MoE offers theoretical advantages, it brings specific challenges in production. Hosting MoE models requires advanced serving frameworks (such as vLLM or TensorRT-LLM) that support 'expert parallelism'. Here, individual experts are distributed across multiple GPUs to balance memory and compute power.
When multiple GPUs must communicate during the forward pass to exchange activation vectors between the router on GPU 0 and the expert on GPU 1, the inter-GPU interconnect (such as NVLink or fast PCIe) becomes the determining factor for overall latency. On systems with slow interconnects (such as separate PCIe slots without NVLink), the communication overhead can negate the speed gains of the sparse computation.
Anyone considering self-hosting open MoE weights on their own infrastructure can find technical details on runtime configuration and network architecture in the article on serving local models behind an API.
Conclusion on architecture selection
Mixture of Experts has fundamentally changed the paradigm of model development. Decoupling model size (memory footprint) from compute intensity (FLOPs per token) makes it possible to build models with enormous ready knowledge without response times becoming unworkable.
For organizations and developers, this means the initial question in hardware procurement is no longer how many parameters a server can handle, but how the VRAM budget relates to the desired compute speed. Anyone with ample memory capacity who is aiming for minimal per-token wait times gets the highest return on infrastructure with MoE. Anyone working within tight memory constraints on individual devices, on the other hand, remains best served for now by optimized dense models.


