arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.05644cs.CL
收藏

隐藏维度混合 Transformer

Mixture of Hidden-Dimensions Transformer

Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Baidu Inc(百度公司)

Yilong Chen, Junyuan Shang, Zhengyu Zhang, Jiawei Sheng, Tingwen Liu, Shuohuan Wang, Yu Sun, Hua Wu, Haifeng Wang

AI总结:

针对 Transformer 均匀扩展隐藏维度效率低的问题,提出 MoHD 稀疏条件激活架构,利用共享与路由激活子维度,在减少激活参数的同时提升性能,为模型扩展提供新视角。

摘要:

Transformer 模型在高效扩展隐藏维度方面面临挑战,因为均匀增加隐藏维度会膨胀计算和内存成本,同时无法突出每个 token 最相关的特征。为深入理解,我们研究了隐藏维度稀疏性,观察到训练后的 Transformer 仅利用 token 维度的一小部分,揭示了一种“激活流”模式。值得注意的是,存在跨多个连续 token 持续激活的共享子维度,以及每个 token 唯一激活的专门子维度。为更好地建模 token 相关的子维度,我们提出了 MoHD(隐藏维度混合),一种稀疏条件激活架构。具体而言,MoHD 采用共享子维度处理常见 token 特征,并通过路由机制动态激活专门子维度。为缓解稀疏性可能带来的信息损失,我们设计了激活缩放和分组融合机制以保留激活流。通过这种方式,MoHD 在计算或参数增加可忽略的情况下扩展隐藏维度,实现高效训练和推理,同时保持性能。在 10 个 NLP 任务上的评估表明,MoHD 在参数效率和任务性能上均超越普通 Transformer。它在激活参数减少 50% 的情况下性能提升 1.7%,在恒定激活成本下参数扩展 3 倍时性能提升 3.7%。MoHD 为模型扩展提供了新视角,展示了隐藏维度稀疏性提升效率的潜力。

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑