EvoMoE:一种基于密集-稀疏门的进化混合专家模型训练框架
EvoMoE: An Evolutional Mixture-of-Experts Training Framework via Dense-To-Sparse Gate
摘要:
混合专家(Mixture-of-Experts,MoE)由于其在提高模型质量,特别是在Transformers中的成功而越来越受欢迎。通过将具有稀疏门的令牌路由到少数专家(即,完整模型的一小部分),MoE可以容易地将模型参数增加到非常大的规模,同时将计算成本保持在恒定水平。现有的大多数工作只是初始化一些随机的专家,设置一个固定的门控策略(例如,Top-k),并以特定的方式从头开始训练模型。我们发现这些MoE模型存在专家不成熟和稀疏门不稳定的问题,不利于收敛性能。在本文中,我们提出了一个有效的端到端的MoE培训框架称为Evo MoE。EvoMoE从训练单个专家开始,逐渐演变成一个大而稀疏的MoE结构。EvoMoE主要包含两个阶段:专家多样化阶段,训练基础专家一段时间,并从中产生多个不同的专家,和门稀疏化阶段,学习自适应稀疏门,并激活动态数量的专家。EvoMoE自然地将专家和稀疏门的联合学习结合起来,并专注于在早期训练阶段与单个专家一起学习基础知识。然后,它多样化的专家,并继续训练的MoE与一个新的密集到稀疏门(DTS门)。具体来说,DTS-Gate不是使用永久的稀疏门,而是作为一个密集门开始,将令牌路由到所有专家,然后逐渐自适应地变得稀疏,同时路由到更少的专家。对三种流行的模型和任务进行了评估,包括用于掩码语言建模任务的RoBERTa,用于语言建模任务的GPT和用于机器翻译任务的Transformer。结果表明,EvoMoE优于现有的基线,包括Switch,BASE层,Hash层和StableMoE。
英文摘要:
Mixture-of-experts (MoE) is becoming popular due to its success in improving the model quality, especially in Transformers. By routing tokens with a sparse gate to a few experts (i.e., a small pieces of the full model), MoE can easily increase the model parameters to a very large scale while keeping the computation cost in a constant level. Most existing works just initialize some random experts, set a fixed gating strategy (e.g., Top-k), and train the model from scratch in an ad-hoc way. We identify that these MoE models are suffering from the immature experts and unstable sparse gate, which are harmful to the convergence performance. In this paper, we propose an efficient end-to-end MoE training framework called EvoMoE. EvoMoE starts from training one single expert and gradually evolves into a large and sparse MoE structure. EvoMoE mainly contains two phases: the expert-diversify phase to train the base expert for a while and spawn multiple diverse experts from it, and the gate-sparsify phase to learn an adaptive sparse gate and activate a dynamic number of experts. EvoMoE naturally decouples the joint learning of both the experts and the sparse gate and focuses on learning the basic knowledge with a single expert at the early training stage. Then it diversifies the experts and continues to train the MoE with a novel Dense-to-Sparse gate (DTS-Gate). Specifically, instead of using a permanent sparse gate, DTS-Gate begins as a dense gate that routes tokens to all experts, then gradually and adaptively becomes sparser while routes to fewer experts. Evaluations are conducted on three popular models and tasks, including RoBERTa for masked language modeling task, GPT for language modeling task and Transformer for machine translation task. The results show that EvoMoE outperforms existing baselines, including Switch, BASE Layer, Hash Layer and StableMoE.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。