Coupling Experts and Routers in Mixture-of-Experts via an Auxiliary Loss
本文提出了一种名为专家-路由器耦合损失(ERC损失)的方法,通过增强路由器与专家之间的耦合来提升混合专家(MoE)模型的表现。
更新于 2026-01-05。作者:Ang Lv、Jin Ma、Yiyuan Ma、Siyuan Qiao。
中文摘要
混合专家(MoE)模型缺乏确保路由器决策与专家能力良好对齐的显式约束,这最终限制了模型性能。为了解决这个问题,我们提出了专家-路由器耦合(ERC)损失,这是一种轻量级的辅助损失,它紧密地将路由器的决策与专家能力耦合。我们的方法将每个专家的路由器嵌入视为分配给该专家的标记的代理标记,并通过扰动路由器嵌入通过专家来获取内部激活。ERC损失对这些激活施加了两个约束:(1)每个专家必须对其自己的代理标记的激活高于对任何其他专家代理标记的激活。(2)每个代理标记必须从其对应专家那里引发比从任何其他专家那里更强的激活。这些约束共同确保每个路由器嵌入忠实代表其对应专家的能力,而每个专家则专注于处理实际路由给它的标记。ERC损失在计算上高效,仅对n^2个激活进行操作,其中n是专家的数量。这代表了一个与批量大小无关的固定成本,而先前的耦合方法会随着标记的数量(通常每个批量数百万)而扩展。通过在3B到15B参数范围内的MoE-LLMs上进行预训练,并在万亿个标记上进行了广泛的分析,我们证明了ERC损失的有效性。此外,ERC损失在训练期间提供了灵活的控制和专家专业化水平的定量跟踪,为MoEs提供了宝贵的见解。
英文摘要
Mixture-of-Experts (MoE) models lack explicit constraints to ensure the router's decisions align well with the experts' capabilities, which ultimately limits model performance. To address this, we propose expert-router coupling (ERC) loss, a lightweight auxiliary loss that tightly couples the router's decisions with expert capabilities. Our approach treats each expert's router embedding as a proxy token for the tokens assigned to that expert, and feeds perturbed router embeddings through the experts to obtain internal activations. The ERC loss enforces two constraints on these activations: (1) Each expert must exhibit higher activation for its own proxy token than for the proxy tokens of any other expert. (2) Each proxy token must elicit stronger activation from its corresponding expert than from any other expert. These constraints jointly ensure that each router embedding faithfully represents its corresponding expert's capability, while each expert specializes in processing the tokens actually routed to it. The ERC loss is computationally efficient, operating only on n^2 activations, where n is the number of experts. This represents a fixed cost independent of batch size, unlike prior coupling methods that scale with the number of tokens (often millions per batch). Through pre-training MoE-LLMs ranging from 3B to 15B parameters and extensive analysis on trillions of tokens, we demonstrate the effectiveness of the ERC loss. Moreover, the ERC loss offers flexible control and quantitative tracking of expert specialization levels during training, providing valuable insights into MoEs.
解读
一句话总结
本文提出了一种名为专家-路由器耦合损失(ERC损失)的方法,通过增强路由器与专家之间的耦合来提升混合专家(MoE)模型的表现。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:混合专家(MoE)模型中,路由器对专家能力的表征不明确,这限制了模型性能。
- 现有方案不足:现有方法,如完全激活所有专家以指导路由,计算和内存成本高,且与输入令牌数量成比例。
- 研究目标:提出一种轻量级的ERC损失,以增强路由器与专家之间的耦合,同时保持计算效率。
问题2:论文的核心创新点是什么?
- 技术创新:ERC损失通过将路由器嵌入视为代理令牌,并通过专家获取内部激活来耦合路由器与专家。
- 方法改进:引入了新的损失函数,该函数通过惩罚违反专家特化和精确路由约束的激活来工作。
- 优势:与现有方法相比,ERC损失在保持效率的同时提高了性能,并提供了对专家专业化的灵活控制和定量跟踪。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在3B至15B参数的MoE-LLMs上进行了预训练实验,并在数万亿个令牌上进行了分析。
- 性能提升:ERC损失显著提高了模型性能,缩小了与更复杂MoE变体的性能差距。
- 对比结果:与基线MoE和AoE模型相比,ERC损失模型在下游任务上实现了稳定的性能提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:MoE模型,特别是大型语言模型。
- 实施建议:在MoE模型训练中使用ERC损失,以增强路由器与专家之间的耦合。
- 局限与展望:虽然ERC损失在性能上有所提升,但需要进一步研究以确定最佳的专业化程度,并探索自动化评估最佳专业化程度的方法。