Inference, Serving & Production·Question 51 of 76Advanced

How does serving a large sparse mixture-of-experts model differ from serving a dense model, and what does expert parallelism change?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

MoE decouples memory from FLOPs: total parameters are enormous, but only a small fraction activate per token. So compute per token is cheap and quality is high, but you must hold every expert somewhere, and routing is data-dependent. That combination rewrites the serving playbook.

Full worked answer with diagram

MoE decouples memory from FLOPs: total parameters are enormous, but only a small fraction activate per token. So compute per token is cheap and quality is high, but you must hold every expert somewhere, and routing is data-dependent. That combination rewrites the serving playbook.

Parallelism choice. The weights do not fit on one GPU. You can tensor-parallel the experts (every GPU holds a slice of every expert), or use expert parallelism: each GPU holds whole experts, and tokens are shipped to the right GPU with all-to-all dispatch and combine (this is what DeepEP-style kernels optimise). EP keeps each expert's GEMM whole and large, which is efficient, and it shrinks weight memory per GPU, but it puts two all-to-alls per MoE layer on the critical path of every token.

Batch size stops being optional. All-to-all cost amortises over tokens, and each expert needs enough tokens to make its GEMM worthwhile. At low QPS you pay for all that memory and interconnect and get dense-like latency with none of the throughput. A sparse MoE at low traffic is a bad deal, and that is the point most candidates miss.

Load imbalance is the defining problem. Routing is data-dependent, so some experts run hot. The slowest GPU sets the step time and everyone waits at the all-to-all barrier, so imbalance shows up as latency, not as a partial slowdown. Mitigations: replicate hot experts, rebalance expert placement periodically from observed routing statistics (DeepSeek's EPLB is the public example), and run bigger batches so routing averages out.

Prefill and decode want different parallelism. Prefill is compute-bound and naturally batchy; decode is all-to-all latency bound. Wanting different EP degrees on each side is one of the strongest arguments for prefill/decode disaggregation, which is exactly the shape of published large-scale MoE deployments.

Re-derive your memory model. MLA-style attention makes KV per token small, so KV stops being what caps batch size and expert weights plus communication become the constraint instead. Do not carry the dense model's intuitions across.

Worth sketching. Two all-to-alls on the critical path and one hot expert at the barrier explain both the latency floor and the imbalance problem at once.

flowchart LR
    T["Token batch"] --> G["Router picks top-k experts per token"]
    G -->|"all-to-all dispatch"| E1["GPU 1: experts 0-15"]
    G -->|"all-to-all dispatch"| E2["GPU 2: experts 16-31"]
    E1 -->|"all-to-all combine"| C["Combine, then next layer"]
    E2 -->|"all-to-all combine"| C
    E1 --> HOT["A hot expert sets step time<br/>for everyone at the barrier"]

What a good answer covers

  • MoE decouples memory from FLOPs: total parameters are enormous, but only a small fraction activate per token
  • So compute per token is cheap and quality is high, but you must hold every expert somewhere, and routing…
  • That combination rewrites the serving playbook
  • You can tensor-parallel the experts (every GPU holds a slice of every expert), or use expert parallelism
  • EP keeps each expert's GEMM whole and large, which is efficient, and it shrinks weight memory per GPU,…

Key terms: Parallelism choice · expert parallelism · Batch size stops being optional · Re-derive your memory model

Interviewer follow-ups to expect

  1. Why does low traffic hurt an MoE deployment more than a dense one of similar quality?

  2. How would you detect and quantify expert imbalance in production?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep