Pick the cheaper to serve option at equal quality: Llama 4 Maverick MoE or Llama 3.1 70B dense
At a fixed quality target where both models score within a few points on your eval, choose between Llama 4 Maverick (MoE: large total params, small active params subset) and Llama 3.1 70B dense. State the conditions under which each wins on tokens per dollar at decode, and name the two failure modes that erase the MoE advantage.
MoE wins on tokens per dollar when batch is moderate to large and full expert set fits in HBM. It loses at batch 1-2 from router overhead and on H100 from expert spill.
Picture two restaurants serving the same menu. The dense restaurant has a small kitchen where every dish uses the same set of ingredients on the same prep counter. The MoE restaurant has a huge pantry with many specialty stations, but each order only uses two or three stations. The MoE saves work per dish because most stations stay idle for any given order. That savings is real when the pantry fits in the kitchen and there are lots of orders to amortize the runners who carry ingredients to the right station. If the pantry has to live in a back warehouse, the runners take forever and the savings disappear. If only one order comes in at a time, the runner overhead is bigger than the saved prep work.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Mixture of experts has changed the economics of LLM serving by decoupling how much the model learned from how much work it does per token. Llama 4 Maverick at 400B total parameters but 17B active per token captures the trick. The question is whether the trick pays off in production against a well-tuned dense alternative like Llama 3.1 70B.
The answer is: it depends on two things, batch size and HBM capacity. Outside the sweet spot where both align, MoE can lose to a smaller dense model. Inside the sweet spot, MoE wins by a meaningful margin on tokens per dollar.
This deep dive covers the mechanics of MoE inference, why active parameters drive decode cost while total parameters drive HBM occupancy, the two failure modes that erase the MoE advantage, and a concrete decision rule tied to hardware and workload shape. The math works out cleanly once you separate the two cost variables, but a lot of production teams conflate them.
MoE inference mechanics in one paragraph
On every token, a small router network reads the hidden state and outputs top-k expert selections (typically k=1 or k=2 for inference). The token's hidden state is sent to those experts, each expert applies its feed-forward block, and the outputs are weighted-summed back. Attention layers are shared across all experts. The trick is that only a small fraction of the model's total feed-forward parameters participate per token, so weight bandwidth per token drops sharply.
Llama 4 Maverick's specific shape: roughly 400B total parameters, 17B active per token, 56 transformer layers, 128 experts per MoE layer (k=1 active per token). At FP8 the total weight footprint is approximately 400 GB; per-token active weights are 17 GB. Llama 4 Scout sits below at roughly 109B total and 17B active, also MoE.
Llama 3.1 70B dense, by contrast, activates all 70B parameters on every token. Per-token weight bandwidth is 70 GB at FP8 across all 80 layers.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Meta's Llama 4 Maverick (400B total, 17B active) targets H200 and B200 deployments where the full expert set fits in single-node HBM.
- DeepSeek V4 uses similar MoE math, with serving stacks tuned for batch 32-128 on H800 clusters.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does expert parallelism distribute the 400B weights across GPUs without breaking decode bandwidth?
Each GPU holds a subset of experts and tokens are routed via all to all communication. NVLink bandwidth (900 GB/s on H100, faster on B200) is fast enough that the all to all stays sub-millisecond at moderate batch. Beyond a single NVLink domain (8 GPUs), the cross-node traffic over InfiniBand becomes a bottleneck and throughput drops sharply. This is why MoE serving is typically single-node.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Comparing total parameter counts. Maverick has 400B total but only 17B active per token, so decode cost compares to a 17B-class dense model, not a 400B one.
60 second bullets to scan on the way to the call.
Distinguish active parameters from total parameters
Describe how decode cost scales with active params while HBM scales with total
Same topic, related formats. Practice these next.