Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Baidu Inc(百度公司)
Transformer models encounter challenges in scaling hidden dimensions efficiently, as uniformly increasing them inflates computational and memory costs while failing to emphasize the most relevant features for each token. For further understanding, we study hidden dimension sparsity and observe that trained Transformers utilize only a small fraction of token dimensions, revealing an "activation flow" pattern. Notably, there are shared sub-dimensions with sustained activation across multiple consecutive tokens and specialized sub-dimensions uniquely activated for each token. To better model token-relevant sub-dimensions, we propose MoHD (Mixture of Hidden Dimensions), a sparse conditional activation architecture. Particularly, MoHD employs shared sub-dimensions for common token features and a routing mechanism to dynamically activate specialized sub-dimensions. To mitigate potential information loss from sparsity, we design activation scaling and group fusion mechanisms to preserve activation flow. In this way, MoHD expands hidden dimensions with negligible increases in computation or parameters, efficient training and inference while maintaining performance. Evaluations across 10 NLP tasks show that MoHD surpasses Vanilla Transformers in parameter efficiency and task performance. It achieves 1.7% higher performance with 50% fewer activation parameters and 3.7% higher performance with a 3x parameter expansion at constant activation cost. MOHD offers a new perspective for scaling the model, showcasing the potential of hidden dimension sparsity to boost efficiency
Improving Transformers with Probabilistic Attention Keys
FPT Software AI Center(FPT软件人工智能中心);University of California, Los Angeles(加州大学洛杉矶分校);VinUniversity(文大);Deezer Research(Deezer研究院);Rice University(莱斯大学);The University of Texas at Austin(德克萨斯大学奥斯汀分校)
多头注意力是最先进的Transformers背后的驱动力,它在各种自然语言处理(NLP)和计算机视觉任务中实现了卓越的性能。已经观察到,对于许多应用,这些注意力头学习冗余嵌入,并且其中大多数可以在不降低模型性能的情况下被移除。受此启发,我们提出了Transformer与混合高斯密钥(transformer-MGK),一种新的Transformer架构,取代冗余的头在每个头的混合密钥的变压器。这些键的混合遵循高斯混合模型,并允许每个注意力头有效地集中在输入序列的不同部分。与传统的Transformer相比,Transformer-MGK加速了训练和推理,参数更少,需要计算的FLOP更少,同时在任务中实现了相当或更好的准确性。transformer-MGK也可以很容易地扩展到使用线性注意力。我们经验证明了Transformer-MGK在一系列实际应用中的优势,包括语言建模和涉及很长序列的任务。在Wikitext-103和Long Range Arena基准测试中,具有4个头的Transformer-MGK获得了与具有8个头的基线Transformers相当或更好的性能。
Hidden Heroes and Gradient Bloats: Layer-Wise Redundancy Inverts Attribution in Transformers
Department of Computer Science, Fu Foundation School of Engineering and Applied Science, Columbia University, New York, NY, USA(计算机科学系,工程与应用科学基金会学院,哥伦比亚大学,纽约,纽约州,美国)
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%。