传统的Transformer模型通常为每个输入token分配固定数量的计算资源,导致计算效率低下且存在不必要的计算。为了解决这一问题,研究者引入了深度混合(Mixture of Depths,MoD)方法,通过跳过较不重要的层来动态调整计算深度。尽管该方法前景广阔,但当前的MoD方法仍探索不足,面临两大主要挑战:(1)训练成本高,因为需要训练整个模型以及决定跳过哪些层的路由器;(2)当重要层被跳过时,存在性能下降的风险。针对第一个问题,我们提出了Router-Tuning方法,该方法仅在小数据集上微调路由器,大幅降低了全模型训练带来的计算开销。针对第二个挑战,我们提出了MindSkip,它部署了具有动态深度的注意力机制(Attention with Dynamic Depths)。该方法在显著提升计算和内存效率的同时,保持了模型的性能。大量实验表明,我们的方法在显著提升计算效率的同时取得了有竞争力的结果,例如实现了21%的加速,且性能仅下降0.2%。代码已发布在https://github.com/CASE-Lab-UMD/Router-Tuning。
英文摘要:
Traditional transformer models often allocate a fixed amount of computational resources to every input token, leading to inefficient and unnecessary computation. To address this, the Mixture of Depths (MoD) was introduced to dynamically adjust the computational depth by skipping less important layers. Despite its promise, current MoD approaches remain under-explored and face two main challenges: (1) high training costs due to the need to train the entire model along with the routers that determine which layers to skip, and (2) the risk of performance degradation when important layers are bypassed. In response to the first issue, we propose Router-Tuning, a method that fine-tunes only the router on a small dataset, drastically reducing the computational overhead associated with full model training. For the second challenge, we propose MindSkip, which deploys Attention with Dynamic Depths. This method preserves the model's performance while significantly enhancing computational and memory efficiency. Extensive experiments demonstrate that our approach delivers competitive results while dramatically improving the computation efficiency, e.g., 21\% speedup and only a 0.2\% performance drop. The code is released at https://github.com/CASE-Lab-UMD/Router-Tuning.
Continual Pre-training of MoEs: How robust is your router?
Université de Montréal(蒙特利尔大学);Mila – Quebec AI Institute(魁北克人工智能研究所);Concordia University(康科迪亚大学);University of Chicago(芝加哥大学);Capital One(Capital One公司)
Zhengzhou University(郑州大学);DFKI(德国人工智能研究中心);Saarland University(萨尔大学);China Mobile Online Services(中国移动在线服务公司);College of Intelligence and Computing, Tianjin University(天津大学智能与计算学部)
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);Baidu Inc.(百度公司)
SpeechMoE: Scaling to Large Acoustic Models with Dynamic Routing Mixture of Experts
Tencent AI Lab(腾讯人工智能实验室)
近年来,基于Transformer的混合专家算法(Mixture of Experts,MoE)在许多领域都取得了可喜的成果。这在很大程度上是由于该架构的以下优点:首先,基于MoE的Transformer可以增加模型容量,而不会增加训练和推理时的计算成本。此外,基于MoE的Transformer是一种动态网络,可以适应实际应用中输入实例复杂性的变化。在这项工作中,我们探讨了基于MoE的语音识别模型,命名为Speech MoE。为了进一步控制路由器激活的稀疏性,提高门值的多样性,我们分别提出了稀疏性L1损失和平均重要性损失。此外,一个新的路由器架构中使用的语音MoE,它可以同时利用信息从一个共享的嵌入式网络和不同的MoE层的分层表示。实验结果表明,与传统静态网络相比,SpeechMoE在计算成本相当的情况下,可以获得更低的字符出错率(CER),在四个评估数据集上的CER相对改善为7.0%-23.0%。
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Baidu Inc.(百度公司);School of Artificial Intelligence, Beijing Normal University(北京师范大学人工智能学院)
Depth-Width tradeoffs in Algorithmic Reasoning of Graph Tasks with Transformers
Courant Institute of Mathematical Sciences, New York University(纽约大学应用数学科学研究所);Google Research(谷歌研究);Meta AI;Bar-Ilan University(巴伊兰大学);Department of Bio-Medical Engineering, Edmond J. Safra Center for Bioinformatics, Tel-Aviv University(生物医学工程系,埃德蒙·J·萨法中心,特拉维夫大学);Tel Aviv University(特拉维夫大学)