Compute a routed mixture, distinguish active from total parameters, and investigate load imbalance.
Preparation: Vectors, weighted averages and feed-forward layers.
Plan 25–40 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
College path. Compute a routed mixture, distinguish active from total parameters, and investigate load imbalance. Preparation: Vectors, weighted averages and feed-forward layers. Move between Signal Room, Workbench and Field Notes without losing your section. Pause before each worked solution.
A mixture-of-experts layer contains several learned subnetworks and a router that selects which ones process a token representation. In a Transformer, these experts commonly replace a feed-forward sublayer; attention still handles interactions between positions. The word expert is a technical label, not a guarantee that one network is a doctor and another a mathematician. Different tokens, layers and contexts can use different combinations. This allows a model to store many parameters while evaluating only part of that capacity for a token. Routing itself and combining results still require work.
Let x be a token vector, f_i(x) an expert output and g_i(x) its router weight. A sparse mixture sums selected weighted outputs. The router and experts are learned jointly, but hard top-k selection introduces discrete choices. Residual connections and attention sit outside this simplified mixture. Inspect empirical routing patterns before assigning human-readable specialties; names alone do not establish interpretable modular knowledge.
Worked example. Imagine four experts that each accept a vector of width four and return a vector of width four. Selecting two does not concatenate them into width eight. Their weighted outputs are added, producing width four so the surrounding Transformer can continue. Our Workbench uses scalar outputs only to make the arithmetic visible.
y = sum over selected i of g_i(x) f_i(x)
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. If a token is routed to two experts, does it receive two independent final answers?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. The expert outputs are intermediate representations combined within a layer. The language model still produces its final next-token distribution through the rest of the network.
Section 02 / 07
Turn router scores into a transparent mixture
The router gives candidate experts scores. In this teaching example we select the two highest scores and normalize their weights among the selected pair. The weights then form a weighted average of the two outputs. This normalization is an explicit choice for our example, not a rule that every model implements identically. Small score changes can leave the selected experts unchanged, then suddenly switch a member at a boundary. That switch helps explain why routing is not the same as smoothly averaging every expert on every token.
With selected logits z_i, use g_i = exp(z_i) divided by the sum of exponentials over the selected set. Subtracting the maximum logit before exponentiation improves numerical stability without changing the mathematical result. Other routers may use different score functions, normalization or scaling. Our deterministic tie-break uses the lower expert index; real implementations must define their own behavior.
Worked example. Take logits log three, zero, minus one and minus two. The selected experts are the first two. Their unnormalized selected weights are three and one, so normalized weights are three quarters and one quarter. If their scalar outputs are two and six, the mixture is three: one-and-a-half plus one-and-a-half.
0.75 × 2 + 0.25 × 6 = 3
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Keep those weights but change the second expert output from six to ten. What is the mixture?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
It becomes four: three quarters times two plus one quarter times ten equals one-and-a-half plus two-and-a-half. Router weights and expert outputs play different roles.
Section 03 / 07
Count total capacity and active computation separately
Suppose a layer has eight equal-sized routed experts, but each token uses two. All eight sets of weights still exist. Only two are evaluated for that token. Total parameter count describes stored capacity; active parameter count describes the subset involved in computation under a stated convention. Neither number alone is the complete memory footprint or measured latency. Attention, shared layers, router costs and communication are additional. A sparse model with many stored weights may still be difficult to fit on one device even when its per-token computation is modest.
If each routed expert has P parameters and there are E experts, routed storage is E P while the selected routed parameters are k P. Include shared experts and non-expert layers when comparing complete models. Training also has gradients and optimizer state. Inference sharding can distribute storage across devices, but exchanging token activations can become expensive. Do not equate a k/E ratio with an end-to-end speedup.
Worked example. Eight experts with ten million parameters each contain eighty million routed parameters. Selecting two activates twenty million routed parameters for a token. Add one always-used shared expert of ten million and the totals become ninety million stored and thirty million active for this toy layer, before router and other layers.
P_total = E P; P_active,routed = k P
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does selecting two of eight experts imply that only one quarter of the complete checkpoint must be stored?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. All expert weights must remain available somewhere unless a separate loading strategy is used. One quarter describes the selected fraction of this routed bank, not complete-model storage.
Section 04 / 07
Dispatch, compute and combine
After routing, tokens must reach their selected experts. Tokens assigned to the same expert can be gathered into a batch, processed together, and returned to their original positions for weighted combination. If experts live on different devices, data must travel between them. A balanced arithmetic count can therefore hide a communication bottleneck. The fastest strategy depends on batch size and hardware. A diagram that shows only expert boxes misses dispatch buffers, sorting, transfers and synchronization. These costs are part of the actual algorithm as experienced by a user.
A typical expert-parallel path dispatches token activations, evaluates expert matrices and combines returned outputs. Routing indices must preserve token identity and weights. All-to-all communication can constrain scaling. Padding expert batches to a fixed capacity trades wasted compute for predictable shapes; dynamic grouping avoids some padding but adds scheduling complexity. These are implementation choices rather than claims that every MoE system behaves alike.
Worked example. Four tokens each choose two experts, creating eight assignments. If every assignment sends a width-1,024 vector with two-byte values, the one-way activation payload is 16,384 bytes. A similarly sized return payload would double that amount. Metadata, topology and protocol overhead are excluded, so this is a payload count rather than a network-time estimate.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why can a model with fewer active arithmetic operations still run slowly?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
It may spend time moving activations, waiting for overloaded experts, launching small kernels or loading weights. End-to-end measurement must include these costs.
Section 05 / 07
A busy expert can hold everyone back
A router may send many tokens to one expert and few to others. The overloaded expert can become the slowest part of the step while other capacity sits idle. Balancing methods encourage useful distribution without simply routing every token uniformly at random. Some systems impose a capacity and drop or reroute excess assignments; others process all assignments. These choices affect both speed and model behavior. An even workload is not automatically a good semantic routing policy, and a skewed workload is not automatically wrong.
For T tokens and top-k routing, there are T k assignments. The mean load across E experts is T k/E. A simple diagnostic is maximum load divided by mean load. Capacity-factor schemes may set capacity near ceil(c T k/E), but implementations differ in how overflow is handled. Auxiliary balancing losses, router biases and scheduling operate at different points; distinguish a training incentive from a hard inference constraint.
Worked example. With eight assignments across four experts, loads of two, two, two, two have mean two and maximum-to-mean ratio one. Loads of five, one, one, one have the same total and mean but ratio two-and-a-half. If capacity were three and no rerouting were allowed, two assignments at the first expert would exceed capacity.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does the overloaded example require more total assignments than the balanced example?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. Both contain eight. The distribution changed, illustrating why a total count alone can conceal an execution bottleneck.
Section 06 / 07
Shared experts and fine-grained choices
Some designs include an always-used shared expert alongside routed experts. The shared part can learn recurring transformations while the routed bank supplies conditional capacity. Another design choice is to split large experts into smaller ones and choose more of those pieces at similar total active size. These ideas increase the possible combinations, but quality remains an empirical question. They do not prove that knowledge is neatly separated. The DeepSeek case study shows these principles in a modern system, where model architecture and training policy must be read together.
For E equal experts and selecting k without order, the number of possible subsets is the binomial coefficient E choose k. Finer segmentation can increase combinations while preserving an approximate active-parameter budget, but real routing only explores a subset and experts may overlap in function. Separate shared computation from routed computation in parameter accounting. Distinguish the earlier DeepSeekMoE design from later model-specific expert counts.
Worked example. Choosing two of four experts gives six possible pairs. Choosing four of eight gives seventy possible subsets. If the eight experts are half the size of the original four, selecting four uses the same total expert parameter count as selecting two original experts. More combinations alone do not establish better generalization or less redundancy.
Choose(4,2) = 6; Choose(8,4) = 70
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Is a shared expert the same as a cache shared between attention layers?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. A shared expert is a learned feed-forward transformation used by tokens. A shared attention cache is reused intermediate key-value state. Both involve sharing, but they share different objects.
Section 07 / 07
Evaluate the whole routed system
A fair comparison begins with a useful task and a realistic budget. Compare quality, stored model size, active computation, memory use, latency and throughput. Keep prompts, tokenization, hardware and evaluation settings visible. Inspect expert load across different kinds of input rather than only an overall average. A system may route text and image tokens differently. Workbench helps you understand weights and load arithmetic, but its four fixed scalar experts are not a trained language model. Use its saved experiments to explain mechanisms, then list what needs measurement.
Ablations can compare top-k choices, shared-expert capacity and balancing methods while controlling training budget. Record per-expert load distributions and tail latency, not only mean utilization. Compare against a meaningful dense baseline and document whether the constraint is total parameters, active FLOPs or measured serving cost. Different constraints answer different research questions.
Worked example. In Workbench vary the first expert’s logit while holding the others at zero, minus one and minus two. Predict when it enters or leaves the top-two set. Observe changes in selected weights and mixture output. Then compare the two fixed assignment-load patterns. The experiments show discontinuous selection and load skew without claiming a particular expert has learned a subject.
Evaluate quality, storage, active work, communication and latency together
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. A sparse model wins a benchmark but uses more stored parameters. Is the result meaningless?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. It may offer a useful quality-compute tradeoff, but report the larger storage requirement and the actual serving costs. One metric cannot replace a clearly stated comparison.
Final checkpoint. Eight 10M routed experts, top-2, plus one 10M shared expert have which toy counts? Option 1: 90M stored and 30M active before other components. Option 2: 30M stored and 90M active. Option 3: 20M stored and 20M active.
Pause and choose an answer before continuing.
Reveal worked solution
Option 1 is correct. Stored capacity is nine experts; active computation includes two routed and one shared expert. Router and other layers are excluded.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.
See why total capacity, active computation, and memory are different quantities.
Additional reading · original lesson audio remains unchanged.
Read the full explanation · 568 words + college extension
One token, selected experts
x
A · 0.75BC · 0.25D
[1.5, 1]combined output
Four experts exist in this toy. Only two participate in the illustrated mixture.
Token representation
Router selection
Experts A + C
Weighted combination
Token representation
An expert is a learned transformation
In a mixture-of-experts layer, several alternative neural transformations are available. A router uses the current token representation to determine which paths should contribute. The term expert is convenient, but it should not be taken literally: an expert is not necessarily a separate conversational agent, a named profession, or a complete language model. Its role emerges from training and may be difficult to summarize in ordinary words.
Imagine a toy layer with four experts. For one token representation, the router selects experts A and C. For the next token, it may select B and C. This is conditional computation: different inputs can use different subsets of parameters. The illustration should show an input choosing computational paths, not four people debating an answer. Human committee metaphors can obscure the fact that these are numerical operations inside one model.
Combining selected outputs
Suppose expert A produces the two-number vector [2, 0], while expert C produces [0, 4]. In a simplified weighted combination with coefficients 0.75 and 0.25, the output is [1.5, 1]. This example explains weighted mixing. It is not a claim that every implementation normalizes its selected router scores in the same way or that real experts have only two outputs. The architecture specifies the actual routing and combination rules.
After this layer, later operations continue transforming the representation. A routed expert does not normally produce the final human-readable answer by itself. A model may also have shared components that always participate. Attention, embeddings, normalization, and output projections can contribute computation outside the routed experts. Therefore, counting selected experts alone is not sufficient to calculate total work per token.
Active parameters are not the whole model
Total parameters count the available learned capacity. Active parameters describe the portion used in a particular forward computation, according to the counting convention. A sparse model can have a large total count while using a smaller subset for each token. This can make additional capacity more computationally affordable, but it does not imply that all inactive parameters disappear from storage.
Across many tokens, different experts can become active. Their weights must be available wherever the runtime expects to execute them. Keeping them in device memory, distributing them across devices, or transferring them from another memory tier creates different costs. A claim that a model has only a small active parameter count therefore cannot establish that the whole model fits on a small GPU. Model storage, active arithmetic, and communication are separate parts of the budget.
Routing creates a systems problem too
If many tokens choose the same experts, those experts can become busy while others are underused. Training methods and serving systems address this balance in different ways. When experts reside on different devices, token representations may need to travel to the selected devices and their outputs must return. The cost of communication can become important even when the arithmetic is efficient. This is one reason a model design and an inference framework need to be understood together.
In Signal Room, follow one token through the highlighted paths, then consider a batch containing many tokens. The picture changes from a single route into a distribution of demand. As a thought experiment, compare two situations with the same number of selected experts: evenly distributed requests and requests concentrated on one expert. The arithmetic count may look similar while waiting and communication differ. A strong explanation of MoE therefore asks three questions: how much capacity exists, how much work each token activates, and how efficiently the system moves and schedules that work.
College extension · make the assumptions explicit
A generic sparse mixture can be written y(x) = Σᵢ∈S(x) gᵢ(x)Eᵢ(x), where S(x) is the selected expert set, gᵢ a routing coefficient and Eᵢ an expert transformation. Shared paths, residual connections, and implementation-specific normalization may add terms or change details. Top-k selection introduces discrete choices; training and load balancing require architecture-specific treatment. Do not infer expert specialization solely from a few routed examples, and do not equate an MoE layer’s sparse activation with sparse attention over token positions.
Sources and further investigation
Source review: October 28, 2026. Model-release claims are attributed to their publishers.