Mixture of Experts: Routing Tokens to a Few Blocks
An interactive live film: four score planes over the token plane, their upper envelope picks each token's experts (top-k with softmax gates). Drag the router directions until every expert carries its share of the load.
Narration
A mixture of experts layer has several expert blocks, here four, and a router in front of them. The dots on the floor are tokens; to draw them, they live in two dimensions.
The router gives every expert a score, a linear function of the token: h i equals w i dot x, where w i is a row of the router matrix. Above the floor, each score is a tilted plane, and the arrow on the floor is its direction w i.
The rest of the narration is in the book's Companion.
More from Chapter 10
Interactive2:11Tensor Parallelism: Block Products Across DevicesChapter 10
Preview1:24Block Diagonal Matrices: Separate WorldsChapter 10
Preview1:28Block Multiplication: Blocks Multiply Like NumbersChapter 10
Preview1:39Longer Contexts with Rotary PositionsChapter 10
Preview2:20Woodbury Identity: a Rank-One Update of the InverseChapter 10
Preview1:40Schur Complement: What Is Left After Minimizing Out a BlockChapter 10
Preview1:32Kronecker Product and the Vectorization IdentityChapter 10
Preview1:40Block Cholesky: Two Steps to a CircleChapter 10
Preview1:30Online Softmax, One Tile at a TimeChapter 10