arXiv:2410.03440cs.CLcs.AI2024-10ICML被引 6

通过动态切换稀疏与密集训练,提升预训练效率并支持快速推理。

Exploring the Benefit of Activation Sparsity in Pre-training

  • 在预训练中动态切换稀疏(MoE)与密集训练模式。
  • 相同模型规模下性能相当,预训练成本更低,推理速度最高提升2倍。
  • 训练后可直接作为稀疏推理的MoE模型使用,适合高效部署场景。

预训练的Transformer天然具有激活稀疏性,即每个词元仅激活少量神经元。尽管已有研究通过后训练实现稀疏激活,但其在预训练阶段的潜力仍未被充分挖掘。本文首先分析了预训练过程中激活特性的变化,发现变压器在整个预训练期间保持激活稀疏性,而激活相关性随训练进程持续演变。基于此,我们提出可切换的稀疏-密集学习(SSD)方法:在预训练中自适应地在基于混合专家(MoE)的稀疏训练与传统密集训练之间切换,兼顾稀疏训练的效率,并避免稀疏训练中静态激活相关性的缺陷。与密集训练相比,SSD在相同模型规模下达到相当的性能,同时降低预训练开销。此外,采用SSD训练的模型可直接用作稀疏推理的MoE模型,在不损失性能的前提下,推理速度最高提升2倍。代码已开源于https://github.com/thunlp/moefication。

原文摘要 · Abstract (English)

Pre-trained Transformers inherently possess the characteristic of sparse activation, where only a small fraction of the neurons are activated for each token. While sparse activation has been explored through post-training methods, its potential in pre-training remains untapped. In this work, we first study how activation properties change during pre-training. Our examination reveals that Transformers exhibit sparse activation throughout the majority of the pre-training process while the activation correlation keeps evolving as training progresses. Leveraging this observation, we propose Switchable Sparse-Dense Learning (SSD). SSD adaptively switches between the Mixtures-of-Experts (MoE) based sparse training and the conventional dense training during the pre-training process, leveraging the efficiency of sparse training and avoiding the static activation correlation of sparse training. Compared to dense training, SSD achieves comparable performance with identical model size and reduces pre-training costs. Moreover, the models trained with SSD can be directly used as MoE models for sparse inference and achieve the same performance as dense models with up to $2\times$ faster inference speed. Codes are available at https://github.com/thunlp/moefication.

预训练稀疏激活MoE高效训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。