Read the equation
After normalization, all selected mixture weights are multiplied by 2.5 in this DeepSeek configuration. Their sum is then approximately 2.5, so the routed contribution is amplified relative to a unit-sum mixture. This factor is separate from the unscaled shared-expert addition.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| topk_weight | Selected normalized routing weights |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
Selection and weighting use different quantities, deliberately.
8. topk_weight = topk_weight / (topk_weight.sum(-1, keepdim=True) + 1e-20)
topk_weight = topk_weight * 2.5 # routed_scaling_factor
Renormalize to sum 1, THEN scale by 2.5.
Then in DeepseekV3MoE.forward (lines 522-532):Exact original notation
topk_weight = topk_weight * 2.5 # routed_scaling_factor
Related builds
Sources & provenance
topk_weight = topk_weight * 2.5 # routed_scaling_factor
topk_weight = topk_weight * 2.5 # routed_scaling_factor