Log inStart free
LESSON 10.11 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Routers and top-k routing

Watch a router score 4 experts and send each token to the best few.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 10.11 · ROUTERSAT · TOP SCORE 1.41 (EXPERT 2)
01
Stage 1 of 5 · Router scores
The router multiplies the sat row by the weights of each expert. Each expert gets one score.
Explain it simply

You see the token sat as a row of 4 numbers at the top. Under it, each expert has its own row of 4 router weights. The router multiplies the numbers in each column and adds them up. That sum is the expert's score, the bar beside its row.

The sat row times each expert's router weights gives 4 scores. Expert 1 scores −1.33. Expert 2 scores 1.41. Expert 3 scores −1.62. Expert 4 scores −0.20.

token vectorrouter weights, the cutscores, shares, gate weightsskipped expert
scorerouter weightsx (sat)0.88−1.28−0.661.07expert 1−1.33−0.061.990.121.27expert 21.410.16−1.150.27−0.02expert 3−1.62−1.410.322.051.29expert 4−0.201.67−0.371.16−1.28router · token sats2 = 0.88·0.16 − 1.28·(−1.15) − 0.66·0.27 + 1.07·(−0.02) = 1.41scorerouter weightsx (sat)0.88−1.28−0.661.07expert 1−1.33−0.061.990.121.27expert 21.410.16−1.150.27−0.02expert 3−1.62−1.410.322.051.29expert 4−0.201.67−0.371.16−1.28router · token sats2 = 0.88·0.16 − 1.28·(−1.15) − 0.66·0.27 + 1.07·(−0.02) = 1.41
Toy: 8 tokens of width 4, a router of 16 weights, 4 experts; random weights, not trained
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
se=x⋅we\sy{s}{out}{s_e} = \sy{x}{data}{x} \cdot \sy{w}{param}{w_e}
s2=x⋅w2=0.14+1.48−0.18−0.02≈1.41\sy{s}{out}{s_2} = \sy{x}{data}{x} \cdot \sy{w}{param}{w_2} = 0.14 + 1.48 - 0.18 - 0.02 \approx 1.41

Each score is the dot product of the token and that expert's weights.

Common mix-ups

MYTHA gate weight of 1 means the router is sure.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With gates rescaled to 1, what happens to the expert 2 gate of sat at 3 experts per token?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.