Mixture of Experts: How a Trillion-Parameter Model Stays Efficient
If you've used a modern AI chatbot in the last two years, there's a good chance you were talking to a model that, for any given word it generated, only used a fraction of its own brain. Not because it was being lazy — because it was being smart. The architecture behind that trick is called Mixture of Experts, and it's the main reason today's largest language models can have well over a trillion parameters while still running at a reasonable cost. It sounds like a contradiction: how do you build something enormous and keep it cheap to use? The answer turns out to be an old idea from 1991, revived and supercharged for the era of trillion-parameter AI.
The Concept
A standard "dense" neural network uses every single one of its parameters for every single input. If you ask it to finish the sentence "The capital of France is," the network fires up all its weights — the ones specialized in grammar, the ones that know geography, the ones that help with poetry, all of it — just to answer a simple factual question. That's wasteful. A lot of those weights are irrelevant to this particular query, but the network has no way to skip them.
Mixture of Experts (MoE) architectures solve this by splitting the network into many smaller sub-networks, called experts, and adding a small traffic-control component called a gating network (or router). Instead of sending every input through every expert, the router looks at the input and decides which handful of experts — often just 2 out of dozens, or even 2 out of 256 — are best suited to handle it. Only those chosen experts actually do computation. The rest sit idle for that token.
This gives you two numbers instead of one when describing a model's size: the total parameter count (all the experts added up, representing the model's total knowledge capacity) and the active parameter count (how many parameters actually get used per token, which determines how much compute and memory you spend). A well-designed MoE model can have a total parameter count in the hundreds of billions or trillions while its active parameter count — and therefore its real inference cost — looks much more like a model a tenth that size.
The idea isn't new. It traces back to a 1991 paper called "Adaptive Mixtures of Local Experts," written by Robert Jacobs and Michael Jordan at MIT together with Steven Nowlan and Geoffrey Hinton at the University of Toronto, published in the journal Neural Computation. Their original motivation wasn't efficiency at trillion-parameter scale — nobody was training anything close to that in 1991 — it was a more basic machine-learning problem: getting different parts of a network to specialize in different regions of a problem rather than all of them trying to learn everything and interfering with each other. Jordan and Jacobs later extended this into "hierarchical mixtures of experts," where gating networks formed branching tree structures, in follow-up work through the early-to-mid 1990s. For years, MoE lived mostly in speech-recognition research and other niche corners of machine learning, interesting but not mainstream.
The modern revival started in 2017, when Noam Shazeer, Azalia Mirhoseini, and colleagues at Google Brain (the author list also included Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean) published "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer." That paper introduced the sparsely-gated version used in essentially every modern MoE model today — a gating mechanism that doesn't just weight all the experts' outputs together but actually sends each input to only a small, sparse subset of them, with noise added during training to encourage balanced routing. That single architectural tweak is what made MoE compatible with the scaling ambitions of the deep learning era.
Why It Matters
The payoff is straightforward: it lets you decouple a model's knowledge capacity from its computational cost. Dense models force those two things to scale together — want a smarter model, pay for more compute on every single query, forever. MoE breaks that link.
Google's Switch Transformer, published in 2021, pushed this to an extreme: a model with up to a trillion total parameters, split across as many as 2,048 experts, where the router sent each token to just one expert ("switch routing") rather than the two-or-more typically used elsewhere. It was one of the first public demonstrations that you could train a model at trillion-parameter scale and still have it train and run efficiently, because any given token only touched a tiny slice of those parameters.
Mistral's Mixtral 8x7B, released in late 2023, is a more digestible example anyone can run on reasonably capable hardware. It has 8 experts per MoE layer, totaling around 46-47 billion parameters, but routes each token to only 2 experts at a time. The result performs competitively with much larger dense models while running inference at a cost closer to a 12-13 billion parameter dense model — roughly a quarter of the compute you'd expect from its total parameter count.
GPT-4 is widely reported — though OpenAI has never officially confirmed the architecture — to be a mixture-of-experts model with on the order of 1.76 trillion total parameters split across 16 experts, using top-2 routing per token. If true, it would explain how a model with that much raw capacity can still respond in a few seconds rather than taking minutes per query.
DeepSeek-V3, released by DeepSeek in December 2024, is a particularly well-documented recent example because the company published a detailed technical report. It has 671 billion total parameters, but only about 37 billion are activated for any given token — roughly 5.5% of the total. Each MoE layer uses 256 routed experts plus one "shared" expert that's always active, with only 8 of the routed experts selected per token. DeepSeek also introduced an "auxiliary-loss-free" load-balancing strategy, addressing a classic MoE headache (more on that below), and reported training the full model for roughly 2.788 million H800 GPU-hours — on the order of $5.5 million in compute cost, remarkably cheap for a model that performs competitively with much more expensively trained systems.
The Details
How does the router actually decide where to send a given token? In the basic sparsely-gated design, the router is itself a small neural network layer that takes the token's internal representation and outputs a score for every expert — essentially a vote for how relevant each expert is to this particular input. The top-scoring experts (commonly the top 1 or top 2) are selected, their outputs are computed, and those outputs are combined, weighted by how confident the router was in each choice. Everything else is skipped entirely — no wasted computation on experts the router didn't pick.
Picture the whole system as a hospital. A dense model is like forcing every patient to see every single specialist in the building regardless of what's wrong with them — thorough, but absurdly slow and expensive. An MoE model is a triage nurse (the router) who looks at your symptoms and sends you to exactly the two specialists who are actually relevant. The hospital can employ hundreds of specialists in total — covering every possible ailment — without every visit taking hundreds of appointments.
This elegance comes with real engineering headaches. The biggest is load balancing: if the router isn't carefully managed, it tends to develop favorites, routing most tokens to a small handful of "popular" experts while others go nearly untrained and useless — a rich-get-richer dynamic. Researchers address this with auxiliary loss terms that penalize uneven routing, or with newer loss-free balancing strategies like the one DeepSeek used, which adjust routing bias terms directly rather than adding a competing loss function. Get the balance wrong and you either waste the dormant experts' capacity or create bottlenecks where overloaded experts become a training speed limit.
There's also a hardware-level puzzle. In a dense model, every GPU does roughly the same work on roughly the same data. In a MoE model, tokens get scattered across many experts, often sitting on different machines in a cluster — so the system needs fast, carefully choreographed communication to ship each token to wherever its chosen experts live and then gather the results back. This is a genuinely hard distributed-systems problem, and a good chunk of recent MoE research (including DeepSeek's reported innovations) is about making that token-shuffling efficient rather than about the core routing idea itself.
Finally, there's a subtlety about what "fine-grained" versus "coarse-grained" experts mean. Early MoE designs like Switch Transformer used relatively few, large experts. More recent architectures — DeepSeek's DeepSeekMoE being a prominent example — use many more, smaller experts (256 of them, in DeepSeek-V3's case), on the theory that finer specialization lets each expert carve out a narrower, cleaner area of competence, improving the overall quality-per-active-parameter ratio.
Takeaways
- Mixture of Experts splits a neural network into many specialized sub-networks ("experts") plus a router that activates only a small subset of them per input, decoupling total model capacity from per-query compute cost.
- The idea dates to 1991 ("Adaptive Mixtures of Local Experts" by Jacobs, Jordan, Nowlan, and Hinton) but didn't become central to large-scale AI until Google's 2017 "sparsely-gated" formulation made it compatible with modern deep learning.
- Real systems span a huge range: Switch Transformer (up to 1 trillion parameters, 2,048 experts), Mixtral 8x7B (~46 billion total, 2-of-8 routing), and DeepSeek-V3 (671 billion total, ~37 billion active per token) all use the same core trick at different scales.
- The hard engineering problems aren't the routing idea itself but keeping experts load-balanced during training and shuffling tokens efficiently across hardware during both training and inference.
- MoE is a big part of why "trillion-parameter" no longer automatically means "impossibly expensive to run" — capacity and cost have become separable design choices rather than a fixed tradeoff.
Resources: - Jacobs, Jordan, Nowlan & Hinton, "Adaptive Mixtures of Local Experts", Neural Computation, 1991 - Shazeer et al., "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer", 2017 - DeepSeek-AI, "DeepSeek-V3 Technical Report", 2024