Model and Inference EngineeringTransformer and model mechanicsStaff
Why can an MoE router change model outputs while selecting exactly the same experts?
By Amit Kumar2 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A serving rewrite selects the same top-two experts for every token but changes quality. Compare full-router probabilities with selected-only renormalization, show how combination weights alter an output and design frozen-state parity checks. Explain why neither convention is universally correct for every checkpoint.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
At the weights used to combine those experts. Imagine four router logits whose full softmax assigns probabilities 0.45, 0.35, 0.15, 0.05. The selected experts are the first two. If you keep their full-softmax values, their contributions sum to 0.80. If you softmax only the selected logits, their weights become 0.5625 and 0.4375, summing to one. The expert IDs match, but the mixture output is scaled and potentially altered at every MoE layer. A residual path can carry that difference through the network. A learned output scale or other routing convention changes the exact arithmetic again.
For a hypothetical scalar pair of expert outputs 2 and 6, retaining weights 0.45 and 0.35 gives 0.45 × 2 + 0.35 × 6 = 3. Renormalizing the selected weights gives 0.5625 × 2 + 0.4375 × 6 = 3.75. The selected experts did not change, but the layer update did.
This is why I would inspect the checkpoint's actual router contract, not assume there is one universal MoE formula. Does it apply softmax before or after top-k? Are selected weights renormalized? Is there a scaling factor? Is it sigmoid routing, grouped selection, shared experts, or a capacity rule that changes which tokens reach an expert? Megatron Core exposes pre-softmax routing and top-k scaling as separate configuration choices, and its router API distinguishes selection scores from expert-combination probabilities. Those knobs are part of the model, not a serving preference to guess at.
Compare the old and new paths on frozen hidden states. Record router logits, chosen indices, combination weights, per-expert outputs and the summed layer output. Include ties and near ties, where small precision changes can flip selection, and measure a complete forward pass before blaming sampling. If the weights differ while the expert IDs agree, you already have a counterexample to equivalence. If both match, move further downstream.
The interviewer might ask whether renormalizing is always wrong. No. Some models are trained that way. The mistake is serving a checkpoint under a different rule than the one it learned. The MoE has plenty of total capacity. Why are tokens still dropped? asks why capacity drops tokens during training. This one has no dropped tokens at all. It tests whether two implementations compute the same model.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux