Shatter:一种高效的单头自注意相对序列分割Transformer编码器
Shatter: An Efficient Transformer Encoder with Single-Headed Self-Attention and Relative Sequence Partitioning
摘要:
基于自我注意力的高度流行的Transformer架构是大型预训练模型(如BERT)的基础,这些模型已成为NLP中持久的范式。虽然功能强大,但预训练此类模型所需的计算资源和时间可能令人望而却步。在这项工作中,我们提出了一种替代的自我注意力架构,破碎,更有效地编码序列信息,通过软分区的相对位置的空间和应用不同的值矩阵的序列的不同部分。这种机制进一步允许我们将Transformer中的多头注意简化为单头注意。我们进行了大量的实验,表明Shatter比BERT实现了更好的性能,预训练每步更快(TPU上为15%),收敛步骤更少,并节省了大量内存(>50%)。总之,Shatter可以在7天内在8个V100 GPU上进行预训练,并与BERT_Base的性能相匹配-使预训练的成本更加实惠。
英文摘要:
The highly popular Transformer architecture, based on self-attention, is the foundation of large pretrained models such as BERT, that have become an enduring paradigm in NLP. While powerful, the computational resources and time required to pretrain such models can be prohibitive. In this work, we present an alternative self-attention architecture, Shatter, that more efficiently encodes sequence information by softly partitioning the space of relative positions and applying different value matrices to different parts of the sequence. This mechanism further allows us to simplify the multi-headed attention in Transformer to single-headed. We conduct extensive experiments showing that Shatter achieves better performance than BERT, with pretraining being faster per step (15% on TPU), converging in fewer steps, and offering considerable memory savings (>50%). Put together, Shatter can be pretrained on 8 V100 GPUs in 7 days, and match the performance of BERT_Base -- making the cost of pretraining much more affordable.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。