Skip to main content
QUICK REVIEW

[论文解读] Improving Expert Specialization in Mixture of Experts

Yamuna Krishnamurthy, Christopher B. Watkins|arXiv (Cornell University)|Feb 28, 2023
Domain Adaptation and Few-Shot LearningComputer Science被引用 3
一句话总结

本文提出了一种注意力门控机制和一种数据驱动的相似性正则化($L_s$),以提升Mixture of Experts(MoE)模型中的专家专业化程度。通过基于专家输出计算门控权重——类似于注意力机制——该方法实现了更直观的任务分解和更优的专家利用,降低了专家分配的熵,提升了泛化能力,且在MNIST、FashionMNIST和CIFAR-100上,$L_s$在稀疏性和准确率方面优于$L_{\text{importance}}$。

ABSTRACT

Mixture of experts (MoE), introduced over 20 years ago, is the simplest gated modular neural network architecture. There is renewed interest in MoE because the conditional computation allows only parts of the network to be used during each inference, as was recently demonstrated in large scale natural language processing models. MoE is also of potential interest for continual learning, as experts may be reused for new tasks, and new experts introduced. The gate in the MoE architecture learns task decompositions and individual experts learn simpler functions appropriate to the gate's decomposition. In this paper: (1) we show that the original MoE architecture and its training method do not guarantee intuitive task decompositions and good expert utilization, indeed they can fail spectacularly even for simple data such as MNIST and FashionMNIST; (2) we introduce a novel gating architecture, similar to attention, that improves performance and results in a lower entropy task decomposition; and (3) we introduce a novel data-driven regularization that improves expert specialization. We empirically validate our methods on MNIST, FashionMNIST and CIFAR-100 datasets.

研究动机与目标

  • 为解决标准MoE训练中任务分解效果差且不直观的问题,该问题导致专家利用不充分和性能下降。
  • 通过引入一种新型门控机制,动态关注专家输出,提升任务分解质量,从而改善专家专业化。
  • 提出一种数据驱动的正则化项$L_s$,基于潜在空间中的特征相似性将样本分配给专家,促进高效且有意义的专家专业化。
  • 通过知识蒸馏,在门控机制中实现推理时的条件计算,即使训练阶段未启用条件计算。

提出的方法

  • 引入一种注意力门控机制,其中门控权重基于每个输入样本的门控输出与专家输出之间的注意力得分进行计算,实现动态、上下文感知的专家选择。
  • 采用类似自注意力的机制计算门控权重:$\text{gate}_i = \text{softmax}(\mathbf{q}_i^T \mathbf{K}_i / \sqrt{d})$,其中$\mathbf{q}_i$为门控输出,$\mathbf{K}_i$为样本$i$的专家输出。
  • 提出一种新颖的正则化项$L_s$,鼓励相似样本被分配给同一专家,基于潜在空间中的特征相似性。
  • 使用$L_s$训练注意力门控MoE模型,并将其蒸馏到标准MoE架构中,以在推理阶段恢复条件计算能力。
  • 应用知识蒸馏,将注意力门控MoE的行为迁移至标准MoE,实现稀疏专家激活的高效推理。
  • 采用标准指标评估性能:测试误差、互信息$I(E;Y)$、稀疏性$H_s$和均匀性$H_u$。
Figure 1: Original Mixture of Experts (MoE) architecture with 3 experts and 1 gate. The output of the model is $\vec{\hat{y}}=p_{1}\cdot\vec{o}_{1}+p_{2}\cdot\vec{o}_{2}+p_{3}\cdot\vec{o}_{3}$ , where $p_{1}$ , $p_{2}$ , $p_{3}$ are the gate outputs and $\vec{o}_{1}$ , $\vec{o}_{2}$ , $\vec{o}_{3}$
Figure 1: Original Mixture of Experts (MoE) architecture with 3 experts and 1 gate. The output of the model is $\vec{\hat{y}}=p_{1}\cdot\vec{o}_{1}+p_{2}\cdot\vec{o}_{2}+p_{3}\cdot\vec{o}_{3}$ , where $p_{1}$ , $p_{2}$ , $p_{3}$ are the gate outputs and $\vec{o}_{1}$ , $\vec{o}_{2}$ , $\vec{o}_{3}$

实验结果

研究问题

  • RQ1原始MoE训练方法是否能实现直观且有效的任务分解,还是会导致专家利用不充分和误差较高?
  • RQ2一种关注专家输出的门控机制能否提升任务分解质量和专家专业化水平?
  • RQ3数据驱动的相似性正则化($L_s$)是否优于现有方法(如$L_{\text{importance}}$)实现更好的专家专业化?
  • RQ4能否通过知识蒸馏在推理阶段保留注意力门控的优势,同时维持条件计算能力?

主要发现

  • 在MNIST数据集上,采用$L_s$正则化的注意力门控MoE模型取得了0.028 ± 0.007的最低测试误差,优于原始MoE及其他变体。
  • 在MNIST上,$L_s$将门控稀疏性熵($H_s$)降低至0.056,在CIFAR-100上降低至0.718,表明稀疏性更好且专家使用更集中。
  • 在MNIST上,$L_s$仅有效使用了15个专家中的5个,而$L_{\text{importance}}$强制所有专家等量使用,表明$L_s$可实现更高效的参数利用。
  • 从注意力门控模型蒸馏得到的模型在CIFAR-100上取得了0.482 ± 0.065的测试误差,证明了性能成功迁移至支持条件计算的架构。
  • 注意力门控模型将任务分解熵($H_s$)从原始MoE的0.092降低至MNIST上的0.071,表明专家分配更集中且更具意义。
  • $L_s$正则化提升了专家均匀性($H_u$)和互信息($I(E;Y)$),表明专家与任务子组件之间对齐更优。
(a) MNIST
(a) MNIST

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。