TL;DR
A mixture-of-experts (MoE) language model holds many feedforward networks, called experts, and sends each token to only a few of them. DeepSeekMoE changes two things about that design. It splits each expert into several smaller experts and activates proportionally more of them, which lets each expert hold more focused knowledge. It also keeps a few shared experts that every token uses, so common knowledge is not copied into every routed expert. A 2-billion-parameter DeepSeekMoE matches a GShard model with 1.5 times the expert parameters, and a 16-billion-parameter version matches the dense DeepSeek 7B on most benchmarks with about 40 percent of its compute.
Builds on: Mixture of Experts, Transformer, Load-Balancing Loss · Leads to: a recipe of many fine-grained experts plus shared experts that later sparse language models use as a reference point
Why it mattered
Mixture-of-experts layers let a language model grow its parameter count without growing the compute spent on each token. Google's GShard and Switch Transformer (Switch Transformers: Scaling to Trillion Parameter Models) showed that this works at large scale. The open question was how well the experts divide the work among themselves.
DeepSeekMoE gave a concrete answer and released a checkpoint. The authors released the 16B model publicly, and they report it can run on a single GPU with 40 gigabytes of memory without quantization. For a practitioner, that is the main outcome: a model with 16.4 billion total parameters and 2.8 billion activated per token, which the authors say runs at nearly 2.5 times the inference speed of a 7B dense model when operator optimizations are applied.
By late 2026 the paper had about 1,300 citations on Semantic Scholar.
The problem
Conventional MoE layers use a small number of experts, usually 8 or 16, and each token is sent to one or two of them. The paper names two failures that follow from that setup.
Knowledge hybridity. With only 8 or 16 experts, each expert sees tokens from very different topics, such as code, law and cooking. A single expert then has to store knowledge that is hard to use together, and the expert cannot specialize.
Knowledge redundancy. Tokens sent to different experts often need the same basic knowledge, such as grammar or common words. Each expert then learns its own copy of that knowledge, and the parameters are wasted on duplicates.
Both failures are about expert specialization: each expert should hold non-overlapping, focused knowledge. The paper's goal is to push specialization as far as possible at a fixed parameter count and a fixed compute cost.
How it works
The walkthrough traces one token through one MoE layer. The token's hidden vector is . The router gives each expert a score, the layer keeps the top few, and their outputs are added to the token's vector.
flowchart LR U["Token vector u"] --> R["Router: scores for every expert"] R --> S["Shared experts: always run"] R --> T["Top-K routed experts: run"] S --> SUM["Weighted sum of expert outputs"] T --> SUM U --> ADD["Residual: add u back"] SUM --> ADD ADD --> H["Output h"]
-
Start with a standard MoE layer. Suppose there are 4 experts and the router gives the token the scores 0.1, 0.5, 0.3 and 0.1. Keep the top 2, which are experts 2 and 3 with scores 0.5 and 0.3. Experts 1 and 4 are skipped entirely, so the token costs two expert computations out of four.
-
Compute the output. The layer returns 0.5 times the output of expert 2, plus 0.3 times the output of expert 3, plus the token's own vector. The gate values are the raw scores of the chosen experts, and every other gate is zero.
-
Split each expert into smaller ones. Now take the same 4 experts and cut each feedforward network's hidden width in half. That gives 8 smaller experts, and each one has half the parameters of the original. The total expert parameters are unchanged.
-
Activate twice as many small experts. To keep compute the same, the router keeps the top 4 of the 8 instead of the top 2 of the 4. The token now sums four half-size outputs, so the same amount of work is done, but the combinations of experts that can serve a token are far more numerous.
-
Make one expert always on. Designate one of the 8 as a shared expert. Every token runs it, whatever the router says. The router then chooses among the remaining 7, and keeps the top 3, so the number of active experts is still 4 (1 shared plus 3 routed).
-
Balance the load. Routing can collapse onto a few experts, which then train well while the rest barely train. Two balance losses are added to the training objective, one for each expert and one for each device, and they penalise uneven use.
Each step changes one design choice, and the expert count, parameter count and compute per token stay fixed across the steps, so any difference in quality comes from the choice itself.
The math
Start with the standard MoE layer. Let be the hidden vector of token , the number of experts, and the feedforward network of expert . The router computes a score for each expert from a learned centroid :
Only the top scores are kept, and the others are set to zero:
The layer output is
Because all but of the gates are zero, each token runs only experts.
Step 1 in symbols: the standard layer
With and and the scores from the walkthrough, . The top two are indices 2 and 3, so , and .
Step 3 in symbols: fine-grained segmentation
Split each expert into pieces, so there are experts, each with of the hidden width. Activate of them. The layer keeps the same total expert parameters, which is times the parameters of one standard FFN, and the same compute, because each piece is of the work and pieces run:
The number of ways to choose the active experts grows fast. For and , a top-2 router can produce combinations. Splitting each expert into 4 pieces and activating 8 gives combinations.
Step 5 in symbols: shared experts
Let experts be shared. They run for every token, so the routed set has experts and the number of nonzero routed gates is , which keeps the compute unchanged:
Take the walkthrough's values, , , and . The routed set has experts, and the number of active routed gates is . The token therefore runs 1 shared expert and 3 routed ones, which is 4 computations as before. The 2B model in the paper uses the same pattern at a larger scale: 1 shared expert and 7 routed experts active out of 63.
Step 6 in symbols: the balance loss
For routed experts, let and tokens. Define the fraction of routed tokens sent to expert , and its mean router probability:
The expert-level loss is . If every expert gets the same share of selections and the same average probability, the sum equals 1, and any imbalance pushes it above 1. A device-level version applies the same idea to groups of experts placed on one device, with its own factor .
Take routed experts, and tokens, so there are selections in total.
- If the selections are spread evenly, each expert is chosen once. The count for each expert is 1.
- Then for every expert.
- With a uniform router, every is , so for every expert.
- The loss is .
- Interpretation: 1 is the value at perfect balance. A router that sent every selection to a few experts would make some and large together, and the sum would rise above 1.
Results
The paper runs three sets of experiments: a 2-billion-parameter validation study, a comparison with larger models, and a 16-billion-parameter model trained on 2 trillion tokens. All validation models are trained on 100 billion tokens.
Validation at 2B (Table 1). DeepSeekMoE, with 2.0B total and 0.3B activated parameters and 4.3 trillion FLOPs per 2,048 tokens, is compared with GShard, Switch and Hash Layer at the same size. On the Pile, DeepSeekMoE reaches a loss of 1.808, against 1.867 for GShard and 2.060 for the dense model. On HellaSwag it scores 54.8 percent, against 50.5 for GShard. On TriviaQA it scores 16.6 percent exact match, against 10.2 for GShard.
Against larger models (Table 2). DeepSeekMoE is compared with GShard at 1.5 times the expert size (2.83 billion total expert parameters, 5.8 trillion FLOPs per 2,048 tokens) and with a dense model with 16 times the FFN parameters. On the Pile, DeepSeekMoE scores 1.808, the same as GShard times 1.5 and close to the dense model's 1.806. The paper says this places DeepSeekMoE close to the upper bound for MoE models at this scale. The paper's claim is limited to about 2 billion parameters and 100 billion training tokens.
Ablations (Figure 3 and Section 4.4). Each design choice was tested with the same total and activated parameters. Isolating one shared expert improved most benchmarks over GShard. Splitting experts further, into 32 and then 64 total, improved overall performance at each step. The number of shared experts mattered little: 1, 2 and 4 shared experts gave Pile losses of 1.808, 1.806 and 1.811.
Shared experts are not replaceable (Section 4.5). Turning off the shared expert and activating one more routed expert raised the Pile loss from 1.808 to 2.414, although compute stayed the same. Activating only 4 routed experts still gave a Pile loss comparable to GShard, and with half the activated expert parameters, DeepSeekMoE still beat GShard at the same total expert parameters (Figure 6).
The 16B model (Table 3). Compared with DeepSeek 7B, a dense model trained on the same 2 trillion tokens, DeepSeekMoE 16B has 16.4 billion total parameters, 2.8 billion activated, and 74.4 trillion FLOPs per 4,096 tokens, against 6.9 billion and 183.5 trillion for the dense model. That is 40.5 percent of the compute. On the Pile (in bits per byte) it scores 0.74 against 0.75. It is ahead on HellaSwag (77.1 against 75.4), TriviaQA (64.8 against 59.7) and NaturalQuestions (25.5 against 22.2), and behind on MMLU (45.0 against 48.2) and C-Eval (40.6 against 45.0).
Limits, in the paper's own words. The authors attribute the weaker multiple-choice results to attention capacity: the 16B model has about 0.5 billion attention parameters, while DeepSeek 7B has 2.5 billion, and in their earlier work they found that attention capacity correlates with multiple-choice scores. The paper also notes that a DeepSeek 7B variant using multi-query attention also struggled on MMLU-like tasks. The validation studies are at 2 billion parameters, and the claim that DeepSeekMoE approaches the MoE upper bound is stated only at that scale.
Reading guide
The paper is short, so the sections map cleanly to the prerequisites.
- Abstract and Section 1. Needs Mixture of Experts for the term "experts" and Transformer for where the layer sits. The two strategies, fine-grained segmentation and shared isolation, are named here.
- Section 2, Preliminaries. Needs Transformer for the block equations and Softmax for the router scores. The formula with the top-K gate is the baseline the paper modifies. Background on the feedforward networks inside each expert is in Feedforward Neural Network.
- Section 3.1, Fine-grained expert segmentation. Needs only the combination counting. The two binomial coefficients are worth checking by hand.
- Section 3.2, Shared expert isolation. The prior idea it cites is an engineering approach that the authors reframe algorithmically. For the earlier MoE layer this builds on, see Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer.
- Section 3.3, Load balance. Needs Load-Balancing Loss. The expert-level and device-level losses are the ones in the math section above.
- Section 4, Validation at 2B. Needs Language Model for the Pile loss and the benchmarks, and Switch Routing for the top-1 baseline the paper compares against.
- Section 5, Scaling to 16B. Compare the Table 3 numbers with the compute accounting in Section 2. The 40.5 percent figure is the ratio of the two FLOPs values.
Check yourself
QuestionA router keeps the top 2 of 4 experts for a token. After splitting each expert into 2 pieces and activating the top 4 of 8, how many expert computations does the token run, and why is the compute the same?Show answer
Two expert computations before, and four half-size pieces after. Each piece has half the hidden width, so four pieces cost the same as two full-size experts. Expert parameters and compute per token are unchanged; only the granularity changes.
QuestionA layer has 16 experts and a top-2 router. How many expert combinations can a token use, and how many can a router use if each expert is split into 4 pieces and 8 are activated?Show answer
With top-2 over 16 experts, the router can choose from C(16, 2) = 120 combinations. With 64 pieces and 8 activated, it can choose from C(64, 8) = 4,426,165,368 combinations. The paper uses these numbers to argue that finer segmentation makes expert choice far more flexible.
QuestionThe paper reports that disabling the shared expert raised the Pile loss from 1.808 to 2.414. Why does this matter if the model still uses the same compute?Show answer
It shows the shared expert holds knowledge that routed experts do not already hold. Activating one more routed expert in its place cannot compensate, even at the same cost. The shared expert is not a redundant copy; it is irreplaceable in this design.
QuestionIn the balance-loss example with 8 routed experts, K' = 2 and T = 4, a router sends every selection to two experts. Does the expert-level loss rise above 1, and why?Show answer
Yes. The selections concentrate on two experts, so for those experts f_i is large, and their P_i is also large because the router gives them high probability. The product sum rises above the perfect-balance value of 1. That pressure pushes the router to spread its choices, which is the point of the loss.
QuestionThe 16B model uses 2.8 billion activated parameters and 74.4 trillion FLOPs per 4,096 tokens, against 6.9 billion and 183.5 trillion for DeepSeek 7B. Compute the compute ratio, and say which benchmark family the MoE model is weakest on.Show answer
The ratio is 74.4 divided by 183.5, which is about 0.405, or 40.5 percent of the dense model's compute, matching the paper's caption. The MoE model is weakest on multiple-choice benchmarks, such as MMLU (45.0 against 48.2) and C-Eval (40.6 against 45.0), which the paper links to its smaller attention capacity.
Sources
- DeepSeekMoE paper, arXiv:2401.06066: https://arxiv.org/abs/2401.06066
- Sparsely-gated mixture-of-experts layer, arXiv:1701.06538: https://arxiv.org/abs/1701.06538