Last verified: 2026-10-14
What is Mixture of Experts
In a standard dense transformer, every token passes through every layer and activates every parameter on each forward pass. A 70B dense model uses all 70B parameters for every token. An MoE model replaces the feed-forward sublayer in selected transformer blocks with multiple parallel expert sub-networks and a router (also called a gating network) that decides which experts process each token. Most experts sit idle for any given token. A model with 256 experts might activate only 8 per token — roughly 3% of its total capacity per step. The result:- Total parameters determine how much memory the model needs (all experts must stay loaded).
- Active parameters determine how much compute each token costs (only the selected experts run).
How does MoE routing work
Each MoE layer contains a router that selects which experts process each token. The most common approach across production models is top-k gating:- The router computes a score for every expert by multiplying the token’s hidden state by a learned weight matrix, then applies a softmax to produce a probability distribution across all experts.
- The top-k experts with the highest scores are selected. Their outputs are combined using the softmax-normalized weights as coefficients.
- All other experts produce no output for that token — they are skipped entirely.
Shared experts
Some architectures reserve a subset of shared experts that activate for every token, regardless of routing scores. Shared experts handle common patterns (language modeling basics, formatting) so the routed experts can specialize. Qwen3-Next uses 1 shared expert plus 10 routed experts. Kimi K3 uses 2 shared experts plus 16 routed experts. DeepSeek-V3 and the original Qwen3 MoE do not use shared experts — all active experts are selected by the router.Load balancing
A router that always sends tokens to the same few experts defeats the purpose of MoE: those experts become bottlenecks while the rest sit idle. Production models use several strategies to keep expert usage balanced:- Auxiliary loss — a training-time penalty that pushes the router toward uniform expert usage. Most early MoE models (Switch Transformer, ST-MoE) use this approach. The cost is a slight reduction in specialization: the router optimizes for balance alongside quality.
- Auxiliary-loss-free load balancing — DeepSeek-V3 introduced a bias-based approach that adjusts per-expert routing biases at inference time. If an expert is receiving more tokens than its target share, its bias decreases, making it less likely to be selected. This removes the quality tradeoff of auxiliary losses entirely.
- Stable LatentMoE — Kimi K3 uses a learned latent routing mechanism that produces more stable expert assignments across tokens, reducing the variance that causes load imbalance in standard top-k gating.
Why MoE memory scales with total parameters, not active
This is the single most important thing to understand before running an MoE model locally. All experts must be resident in memory at all times. The router decides dynamically — per token, per layer — which experts to activate. There is no way to know in advance which experts a given prompt will need, so every expert must be loaded and ready. Swapping experts from disk on demand is far too slow for interactive inference. That means the memory formula from Memory and offloading applies to total parameters, not active:Worked examples
The 1.2x factor accounts for KV cache, activations, and framework overhead at a modest context length — the same formula as dense models. See Memory and offloading for the full sizing derivation.
What this means in practice
A Qwen3-30B-A3B has 30.5B total parameters but only 3.3B active. It generates tokens at roughly the speed of a 3.3B dense model — but it needs memory for all 30.5B. At 4-bit, that is about 18 GB, which fits a 24 GB GPU. A dense 30B model at 4-bit would need about the same memory but generate tokens more slowly, because it processes all 30B parameters per token instead of 3.3B. Conversely, Kimi K3 has 2.8T total parameters and 104B active. It generates tokens at roughly the speed of a 104B dense model — but it needs about 1.4 TB of memory just for the weights at 4-bit. No consumer or prosumer hardware holds that.MoE vs dense models
The key insight: MoE decouples knowledge capacity from per-token compute. A 671B-parameter MoE with 37B active can match or exceed a 70B dense model on quality while generating tokens at roughly 70B speed — but it needs 671B worth of memory.
Expert parallelism: serving MoE across multiple GPUs
When an MoE model does not fit on a single GPU, you need to distribute it. Expert parallelism is the MoE-specific strategy for doing this:- Each GPU holds a subset of the total experts. In a 256-expert model across 8 GPUs, each GPU holds 32 experts.
- During the forward pass, the router’s decisions determine which tokens need to be sent to which GPU. Tokens routed to experts on GPU 3 are communicated to GPU 3 for processing, then the results come back.
- Non-expert layers (attention, embeddings) are typically split using standard tensor parallelism, where each GPU holds a slice of every layer’s weight matrices.
Which open-weight models use MoE
The current generation of frontier open-weight models has moved heavily toward MoE. Here is the landscape as of October 2026:Sub-50B total (runnable on 1-2 consumer GPUs at 4-bit)
50B-250B total (multi-GPU or high-memory unified systems)
250B+ total (server-class hardware required)
Sources: model cards on HuggingFace and the official technical reports linked below.
Practical takeaway for local inference
MoE changes what the numbers on a model card mean:- Active parameters tell you how fast the model generates tokens. A 671B MoE with 37B active generates at roughly 37B speed.
- Total parameters tell you how much memory the model needs. That same 671B MoE needs 671B worth of VRAM, not 37B.
- Expert count and routing are architecture details that affect quality and training efficiency, but as a local inference user, you do not configure them — you configure memory and parallelism.
Go deeper
Memory and offloading
The full sizing formula, including bytes-per-parameter by precision and the offloading mechanics.
Quantization
Shrink bytes-per-parameter to change the memory equation for MoE and dense models alike.
How inference works
Why decode is memory-bandwidth-bound and how active parameters affect generation speed.
Model serving and scaling
Parallelism strategies, multi-GPU serving, and how runtimes distribute models.
Models using MoE
Kimi K3
2.8T total, 104B active, 896 experts with Stable LatentMoE routing.
DeepSeek
V3/R1 at 671B/37B, V4.1-Flash at 552B with asymmetric 8B/16B activation.
Qwen3
30B-A3B and 235B-A22B MoE tiers, 128 experts with top-8 routing.
Qwen3.8
2.4T flagship with 95B active, 512 experts, 10 routed + 1 shared.
GLM-5.3
753B total, ~40B active, MoE with 1M context.
gpt-oss
20b (32 experts) and 120b (128 experts), top-4 routing, Apache 2.0.
Once it fits and runs
Getting an MoE model loaded on your hardware is the first step. Once it is answering requests onlocalhost, the next step is reaching it from anywhere else.
Give it a stable endpoint
Tokios does not pick, host, or fine-tune the model — once it runs locally, Tokios turns it into a stable, authenticated endpoint you can call from anywhere.
Frequently asked questions
Why does an MoE model need memory for all experts if only a few are active?
Why does an MoE model need memory for all experts if only a few are active?
The router selects different experts for each token, so every expert must be reachable. At any given moment only k experts fire, but the next token might need a completely different set. That means all expert weights must stay resident in memory (VRAM or RAM) at all times — you size by total parameters, not active parameters.
How do I know if my hardware can run an MoE model?
How do I know if my hardware can run an MoE model?
Calculate: total parameters × bytes per weight. At 4-bit (the native quantization floor for most MoE models), that is
total_params × 0.5 GB. Add 20% for KV cache and overhead. If that number fits your combined VRAM + RAM, the model loads. If it does not fit, no amount of optimization changes that — you need more memory or a smaller model.Can I run an MoE model on a single GPU?
Can I run an MoE model on a single GPU?
Only the small ones. Qwen3-30B-A3B (30.5B total, ~18 GB at 4-bit) fits a 24 GB GPU. gpt-oss-20b (21B total, ~13 GB at 4-bit) also fits. Anything above ~50B total parameters needs either multi-GPU serving (vLLM, SGLang with expert parallelism) or a high-unified-memory system (Mac Studio, DGX Spark) with CPU offload.
What is expert parallelism and when do I need it?
What is expert parallelism and when do I need it?
Expert parallelism splits the expert layers across multiple GPUs — GPU 0 holds experts 0-63, GPU 1 holds experts 64-127, etc. Each GPU computes its experts’ outputs and they are combined via all-to-all communication. You need it when the total expert weights do not fit on a single GPU. vLLM and SGLang both support it; see the vLLM optimization guide for configuration.
Sources
- DeepSeek-V3 Technical Report — 671B total, 37B active, 256 experts, auxiliary-loss-free load balancing.
- Kimi K2: Open Agentic Intelligence — 1T total, 32B active, 384 experts, 8 active per token.
- Kimi K3 model card — 2.8T total, 104B active, 896 experts, Stable LatentMoE.
- Qwen3 Technical Report — 128 experts, 8 active, no shared experts in Qwen3 MoE.
- Qwen3-Next-80B-A3B — 512 experts, 10 routed + 1 shared.
- Qwen3.8-Max announcement — 2.4T total, 95B active, 512 experts.
- gpt-oss model card — 32 experts (20b) and 128 experts (120b), 4 active per token.
- GLM-5.3 model card — 753B total, ~40B active.
- Mixture of Experts Explained (localaimaster.com) — Routing mechanics and memory implications.
- Mixture-of-Experts LLMs (Cameron R. Wolfe) — Top-k gating formulation and training dynamics.
- MoE training in Qwen3-235B and Kimi-K2 — Learned routing comparison.
- vLLM MoE Playbook — Expert parallelism and mixed parallelism configuration.
- Expert Parallelism in TensorRT-LLM — Multi-GPU expert distribution strategies.