Exploring the Benefit of Activation Sparsity in Pre-training

要約

事前学習されたTransformerは、各トークンに対してニューロンのごく一部のみが活性化されるスパース活性化という特性を本質的に持っている。スパース活性化は学習後の手法によって探求されてきたが、事前学習におけるその可能性は未開拓のままである。本研究では、まず事前学習中に活性化特性がどのように変化するかを研究する。その結果、Transformerは事前学習プロセスの大部分において疎な活性化を示すが、活性化の相関は学習が進むにつれて進化し続けることが明らかになった。この観察結果を利用して、我々はスイッチング可能な疎密学習(SSD)を提案する。SSDは、MoE(Mixtures-of-Experts)に基づくスパース学習と従来の密な学習を適応的に切り替え、スパース学習の効率性を活用し、スパース学習の静的な活性化相関を回避する。密な学習と比較して、SSDは同じモデルサイズで同等の性能を達成し、事前学習コストを削減する。さらに、SSDで訓練されたモデルは、スパース推論用のMoEモデルとして直接使用することができ、密なモデルと同じ性能を達成し、推論速度が最大$2times$速い。コードはhttps://github.com/thunlp/moefication。

要約(オリジナル)

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.

arxiv情報

著者 Zhengyan Zhang,Chaojun Xiao,Qiujieli Qin,Yankai Lin,Zhiyuan Zeng,Xu Han,Zhiyuan Liu,Ruobing Xie,Maosong Sun,Jie Zhou
発行日 2024-10-04 13:53:33+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.AI, cs.CL パーマリンク