Skip to content
nonconvexcard

Mixture-of-experts sparsity accounting

NumericalIntermediate⏱ 30 minLLMsmixture of expertsflopsmemoryload balancing

Problem

A model routes each token to k=2k=2 of E=64E=64 experts, each expert having P=2×108P = 2\times10^8 parameters, with S=109S = 10^9 shared parameters.

  1. Compute the total parameter count and the per-token active parameter count.
  2. Compute the FLOPs per token and compare with a dense model of the same total size.
  3. Compute the memory required and comment on the binding constraint.

Compute the requested quantities and say what they mean. A number without an interpretation is not an answer.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Count the FLOPs of a forward passLLM OpsNumericalFoundation15 min
Derive the attention crossover lengthLLM OpsProofBeginner15 min
KV cache sizing with MHA and GQALLM OpsNumericalBeginner30 min
LoRA parameter accountingLLMsNumericalBeginner15 min
Product quantisation budget arithmeticRAGNumericalBeginner30 min