Wednesday, February 25, 2026

Mixture of Experts (MoE)


Imagine you must build one neural network to process Python code, legal contracts, causal dialogue, mathematical proofs, and poetry. Modern large language models attempt exactly this by training a single dense function on a dataset that contains all of these behaviors simultaneously.

However, these behaviors do not form a single coherent distribution. They occupy different regions of the input space, obey different statistical regularities, and demand different inductive biases from the model (that is, different built-in assumptions about what patterns matter and how they should be represented).

Despite this heterogeneity, a dense language model applies the same parameters and the same computation to every token. Regardless of whether the token belongs to source code, poetry, or mathematical reasoning, it flows through the entire network and activates all parameters. This design choice is simple and stable, but it implicitly assumes that all inputs deserve the same internal computation.

This assumption is where the mismatch begins.

When the data is structurally diverse but the computation is uniform, the model is forced to reuse the same internal pathways for fundamentally different problems. The same parameters must simultaneously support symbolic precision, long-range logical consistency, pragmatic compression, and stylistic ambiguity. Instead of adapting its computation to the input, the model adapts the input to a single computation, and the tension shows up during training.

Interference
This mismatch manifests during training as interference, often referred to as negative transfer. Interference is not a vague capacity limitation. It arises because the same parameters are forced to encode incompatible requirements at the same time. Code demands precise, indentation-sensitive, and brittle representations. Mathematics and legal text require long-range logical consistency. Casual dialogue favors brevity and pragmatic flexibility, while poetry relies on ambiguity, metaphor, and rhythm.

During optimization, these demands translate into conflicting gradient signals. Updates coming from code examples push the model toward symbolic precision and rigidity. Updates coming from poetry encourage flexibility and stylistic variation. Dialogue data biases the model toward informality and compression. Because these gradients act on the same parameters, progress in one domain can actively degrade representations that are useful for another. This is not merely a matter of limited capacity. It is a structural consequence of forcing a single set of parameters to explain incompatible patterns.

Why scaling alone does not solve the problem
At first glance, increasing model size appears to offer a solution. With enough parameters, perhaps the model can simply memorize all behaviors without conflict. In practice, this intuition fails.

Even very large dense models still apply the same computation to every token. Every input is routed through all layers, and every parameter remains entangled with every domain. As a result, scaling increases capacity but does not change the computation pattern.

The same parameters continue to receive gradients from incompatible data regimes, and interference persists. The issue is not that the model is too small, but that its computation is unconditional.

This reveals a deeper inefficiency in dense architectures. They couple model size to compute cost and enforce uniform computation, even when the input itself does not warrant it.

What is missing is the ability for computation itself to depend on the input. Instead of asking a single monolithic network to process everything, we would like the model to adapt its internal pathway based on what it is seeing.

Now imagine an alternative design. The model contains multiple sub-networks, each capable of specializing in a narrower region of the input space. One sub-network predominantly handles code, another mathematics, another poetry, and another casual dialogue. Alongside these experts, there is a small controller that examines each token and decides which sub-network should process it.

Under this design, parameters no longer compete to explain all behaviors at once. Each expert receives gradients primarily from the data it is suited for, allowing specialization to emerge naturally. Representations useful for code are not overwritten by gradients from poetry, and capacity is not wasted modeling irrelevant patterns.

This is the core idea behind Mixture of Experts. MoE is not an ensemble and not a voting mechanism. It is a way to introduce conditional computation into neural networks, allowing different inputs to activate different subsets of parameters. By doing so, it increases effective capacity, reduces interference, and decouples model size from per-token compute.


Conditional Computation

Once we accept that uniform computation is the source of inefficiency, the natural next step is to relax it. Instead of forcing every token through the same computation graph, we allow the computation itself to depend on the input.

This idea is known as conditional computation. At a high level, conditional computation means that only a subset of a model's parameters are activated for a given input, while the rest remain inactive. The model is no longer evaluated as a single monolithic function. Instead, it behaves like a collection of functions, with the active one chosen dynamically.

In the context of Mixture of Experts, conditional computation takes a very concrete form. The model contains many experts, typically implemented as independent MLP blocks. For each token, only a small number of these experts are executed. All others are skipped entirely. As a result, the total number of parameters can grow very large, while the amount of computation performed per token stays roughly constant.

A dense FFN layer where every token passes through one large FFN, next to an MoE layer where a router sends each token to only a few of N experts

This decoupling is the key architectural shift. In dense models, increasing capacity necessarily increases compute. In MoE models, capacity scales with the number of experts, while compute scales with how many experts are activated. Effective model size and per-token cost are no longer tied together.

Conditional computation therefore reframes scaling. Instead of asking how much computation we can afford per token, we ask how much specialized capacity we can attach behind a fixed compute budget. Mixture of Experts is one of the most successful realizations of this idea.

However, conditional computation is alone is not sufficient. Once we introduce many experts, we must answer a new question: who decides which experts run for which tokens?

Conditional Routing / Assignment

Conditional routing is the mechanism that makes conditional computation operational. It determines which expert or experts are responsible for processing a given token, and how strongly their outputs should contribute.

In practice, routing is implemented by a small gating network. The gate takes the token's hidden representation as input and produces a score for each expert. These scores are then used to select a small subset of experts, typically the top-k, that will process the token. All other experts are ignored for that token.

A gating network turns the token hidden state into softmax scores over 8 experts; the top 2 are selected and their outputs combined as a weighted sum

This step introduces several nontrivial constraints. Routing must be stable enough to train with gradient-based optimization. It must avoid pathological collapse, where a small number of experts receive all the tokens while others are never used. At the same time, it must allow meaningful specialization to emerge, so that experts are not interchangeable copies of each other.

Early naive routing schemes made hard, discrete assignments. A token was sent to exactly one expert, with no gradient flowing through the routing decision itself. While this achieved sparsity, it made optimization brittle and often led to dead experts that never received updates.

Modern MoE architectures address this by using soft routing during training. Instead of making a hard decision, the gate produces a distribution over experts, allowing gradients to flow through the routing mechanism itself. However, differentiability alone is not enough. Without additional constraints, the router can still collapse onto a small subset of experts.

To counter this, MoE models introduce auxiliary losses that explicitly shape routing behavior. These losses do not improve the task objectives directly. Instead, they act as structural regularizers, encouraging tokens to be spread across experts so that capacity is actually used. In effect, they teach the router how to use the experts, not what the experts should compute.

Conditional routing is therefore not just a lookup table. It is a learned, differentiable mechanism that must simultaneously satisfy competing objectives: sparsity, load balance, and specialization. The success of sparse MoE models depends as much on routing design as on the experts themselves.

With conditional computation providing the capacity and conditional routing deciding how the capacity is accessed, we now have the full structural picture of Mixture of Experts.

The remaining questions are no longer conceptual but practical: how to design the gate, how to scale experts across devices, and how to keep the system stable at scale.

Once routing is introduced, the problem shifts again. Conditional computation gives us capacity, and conditional routing gives us a way to access it, but neither guarantees that the experts will be used in a healthy or meaningful way. In practice, sparse MoE systems tend to fail along two recurring axes.

Load Imbalance

The first one is load imbalance. In an ideal system, tokens would be distributed evenly across experts so that all available capacity is utilized. In reality, routing decisions often concentrate traffic onto a small subset of experts. A few experts receive the majority of tokens, while others are rarely or never activated.

This creates two problems at once. Computationally, the overloaded experts become bottlenecks, limiting throughput and forcing strict capacity constraints. Statistically, underutilized experts receive fewer gradient updates and fail to learn useful representations, effectively becoming dead parameters.

Expert Redundancy / Weak Specialization

The second failure method is expert redundancy, or weak specialization. Even when load is balanced, there is no guarantee that different experts will learn meaningfully different functions. Without additional pressure, multiple experts can converge to similar behaviors, differing only in parameterization rather than in function.

In this regime, the model pays the systems complexity of maintaining many experts without gaining the representational benefits of specialization. Capacity increases on paper, but effective capacity does not.

These two failure modes pull in opposite directions. Aggressively balancing load can encourage experts to behave similarly, reducing specialization. Encouraging strong specialization can cause routing collapse, where only a few experts become preferred. Much of the practical work on Mixture of Experts can be understood as navigating this trade-off.

The remainder of the MoE literature is largely concerned with controlling these failure modes. Load balancing losses, routing regularization, expert capacity constraints, and architectural choices are all attempts to ensure that experts are both used evenly and allowed to differentiate. Understanding MoE at scale therefore requires not only the core idea of sparse computation, but also the mechanisms that prevent it from degenerating.


Brief History

The idea behind MoE is older than modern language models. In fact, the core intuition predates Transformers by decades. What changed over time was not the idea itself, but the ability to make it work at scale.

Early formulation of MoE appeared in the 1990s, notably in work by Jacobs et al.. These models already contained the essential components: multiple experts and a gating mechanism that decided with expert should handle which input. However, these systems were small, shallow, and trained on limited data. They were primarily explored as statistical models rather than scalable neural architectures, and they never became a dominant paradigm.

The modern framing of conditional computation emerged much later. Bengio et al., 2013 explicitly argued that evaluating all parameters for every input was inefficient. They proposed conditional computation as a way to scale the model capacity without scaling compute, suggesting that only a subset of parameters should be active for each example. At the time, this idea was largely conceptual. Training large, sparsely activated neural network was difficult, distributed infrastructure was immature, and routing instability made the approach impractical beyond small experiments.

The turning turning point came with the work of Shazeer et al., 2017. This paper demonstrated, for the first time at scale, that sparse MoE could be integrated into deep neural networks and trained end-to-end. Several ideas introduced in this work became foundational.

First, they showed that MoE layers could be inserted into existing sequence models, in their case stacked LSTM architectures, without requiring a complete redesign of the surrounding network. This established sparse MoE as a practical architectural component rather than a theoretical curiosity. Second, the paper introduced sparse top-k routing, where each token is sent to only a small number of experts. This made conditional computation practical by keeping per-token compute bounded even as the total parameter count grew dramatically. Third, and critically, the authors introduced auxiliary load balancing losses to prevent routing collapse and ensure that experts were actually utilized during training.

This work showed that MoE was not just theoretically appealing, but systematically viable.

By the end of 2010s, the core ideas behind sparse Mixture of Experts were in place. Conditional computation are well-motivated. Sparse routing was known to be necessary. Load balancing was understood as a central failure mode. What remained unresolved was how to make these ideas work reliably in large, distributed training systems.

This is were GShard enters the picture.

Rather than introducing a new routing mechanism or a fundamentally a new expert design, GShard focused on a different question: how to make sparse MoE trainable at scale. In doing so, it effectively established the baseline architecture that most modern MoE systems would build upon.

GShard

Lepikhin et al., 2021 introduced GShard, which combined sparse MoE with automatic model parallelism to enable training extremely large Transformer models. Its contribution was not a single algorithmic trick, but a coherent stack that made MoE practical in distributed settings.

At the architectural level, GShard formalized a now-familiar pattern. Dense feed-forward layers in the Transformer were replaced with MoE layers, where each token is routed to a small number of experts using top-k gating. Each expert is independent MLP, and experts are sharded across devices rather than replicated. This immediately allows model capacity to scale with the number of experts, without increasing per-token computation.

Crucially, GShard treated routing as a first-class systems concern. Tokens are assigned to experts subject to explicit capacity constraints, ensuring that no expert becomes a computational bottleneck. When an expert exceeds its capacity, excess tokens are dropped or rerouted, introducing a controlled approximation rather than an unbound slowdown.

To prevent routing collapse, GShard retained auxiliary load balancing losses that encourage uniform expert utilization. These losses do not improve the task objective directly. Instead, they stabilize training by ensuring that all experts receive sufficient traffic and gradients. In effect, they turn expert usage into a resource that must be actively managed.

What GShard locks in is not a single design choice, but a set of abstractions that would persist across subsequent work. Tokens are routed to experts via top-k gating. Expert capacity is enforced explicitly. Load balance is encouraged through auxiliary objectives rather than emergent behavior. And most importantly, MoE is treated as a distributed systems problem as much as modeling one.

Much of the work that follows can be seen as attempts to simplify, relax, or replace parts of the GShard design without losing stability.

The Cost of Stability

GShard demonstrated that sparse MoE could be trained reliably at scale, but it did so by introducing a carefully balanced stack of mechanisms. Routing decisions had to be regularized. Expert capacity had to be enforced explicitly. Auxiliary losses were required to prevent collapse. None of these components were optional. Together, they formed a tightly coupled system in which stability emerged only when every piece was tuned correctly.

This had two important consequences. First, MoE ceased to be just a modeling idea and became an operational challenge. Training dynamics depended not only on the task loss, but also on routing hyperparameters, capacity factors, and load balancing coefficients. Small changes could shift traffic patterns dramatically, leading to underutilized experts or overloaded ones. Second, the complexity of the routing machinery itself began to limit scalability. As models grew, the overhead of managing sparse dispatch and all-to-all communication increasingly dominated the cost of computation.

As a result, the central question shifted. The problem was no longer whether sparse conditional computation could work, but how much machinery was truly necessary to make it work. Could routing be simplified without destabilizing training? Could expert utilization be controlled without carefully tuned auxiliary objectives? And more broadly, could MoE be made robust enough to serve as a default architectural choice rather than a delicate research construct?

Switch Transformer

The first major attempt to simplify GShard came with the Switch Transformer. Rather than rethinking conditional computation from scratch, Switch makes a single, aggressive move: it removes top-k routing altogether. Each token is routed to exactly one expert.

At first glance, this seems like an unnecessarily severe restriction. Top-k routing allows a token to draw on multiple experts, potentially capturing richer structure. In practice, however, this flexibility comes at a cost. Routing to multiple experts multiplies communication. increases kernel launches, and complicates capacity management. Switch observes that most of the benefits of MoE come not from combining experts, but from not activating all of them. Once sparsity is achieved, additional routing complexity delivers diminishing returns.

Top-2 routing sends each token to two experts, while Switch top-1 routing sends each token to one expert with fixed capacity, dropping a token that overflows a full expert

By collapsing routing to top-1, Switch dramatically simplifies the training dynamics. Each token produces a single routing decision, a single expert dispatch, and a single gradient path. This reduces communication overhead, improves hardware efficiency, and makes expert parallelism easier to scale. Importantly, it also makes failure modes easier to reason about. When a token is misrouted, there is no ambiguity about which expert was responsible.

Of course, this simplification does not eliminate the core challenges of MoE. Routing collapse remains a risk, and expert imbalance does not disappear simply because routing is simpler. Switch therefore retains auxiliary load balancing losses, inherited directly from GShard. These losses encourage the router to distribute tokens evenly across experts, preventing a small subset from dominating the workload. Capacity constraints are still enforced, and tokens that exceed capacity are either dropped or rerouted, introducing another axis of trade-offs.

What change is not the objective, but the operating regime. Switch trades expressive routing for stability and throughput. The model becomes easier to train, easier to scale, and easier to deploy, even if it gives up some theoretical flexibility. In doing so, it establishes a practical baseline: sparse MoE that is fast, stable and good enough to compete with dense models at scale.

This is why Switch matters. It reframes MoE not as a delicate construct that must be carefully engineered, but as a production-ready architecture with a simple training recipe. Many subsequent systems would measure themselves against this baseline, either by attempting to remove its remaining auxiliary machinery or by offering alternative ways to guarantee balance and specialization.

BASE Layers

Switch simplifies MoE by collapsing routing to top-1, but it keeps one important piece of machinery intact: auxiliary losses. Expert balance is still something the model must learn through an additional objective, and training stability still depends on carefully tuned capacity factors and loss weights. BASE layers start from the observation that this entire balancing apparatus is a workaround for a more fundamental issue.

The issue is that routing is treated as a prediction problem when it is, in fact, a resource allocation problem.

In Switch, the router predicts which expert a token should go to, and balance is encouraged indirectly by penalizing uneven usage. In BASE, this logic is inverted. Instead of asking where each token should go and hoping balance emerges, BASE enforces balance by construction and lets the model adapt within those constraints.

Concretely, BASE frames routing as a bipartite assignment problem between tokens and experts. Each token produces a preference score over experts, as usual. However, instead of independently selecting the top expert per token, the system solves a constrained assignment that ensures each expert receives exactly its allotted number of tokens. The result is globally balanced routing, not because the model is learned to balance, but because imbalance is not allowed.

Bipartite routing of 8 tokens to 4 experts: independent top-1 choices overload one expert and leave another unused, while BASE assignment gives every expert exactly 2 tokens

This change removes the need for auxiliary load balancing losses entirely. There is no collapse to prevent, because no expert can receive more than its capacity. There are no dead experts, because every traffic is guaranteed traffic. Balance is no longer an emergent property of optimization, but an explicit constraint of the routing mechanism.

The cost of this approach is complexity. Solving a global assignment problem is more expensive than making independent routing decisions, and it introduces additional coordination across tokens. BASE therefore shifts some burden from optimization to routing infrastructure. What it gains in conceptual cleanliness, it pays for in algorithmic and systems overhead.

Nevertheless, BASE clarifies something important. Auxiliary losses are not a fundamental requirement of MoE. They are one ways of approximating balance, but they are not the only way. Balance can be enforced structurally, rather than encouraged statistically.

This reframing opens the door to a broader question that much of the later literature explores: if balance is the real objective, how many different ways are there to achieve it, and what trade-offs do they impose?

Hash Layers

Up to this point, every design we have discussed assumes that routing must be learned. Even if balance is enforced, as in BASE, the model still computes token dependent expert scores. A gating network still exists. Hash Layers challenge this assumption directly.

Instead of learning a routing function, expert assignment is determined by a fixed hash of the token identity. Routing is no longer a prediction problem. It becomes a deterministic mapping.

Tokens such as the, cat, sat and on pass through a fixed hash of the token id mod 4 to pick an expert with no learned gate, and repeated tokens always reach the same expert

This removes an entire subsystem from the architecture. There are no router parameters to optimize, no gating network to train, no auxiliary balancing losses, and no gradient-shaped capacity heuristics. Load balance arises statistically from the properties of hashing rather than from optimization or constrained assignment.

Each token is consistently mapped to the same expert under a given hash configuration. Routing is stable, parameter-free, and computationally trivial. From a systems perspective, this makes traffic predictable and cheap.

However, this simplification comes with a clear trade-off.

Learned routing has the potential to align expert specialization with structure in the data. A router can, in principle, discover that code tokens cluster differently from poetry tokens and allocate experts accordingly. Hash routing does not adapt to such structure. It imposes a static partition of the token space.

The underlying assumption is that specialization can still emerge even if routing is fixed. If each expert consistently receives a subset of tokens, it may learn to specialize on the patterns that appear in that subset. The model does not choose the partition, but it can still adapt to it.

Whether this is sufficient depends on the regime. If the hash partition roughly respects latent structure, performance can remain competitive while dramatically simplifying training. If the partition misaligns with task structure, the model cannot create it, because routing is not learnable.

Hash Layers therefore represent the extreme end of the spectrum. If GShard treated routing as a learned and heavily regularized subsystem, and BASE treated it as a constrained optimization problem, Hash Layers treat it as a deterministic systems primitive.

The next development in this sequence does not simplify routing further. Instead, it inverts it.

Expert Choice Routing

So far, every routing scheme shares a common abstraction. Tokens choose experts. The router looks at a token representation, computes scores over experts, and selects the top candidates. Capacity constraints are then applied to limit how many tokens each expert can accept.

Expert Choice Routing flips this perspective.

Instead of asking, "Which experts should process this token?", it asks, "Which tokens should this expert process?"

The distinction is subtle but structurally important.

In token choice routing, the primary unit is the token. Each token independently selects its top experts, and experts must absorb whatever traffic results from those decisions. Capacity constraints are reactive. If too many tokens choose the same expert, some must be dropped or rerouted.

In Expert Choice Routing, capacity is proactive. Each expert is assigned a fixed quota, a bucket size. The expert examines all tokens and selects the ones it prefers, up to its capacity. Tokens can be selected by multiple experts or none, depending on the routing configuration.

Token choice, where tokens pick experts and one expert overflows while another sits idle, compared with expert choice, where each expert fills a fixed bucket and tokens receive 0, 1 or 2 experts

The control surface shifts from tokens to experts. This inversion has two immediate consequences.

First, load balance becomes structurally guaranteed. Since each expert has a fixed bucket size, no expert can become overloaded. There is no need for auxiliary balancing losses to encourage uniform traffic. Utilization is enforced by construction.

Second, the number of experts assigned per token becomes variable. In token choice routing, we typically fix top k. In expert choice routing, the effective number of experts per token depends on how many experts select it. This introduces flexibility in how capacity is allocated across the input distribution.

Conceptually, this reframes routing as a matching problem under capacity constraints, but with the direction of optimization reversed. Instead of tokens competing for expert slots, experts compete for tokens.

From a systems standpoint, this design improves predictability. Each expert processes exactly its bucket size, no more, no less. Communication patterns become regular, and token dropping can be reduced or eliminated.

From a modeling standpoint, the implications are more subtle. Experts now actively select tokens that align with their learned preferences. Specialization can sharpen because each expert is trained primarily on the tokens it consistently chooses.

However, this also introduces a new dynamic. If multiple experts strongly prefer the same subset of tokens, redundancy can reappear. The mechanism guarantees balance in volume, but not necessarily diversity in function. As always, structural guarantees solve one axis of failure while potentially shifting pressure to another.

Before moving further, it is worth synthesizing these approaches. Not to rank them, but to clarify when and why each design helps.

When / Why Each Approach Helps

At this point, the routing landscape is no longer a single trajectory of improvements. It is a set of design axes, each addressing a different failure mode or systems constraint. The differences are easier to understand if we frame them in terms of what is being optimized: flexibility, balance, simplicity, or predictability.

GShard represents the full expressive version of sparse MoE. It uses top-k token choice routing with auxiliary load balancing losses and explicit capacity limits. This design preserves maximal flexibility. The router is fully learned, tokens can choose multiple experts, and specialization can emerge organically. The tradeoff is complexity. Stability depends on carefully tuned auxiliary objectives and capacity heuristics.

Switch Transformer simplifies this design by reducing routing to top-1. Each token activates exactly one expert. The result is a dramatic improvement in stability and throughput. Communication is simpler, kernels are easier to optimize, and training becomes more predictable. The cost is reduced flexibility. With only one expert per token, representation mixing is more constrained, and routing mistakes become harder to correct.

BASE Layers move in a different direction. Instead of encouraging balance through auxiliary losses, they enforce it through global assignment. Routing becomes an optimization problem solved under strict capacity constraints. This eliminates the need for balancing hyperparameters and makes expert utilization guaranteed by construction. However, it introduces additional computational overhead in solving the assignment problem and slightly weakens the purely local nature of token routing.

Hash Layers take the most radical step. They remove learned routing entirely. Tokens are assigned to experts via a deterministic hash function. This eliminates router parameters, auxiliary losses, and collapse risk. Systems complexity decreases significantly. However, specialization is no longer adaptive. Any alignment between experts and semantic structure must emerge implicitly rather than through learned routing.

Expert Choice Routing changes the direction of control. By allowing experts to select tokens, it guarantees balanced utilization at the expert level while retaining learned scoring. This improves predictability and reduces collapse without fully removing adaptivity. Yet it also shifts specialization dynamics and can reintroduce redundancy if experts converge toward similar token preferences.

Viewed together, these methods reveal a deeper pattern. There is no universally optimal routing design. Each proposal emphasizes a different point in the triangle formed by learnability, balance guarantees, and systems efficiency. As models scale, the preferred solution often depends less on theoretical elegance and more on training stability and hardware constraints.


Systems Reality Check

By the time sparse MoE models reached billion and trillion parameter scale, it became clear that their main bottlenecks were not conceptual but infrastructural. Conditional computation reduces floating point operations per token, but it introduces irregular communication and fragmented compute. The dominant constraint shifts from arithmetic to data movement.

When tokens are routed to experts that live on different devices, training requires large all to all exchanges of hidden states. Each forward pass involves shuffling token representations across GPUs, executing expert MLPs, and then sending outputs back to their original positions. If this communication is poorly optimized, it quickly dominates runtime. The theoretical savings from sparsity disappear under network latency and bandwidth limits.

This is the context in which systems focused work like DeepSpeed-MoE becomes central rather than peripheral.

DeepSpeed-MoE

DeepSpeed-MoE provides an end to end training and inference stack designed specifically for expert parallelism. Instead of treating MoE as a modeling add on, it integrates expert parallelism with data parallelism and model parallelism in a unified framework. Experts are partitioned across devices, communication patterns are optimized, and memory management is carefully engineered. The contribution is not a new routing algorithm but a scalable execution model that makes large sparse MoE practical outside of highly specialized infrastructure. In effect, it lowers the barrier between research prototypes and production scale deployment.

A related but more fine grained systems issue appears inside the expert computation itself. Sparse routing creates variable sized token batches per expert. Some experts receive many tokens, others few. GPUs, however, prefer dense, regular workloads. Small micro batches per expert reduce arithmetic intensity and waste hardware capacity.

This is where MegaBlocks enters the picture.

MegaBlocks

MegaBlocks reframes sparse expert execution as a block sparse matrix multiplication problem. Instead of padding expert inputs to a fixed capacity, which wastes compute, or dropping overflow tokens, which harms quality, MegaBlocks restructures expert computation so that sparse token assignments can be executed efficiently as a single block sparse kernel. The focus is kernel efficiency rather than routing design. The key tradeoff it addresses is between token dropping and padding. Dropping improves hardware efficiency but sacrifices training signal. Padding preserves signal but wastes compute. Efficient block sparse kernels reduce this tension.

Fixed expert capacity pads underused experts and drops overflow tokens, while MegaBlocks groups tokens by expert into a block-sparse matrix with variable-sized blocks and no padding or drops

Taken together, these systems contributions shape what becomes standard practice in modern MoE training. Routing decisions are constrained by communication topology. Capacity factors are chosen not only for statistical balance but also for memory planning. Top-1 routing is often preferred because it simplifies all to all exchange. Batch sizes are scaled aggressively to maintain expert utilization. Kernel fusion and overlap between communication and computation become first class concerns.

Practical Constraints that shape "current popular practice".
At this stage, MoE is no longer just an architectural choice. It is a co design problem between model structure and distributed systems. What survives in large scale practice is not necessarily the most expressive routing mechanism, but the one that fits within communication bandwidth, GPU utilization limits, and memory budgets.

This systems reality explains why many papers emphasize throughput, scalability, and infrastructure as much as perplexity. In sparse MoE, modeling elegance must pass through the filter of hardware efficiency. Only designs that respect both constraints tend to become part of the mainstream stack.


MoE Goes Mainstream

Up to this point (late 2023 to early 2024), sparse MoE had largely lived inside research groups with strong systems infrastructure. The ideas were validated at scale, but they were not yet canonical in the open ecosystem. That changed when models like Mixtral brough a clear, reproducible MoE recipe into the mainstream.

Mixtral

Mixtral did not introduce a radically new routing algorithm. It did something arguably more important. It demonstrated that a carefully chosen, moderately sized sparse MoE configuration could deliver strong quality while remaining trainable and deployable under realistic constraints.

The architectural pattern is now familiar. The Transformer backbone remains intact. Self attention layers are dense. The MoE replaces the feed forward network blocks. Instead of a single dense MLP in each Transformer layer, Mixtral uses multiple experts per layer. In the commonly referenced configuration, each MoE layer contains 8 experts, and the router selects 2 experts per token per layer. This is top-2 routing, not top-1.

Mixtral Transformer block: RMSNorm, dense self-attention and a residual add, then RMSNorm and an MoE feed-forward layer where a router picks 2 of 8 experts, followed by a residual add

The framing that accompanies this design is crucial. Mixtral emphasizes the distinction between total parameters and active parameters. The total parameter count includes all experts across all layers. However, for any given token, only a small subset of those parameters is actually executed. If there are 8 experts and 2 are selected, then only a quarter of the expert parameters are active for that token in that layer. Across the full model, the active parameter count per forward pass is dramatically smaller than the total parameter count.

This makes the tradeoff concrete. You can increase the total capacity by adding experts, while keeping per token compute closer to that of a dense model. In practice, this often results in a model that behaves like a much larger dense model in terms of quality, but with throughput closer to a smaller one.

The placement of MoE strictly inside the feed forward blocks also reflects accumulated wisdom from earlier work. The FFN layers dominate parameter count in a Transformer. Replacing them yields the largest capacity gain per unit of additional complexity. At the same time, attention layers remain dense, preserving stable sequence modeling and avoiding further communication overhead.

Top-2 routing in Mixtral represents a middle ground in the routing design space. Compared to top-1, it provides slightly richer gradient flow and smoother specialization, since each token contributes to two experts. Compared to higher k, it keeps communication and compute manageable. This choice reflects a practical equilibrium between modeling flexibility and systems efficiency.

By the time Mixtral appears, the narrative around MoE has shifted. It is no longer presented primarily as a research curiosity about conditional computation. Instead, it is framed as a practical scaling strategy. Large total parameter count, smaller active parameter count, competitive quality per unit of compute. This is the modern recipe that many subsequent open model follows.

In that sense, Mixtral does not redefine MoE. It consolidates it. It packages the lessons from Shazeer, GShard, Switch, and the systems stack into a configuration that is straightforward to replicate. Sparse experts in FFN layers. Top-2 routing. Explicit capacity management. Balanced training. And a clear throughput versus quality positioning.

At this point, MoE is no longer a fragile experiment. It becomes one of the standard options in the design space of large language models.

DeepSeekMoE

If Mixtral represents a clean execution of the established sparse MoE recipe, DeepSeekMoE takes a different angle. Rather than focusing primarily on stability and throughput, it asks a more pointed question: can specialization be made more deliberate?

Up to this point, most MoE designs rely on routing dynamics and load balancing losses to encourage specialization. Experts receive different traffic, gradients diverge, and specialization emerges as an effect of training. DeepSeekMoE shifts the emphasis. Instead of hoping specialization arises, it modifies the architecture so that specialization becomes structurally easier.

It introduces two techniques that directly reshape how experts are organized and used.

The first is fine grained expert segmentation. Instead of treating each expert as a large monolithic MLP, DeepSeekMoE splits each expert into multiple smaller experts. Suppose the baseline activates K experts per token. After segmentation, each original expert is divided into m smaller ones, and the router activates mK experts per token. The key constraint is that total compute per token remains approximately constant. The model does not become more expensive. What changes is the granularity of specialization. By increasing the number of independently routed units, the model can represent more nuanced partitions of the input space.

DeepSeekMoE in three steps: top-2 of 4 large experts, fine-grained segmentation into 8 half-size experts with top-4, and 1 always-active shared expert plus top-3 of 7 routed experts at the same compute

The second technique is shared expert isolation. DeepSeekMoE reserves a small number of shared experts that are always activated for every token. These shared experts capture broadly useful representations that should not depend on routing decisions. To keep compute constant, the number of routed experts is reduced accordingly. The effect is a decomposition of computation into two parts: a shared backbone that processes all inputs, and a routed component that captures domain specific variation.

This design addresses a subtle weakness in earlier MoE models. Purely routed experts risk over fragmentation, where even universally useful transformation must be redundantly learned across multiple experts. By explicitly separating shared and routed capacity, DeepSeekMoE reduces redundancy and sharpens the role of specialization.

Importantly, the paper does not stop at architectural description. It attempts to measure specialization directly. One of its reported findings is that disabling the top routed experts in DeepSeekMoE causes a large degradation in performance than in comparable GShard style configurations with similar compute. This suggests that experts in DeepSeekMoE are less interchangeable. The model's behavior depends more strongly on the specific experts chosen by the router. In that sense, specialization is not only encouraged but empirically more pronounced.

The shared experts, in particular, are shown to be difficult to replace. Removing them leads to significant quality loss, indicating that they capture common linguistic structure that routed experts do not redundantly encode. This separation of shared and specialized roles supports the claim that specialization can be architected rather than left entirely to emergent routing dynamics.

Mixtral vs. DeepSeekMoE

Placed next to Mixtral, the contrast becomes clear. Both are early 2024 MoE models operating within a similar high level framework: experts in FFN blocks, sparse top-k routing, explicit capacity management. However, they optimize for slightly different objectives.

Mixtral can be understood as a disciplined realization of the standard sparse MoE template. Its emphasis is clarity, stability, and reproducibility of the now canonical recipe.

DeepSeekMoE, by contrast, pushes deeper into the structure of specialization itself. It modifies the granularity of experts and explicitly isolates shared capacity, attempting to reduce redundancy and strengthen expert identity.

The broader design lesson is that specialization is not merely an emergent side effect of sparse routing. It can be shaped by architectural constraints. How experts are partitioned, which components are always active, and how granularity is chosen all influence whether experts become genuinely distinct or remain loosely differentiated replicas.

At this stage in the MoE evolution, the focus is no longer just making sparse models trainable or efficient. It is on sculpting how capacity is organized internally. The question shifts from "Can we scale sparse models?" to "How should specialization itself be structured?"


Modern MoE Ideas

So far, the dominant MoE paradigm has operated within a relatively narrow structural regime. Models typically deploy a moderate number of fairly large experts, often eight or sixteen per layer, occasionally a few dozen at larger scales. Each expert is a full feedforward block comparable to the dense MLP it replaces, and routing selects one or two experts per token. Capacity increases by replicating these substantial modules while keeping activation sparse.

This design implicitly assumes that experts are coarse grained computational units. Sparsity is achieved by choosing among them, not by shrinking their internal scale.

A more recent direction challenges this assumption by reconsidering what an expert should represent. Instead of scaling capacity by adding more large experts, this line of work explores shrinking experts dramatically while increasing their number to extreme scales. This idea is explored in the Mixture of a Million Experts framework, where experts are treated as very small, highly granular parameter modules. The total expert count can grow into the hundreds of thousands or even millions, while each token still activates only a tiny subset of them.

The motivation is to push the decoupling between parameter and compute much further than classical sparse MoE allows. As we saw in traditional designs, compute per token is determined by the number of activated experts multiplied by the size of each expert. When experts remain large MLPs, activating even one or two introduces a substantial computational cost. In the million expert regime, each expert is intentionally lightweight. Activation becomes inexpensive, allowing parameter capacity to grow dramatically while maintaining bounded per token FLOPs.

Scaling expert count to this level introduces a fundamental challenge. A conventional learned router that computes compatibility scores between each token and every expert becomes computationally infeasible. The routing operation would dominate both memory and compute, eliminating the efficiency benefits of sparsity.

To overcome this bottleneck, the Mixture of a Million Experts framework introduces Product Key Expert Retrieval (PEER) as a scalable routing mechanism. Instead of evaluating every expert directly, routing is reformulated as a learned retrieval problem. Tokens generate query representations, while experts are organized within a structured key space constructed using product key decomposition. This structure enables approximate nearest neighbor style retrieval, allowing the router to identify relevant experts with sublinear complexity relative to the total expert count.

Product key expert retrieval: the query splits into two halves, each scored against a small sub-key table; the top-k from each form k by k candidates that index a pool of n squared tiny experts

Under this formulation, routing behaves less like conditional branching and more like differentiable indexing. The model learns a representation space in which tokens act as queries and experts act as indexed memory entries. Rather than scoring every candidate expert, the router retrieves a small set of experts that are likely to be relevant based on geometric proximity within the learned key space.

This perspective represents an extreme interpretation of the MoE principle. Instead of maintaining a limited collection of large specialized modules, the model contains an enormous library of micro experts. Sparse activation evolves from a mechanism for compute efficiency into a form of structured memory access. Parameter count can increase by orders of magnitude without proportionally increasing the computational cost of processing each token.

Conceptually, this direction extends the broader trajectory of MoE research. Early work demonstrated that conditional computation could decouple model capacity from compute. Later work focused on stabilizing routing and improving systems efficiency. The million expert paradigm attempts to extend capacity scaling even further by transforming experts into fine grained parameter units and reframing routing as scalable retrieval.

In this regime, the central question shifts. Stability and load balancing remain important, but performance increasingly depends on the quality of the learned indexing structure. If the key space organizes experts in a way that aligns with meaningful structure in the data, specialization can emerge naturally. If the indexing geometry is poorly structured, retrieval quality deteriorates and specialization weakens. Specialization therefore becomes tightly coupled to representation geometry rather than solely to routing optimization.

At this frontier, MoE begins to intersect with ideas from memory augmented neural networks and large scale retrieval systems. The distinction between model parameters and external memory becomes less clear. The original MoE intuition remains unchanged, different inputs should activate different parameters, yet the mechanism evolves toward large scale differentiable indexing over massive parameter libraries.


MoE Scaling Laws

As sparse MoE matured from a system experiments to a mainstream scaling strategy, a deeper question began to surface. Dense language models follow well established scaling laws: training loss decreases predictably as we increase parameter count, dataset size, and compute increase. These relationships are smooth, empirical, and surprisingly stable across architectures.

MoE models complicate this picture.

In a dense model, every parameter participates in every forward pass. Model size and per-token compute are tightly coupled; increasing one necessarily increases the other. In a sparse MoE, this coupling is broken. The model may contain hundreds of billions of parameters, yet only a small subset is active for each token. Capacity and computation are no longer identical quantities. Once this decoupling appears, the classical dense scaling framework becomes incomplete.

The guiding question therefore shifts. It is no longer sufficient to ask how loss scales with total parameter count. Instead, we must ask which notion of parameter count actually governs performance: total parameters, active parameters per token, or some interaction between the two.

Recent work begins to formalize the answer.

Joint MoE Scaling

 Ludziejewski et al., 2025 provides one of the first systematic empirical answers. Their work distinguishes explicitly between total parameters and active parameters and studies how both interact with dataset scale and compute. Across a large grid of MoE configurations with varying expert counts and routing strategies, they demonstrate that loss correlates more strongly with the number of active parameters per token than with total parameter count alone.

This reframes the meaning of model size. In dense scaling laws, parameter count is a single scalar that proxies capacity and compute simultaneously. In MoE, total parameters determine memory footprint and potential representational diversity, but active parameters determine how much capacity is actually engaged per token and how frequently parameters receive gradient updates. Increasing the number of experts without increasing data reduces update frequency per expert and yields diminishing returns. Scaling therefore becomes a coordination problem between dataset size, activation ratio, and expert count.

Empirically, the authors show that models follow power law behavior when loss is expressed as a function of active parameters and dataset size. When properly configured, sparse models can achieve lower loss than dense models under fixed memory or compute budgets. The advantage arises because conditional computation allows greater total representational capacity without proportionally increasing per computation.

Efficiency Leverage

A complementary perspective appears in more recent work (Tian et al., 2025), which frames sparse scaling in terms of efficiency leverage. Rather than predicting absolute loss directly, this framework measures the performance advantage of MoE relative to a dense baseline under identical compute budgets.

The central finding is that the benefit of MoE increases with overall scale, but only within an intermediate activation regime. If too few experts are activated, representational capacity per token becomes constrained. If too many are activated, the computational savings disappear and the architecture approaches dense behavior. Optimal performance emerges from balancing activation ratio with compute and dataset scale.

Large scale empirical evidence from the Ling 2.0 report reinforces this view. In experiments spanning tests of billions to one trillion parameters under highly sparse configurations, the results show that activation ratio is the primary driver of MoE efficiency under fixed compute budgets. Models with carefully tuned activation rations consistently achieved better loss reductions than configurations that merely increased total parameter count. The report further observes that efficiency leverage is not constant across scales. As compute investment6 grows, the advantage of well configured sparse models over dense baselines becomes more pronounced, suggesting that activation and compute interact in compounding rather than linear manner.

These results collectively show that MoE obeys scaling laws, but the governing variables differ from dense systems. Capacity becomes multi dimensional. Total parameters, active parameters, expert granularity, and dataset scale interact nontrivially. The relative advantage of sparse architectures grows as training budgets increase, because conditional computation increasingly decouples memory from compute.

Dense scaling laws revealed smooth power law regularities along a single dominant axis. MoE scaling laws reveal a higher dimensional structure in which specialization, gradient frequency, and activation sparsity jointly determine performance. Sparse modeling is therefore no longer merely an efficiency heuristic, but also a distinct scaling regime with its own predictive theory.


The Infrastructure Wall

If scaling laws clarified when Mixture of Experts should work, infrastructure reality clarifies why they often do not.

In principle, MoE offers an elegant tradeoff. You increase total capacity while keeping per token computation bounded. In practice, this decoupling between memory and compute creates a systems problem that is substantially harder than dense training.

This difficulty becomes visible when trying to train even moderately sized frontier style MoEs, for example models under twenty billion total parameters. One might expect mature tooling to exist for this regime. Instead, practitioners repeatedly encounter friction. Existing frameworks such as Megatron, NeMo, or TorchTitan are optimized for dense or production scale environments. They are powerful but rigid, and often difficult to adapt for rapid research iteration.

The absence of a clean, research focused MoE stack is not accidental. It reflects three structural pressures that make sparse training fundamentally harder than dense training: flop efficiency, router stability, and data quality.

Flop Efficiency and Stranded Compute

Dense training is tightly coupled. All parameters are active every step. If your architecture is sufficiently overparameterized, gradient flow is forgiving. Many implementation imperfections are absorbed by the redundancy of dense updates.

Ultra sparse MoE behaves differently. Only a subset of experts is active for each token. As routing policies evolve, different experts are activated over time. The training dynamics are therefore partially decoupled. Experts specialize, drift, and sometimes starve.

This decoupling forces additional compute expenditure. You must invest more flops to learn a stable routing policy and to ensure each expert receives sufficient gradient signal. At the same time, memory usage increases dramatically because all experts must reside in high bandwidth memory, even if most are idle per step.

This creates a paradox. You allocate large GPU memory footprints to host experts, yet many flops remain underutilized. Traditional sharding strategies such as FSDP were designed for dense workloads. They do not naturally saturate hardware in ultra sparse settings. As a result, many practitioners observe extremely low model flop utilization during MoE training.

Recent systems efforts attempt to close this gap. The DeepSeek infrastructure initiatives, including the open infrastructure index and DeepSeek OS Week, document the state of engineering required to make sparse training efficient. The DeepSeekMoE technical report further demonstrates that achieving extreme efficiency is not merely an architectural question but a topology question. Expert parallel dispatch, communication scheduling, and memory layout becomes first order concerns.

In other words, sparse modeling transforms what was once a modeling problem into a distributed systems optimization problem.

You can watch our overview video on DeepSeek OS Week to get more detailed walkthrough of DeepSeek's initiatives.

Mixed Precision and Router Instability

If memory pressure is severe, the natural instinct is to reduce expert precision. Lowering expert weights to fp8 or even lower precision reduces HBM usage and improves inference efficiency. In theory, this should unlock additional throughput.

In practice, mixed precision interacts pathologically with router dynamics.

Routers are already fragile. They must learn token to expert assignments that are both balanced and semantically meaningful. When expert weights are aggressively quantized, the magnitude of gradients flowing through those experts often shrinks. At first this appears to be a purely numerical issue. However, because routing decisions depend on downstream learning signals, reduced expert gradients weaken the feedback that t informs the router. As a result, the router struggles to update its assignment policy effectively. Certain experts begin receiving fewer tokens, which further reduces their gradient exposure. Over time this creates a feedback loop in which a small subset of experts absorbs most of the traffic while others starve. Once this imbalance sets in, training dynamics deteriorate and instability emerges at the system level rather than merely at the numerical level.

The DeepSeek V3 technical report presents an elegant auxiliary loss free routing setup, relying heavily on massive batch sizes to stabilize dynamics. Large batch training smooth gradient variance and helps routers converge. However, this assumption breaks in smaller research settings where hardware limits batch size.

Empirical investigations inspired by Character AI's Kaiju interventions show that stabilization requires careful scaling. Techniques such as μPμP based embedding scaling and controlled logit scaling can amplify otherwise vanishing gradients, allowing routers to learn under low precision regimes. Interestingly, conventional gradient clipping sometimes suppresses the very signals required for router adaptation. In certain experimental contexts, removing clipping entirely restores learning dynamics, albeit at increased risk.

These interventions illustrate a broader point. In dense models, mixed precision is primarily a numerical optimization problem. In MoE models, it is a dynamical systems problem. Any perturbation to expert gradients immediately feeds back into routing stability, which in turn reshapes the entire training trajectory.

The infrastructure burden is therefore not only computational but also algorithmic.

Data as a Multiplier

Even with stable routing and acceptable hardware utilization, MoE introduces another amplification effect: data sensitivity.

Because experts specialize, each expert effectively sees a smaller slice of the dataset. If data quality is inconsistent, specialization amplifies noise. Poorly filtered corpora that might be tolerable for dense training can degrade sparse systems disproportionately.

Open releases such as OLMo 3 provide valuable transparency into mixture construction. However, raw mixture often requires significant cleaning to achieve competitive performance. Modern pipelines increasingly incorporate heuristic filtering followed by model based quality scoring. Inspired by approaches like Seed Coder, one can use large oracle models to generate quality annotations and distill them into lightweight classifiers with early exit mechanisms. Such pipelines dramatically reduce noise while maintaining throughput.

For MoE, this filtering is not cosmetic. Cleaner data improves routing consistency, reduces expert starvation, and accelerate specialization. Data engineering thus becomes intertwined with architectural stability.

The Emerging Pattern

Taken together, these observations reveal why building infrastructure around MoE remains exceptionally difficult.

First, sparsity inflates memory requirements while reducing instantaneous compute utilization, forcing custom sharding and dispatch strategies. In a dense model with 100 billion parameters, all parameters are stored once and used in every forward pass. In a sparse MoE model with 1 trillion total parameters but only 100 billion active per token, the full trillion parameters must still reside in memory across devices even though only a fraction participate in each computation. This means memory scales with total capacity, not with active capacity. As a result, a model that is compute equivalent to a 100 billion dense model may require an order of magnitude more memory simply to host inactive experts.

Second, mixed precision interacts directly with routing dynamics, making numerical optimization inseparable from algorithmic stability. In a routed MoE layer, the gating network produces softmax scores that determine which experts receive each token. Under low precision formats such as FP16 or BF16, small numerical perturbations in these logits can change which one expert's score above another's, altering the token-to-expert assignment. This changes load balancing, gradient flow, and even which parameters receive updates in that step. As a result, numerical precision does not merely affect stability in the traditional sense of overflow or underflow. It directly modifies the model's routing behavior and therefore its training dynamics.

Third, data quality exerts stronger influence because specialization amplifies distributional irregularities. In a dense model, all parameters are exposed to the full training distribution at every step, so rare or noisy samples are averaged into a shared representation. In a sparse MoE model, routing encourages certain experts to specialize on particular patterns. If the training data contains skewed distribution, duplicated artifacts, or domain-specific noise, the router may consistently assign those patterns to the same subset of experts. Over time, those experts overfit to narrow signals while receiving limited exposure to the broader distribution. This creates uneven generalization across experts and can degrade overall performance, even if aggregate data volume in large.

DeepSeek’s recent open infrastructure efforts illustrate that achieving extreme efficiency requires coordinated advances across all three axes. Architecture alone is insufficient. Systems design, numerical scaling, and data curation must evolve together.

MoE therefore represents not just a modeling shift but a full stack shift. Where dense scaling primarily required more hardware and larger datasets, sparse scaling demands architectural insight, distributed systems engineering, and training dynamics control in equal measure.


Engram

Throughout this discussion, sparsity has primarily meant conditional computation. Mixture of Experts expanded model capacity by activating only a subset of parameters for each token, thereby decoupling total parameters from per token compute. This idea reshaped scaling strategy by allowing models to grow in representational capacity without proportionally increasing inference cost. However, conditional computation addresses only one side of the efficiency problem. Language itself contains a large volume of recurring, locally structured patterns that do not require deep recomputation each time they appear. In conventional Transformers, even these static patterns are reconstructed through repeated attention and feedforward operations. Compute is spent to relearn what is, in essence, structured memory.

Cheng et al., 2026 argue that this reveals a second sparsity axis that current architectures underutilize. MoE selectively activates computation, but it does not introduce a native primitive for sparse lookup. The authors propose conditional memory as a complementary mechanism that allows models to retrieve stored representations directly rather than recompute them through layered transformations.

Their proposed module, Engram, can be understood as a scalable evolution of classical n-gram embeddings. Instead of treating token sequences purely as inputs to be transformed through attention, Engram stores representations of frequently occurring local patterns in a structured memory. Consider a common phrase such as "on the other hand." In a standard Transformer, each occurrence of this phrase is processed token by token through multiple attention and feedforward layers, reconstructing its compositional meaning from scratch every time it appears. Even though the phrase has a stable semantic function as a discourse transition, the model recomputes its representation at each position and in every context.

Engram approaches this differently. If a phrase like “on the other hand” appears frequently during training, the model stores a learned representation of that entire pattern in structured memory. When the same token sequence appears again, retrieval is performed through deterministic addressing rather than deep recomputation. The lookup operates in constant time relative to sequence length, allowing the model to access a stable representation directly. In effect, the workload shifts from repeated dynamic transformation to structured memory access.

This does not eliminate contextual reasoning, since higher layers can still integrate the retrieved representation with surrounding tokens. But it reduces redundant computation for locally stable structures. The result is a second form of sparsity: not conditional activation of experts, but conditional retrieval of memorized patterns.

Two sparsity axes: MoE conditional computation routes a hidden state to a few experts, while Engram conditional memory hashes an n-gram into a large embedding table and fuses the retrieved row into the hidden state

What makes this proposal significant is not merely the addition of memory, but the framing of how it interacts with MoE. The paper introduces the concept of sparsity allocation. Given a fixed parameter and FLOPs budget, capacity can be distributed between expert based computation and memory based lookup. Rather than assuming that more experts always yield better results, the authors empirically evaluate how performance changes as the allocation shifts between these two forms of sparsity.

Their experiments reveal a consistent pattern. When all capacity is assigned to MoE experts, the model expands computation reconstructing many static patterns. When all capacity is assigned to memory, the system lacks sufficient dynamic reasoning power. Performance improves when a moderate portion of parameters is allocated to conditional memory while the remaining capacity supports conditional computation. Across scales examined in the paper, this balanced allocation achieves lower validation loss and stronger downstream results than iso parameter MoE baselines under equivalent compute budgets. The relationship follows a U shaped curve, where immediate allocations outperform both extremes.

This finding reframes how sparse scaling can be conceptualized. MoE expands the model's ability to specialize computation dynamically. Engram introduces a structured mechanism for specialization in storage. Instead of treating all parameters as compute units, some parameters function explicitly as indexed memory. The backbone network is therefore relived from reconstructing recurring patterns and can devote more depth and attention bandwidth to higher order dependencies.

Another practical aspect concerns infrastructure awareness. Because Engram relies on deterministic addressing, relevant memory entries can be prefetched efficiently. Static representations do not require the same dynamic routing communication patterns as MoE experts. This reduces synchronization overhead and allows certain memory components to reside outside the most expensive tiers of device memory. The result is not only conceptual elegance but also hardware aligned design.

Seen in continuity with MoE, Engram does not replace conditional computation. Rather, it introduces a second axis along which sparsity can operate. One axis governs which parameters compute. The other governs which representations are retrieved. When both are present, scaling is no longer a question of adding more experts alone. It becomes a question of how to divide limited resources between thinking and remembering.

This perspective subtly shifts the trajectory of sparse modeling. Earlier, the central challenge was how to increase capacity without increasing per token cost. MoE answered that by activating subsets of computation. Engram extends the answer by suggesting that some knowledge does not need to be recomputed at all. If sparse computation was the first structural break from dense scaling, conditional memory may represent the next refinement, where capacity is partitioned not only across experts but across fundamentally different functional roles within the model.

In that sense, sparsity is no longer a single dimension. It becomes a design space. Conditional computation and conditional memory coexist, and performance emerges from how carefully they are balanced.


The Bottom Line

Dense models apply uniform computation to structurally diverse data. Mixture of Experts fixes this by making computation conditional, activating only a subset of parameters per token. This decouples capacity from per-token compute and remains the core reason MoE works.

Routing is the central engineering challenge. Every major design after GShard can be understood as a different answer to the same question: how to keep experts both balanced and specialized. No single routing scheme dominates. Top-1 is simplest and most hardware friendly. Top-2 provides smoother gradient flow at moderate communication cost. Expert Choice guarantees balance by construction. The right choice depends on your systems constraints more than on modeling preference.

Shared experts, as introduced in DeepSeekMoE, reliably reduce redundancy and strengthen specialization. If your framework supports them, use them. Fine-grained expert segmentation helps further but adds routing complexity.

MoE scaling laws differ from dense scaling laws. Performance tracks active parameters more closely than total parameters. Adding experts without proportionally scaling data yields diminishing returns because each expert sees fewer updates. Scale data and experts together.

Infrastructure is not secondary. Sparse routing creates irregular communication and variable batch sizes per expert. Mixed precision interacts directly with router stability. Data quality matters more than in dense training because specialization amplifies distributional noise. Treat these as first-order concerns, not afterthoughts.

Conditional memory, as proposed in Engram, introduces a second sparsity axis orthogonal to MoE. Not all capacity needs to compute. Some can store. The optimal allocation lies between the two extremes, not at either end.


posted by derek @ 2026.02.25 · permalink