arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.08668cs.LGcs.AIcs.CLcs.NE
收藏

Primer:寻找语言建模的有效Transformers

Primer: Searching for Efficient Transformers for Language Modeling

Google Research, Brain Team(谷歌研究院大脑团队)

David R. So, Wojciech Mańke, Hanxiao Liu, Zihang Dai, Noam Shazeer, Quoc V. Le

摘要:

大型Transformer模型是自然语言处理最新进展的核心。然而,这些模型的训练和推理成本迅速增长,变得过于昂贵。在这里,我们的目标是通过寻找更有效的变体来降低Transformers的成本。与以前的方法相比,我们的搜索在较低的级别上执行,在定义Transformer TensorFlow程序的原语上执行。我们确定了一个名为Primer的架构,它比原始的Transformer和其他自回归语言建模变体具有更小的训练成本。Primer的改进主要归功于两个简单的修改:平方ReLU激活,并在自我注意力中的每个Q,K和V投影后添加dependency卷积层。实验表明,随着计算规模的增长,Primer相对于Transformer的增益会增加,并且在最佳模型大小下,Primer的质量遵循幂律。我们还根据经验验证了Primer可以放入不同的代码库中,以显着加快训练,而无需额外的调整。例如,在500 M的参数大小下,Primer在C4自回归语言建模上改进了原有的T5架构,将训练成本降低了4倍。此外,降低的训练成本意味着Primer需要更少的计算来达到目标的一次性性能。例如,在类似于GPT-3 XL的1.9 B参数配置中,Primer使用1/3的训练计算来实现与Transformer相同的单次性能。我们在T5中开源了我们的模型和几个比较,以帮助重现性。

英文摘要:

Large Transformer models have been central to recent advances in natural language processing. The training and inference costs of these models, however, have grown rapidly and become prohibitively expensive. Here we aim to reduce the costs of Transformers by searching for a more efficient variant. Compared to previous approaches, our search is performed at a lower level, over the primitives that define a Transformer TensorFlow program. We identify an architecture, named Primer, that has a smaller training cost than the original Transformer and other variants for auto-regressive language modeling. Primer's improvements can be mostly attributed to two simple modifications: squaring ReLU activations and adding a depthwise convolution layer after each Q, K, and V projection in self-attention. Experiments show Primer's gains over Transformer increase as compute scale grows and follow a power law with respect to quality at optimal model sizes. We also verify empirically that Primer can be dropped into different codebases to significantly speed up training without additional tuning. For example, at a 500M parameter size, Primer improves the original T5 architecture on C4 auto-regressive language modeling, reducing the training cost by 4X. Furthermore, the reduced training cost means Primer needs much less compute to reach a target one-shot performance. For instance, in a 1.9B parameter configuration similar to GPT-3 XL, Primer uses 1/3 of the training compute to achieve the same one-shot performance as Transformer. We open source our models and several comparisons in T5 to help with reproducibility.

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

↑