LatentMoE: K3 sigmoid routing and Switch aux/z-loss
Route with σ(W_r x), Top-k(s+b), then L1-normalize over the selected set. Add Switch/GShard aux and router z-loss into train_k3 and train_sft. Wiki parquet URLs honor HF_ENDPOINT for mirrored downloads.
This commit is contained in:
@@ -30,6 +30,9 @@ $n_r$ & routed 专家数 & 16 \\
|
||||
$k$ & Top-$k$ & 2 \\
|
||||
$n_s$ & shared 专家数 & 2 \\
|
||||
$d_{\mathrm{ff}}$ & 专家中间维度 & 96 \\
|
||||
$C$ & MoE 专家容量(pad 宽度) & 动态 \\
|
||||
$\alpha_{\mathrm{aux}}$ & Switch/GShard aux 系数 & $10^{-2}$ \\
|
||||
$\alpha_z$ & router z-loss 系数 & $10^{-3}$ \\
|
||||
$N$ & AttnRes 原子层数 ($= 2L$) & 8 \\
|
||||
$S$ & AttnRes 块大小(原子层) & 2--24 \\
|
||||
\bottomrule
|
||||
@@ -105,12 +108,19 @@ gate & \shape{B, T, H \cdot d_v} & $\sigma(W_g x)$ \\
|
||||
\midrule
|
||||
$x$ & \shape{B, T, D} & 输入 \\
|
||||
$z$ & \shape{B, T, \ell} & latent ($\ell = D/2$) \\
|
||||
logits & \shape{B, T, n_r} & router logits \\
|
||||
logits & \shape{B, T, n_r} & router logits $W_r x$ \\
|
||||
$s$ & \shape{B, T, n_r} & sigmoid 分数 $\sigma(\mathrm{logits})$ \\
|
||||
$b$ & \shape{n_r} & expert bias(非持久,只进 TopK) \\
|
||||
ids & \shape{B, T, k} & Top-$k$ 专家索引 \\
|
||||
probs & \shape{B, T, k} & softmax 权重 \\
|
||||
$p_i$ & \shape{B, T, k} & sigmoid-L1 权重 $s_i/\sum_{j\in T}s_j$ \\
|
||||
padded & \shape{n_r, C, \ell} & dispatch 后 pad 到容量 $C$ \\
|
||||
$C$ & 标量 & 最大专家负载(pad 宽度) \\
|
||||
$u$ & \shape{B, T, \ell} & routed 加权输出 \\
|
||||
$s$ & \shape{B, T, D} & shared 专家求和 \\
|
||||
$y$ & \shape{B, T, D} & $s + W_\uparrow \mathrm{RMSNorm}(u)$ \\
|
||||
$s_{\mathrm{sh}}$ & \shape{B, T, D} & shared 专家求和 \\
|
||||
$y$ & \shape{B, T, D} & $s_{\mathrm{sh}} + W_\uparrow \mathrm{RMSNorm}(u)$ \\
|
||||
$f_e, P_e$ & 标量 & aux loss 负载占比 / 平均分数 \\
|
||||
$\mathcal{L}_{\mathrm{aux}}, \mathcal{L}_z$ & 标量 & 负载均衡 / z-loss \\
|
||||
$\alpha_{\mathrm{aux}}, \alpha_z$ & 标量 & 对应系数($10^{-2}$ / $10^{-3}$) \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Reference in New Issue
Block a user