Abstract
How can a language model hold hundreds of billions of parameters yet spend, per token, the expert arithmetic of a far smaller model? In the transformer designs covered here, a mixture-of-experts (MoE) layer replaces one feed-forward block with many parallel experts and a learned router that sends each token to a few. Parameter count then grows with the number of experts, while the expert computation per token grows with the number chosen. That answer has a limit: routed computation, the memory needed to hold every expert, and measured serving speed are three separate budgets. Routing directly reduces expert arithmetic relative to activating every expert; whether memory use and serving speed improve depends on what the model is compared with and how it is implemented. The reader runs from the 1991 gating network to Mixtral 8x7B and DeepSeek-V3, with a top-2 routing example and a Mixtral parameter count to check by hand. It covers expert specialisation, how MoE differs from ensembles, model routers and multi-agent systems, and security research: laboratory attacks in which batch-dependent routing lets one user’s queries affect or leak another’s, and white-box studies in which safety behaviour hinges on a few routing decisions.
What a mixture-of-experts layer does
A transformer language model is a stack of blocks. Each block has an attention sub-layer, which mixes information between positions in the text, and a feed-forward sub-layer, a small network applied to each token’s vector on its own. The sibling reader on large language models and the transformer covers attention and next-token prediction. For this article it is enough that in a standard dense model every token passes through the whole feed-forward sub-layer, and that in Mixtral’s configuration, counted below, each layer’s feed-forward weights outnumber its attention weights by more than four to one.
A mixture-of-experts layer of the kind used in the transformer models below replaces that single feed-forward network with n networks of the same shape, each with its own weights, plus a router (also called a gate). Shazeer and colleagues’ 2017 formulation only requires that experts accept and produce vectors of the same size; identical feed-forward experts were their chosen case.1 The router gives each expert a score for the current token, the layer keeps the k highest-scoring experts, turns their scores into weights, runs the token through those experts, and adds up their outputs in proportion to the weights. Shazeer and colleagues wrote the output as y = Σ G(x)ᵢ Eᵢ(x), where G(x) is the gate vector and Eᵢ(x) the output of expert i, and noted that “Wherever G(x)ᵢ = 0, we need not compute Eᵢ(x)”.1 Mixtral’s paper uses G(x) = Softmax(TopK(x · W_g)), where TopK leaves the k largest logits in place and sets the rest to minus infinity, so their weight is zero.2 DeepSeek-V3 uses sigmoid scores and a more elaborate selection, described later.3
The consequence is two parameter counts. The total (or sparse) count includes every expert and sets how much memory is needed to hold the weights. The active count includes the experts one token uses plus the layers every token uses, and tracks the weight arithmetic per token. Mixtral’s authors put it this way: raising n while keeping k fixed increases the parameter count “while keeping its computational cost effectively constant”.2 That constancy covers the expert computation. Router scoring grows with n, attention work grows with context length, and dispatching tokens to experts has its own systems cost, so measured speed is a separate question. The routing decision is made again at every MoE layer and for every token, so one sentence may touch most of a layer’s experts even though each token touches two.
Three terms recur. Load balance is how evenly tokens spread over experts. An expert that receives most of the tokens can become a bottleneck, and in the extreme the others receive few training updates; Shazeer’s paper describes the router’s tendency to converge on a few favoured experts, which then train faster and are chosen even more.1 Expert capacity is a limit, in capacity-limited implementations, on how many tokens one expert processes per batch, so that work on parallel hardware has a predictable size. An overflowed assignment is a token’s request to an expert that is refused because the expert is full; the token may still be processed by another of its selected experts. A token left with no surviving assignment in a layer (a dropped token) skips that layer’s expert computation and, in GShard and Switch Transformer, passes on through the residual connection.45
A top-2 routing example to check by hand
The following is a simplified illustration: one token, four experts, no noise, bias or grouping, and no shared expert. The router produces logits (2.0, 1.0, 0.5, −1.0). The two largest belong to experts 1 and 2. A softmax over just those two, as in Mixtral’s formula, gives
- weight for expert 1: e²·⁰ / (e²·⁰ + e¹·⁰) = 7.389 / (7.389 + 2.718) = 0.731
- weight for expert 2: 2.718 / 10.107 = 0.269
GShard’s algorithm computes a softmax over all experts first and then renormalises the top two.4 The full softmax gives (0.609, 0.224, 0.136, 0.030), and renormalising the first two gives 0.609 / 0.833 = 0.731 and 0.224 / 0.833 = 0.269. The two procedures agree, because the denominator of the full softmax cancels when the chosen pair is renormalised. Suppose expert 1 returns the vector (4, −2) and expert 2 returns (1, 3). The layer’s output is 0.731 × (4, −2) + 0.269 × (1, 3) = (2.924 + 0.269, −1.462 + 0.807) = (3.193, −0.655). Experts 3 and 4 are never evaluated for this token.
DeepSeek-V3’s report computes each affinity as a sigmoid and normalises the selected affinities to sum to one.3 With the same logits, sigmoid(2.0) = 0.881 and sigmoid(1.0) = 0.731, so the gate values become 0.881 / 1.612 = 0.546 and 0.731 / 1.612 = 0.454. The released configuration adds details this toy omits: selection is restricted to a subset of expert groups (n_group 8, topk_group 4), the selection uses a correction bias, the normalised routed output is multiplied by a scaling factor of 2.5, and a shared expert is always added.63
In code, the token-choice router at the core of most of the models below is short:
def moe_layer(x, W_g, experts, k=2):
logits = x @ W_g # one score per expert
top = argsort(logits)[-k:] # indices of the k largest scores
w = softmax(logits[top]) # weights over the chosen k only
return sum(w[j] * experts[i](x) for j, i in enumerate(top))The sketch handles one token. Real implementations route a whole batch at once, may give each expert a fixed buffer, and in expert-parallel deployments place experts on different accelerators. Those three choices are where the systems costs and most of the security questions below come from.
Total versus active parameters: Mixtral 8x7B by hand
Mixtral 8x7B’s paper lists model dimension 4,096, 32 layers, feed-forward hidden dimension 14,336, 32 query heads and 8 key-value heads of dimension 128, vocabulary 32,000, 8 experts per layer and 2 active per token, each expert a SwiGLU feed-forward block.2 The published configuration confirms these values and records that the input embedding and output projection are separate matrices (tie_word_embeddings is false).7 A SwiGLU block has three weight matrices of size 4,096 × 14,336. The table marks per-unit rows (P) and model-wide subtotals (S); the totals add only the S rows.
| Row | Calculation | Parameters |
|---|---|---|
| (P) One expert | 3 × 4,096 × 14,336 | 176,160,768 |
| (S) All experts | 176,160,768 × 8 experts × 32 layers | 45,097,156,608 |
| (P) Attention, one layer | 4,096 × 4,096 (queries) + 2 × 4,096 × 1,024 (keys, values) + 4,096 × 4,096 (output) | 41,943,040 |
| (S) Attention, all layers | 41,943,040 × 32 | 1,342,177,280 |
| (S) Routers | 4,096 × 8 × 32 | 1,048,576 |
| (S) Embedding and output matrices | 2 × 32,000 × 4,096 | 262,144,000 |
| (S) Normalisation weights | (2 × 32 + 1) × 4,096 | 266,240 |
| Total | sum of the five S rows | 46,702,792,704 |
| Active per token | 2 × 176,160,768 × 32, plus the four non-expert S rows | 12,879,925,248 |
The totals, 46.7 billion and 12.9 billion, match the figures Mistral AI gave on 11 December 2023: “46.7B total parameters but only uses 12.9B parameters per token”.8 The paper rounds them to 47B and 13B.2 The active figure follows the usual convention of counting every shared matrix in full. That convention overstates some work (an embedding lookup reads one row of its matrix, not all of it) and leaves out other work (attention over the context costs arithmetic that no weight count records). The name “8x7B” is not multiplication: eight 7-billion-parameter models would be 56 billion, but only the feed-forward blocks are replicated, and attention and embeddings are shared.
The same exercise can be run as an estimate for DeepSeek-V3 from its published configuration: 61 layers, hidden size 7,168, the first three layers dense with a feed-forward width of 18,432, every later layer an MoE layer with one shared expert and 256 routed experts of width 2,048, eight routed experts active per token, vocabulary 129,280 and untied embeddings.6 One expert has 3 × 7,168 × 2,048 = 44,040,192 parameters. The 58 MoE layers hold 58 × 257 = 14,906 experts, about 656.5 billion parameters. Adding attention weights computed from the configuration’s latent-attention dimensions (about 187 million per layer), the three dense layers, the routers and the embeddings gives about 671.0 billion. Each token uses the shared expert plus eight routed experts in each of 58 layers, 58 × 9 × 44,040,192 ≈ 23.0 billion, plus about 14.6 billion non-expert weights, about 37.6 billion. The authors report 671B total and 37B activated.3 The reconstruction is this article’s estimate and excludes the separate multi-token-prediction module that the configuration also describes. On it, about 98 per cent of DeepSeek-V3’s parameters sit in experts, and a token touches about 3.5 per cent of the expert parameters.
1991 and 1994: the gating network and competing experts
The idea is older than deep learning. In “Adaptive Mixtures of Local Experts” (Neural Computation, 1991), Robert Jacobs, Michael Jordan, Steven Nowlan and Geoffrey Hinton started from a problem with training one network on several different subtasks: backpropagation produces “strong interference effects that lead to slow learning and poor generalization”. Their remedy was a system of several “expert” networks “plus a gating network that decides which of the experts should be used for each training case”, so that weight changes on a case are localised to the experts given that case.9 The paper’s first footnote records that the idea was first presented by Jacobs and Hinton at the Connectionist Summer School in Pittsburgh in 1988.9
The paper’s technical point concerns the error function. If the system’s output is a weighted blend of expert outputs and the error is measured on the blend, each expert learns to cancel the residual left by the others, and many experts end up active for every case. The authors wanted an arrangement in which “the local experts are encouraged to compete rather than cooperate”. They modelled the gate as a stochastic switch that picks one expert’s output with probability equal to its gate weight, and in their simulations minimised the negative log probability of the desired output under a mixture of Gaussians, one centred on each expert’s output.9 All experts are still evaluated when this objective and its gradient are computed; the one-expert choice is the generative model, not a saving in computation. Under the objective, each expert’s update on a case is weighted by its share of the explanation for that case: its gate weight times the likelihood it gives the target, divided by the mixture’s likelihood. An expert that fits a case better than the mixture as a whole gains responsibility for it.9 The test was a four-class vowel discrimination task using the first two formants of vowels from 75 speakers, training on 50 and testing on 25. Mixtures of 4 or 8 experts, each able to draw only a straight decision line, matched the test accuracy of backpropagation networks with 6 or 12 hidden units (about 90 per cent) in roughly half the training epochs: 1,124 and 1,083 on average, against 2,209 and 2,435.9
Two features of the 1991 design are worth holding onto. The gate saw the same input as the experts and learned the division of labour without being told it. And the motivation was specialisation and cleaner credit assignment rather than saving computation. Jordan and Jacobs extended the design in “Hierarchical Mixtures of Experts and the EM Algorithm” (Neural Computation 6, 1994), a tree-structured architecture in which both the mixing coefficients and the experts are generalised linear models, fitted as a maximum-likelihood problem with the expectation-maximisation algorithm.10 A hierarchical form returns in 2017 as a way to manage very large numbers of experts.
2017: the sparsely-gated layer
Noam Shazeer and colleagues at Google Brain (with Hinton and Jeff Dean among the authors) turned the mixture into a component of a larger network and made it sparse. “Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer”, posted on 23 January 2017, placed an MoE layer of “up to thousands of feed-forward sub-networks” between stacked LSTM layers for language modelling and translation.1 The motive was now computation: capacity could grow by orders of magnitude while each example used a handful of experts.
The gate was noisy top-k. Before choosing, the router adds Gaussian noise to each logit, scaled per expert by a second learned matrix through a softplus; then it keeps the top k and applies a softmax. The noise “helps with load balancing”.1 The paper notes that with k > 1 the gate values of the chosen experts have nonzero derivatives with respect to the router’s weights.1 Balance needed more than noise. The authors defined an expert’s importance in a batch as the sum of its gate values and added a loss equal to the squared coefficient of variation of the importance values, times a hand-tuned weight. Because equal importance can still mean unequal numbers of tokens, a second load loss targeted the count directly.1
The paper also named the systems problem that shaped later designs. If each of b examples picks k of n experts, each expert sees about kb/n examples: the shrinking batch problem. Shazeer’s answer was to combine batches from d data-parallel replicas at the MoE layer while keeping one shared copy of each expert, giving each expert about kbd/n examples, “a factor of d improvement”.1
On the One Billion Word benchmark, at roughly equal compute (about 8 million multiply-adds per example per timestep, excluding the output softmax) and with 4 experts active per input, the largest model, with 4,096 experts, reached 24 per cent lower test perplexity than the computationally matched baselines. On a 100-billion-word corpus, perplexity kept improving up to 65,536 experts (68 billion parameters), 39 per cent below the matched baseline, and then got worse at 131,072 experts (137 billion parameters in the MoE layer), “possibly a result of too much sparsity”.1 The authors reported that experts became “highly specialized based on syntax and semantics”, with examples such as one expert used when the indefinite article “a” introduces a direct object in a phrase about importance or leadership.1
2020: GShard, capacity and the all-to-all
GShard (Lepikhin and colleagues, 30 June 2020) moved the sparse layer into the transformer and onto thousands of chips. Every other feed-forward layer in the encoder and decoder became an MoE layer with a variant of top-2 gating, and the paper’s main systems contribution was an extension to the XLA compiler that partitions such a model across devices from light annotations.4 The headline model, with 2,048 experts per MoE layer and 36 layers, had 600 billion parameters and was trained on 2,048 TPU v3 cores in four days for translation from 100 languages into English.4
GShard’s Algorithm 1 introduced mechanisms that later papers and the security work below take for granted:4
- Expert capacity. Each expert processes at most a fixed number of tokens per batch, of order N/E for N tokens and E experts. An assignment to a full expert is refused. A token whose first choice is refused can still be processed by its second choice, and a second choice can be skipped by the random gate even when capacity remains. Only a token with no surviving assignment has a zero gate vector, and its representation then passes to the next layer through the residual connection.
- Local group dispatching. The batch is split into G groups processed in parallel, each allowed 2N/(G·E) tokens per expert.
- An auxiliary loss that multiplies, for each expert, the share of first-choice decisions made for it (counted whether or not capacity remained) by its mean gate value. It is a differentiable stand-in for penalising uneven counts.
- Two passes. The algorithm loops over the group’s tokens once to place first choices, each accepted only while that expert’s counter is below capacity, and then a second time for second choices.
- Random routing for the second expert. In the second pass, a token goes to its second-choice expert only if capacity remains and twice its normalised second weight exceeds a uniform random number; a small second weight contributes little and would use up capacity.
So a token is sent to at most two experts, and possibly to one or none. Because each pass walks the tokens in sequence and increments counters, which tokens overflow depends on what else is in the group and in what order.
Sharding experts across devices needs a particular communication pattern. GShard describes AllToAll as an operator that splits each participant’s input along one dimension and “sends each piece to a different participant”.4 In expert-parallel implementations, each MoE layer then needs two such exchanges per forward pass, one to dispatch tokens to experts and one to combine the results, the “dispatch and combine” steps DeepSeek-V3’s report describes.3 GShard trained in float32 for stability and reported that a 1-trillion-parameter, 60-layer variant with bfloat16 activations ran into numerical-stability problems, so those results were left out.4
2021: Switch Transformer and top-1 routing
Shazeer’s gradient argument suggested that the router needed at least two experts to compare.1 William Fedus, Barret Zoph and Shazeer tested the opposite in “Switch Transformers” (arXiv, 11 January 2021; Journal of Machine Learning Research 23(120), 2022): route each token to one expert. They reported that this “preserves model quality, reduces routing computation and performs better”, and listed three benefits: less router computation, expert batch sizes that can be at least halved, and simpler routing with lower communication cost.5 The router still computes a softmax over all experts; the chosen expert’s output is multiplied by that expert’s probability from the full softmax, and that probability is what gives the router a gradient.5 (Applying the earlier sketch with k = 1 would not work, since a softmax over one retained logit is always 1.) If the chosen expert is full, the token’s assignment is dropped and the token passes through the residual connection.
Switch made capacity an explicit hyperparameter:
expert capacity = (tokens per batch / number of experts) × capacity factor
A capacity factor above 1.0 leaves slack for imbalance; a larger factor drops fewer tokens but wastes computation and memory on empty slots. The authors found low drop rates mattered for scaling, and with their balancing loss typically fewer than 1 per cent of tokens were dropped.5 For example, a batch of 1,024 tokens spread over 8 experts with a capacity factor of 1.25 gives each expert 160 slots.
The balancing loss: for N experts and a batch of T tokens, let fᵢ be the fraction of tokens whose top choice is expert i, and Pᵢ the average router probability assigned to expert i. Then
loss = α · N · Σᵢ fᵢ · Pᵢ
with α = 10⁻² throughout the paper.5 The f terms are counts and carry no gradient; the P terms are differentiable. Under perfectly uniform routing every fᵢ and Pᵢ is 1/N, the sum is N × (1/N²) = 1/N, and the loss is α. If every token goes to one expert with probability near one, that expert’s f and P are both 1, the sum is 1, and the loss rises to α·N, which is 8α for eight experts.
Much of the paper’s practical advice concerns instability. Switch kept the model in bfloat16 but cast the router’s input to float32 inside the router function only, which “permits nearly equal speed to bfloat16 training while conferring the training stability of float32”.5 It reduced the default weight initialisation scale by a factor of ten, and for fine-tuning used a higher dropout inside experts (0.4) than elsewhere (0.1). In its controlled comparisons with T5 baselines at matched FLOPs per token, Switch models reached a target quality up to seven times faster in pre-training. The largest, Switch-C, had 1.571 trillion parameters and 2,048 experts and was reported as showing no training instability, while Switch-XXL (395 billion parameters, 64 experts, 6.3 trillion FLOPs per sequence in the paper’s Table 9 against Switch-C’s 890 billion) was “sometimes unstable”.5 The two models differ in several dimensions, so the comparison does not isolate a cause.
2022: ST-MoE, the router z-loss and fine-tuning
“ST-MoE: Designing Stable and Transferable Sparse Expert Models” (Zoph and colleagues, 17 February 2022) addressed two problems: training runs that diverged, and models that pre-trained well but fine-tuned badly.11
For stability the paper introduced the router z-loss: the mean over tokens of the squared log-sum-exp of the router logits, weighted by c_z = 0.001 and added to the cross-entropy and balancing losses. The penalty acts on the log normaliser of the router’s softmax: it discourages large positive logits and a large common offset, though individual negative logits are not bounded by it. The motivation is numerical: bfloat16 keeps 7 mantissa bits to float32’s 23, so for numbers in the same range bfloat16’s representable values are 2¹⁶ = 65,536 times further apart, and larger numbers carry larger rounding errors; routers add exponentials, where a small input error makes a large output difference, and rounding can change where a token’s second choice lands.11 In the paper’s ablation, tightening the optimiser’s update clipping also stabilised training but at a “catastrophic loss of quality”, while the z-loss stabilised all three runs with a slight quality gain.11
For fine-tuning, the authors argued that sparse models overfit: on SuperGLUE’s CommitmentBank task, with 250 training examples, the sparse model reached 100 per cent training accuracy faster than a dense model but lagged it on held-out data, while on the much larger ReCoRD task it significantly exceeded the dense model. Fine-tuning only the non-expert parameters worked about as well as fine-tuning everything; fine-tuning only the expert parameters caused a “drastic quality reduction”. Sparse models preferred smaller batches and higher learning rates than dense ones, and dropping 10 to 15 per cent of tokens during fine-tuning hardly hurt.11 ST-MoE-32B had 269 billion parameters with compute comparable to a 32-billion-parameter dense encoder-decoder, 64 experts in every fourth feed-forward layer, and the paper recommended top-2 routing with a training capacity factor of 1.25. The authors describe it as the first sparse model to achieve state-of-the-art transfer-learning performance across their set of tasks, which included SuperGLUE, ARC, XSum and closed-book question answering.11
Two other designs from this period are needed later. GLaM (Du and colleagues, December 2021; ICML 2022) was a decoder-only model with 1.2 trillion parameters, 64 experts in every other layer and two experts per token, activating 96.6 billion parameters (8 per cent) per token; it reported using about a third of GPT-3’s training energy and about half its inference FLOPs.12 Expert-choice routing (Zhou and colleagues, 18 February 2022) reversed the direction of selection: each expert picks its top tokens from the batch. Every expert then has a fixed bucket and load is balanced by construction, while each token may be processed by a variable number of experts; in the authors’ controlled comparison with GShard top-2 gating at matched activated size and per-token compute, expert choice reached the same perplexity in less than half the training steps.13 Their limitations section notes that the method “might not immediately apply to auto-regressive text generation” because the implementation “takes in the past and future tokens to perform the top-k selection”.13 A 2026 paper puts the problem more sharply: expert-choice routing “fundamentally violates causality”, because selection compares against a batch that includes future positions of the same sequence.14 That is a separate property from dependence on other users’ requests in a shared batch, which can arise even among tokens that are all available. One of the attacks below exploits the second property.
2024: Mixtral 8x7B
Mistral AI released Mixtral 8x7B on 11 December 2023 under the Apache 2.0 licence, and the paper followed on 8 January 2024.82 It reused the Mistral 7B architecture, replaced every feed-forward block (GShard had replaced every other one) with eight SwiGLU experts, and routed each token to two.2 The paper reported that Mixtral led Llama 2 70B on most of the metrics it re-ran, with reading comprehension an exception in its category-level comparison and some individual losses outside that category (HellaSwag, WinoGrande and TriviaQA in its Table 2), and with large margins over Llama 2 70B in mathematics and code, while using about a fifth of Llama 2 70B’s active parameters; it also compared Mixtral with GPT-3.5 on a smaller table.2
The paper is direct about what the active count leaves out. Active parameters are “directly proportional to the inference compute cost” but do not capture memory or hardware utilisation; serving memory scales with the 47B total; MoE layers add routing overhead and extra memory traffic when one device runs several experts; and such models “are more suitable for batched workloads where one can reach a good degree of arithmetic intensity”.2 It points to Megablocks kernels, which handle experts receiving unequal numbers of tokens, and to expert parallelism, in which tokens travel to the device holding their expert and back.2 According to Hayes and colleagues, Mixtral’s default implementation sets no expert capacity limit, which matters for the first attack below.15
2024 to 2025: DeepSeekMoE and DeepSeek-V3
“DeepSeekMoE” (Dai and colleagues, 11 January 2024) argued that conventional designs struggle to make each expert hold distinct, focused knowledge, and proposed two changes. Fine-grained segmentation splits each expert into several smaller ones and activates proportionally more of them, keeping compute constant while allowing far more combinations. Shared expert isolation sets aside a few experts that every token uses, to hold common knowledge so that routed experts need not duplicate it.16 The paper reported that a 2-billion-parameter DeepSeekMoE matched GShard at 2.9 billion, and that the 16-billion version matched LLaMA2 7B with about 40 per cent of the computation.16
DeepSeek-V3 (technical report first posted 27 December 2024) has 671 billion parameters with 37 billion activated per token. It was pre-trained on 14.8 trillion tokens, and the report gives 2.788 million H800 GPU hours as the total for its official pre-training, context-length extension and post-training.3 Its MoE-specific choices:
- One shared expert and 256 routed experts per MoE layer, eight routed experts per token, with each token sent to experts on at most four nodes to cap cross-node traffic.3
- Batch-level balancing without its own auxiliary loss. Following Wang and colleagues (August 2024), who argued that a strong balancing loss adds “interference gradients” that hurt quality,17 each expert gets a bias bᵢ that is added to its affinity score only when choosing the top experts; the gate value that weights the expert’s output still comes from the unbiased score. After each training step the bias is lowered by γ for overloaded experts and raised by γ for underloaded ones, with γ = 0.001 for the first 14.3 trillion tokens and zero for the last 500 billion.3 The bias update is a rule, not a gradient, so it adds no gradient of its own.
- A retained sequence-level balancing loss, weighted α = 0.0001, to prevent extreme imbalance within a single sequence; that loss does contribute gradients, though with a very small weight.3
- No token dropping in DeepSeek’s own training or inference, which the report attributes to effective balancing during training and to deployment measures at inference.3
With the earlier numbers: suppose expert 1 has been overloaded and its bias has drifted to −1.2. Selection now compares 0.881 − 1.2 = −0.319 for expert 1 with 0.731 for expert 2, sigmoid(0.5) = 0.622 for expert 3 and sigmoid(−1.0) = 0.269 for expert 4, so experts 2 and 3 are chosen. Their gate values come from the unbiased scores: 0.731 / (0.731 + 0.622) = 0.540 and 0.460. The bias of −1.2 is for illustration; with γ = 0.001 per step, a real bias moves slowly.
DeepSeek-V3 also trained with a separate multi-token-prediction objective of depth one, predicting one extra token through an additional module. The report says the module can be discarded at inference or repurposed for speculative decoding.3 The report does not say whether that objective changes the routing the model learns.
The landmark designs compared
| Design (first posted) | Experts per MoE layer | Experts per token | Where MoE layers sit | Balancing | Total / active parameters as stated |
|---|---|---|---|---|---|
| Jacobs et al. (1991)9 | 4 or 8 (vowel task) | all evaluated; generative model picks one | the whole model | competition through the error function | small; not reported as a design goal |
| Shazeer et al. (Jan 2017)1 | up to 131,072 (hierarchical) | 4 in the language-model runs | between LSTM layers | noise, importance and load losses | up to 137B in the MoE layer / not stated |
| GShard (Jun 2020)4 | 2,048 | at most 2; second is random | every other layer | capacity, groups, auxiliary loss | 600B / not stated |
| Switch-C (Jan 2021)5 | 2,048 | at most 1 (dropped at capacity) | every layer | capacity factor, α·N·Σfᵢ·Pᵢ | 1,571B / not stated |
| ST-MoE-32B (Feb 2022)11 | 64 | 2 | every fourth layer | auxiliary loss (router z-loss added for stability) | 269B / FLOPs comparable to a 32B dense model |
| GLaM (Dec 2021)12 | 64 | 2 | every other layer | GShard-style | 1.2T / 96.6B |
| Mixtral 8x7B (Jan 2024)2 | 8 | 2 | every layer | not specified in the paper | 46.7B / 12.9B |
| DeepSeek-V3 (Dec 2024)3 | 1 shared + 256 routed | 1 + 8 | all but the first three layers | bias terms, small sequence loss | 671B / 37B |
“Not stated” means the paper does not give an active count in the form used here.
What sparsity buys and costs at inference
The saving is in routed expert arithmetic per token, and the costs appear as memory and communication. A forward pass through Mixtral costs roughly what a 13-billion-parameter dense model costs in weight multiply-adds, but every one of the 46.7 billion weights has to be stored somewhere the next token can reach, because it may need any expert. At two bytes per parameter that is about 93 GB of weight storage, against about 26 GB for a 13-billion-parameter dense model (this article’s arithmetic, weights only, excluding activations and the attention cache).
The Fedus, Dean and Zoph review of 2022 frames the conventional trade-off under the assumption that all parameters are kept in accelerator memory: “On a per parameter basis, sparse models will always look comparatively worse to dense models”, and seeking the best model that fits on a fixed hardware size again favours dense. On that view sparsity pays when there are many accelerators to host the extra parameters, for training with data parallelism or high-throughput serving.18 The review itself qualifies this: sparse models can work with as few as two experts, and offloading can move parameters between CPU and accelerator.18 Ludziejewski and colleagues’ 2025 joint scaling laws, which model memory and compute together, found regimes in which an MoE model is the more memory-efficient choice (discussed below).19
Arithmetic is not latency. Speed also depends on memory bandwidth, dispatch overhead and the workload. Mixtral’s paper claims faster inference at low batch sizes and higher throughput at large ones, and adds that MoE layers carry routing overhead and extra memory loads.2 As batch size grows, and if routing is diverse enough, more of the experts are needed in each step, so the benefit shifts toward throughput, by an amount that depends on the workload. The shrinking-batch problem from 2017 also returns, since each expert sees only a fraction of the batch.1
Large deployments spread experts over many devices and pay in all-to-all traffic. DeepSeek-V3’s report describes its own serving layout. For prefilling (processing the prompt), the smallest deployment unit is 4 nodes with 32 GPUs and 32-way expert parallelism; in the prefilling stage, the set of duplicated “high-load experts” is chosen from statistics collected during the online service and adjusted periodically, for example every ten minutes. For decoding, the unit is 40 nodes with 320 GPUs; the shared expert is treated as an expert that is always selected, each GPU hosts only one expert, and 64 GPUs are responsible for hosting redundant experts and shared experts. The report lists the size of the recommended deployment unit as a limitation that “might pose a burden for small-sized teams”.3
Running a large MoE model on one machine is possible when weights do not all have to sit in accelerator memory. Eliseev and Mazur (December 2023) ran Mixtral-8x7B-Instruct on a T4, an RTX 3060 and an RTX 3080 Mobile by combining mixed quantization with offloading experts to host memory, an LRU cache of recently used experts on the GPU (based on the expert-reuse patterns they measured) and speculative loading of likely next experts. Their Table 2 gives about 2.1 to 2.7 tokens per second on those three systems with 2-bit experts, and about 1.6 to 2.5 with 3-bit experts.20
What do the experts specialise in?
The name invites a picture of a medicine expert, a law expert and a code expert. The published routing analyses of a few specific models mostly do not show that, with qualifications. These studies observe which tokens the router sends where; they do not directly measure what function each expert network computes.
Shazeer’s 2017 translation model showed experts tied to particular words and syntactic contexts.1 ST-MoE found that in its encoder at least one expert per layer specialised in sentinel tokens (the placeholders of its fill-in-the-blank training objective), and some specialised in punctuation, verbs, proper names or counting; in the decoder it found no meaningful specialisation. In a multilingual model, experts specialised, “But Not by Language”: an expert for numbers or articles handled them across languages.11 Mixtral’s authors looked for topic experts on subsets of The Pile at layers 0, 15 and 31 and reported that “we do not observe obvious patterns in the assignment of experts based on the topic”; distributions were very similar for arXiv papers, PubMed abstracts and philosophy papers, with only the synthetic DM Mathematics set slightly different. They did see syntactic regularity: tokens such as “self” in Python or “Question” in English tend to go to the same expert, code indentation is consistently routed together, and consecutive tokens share experts at layers 15 and 31 far more often than random assignment would give.2 OpenMoE (Xue and colleagues, January 2024) found routing in its models driven mostly by token identity with little dependence on context (“Context-Independent Specialization”), fixed early in pre-training, and a tendency for later tokens in a sequence to be dropped more often.21
Two cautions keep this from being settled. The review points out that these studies look at the token arriving at an expert, but by the middle of a transformer that token’s vector already carries context from attention, so “more nuanced specialization may be missed by these heuristic techniques”.18 And specialisation depends on design. DeepSeek-V3’s ablation compared two 16-billion-parameter models, one balanced by auxiliary losses and one by bias terms, and found that the latter “demonstrates greater expert specialization patterns” across domains of the Pile.3 DeepSeekMoE’s design aimed to increase specialisation.16 Across these experiments, router assignments in Mixtral and OpenMoE followed token identity and syntax more than topic, DeepSeek’s bias-balanced ablation showed more domain structure, and none of them shows experts corresponding to human subjects.
Better than dense? It depends on what is held equal
The headline comparisons hold different things fixed. Switch’s speed-ups are time to a target quality at matched FLOPs per token and comparable hardware.5 Mixtral’s comparison with Llama 2 70B is framed in active parameters.2 GLaM compares measured or estimated training energy and inference FLOPs with GPT-3.12 For those models and tasks, MoE comes out ahead on the budget each paper chose. Held to equal parameters resident in accelerator memory, the review’s conventional answer is that sparse models look worse.18
Recent work complicates both. Jelassi and colleagues (“Mixture of Parrots”, October 2024; ICLR 2025) held active parameters fixed and added experts, and found that “the memorization performance consistently increases while the reasoning capabilities saturate”. On the theory side they proved, for a one-layer transformer under stated width and precision assumptions, that MoEs with small hidden dimension cannot solve a graph-connectivity problem “regardless of the number of experts used”, while a somewhat wider dense model can.22 Ludziejewski and colleagues (February 2025) fitted joint scaling laws over more than 280 runs and concluded that “MoE models can be more memory-efficient than dense models, contradicting conventional wisdom”; their largest runs reached 2.7 billion active and, separately, 5 billion total parameters.19 A comparison is interpretable only once it says which budget it held fixed: compute, memory, training tokens or serving cost.
Four things called “experts”
The word is used for at least four different designs. The table shows typical patterns; individual systems vary.
| Mixture of experts in one model | Ensemble | Model router or cascade | Multi-agent system | |
|---|---|---|---|---|
| What the “experts” are | sub-networks inside a layer | complete, separately trained models | complete models, often different sizes or vendors | complete models (often one model in several roles), typically with prompts and tools |
| How work is divided | a learned router, per token, at every MoE layer | every member processes every input | a router picks a model per query, or a cascade escalates when a cheaper answer is judged inadequate | explicit messages between agents |
| Trained together? | yes, end to end | usually not | no; the router is trained separately | usually not |
| What is combined | weighted sum of a few expert outputs inside the layer | votes or averaged predictions | usually nothing; one model’s answer is returned | text passed between agents |
| Granularity | token | query | query | response or task step |
RouteLLM (Ong and colleagues, June 2024) trains routers on human preference data to send each query to a strong or a weak model, and reports cost reductions “by over 2 times in certain cases” without compromising response quality on the benchmarks it tested.23 FrugalGPT (Chen, Zaharia and Zou, May 2023) learns cascades over commercial model APIs and reports cost savings from 50 to 98 per cent across its datasets while matching the best single model, with the 98 per cent figure on the HEADLINES financial-news dataset at the API prices it used.24 “Mixture-of-Agents” (Wang and colleagues, June 2024) stacks layers of complete language models, each reading the previous layer’s answers.25 Despite the name, it composes whole responses and has no sparse layers.
For security the distinction matters because the attack surfaces differ. In routers, cascades and multi-agent systems the components exchange whole queries or texts, and the familiar problems are which model sees which data and what one component can make another do, the subject of the library’s reader on prompt injection and the agent attack surface. In an MoE model the experts are weights within one forward pass, and the new questions come from the router: decisions that may depend on other users’ tokens, leave traces in hardware, or carry safety behaviour.
Security: when a batch is not a set of independent queries
In exact arithmetic a dense transformer processes each sequence in a batch independently; batching is an efficiency measure. Routing with expert capacity breaks that independence by design, because which of your tokens overflow depends on how many other tokens in the batch, from anyone, wanted the same experts. The term “buffer overflow” in the first paper below refers to exactly this: an expert’s capacity being used up, not a memory-safety bug.
Expert-capacity exhaustion
Jamie Hayes, Ilia Shumailov and Itay Yona of Google DeepMind posted “Buffer Overflow in Mixture of Experts” on 8 February 2024. They study a “vanilla” routing strategy that assigns first choices through the batch in order, then second choices, with a fixed buffer for each expert.15 An attacker whose sequences are placed in the same batch as a victim’s, ahead of it, can fill the buffers of the experts the victim’s tokens prefer, so the victim’s tokens are dropped.
Their threat model: the attacker queries a black-box model and sees output logits, controls every other sequence in the batch and their order, and the deployment uses finite per-expert buffers with order-dependent routing.15 Mixtral-8x7B’s default implementation sets no capacity limit, so it is not exposed to this capacity-exhaustion mechanism; the authors modified it to use vanilla routing with a small buffer (38 tokens per expert out of 96 in the batch), and found adversarial batches that changed the model’s most likely next token on a short arithmetic prompt. The effect transferred to one of two similar prompts tested, did not occur when the victim was first in the batch, and occurred only at the two smallest buffer sizes tried.15 A white-box variant aimed at “denial of expert” caused all of the victim’s tokens that used a chosen expert to be dropped.15
The authors reported that the attack failed when the capacity limit was removed (as in stock Mixtral), and that their random-search attack also failed under each of three other changes: randomising batch order, using a large capacity slack, and sampling experts from the gate distribution instead of taking the top k. They say these three “will not offer guarantees of protection” and were tested only against their attack.15 They were explicit about practicality: “It is unclear if an attack on MoE could represent a practical risk to deployed models.”15
Prompt leakage through tie-breaking
“Stealing User Prompts from Mixture of Experts” by Yona, Shumailov, Hayes and Nicholas Carlini (30 October 2024) turned the same kind of dependence into a confidentiality result.26 It targets expert-choice routing, where a full expert must decide among equal-priority tokens. The leak comes from how ties between equal-priority tokens are broken (the tie-handling of the torch.topk CUDA implementation), which makes one request’s processing depend on another’s position in the batch.26 The evaluation was deliberately constrained: a modified model consisting of the first two layers of Mixtral with expert-choice routing, router weights rounded to induce ties, secret messages drawn from the 1,000 most common English words tokenized at the character level, and guesses restricted to 27 tokens (lowercase letters and space). Under those conditions the attack recovered 996 of the 1,000 words and 4,833 of their 4,838 character tokens.26
The prerequisites are strong, and the authors list them: white-box access to the model, control over where the attacker’s and the victim’s inputs sit in the batch, and repeated queries with the victim’s input always in the same batch. They write that the query cost “makes it infeasible at present to use our attack against real world systems” and that “the current threat model assumes unrealistic attacker capabilities”, while expecting future work to relax these requirements.26 Their suggested defences, which the paper proposes but does not evaluate, are to preserve batch independence across users and to add randomness to the capacity factor, batch order, input or routing.26
Hardware side channels on routing
A third line needs no batch manipulation. Routing is input-dependent, so which experts run and how much work each gets depends on the tokens, and that activity can show up in caches, memory paging and GPU performance counters. “MoEcho” (Ding and colleagues, August 2025; ACM CCS 2025) builds four such channels: cache occupancy and Pageout+Reload on CPUs, and performance counters and TLB Evict+Reload on GPUs.27 Its threat model places the attacker on the same machine as the victim’s model process (for example as malware) or as a malicious co-tenant virtual machine on the same physical server, with the channel-specific access each technique needs, and with a profiling phase in which the attacker runs its own copy of the model on chosen inputs.27 On DeepSeek-V2-Lite, inferring a private illness attribute (116 possible values) from expert load reached 99.9 per cent top-1 accuracy on templated healthcare-record prompts but 56.5 per cent on unstructured ones, against a random baseline of 0.86 per cent; the end-to-end CPU attack reconstructed 92.8 per cent of response tokens and the GPU attack 82.5 per cent.27 The gap between templated and unstructured inputs shows how much the results depend on the attacker knowing the input distribution. The authors’ suggested mitigations include randomising expert execution order and adding noise to router decisions.27
How practical are these?
None of these three papers demonstrates an attack on a production inference service. The batch attacks need a capacity-limited or expert-choice routing implementation, batch co-location with a target and, for prompt leakage, white-box access and control of batch placement; the side-channel attack needs co-residency and profiling.152627 DeepSeek-V3’s report says its own deployment drops no tokens at inference, which removes the capacity mechanism Hayes and colleagues used but does not by itself establish batch independence, and says nothing about other providers.3 What a given provider’s serving stack does about capacity, dropping, batch construction and host sharing is an open question for that deployment.
Batch dependence also arises without capacity limits. Thinking Machines Lab (Horace He and colleagues, 10 September 2025) argues that “the primary reason nearly all LLM inference endpoints are nondeterministic is that the load (and thus batch-size) nondeterministically varies”, because kernels change their order of floating-point reductions with batch size.28 In their experiment, 1,000 temperature-zero completions of one prompt from Qwen3-235B-A22B-Instruct-2507 produced 80 unique completions; with their batch-invariant kernels enabled, all 1,000 were identical.28 The post concerns inference kernels in general, not MoE. A plausible further mechanism, not demonstrated in any paper cited here, is that in an MoE model such small numerical differences could push a token’s scores across a top-k boundary and send it to a different expert, as ST-MoE described for rounding errors during training.11 Whether that would leak anything useful is unverified. Yona and colleagues’ remark that in dense LLMs “it is essentially impossible for one user’s data to impact another user’s output” describes routing interference; numerically, outputs of dense models can also vary with batch size.2628
Router designers have started to address batch dependence. The 2026 Expert Threshold routing paper gives each expert a threshold maintained during training as a moving average over the token distribution and, at inference, routes a token to every expert whose threshold its score exceeds, a mechanism that “eliminates dependence on other tokens in the batch”; it cites batch-dependent routing as raising “privacy/safety concerns in multi-tenant settings”.14
Safety that lives in routes
The second security question concerns the model itself. If an MoE model’s refusal behaviour depends on which experts a token visits, then forcing a different route might change the behaviour.
Sparse Models, Sparse Safety
Yukun Jiang, Hai Huang, Mingjie Li, Yage Zhang, Michael Backes and Yang Zhang of the CISPA Helmholtz Center posted “Sparse Models, Sparse Safety: Unsafe Routes in Mixture-of-Experts LLMs” on 9 February 2026. Their claim is that “the safety of MoE LLMs is as sparse as their architecture”.29 An unsafe route is a routing configuration across layers that, once forced, turns a refusal into a harmful answer, found without changing any weights.
The threat model is white-box: the attacker can submit any query, read per-layer routing scores and, at inference, mask chosen experts so that top-k selection must pick among the rest.29 A per-router score, RoSais, estimates how much masking each layer’s router raises the probability of a non-refusing first token. On JailbreakBench, applying masks found at the dataset level to the five highest-scoring routers in DeepSeek-V2-Lite (which activates 6 of 64 experts per layer) raised the attack success rate from 0.15 to 0.79; the sample-level top-five variant reached 0.46 on the same model.29 A finer search method, F-SOUR, chooses masks token by token and layer by layer. Across one model from each of four families, its JailbreakBench success rates were 0.94 on DeepSeek-V2-Lite, 0.91 on Mixtral-8x7B, 0.86 on OLMoE-1B-7B and 0.88 on Qwen1.5-MoE-A2.7B (average 0.90), against default rates of 0.15, 0.40, 0.00 and 0.07; on AdvBench the average was 0.98.29 Harmfulness was judged by GPT-4o using JailbreakBench’s judge prompt, with deterministic generation at temperature zero.29 In the same table, the authors’ runs of SteerMoE scored 0.66, 0.73, 0.14 and 0.46 on the four models (average 0.50), and SAFEx averaged 0.31.29
The authors hypothesise that unsafe routes exist because refusal is mediated by directions concentrated at particular depths, and because uneven routing across domains concentrates safety alignment in a subset of experts.29 As a defence they tested route disabling, permanently masking the experts on a dataset-level unsafe route. On DeepSeek-V2-Lite, masking 6 of 64 experts in 5 of its 25 MoE layers cut the success of the GCG attack on JailbreakBench from 0.38 to 0.02 and of the TAP attack from 0.60 to 0.44, with a measurable cost on mathematics tasks; they note it may be defeated by adaptive attacks.29 They propose, as future work, exposing rarely activated experts to safety data during training.29 Their limitations section states that the methods “assume white-box access to routing scores, which may limit applicability to closed APIs”.29
The paper itself notes that attackers can already circumvent safety alignment by manipulating a model’s inputs or internals such as its weights.29 What it adds is experimental evidence that, in these four open models, the route is a small, discrete control surface with a large effect on refusal, searchable without training.
Steering by expert activation
SteerMoE (Fayyaz and colleagues, September 2025; ICLR 2026) reaches a related result from the other side. It finds experts whose activation frequency differs between paired inputs with opposite behaviour, then switches those experts on or off at inference without fine-tuning.30 It was evaluated on 11 benchmarks and six MoE models (including GPT-OSS-120B, Qwen3-30B-A3B, Mixtral-8x7B-Instruct and OLMoE). Its safety metric is the share of tested responses to harmful prompts that the Llama-Guard-3-8B classifier labels safe; steering toward safety-associated experts raised it and steering toward unsafe ones lowered it. In the paper’s Table 2, on 50 AdvBench examples, GPT-OSS-120B’s safe-response rate fell from 100 per cent to 0 per cent when unsafe steering was combined with an existing jailbreak method, which the authors describe as going “from fully aligned to fully compromised”.30
Request isolation, host isolation and model validation
| Capacity exhaustion (Hayes et al.) | Prompt leakage via tie-breaking (Yona et al.) | Hardware side channels (MoEcho) | Unsafe routes (Jiang et al.; SteerMoE) | |
|---|---|---|---|---|
| Prerequisites | capacity-limited, order-dependent routing; attacker inputs batched with and ahead of the victim; logits visible | expert-choice routing; white-box model; control of batch placement; repeated co-batched queries | co-resident process or co-tenant VM; channel-specific access; profiling a model copy | white-box access to routing scores and the ability to mask or steer experts |
| Demonstrated effect | changed next token or dropped tokens on a modified Mixtral | recovery of secret prompts on a two-layer Mixtral | inference of input attributes and response tokens on open MoE models | higher attack success rates on four to six open MoE models |
| Relevant control | removing capacity-based dropping removes this mechanism (it does not by itself establish request isolation); randomised batch order, large capacity slack and sampled routing were evaluated only against this specific attack | proposed by the authors, not evaluated: batch independence across users; randomness in capacity, batch order, input or routing | host isolation: no co-tenancy for sensitive workloads | model validation: route-aware red-teaming of self-hosted weights |
What a practitioner should take from this
For someone deploying an MoE model or buying access to one through an inference provider, the research supports a few specific conclusions.
Outputs can depend on the batch. Thinking Machines showed, for one Qwen3 MoE checkpoint, that temperature-zero outputs varied across runs and became identical with batch-invariant kernels; their explanation that batch-size variation is the main cause across endpoints is their hypothesis.28 If an application needs reproducible outputs (evaluation, regression testing, audit), the thing to check is batch invariance and repeatability on the actual serving stack. Dedicated hardware removes one source of variation but does not by itself guarantee determinism. Expert capacity makes batch dependence larger and, in the laboratory, exploitable; a provider should be able to say whether its stack enforces expert capacity and drops or reroutes tokens, and whether batch order is randomised.15
Shared batches and shared hosts are isolation boundaries. The published batch attacks require conditions that a provider can avoid, and their authors call them impractical today while expecting improvement.1526 Where prompts are highly sensitive, the controls that follow from these threat models are batches not shared with untrusted tenants and host isolation; removing capacity-based dropping removes the Hayes mechanism but does not by itself establish request isolation. MoEcho’s results under its co-residency assumptions show that expert activity can reveal information about inputs, so co-tenancy rules for hosts running MoE models deserve scrutiny.27
Red-teaming should cover routing where the operator controls it. If an organisation hosts open MoE weights, its safety evaluation can include routing perturbations (masked or forced experts) as well as prompts, since the cited white-box studies show safety behaviour depending on a few routing decisions.2930 Changes that alter which experts run or how they compute, such as expert pruning, lower-precision expert weights or a different capacity rule, can change behaviour and should be followed by re-evaluation; moving identical weights between host and accelerator memory, as in offloading, preserves routing only when the numerical computation is also unchanged, since different execution kernels can change floating-point results.2028 Through an ordinary API, an evaluator can observe outputs but cannot manipulate routes directly, so these white-box results describe what an insider or a self-hoster could do; Jiang and colleagues suggest the existence of unsafe routes may open room for black-box attacks.29 The MITRE ATLAS reader shows how model-level attacks of this kind are classified.
Read parameter counts as separate budgets. Active parameters track routed weight arithmetic; total parameters set weight storage and, in Jelassi and colleagues’ experiments, were associated with memorisation performance.222 Measured latency and throughput are a third number. A vendor comparison that cites only one of the three is incomplete.
Reading list
- Jacobs, Jordan, Nowlan and Hinton, “Adaptive Mixtures of Local Experts” (opens in a new tab) (1991): the gating network and a competitive objective.9
- Jordan and Jacobs, “Hierarchical Mixtures of Experts and the EM Algorithm” (opens in a new tab) (1994): trees of gates fitted by expectation-maximisation.10
- Shazeer and colleagues, “Outrageously Large Neural Networks” (opens in a new tab) (2017): sparse top-k gating, balancing losses, the shrinking batch problem.1
- Lepikhin and colleagues, “GShard” (opens in a new tab) (2020): expert capacity, overflow, random second expert, all-to-all sharding.4
- Fedus, Zoph and Shazeer, “Switch Transformers” (opens in a new tab) (2021): top-1 routing, capacity factor, the α·N·Σfᵢ·Pᵢ balancing loss.5
- Zoph and colleagues, “ST-MoE” (opens in a new tab) (2022): the router z-loss, fine-tuning behaviour, specialisation analysis.11
- Zhou and colleagues, “Mixture-of-Experts with Expert Choice Routing” (opens in a new tab) (2022): experts choose tokens; balanced by construction, with the causality limitation noted by its authors and later by Sun and colleagues.1314
- Fedus, Dean and Zoph, “A Review of Sparse Expert Models in Deep Learning” (opens in a new tab) (2022): history, resource trade-offs, limits of specialisation studies.18
- Jiang and colleagues (Mistral AI), “Mixtral of Experts” (opens in a new tab) (2024): total versus active parameters, routing analysis.2
- Dai and colleagues, “DeepSeekMoE” (opens in a new tab) (2024), and DeepSeek-AI, “DeepSeek-V3 Technical Report” (opens in a new tab) (2024): fine-grained and shared experts, bias-based balancing, serving at scale.163
- Cai and colleagues, “A Survey on Mixture of Experts in Large Language Models” (opens in a new tab) (2024; IEEE TKDE 2025): a taxonomy of gating, expert design and systems work.31
- Hayes, Shumailov and Yona, “Buffer Overflow in Mixture of Experts” (opens in a new tab) (2024), and Yona and colleagues, “Stealing User Prompts from Mixture of Experts” (opens in a new tab) (2024): cross-request interference and leakage within a shared batch, under laboratory threat models.1526
- Jiang and colleagues, “Sparse Models, Sparse Safety” (opens in a new tab) (2026): white-box unsafe routes and route disabling on four open model families.29
Contested across this list: whether experts are specialists in any human sense; whether MoE beats dense models at equal memory as well as at equal compute; and whether batch-level and routing attacks can be made to work against real serving stacks, whose batching, capacity and isolation are deployment-specific.
Conclusion
A mixture-of-experts model divides its feed-forward computation among many sub-networks and lets a learned router send each token to a few of them. The 1991 version used competition among experts to reduce interference; since 2017 the purpose has been to grow parameter counts faster than routed computation. The engineering that made this work, from noisy gates and balancing losses through capacity factors, z-losses and bias-based balancing, is mostly about keeping experts evenly used and training stable across many devices. The answer to the opening question carries a qualification: routed expert arithmetic, weight storage and measured serving speed are separate budgets. Routing directly reduces expert arithmetic relative to activating every expert, while memory use and serving speed depend on the comparison and the implementation, with costs that can appear as memory, communication and dependence on batching. Routing analyses of Mixtral and OpenMoE found assignments following token identity and syntax more than topic, while DeepSeek’s bias-balanced ablation showed more domain structure. The security evidence is controlled and implementation-dependent: capacity-limited and expert-choice routing let one user’s tokens affect or reveal another’s in laboratory settings, expert activity leaked input information to co-resident attackers in MoEcho’s experiments, and in white-box studies of open models safety behaviour depended on a few routing decisions. For practitioners, that points to treating the batch and the host as isolation boundaries, checking repeatability on the actual serving stack, and including routes as well as prompts in red-teaming of self-hosted MoE models.
Footnotes
- Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton and Jeff Dean, “Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer”, arXiv:1701.06538, 23 January 2017. https://arxiv.org/abs/1701.06538 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15
- Albert Q. Jiang, Alexandre Sablayrolles, Antoine Roux, Arthur Mensch and colleagues (Mistral AI), “Mixtral of Experts”, arXiv:2401.04088, 8 January 2024. https://arxiv.org/abs/2401.04088 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15
- DeepSeek-AI, “DeepSeek-V3 Technical Report”, arXiv:2412.19437, first posted 27 December 2024, revised 18 February 2025. https://arxiv.org/abs/2412.19437 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16
- Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer and Zhifeng Chen, “GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding”, arXiv:2006.16668, 30 June 2020. https://arxiv.org/abs/2006.16668 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
- William Fedus, Barret Zoph and Noam Shazeer, “Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity”, arXiv:2101.03961, first posted 11 January 2021; Journal of Machine Learning Research 23(120):1–39, 2022. https://arxiv.org/abs/2101.03961 (opens in a new tab) ; JMLR record: https://www.jmlr.org/papers/v23/21-0998.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10
- DeepSeek-AI, model configuration file for DeepSeek-V3, Hugging Face, accessed 25 November 2026. https://huggingface.co/deepseek-ai/DeepSeek-V3/raw/main/config.json (opens in a new tab) ↩1 ↩2
- Mistral AI, model configuration file for Mixtral-8x7B-v0.1, Hugging Face, accessed 25 November 2026. https://huggingface.co/mistralai/Mixtral-8x7B-v0.1/raw/main/config.json (opens in a new tab) ↩
- Mistral AI, “Mixtral of experts”, announcement, 11 December 2023. https://mistral.ai/news/mixtral-of-experts/ (opens in a new tab) ↩1 ↩2
- Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan and Geoffrey E. Hinton, “Adaptive Mixtures of Local Experts”, Neural Computation 3(1):79–87, 1991 (scanned copy on Geoffrey Hinton’s University of Toronto page). https://www.cs.toronto.edu/~hinton/absps/jjnh91.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
- Michael I. Jordan and Robert A. Jacobs, “Hierarchical Mixtures of Experts and the EM Algorithm”, Neural Computation 6(2):181–214, 1994, doi:10.1162/neco.1994.6.2.181 (record on the ML Anthology). https://mlanthology.org/neco/1994/jordan1994neco-hierarchical (opens in a new tab) ↩1 ↩2
- Barret Zoph, Irwan Bello, Sameer Kumar, Nan Du, Yanping Huang, Jeff Dean, Noam Shazeer and William Fedus, “ST-MoE: Designing Stable and Transferable Sparse Expert Models”, arXiv:2202.08906, 17 February 2022, revised 29 April 2022. https://arxiv.org/abs/2202.08906 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
- Nan Du, Yanping Huang, Andrew M. Dai and colleagues, “GLaM: Efficient Scaling of Language Models with Mixture-of-Experts”, arXiv:2112.06905, 13 December 2021; ICML 2022. https://arxiv.org/abs/2112.06905 (opens in a new tab) ↩1 ↩2 ↩3
- Yanqi Zhou, Tao Lei, Hanxiao Liu, Nan Du, Yanping Huang, Vincent Zhao, Andrew Dai, Zhifeng Chen, Quoc Le and James Laudon, “Mixture-of-Experts with Expert Choice Routing”, arXiv:2202.09368, 18 February 2022, revised 14 October 2022. https://arxiv.org/abs/2202.09368 (opens in a new tab) ↩1 ↩2 ↩3
- Hanchi Sun, Yixin Liu, Yonghui Wu and Lichao Sun, “Expert Threshold Routing for Autoregressive Language Modeling with Dynamic Computation Allocation and Load Balancing”, arXiv:2603.11535, 12 March 2026. https://arxiv.org/abs/2603.11535 (opens in a new tab) ↩1 ↩2 ↩3
- Jamie Hayes, Ilia Shumailov and Itay Yona (Google DeepMind), “Buffer Overflow in Mixture of Experts”, arXiv:2402.05526, 8 February 2024. https://arxiv.org/abs/2402.05526 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11
- Damai Dai, Chengqi Deng, Chenggang Zhao and colleagues, “DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models”, arXiv:2401.06066, 11 January 2024. https://arxiv.org/abs/2401.06066 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
- Lean Wang, Huazuo Gao, Chenggang Zhao, Xu Sun and Damai Dai, “Auxiliary-Loss-Free Load Balancing Strategy for Mixture-of-Experts”, arXiv:2408.15664, 28 August 2024. https://arxiv.org/abs/2408.15664 (opens in a new tab) ↩
- William Fedus, Jeff Dean and Barret Zoph, “A Review of Sparse Expert Models in Deep Learning”, arXiv:2209.01667, 4 September 2022. https://arxiv.org/abs/2209.01667 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Jan Ludziejewski, Maciej Pióro and colleagues, “Joint MoE Scaling Laws: Mixture of Experts Can Be Memory Efficient”, arXiv:2502.05172, 7 February 2025, revised 19 February 2025. https://arxiv.org/abs/2502.05172 (opens in a new tab) ↩1 ↩2
- Artyom Eliseev and Denis Mazur, “Fast Inference of Mixture-of-Experts Language Models with Offloading”, arXiv:2312.17238, 28 December 2023. https://arxiv.org/abs/2312.17238 (opens in a new tab) ↩1 ↩2
- Fuzhao Xue, Zian Zheng, Yao Fu, Jinjie Ni, Zangwei Zheng, Wangchunshu Zhou and Yang You, “OpenMoE: An Early Effort on Open Mixture-of-Experts Language Models”, arXiv:2402.01739, 29 January 2024, revised 27 March 2024. https://arxiv.org/abs/2402.01739 (opens in a new tab) ↩
- Samy Jelassi, Clara Mohri, David Brandfonbrener, Alex Gu, Nikhil Vyas, Nikhil Anand, David Alvarez-Melis, Yuanzhi Li, Sham M. Kakade and Eran Malach, “Mixture of Parrots: Experts improve memorization more than reasoning”, arXiv:2410.19034, 24 October 2024, revised 1 March 2025; ICLR 2025. https://arxiv.org/abs/2410.19034 (opens in a new tab) ↩1 ↩2
- Isaac Ong, Amjad Almahairi, Vincent Wu, Wei-Lin Chiang, Tianhao Wu, Joseph E. Gonzalez, M Waleed Kadous and Ion Stoica, “RouteLLM: Learning to Route LLMs with Preference Data”, arXiv:2406.18665v1, 26 June 2024. https://arxiv.org/abs/2406.18665v1 (opens in a new tab) ↩
- Lingjiao Chen, Matei Zaharia and James Zou, “FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance”, arXiv:2305.05176, 9 May 2023. https://arxiv.org/abs/2305.05176 (opens in a new tab) ↩
- Junlin Wang, Jue Wang, Ben Athiwaratkun, Ce Zhang and James Zou, “Mixture-of-Agents Enhances Large Language Model Capabilities”, arXiv:2406.04692, 7 June 2024. https://arxiv.org/abs/2406.04692 (opens in a new tab) ↩
- Itay Yona, Ilia Shumailov, Jamie Hayes and Nicholas Carlini (Google DeepMind), “Stealing User Prompts from Mixture of Experts”, arXiv:2410.22884, 30 October 2024. https://arxiv.org/abs/2410.22884 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
- Ruyi Ding, Tianhong Xu, Xinyi Shen, Aidong Adam Ding and Yunsi Fei, “MoEcho: Exploiting Side-Channel Attacks to Compromise User Privacy in Mixture-of-Experts LLMs”, arXiv:2508.15036, 20 August 2025; ACM CCS 2025. https://arxiv.org/abs/2508.15036 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
- Horace He and Thinking Machines Lab, “Defeating Nondeterminism in LLM Inference”, Thinking Machines Lab blog, 10 September 2025. https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/ (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
- Yukun Jiang, Hai Huang, Mingjie Li, Yage Zhang, Michael Backes and Yang Zhang (CISPA Helmholtz Center for Information Security), “Sparse Models, Sparse Safety: Unsafe Routes in Mixture-of-Experts LLMs”, arXiv:2602.08621, 9 February 2026. https://arxiv.org/abs/2602.08621 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14
- Mohsen Fayyaz, Ali Modarressi, Hanieh Deilamsalehy, Franck Dernoncourt, Ryan Rossi, Trung Bui, Hinrich Schütze and Nanyun Peng, “Steering MoE LLMs via Expert (De)Activation”, arXiv:2509.09660, 11 September 2025, revised 12 February 2026; ICLR 2026. https://arxiv.org/abs/2509.09660 (opens in a new tab) ↩1 ↩2 ↩3
- Weilin Cai, Juyong Jiang, Fan Wang, Jing Tang, Sunghun Kim and Jiayi Huang, “A Survey on Mixture of Experts in Large Language Models”, arXiv:2407.06204, 26 June 2024, revised 9 April 2025; IEEE Transactions on Knowledge and Data Engineering, 2025. https://arxiv.org/abs/2407.06204 (opens in a new tab) ↩

SecSIG