Read the equation
The shared expert processes identity, the input representation saved before the routed expert computation. Its output is added to the weighted routed sum. It therefore contributes a parallel transformation of the original input; it does not take the routed output as its input.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| identity | Pre-MoE input |
| y | Weighted routed sum before this addition |
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
identity = h # the PRE-MoE residual
y = moe_infer(h, topk_idx, topk_weight) # sum_i w_i * Expert_i(h)
y = y + shared_experts(identity) # shared expert added afterwards
The shared expert consumes the pre-MoE hidden state, not the routed output.
moe_infer (lines 535-608) is a gather/scatter batching routine: sort tokens byExact original notation
y = y + shared_experts(identity) # shared expert added afterwards
Related builds
Sources & provenance
y = y + shared_experts(identity) # shared expert added afterwards
y = y + shared_experts(identity) # shared expert added afterwards