← Back to LLMs Mind Map
⚡ LLMsID: moe-routing

MoE Routing Top-k

MoE 路由 Top-k
🎯Core Definition
MoE (Mixture-of-Experts) places NN experts in FFN layers; a gating network g(x)=softmax(Wgx)g(x) = \text{softmax}(W_g x) scores every token and selects the top-kk experts, outputting the weighted sum y=∑i∈top-kgi(x)Ei(x)y = \sum_{i \in \text{top-}k} g_i(x) E_i(x); DeepSeek-V3, for instance, has 671B total parameters but activates only 37B per token — sparse activation is the core mechanism.
💡Use Cases
large-scale pretraining — buy more capacity with more parameters under the same FLOPs budget; inference only computes routed experts, cutting per-token compute; Llama 4, DeepSeek, and Mixtral all use top-2 or larger top-k routing.
⚡Key Problems Solved
scaling a Dense model scales compute proportionally; MoE breaks the params-≈-compute coupling via conditional computation, letting total parameters exceed active parameters by a large factor and boosting capacity at a fixed compute budget.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of MoE Routing Top-k.
Use Cases
In production engineering, what are the primary use cases for MoE Routing Top-k and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
How does MoE routing work — what does top-k selection mean?
2
Why 671B total but 37B active — what do active params mean?
3
What is the gating network's input and how is it trained?
4
Trade-offs between top-1 and top-2 routing?
5
Why does MoE cut both training and inference cost?
📖 In-depth Guide:📄 moe-architecture →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "MoE Routing Top-k"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardKnowledge DistillationNext Card →MoE Load Balancing

🔗 More LLMs Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/LLM/card/moe-routing
中文速览与面试要点

MoE 路由 Top-k (MoE Routing Top-k)

定义: MoE (Mixture-of-Experts) 在 FFN 层放置 N 个专家,门控网络 g(x) = softmax(W_g x) 为每个 token 打分并选 top-k 个专家,输出为加权和 y = _i top-k g_i(x) E_i(x);以 DeepSeek-V3 为例,总参 671B,但每个 token 仅激活 37B——稀疏激活是 MoE 的核心机制。 使用场景: 大规模预训练——在相同 FLOPs 预算下用更多参数换取更大容量;推理时只计算被路由到的专家,降低每 token 计算量;Llama 4、DeepSeek、Mixtral 等主流模型均采用 top-2 或更大 top-k 路由。 解决的问题: Dense 模型扩参意味着同比例增加计算量;MoE 用条件计算 (conditional computation) 打破“参数量≈计算量”的绑定,让总参数可以数倍于激活参数,在算力预算不变时显著提升模型容量与能力上限。

核心要点

  • MoE 路由如何工作?top-k 选择意味着什么?
  • 为什么 671B 总参只有 37B 激活?激活参数的含义?
  • 门控网络的输入与训练方式是什么?
  • top-1 与 top-2 路由的权衡?
  • MoE 为什么能同时降低训练和推理成本?