How a Mixture of Experts model routes each token to two of eight expert networks, blends their outputs, and activates only about 28% of its parameters.
One big AI model, built from many small helper networks called experts. For each word, only a few experts do the work. 一个大模型由许多小“专家”网络组成,每个词只请其中几位来工作。
Drag the bench to turn it. 拖动可旋转视角。
Text is cut into small pieces called tokens. Each token becomes a long list of numbers: 4,096 of them in Mixtral 8x7B. 文字被切成“词元”,每个词元变成一串数字(Mixtral 中有 4096 个)。
Tap a token block on the left rail to send it. 点击左侧的词元块即可发送。
The router is a tiny network that gives every expert a score for this token. The eight bars show those scores. 路由器是一个小网络,为每位专家给这个词元打分,八根柱子就是分数。
Only the two highest scores win (K = 2). Those two experts light up and lift; the other six rest for this token. 只有得分最高的两位专家被选中(K=2),其余六位休息。
Press the button to route the token again. 按按钮重新路由。
Each expert is a feed-forward network: layers of number-crunching neurons. The two chosen experts work at the same time. 每位专家是一个前馈网络,被选中的两位专家同时计算。
The two answers are blended, not voted on. Each is multiplied by its gate weight, and the two weights add up to 1. 两位专家的结果按门控权重混合,两个权重之和为 1。
Output = g₁·E₁(x) + g₂·E₂(x)
Different tokens wake different experts. Choose one and watch the scores, the chosen pair and the weights change. 不同的词元会唤醒不同的专家,选一个看看分数和权重如何变化。
Routing here is illustrative. Real experts follow word patterns more than topics. 此处路由仅为示意。
Mixtral holds 46.7 billion parameters, but each token uses only about 12.9 billion, roughly 28%. It thinks fast like a small model, yet must keep every expert in memory. 总参数 467 亿,每个词元只激活约 129 亿。
Parameters are the learned numbers inside a network. 参数是网络学到的数字。
Mixtral repeats this in all 32 layers, each with its own router and eight experts. Every token is routed again at every layer. 这个过程在 32 层中反复进行,每层都有自己的路由器。
DeepSeek-V3 picks 8 of 256 experts: 37B active of 671B. 从 256 位中选 8 位。