HAMZA KAREEM / CONCEPTS hamzawi.dev

Lesson 1162 min read

Mixture of Experts (Active vs Total Params)

Where the "Panel of Specialists" Analogy Breaks

AI engineeringAI engineering / inference & serving

The mental model

A dense model is one generalist reading every token. An MoE is a panel: at each layer a tiny router scores the experts and sends the token to the top 2 of, say, 8. Same layer slot, a fraction of the FLOPs.

Mixtral 8x7B: 46.7B total params, ~12.9B active per token.

DeepSeek-V3: 671B total, 37B active.

So it thinks with a 37B compute budget and a 671B knowledge budget. That analogy gets you 70% there. The remaining 30% is what makes you intermediate.

Break #1 — you still pay for everyone

A panel member you don't call still occupies a chair. ALL expert weights must sit in VRAM, because the next token may route anywhere.

671B at FP8 ≈ 671 GB of weights. An 8×H100 node = 640 GB. You don't fit.

Rule of thumb: active params predict tokens/sec. Total params predict your GPU bill. MoE buys quality per FLOP — never quality per GB.

Break #2 — experts are not topic specialists

"Medical question → medical expert" is simply wrong. Routing is per-token AND per-layer. The token "insulin" may hit experts 3 and 7 in layer 5, then 1 and 6 in layer 6. The specializations that actually emerge are things like punctuation, digits, or code syntax — not domains. You cannot ship "just the finance experts."

Break #3 — batching erases the savings

One request: 2 of 8 experts touched, little memory traffic.

Batch of 256 tokens: they scatter, nearly every expert is needed, so you stream almost all the weights anyway. The FLOP savings survive; the bandwidth savings mostly don't.

Worse, routing is uneven. A hot expert draws 3× its share, the GPU holding it becomes the straggler, and every other GPU waits — p99 latency spikes with no obvious smoking gun in CPU or GPU-util graphs. Serving stacks fight this with a capacity factor, and tokens over capacity get dropped (they skip the expert and ride the residual through). Quality quietly dips under load.

What to do with this

  • Sizing a self-hosted deploy? Line up active params for speed, total params for memory. A 37B-active MoE ≈ the speed of a 37B dense at the cost of a 671B.
  • p99 spiking at high batch under even traffic? Check per-expert routing counts before blaming the network.
  • Fine-tuning an MoE? Watch the router — gradients love to collapse it onto a few experts. Freeze it or keep the load-balancing loss on.

Your exercise

Open the model card of an MoE you might actually run (Mixtral 8x7B, DeepSeek-V3, a Qwen3-MoE — your pick). Write down three numbers: total params, active params, the ratio.

Then answer: at FP8, how many 80 GB GPUs just to HOLD the weights, before you reserve a single byte of KV cache? Now compare it to a dense model with the same active count — which would you deploy, and was the deciding factor speed or VRAM?