Understand: state assumptions, shapes/units and a counterexample.
Implement: reproduce a numerical example and inspect boundaries.
Investigate: compare one alternative under a matched budget.
This technical article displays the English edition.
Mechanism & assumptions
Sparse expert routing activates a subset of experts for each token. Stored parameters may greatly exceed active parameters, so a low active count does not establish that a model fits on one device. DeepSeek-V2 combines sparse experts and attention-cache compression; isolate these mechanisms when designing ablations. No specific speedup follows from parameter counts alone.
For 128 tokens, 8 experts and top-2 routing, there are 256 assignments, averaging 32 per expert. With capacity 40, an expert receiving 60 assignments exceeds capacity by 20; the implementation must explicitly drop, reroute or accommodate them. A hypothetical 16B-parameter model at 2 bytes per weight stores 32 GB before overhead, even if only 4B parameters are active.
Implementation exercise
Create balanced and skewed routing histograms with the same token count. Report maximum load, overflow, per-expert utilization and communication bytes under a declared placement. Compare quality after any dropped-token policy.
Deliver code, fixed seeds, raw results and one counterexample. These are experiment specifications, not executed GPU benchmarks.
Why can sparse models be slow at small batch sizes?
Routing, communication and small expert matrix multiplications can dominate. Measure device utilization and transfer time rather than assuming FLOP savings equal latency savings.
Original teaching examples; sources checked October 2026. These are foundational mechanisms relevant to engineering, not a claim to cover every latest model.
Activated parameter count is not total resident weight memory. Routing capacity, token imbalance, communication and expert precision all affect runtime. Distinguish logical dispatch bytes from measured network traffic.
Formula conditions, units and worked arithmetic reviewed. The implementation isolates one numerical mechanism; it does not train a policy or control real hardware.
Mechanism map: follow the transformations from top to bottom.
Before running: predict a boundary case
256 expert assignments dispatch 2 MiB once; return traffic is additional. This excludes protocol overhead.
Hint: isolate the assumption
Keep the baseline input fixed, change one parameter or boundary, and compare both the numerical result and the claimed units. A passing example verifies this fixture only.
Minimal executable example
Save the example and linked modules in one folder. Use Node.js 22 or newer, then run node moe-budgets.mjs. No third-party runtime dependencies.
256 expert assignments dispatch 2 MiB once; return traffic is additional. This excludes protocol overhead.
Record input, code version, expected result and observed result in the notebook below. Then construct a counterexample that violates the assumption above and explain why the original conclusion no longer follows.
Before revealing an answer, predict one result. After the exercise, record the discrepancy and a transfer test. Saved locally across language editions.
The mathematical review scope is recorded per lesson. It does not establish empirical paper reproduction; report suspected errors in your notes. Review scope