← Back to LLMs Mind Map
⚡ LLMsID: moe-load-balance

MoE Load Balancing

负载均衡损失
🎯Core Definition
without constraints, the gate makes tokens pile onto a few experts, causing load imbalance and routing collapse (a few experts absorb nearly all signal). Mitigations: the auxiliary balance loss Laux=α⋅N∑i=1NfiPi\mathcal{L}_{\text{aux}} = \alpha \cdot N \sum_{i=1}^{N} f_i P_i, where fif_i is expert ii's fraction of tokens (actual utilization) and PiP_i its mean routing probability — minimizing the product encourages uniform routing; plus a per-expert capacity cap (capacity factor: max tokens per expert = capacity factor × average load), where overflow tokens are dropped or routed through a residual path (recompute/residual connection).
💡Use Cases
a standard component of every top-k MoE training run (Switch Transformer, Mixtral, DeepSeek-V3); the capacity cap is also needed at inference to bound per-batch compute and prevent a hot expert from bloating latency.
⚡Key Problems Solved
imbalance idles some experts and overloads others, wasting memory and compute; expert collapse reduces MoE to a few effective experts, no better than a Dense model of the same size; the balance loss gives every expert a training signal, and the capacity cap makes training/inference deterministic.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of MoE Load Balancing.
Use Cases
In production engineering, what are the primary use cases for MoE Load Balancing and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
What are f_i, P_i, α, and N in the load-balancing loss?
2
Why does imbalance occur — what is expert/routing collapse?
3
What is the capacity factor — effects of it being too large or small?
4
How are overflow tokens handled?
5
Trade-offs of the aux-loss weight α being too large or small?
📖 In-depth Guide:📄 moe-architecture →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "MoE Load Balancing"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardMoE Routing Top-kNext Card →Dense vs MoE

🔗 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-load-balance
中文速览与面试要点

负载均衡损失 (MoE Load Balancing)

定义: 若不加约束,门控会让 token 扎堆到少数专家,产生负载不均与专家退化 (routing collapse, 少数专家吸收几乎所有信号)。缓解手段: 辅助均衡损失 L_ aux = N _i=1^N f_i P_i,其中 f_i 是专家 i 的 token 占比 (实际利用率)、P_i 是路由概率均值,两者之积均匀化即鼓励均匀路由;同时设置专家容量上限 (capacity factor, 每专家最大 token 数 = 容量因子 × 平均负载),超限 token 被丢弃或走残差路径 (recompute/残差连接)。 使用场景: 任何 top-k MoE 训练 (Switch Transformer、Mixtral、DeepSeek-V3 等) 的标配组件;推理时容量上限同样必要,它把单 batch 内的计算量固定在确定边界内,避免个别专家过热拖慢整体延迟。 解决的问题: 负载不均使部分专家闲置、部分过载,浪费显存与算力;专家崩溃会让 MoE 退化成少数专家在起作用,能力不如同参 Dense;均衡损失保证每个专家都获得训练信号,容量上限保证训练/推理的确定性。

核心要点

  • 负载均衡损失公式中 f_i、P_i、α、N 各是什么?
  • 为什么会出现负载不均?专家崩溃 (routing collapse) 是什么?
  • 容量因子 (capacity factor) 是什么?过大/过小的影响?
  • 超限 token 如何处理?
  • 均衡损失权重 α 太大/太小的权衡?