arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2210.00640cs.LG
收藏

广泛关注是Transformers的未来之路?

Wide Attention Is The Way Forward For Transformers?

University of Cambridge(剑桥大学);Imperial College London(帝国理工学院);University of Oxford(牛津大学)

Jason Ross Brown, Yiren Zhao, Ilia Shumailov, Robert D Mullins

摘要:

Transformer是一个非常强大和突出的深度学习架构。在这项工作中,我们挑战了深度学习中普遍持有的信念,即更深入更好,并展示了一种替代设计方法,可以构建更广泛的关注Transformers。我们证明了宽的单层Transformer模型可以在各种自然语言处理(NLP)任务中与更深的模型竞争或优于更深的模型,当两者都是从头开始训练时。然后系统地研究了改变模型长宽比对Transformers的影响。这个比率平衡了层数和每层的注意力头数,同时保持注意力头总数和所有其他超参数不变。平均而言,在4个NLP任务和10种注意力类型中,单层宽模型的性能比深度模型高出0.3%。我们展示了一个深入的评估,并展示了宽模型需要更小的内存占用,可以在商品硬件上运行得更快,此外,这些更宽的模型也更容易解释。例如,IMDb字节级文本分类上的单层Transformer在CPU上的推理延迟比同等精度的更深层次对应物快3.1倍,并且大小是其一半。因此,我们提出了更广泛和更浅的模型,作为NLP任务上小模型的可行和理想的替代方案,并作为超越这一领域的重要研究领域。

英文摘要:

The Transformer is an extremely powerful and prominent deep learning architecture. In this work, we challenge the commonly held belief in deep learning that going deeper is better, and show an alternative design approach that is building wider attention Transformers. We demonstrate that wide single layer Transformer models can compete with or outperform deeper ones in a variety of Natural Language Processing (NLP) tasks when both are trained from scratch. The impact of changing the model aspect ratio on Transformers is then studied systematically. This ratio balances the number of layers and the number of attention heads per layer while keeping the total number of attention heads and all other hyperparameters constant. On average, across 4 NLP tasks and 10 attention types, single layer wide models perform 0.3% better than their deep counterparts. We show an in-depth evaluation and demonstrate how wide models require a far smaller memory footprint and can run faster on commodity hardware, in addition, these wider models are also more interpretable. For example, a single layer Transformer on the IMDb byte level text classification has 3.1x faster inference latency on a CPU than its equally accurate deeper counterpart, and is half the size. We therefore put forward wider and shallower models as a viable and desirable alternative for small models on NLP tasks, and as an important area of research for domains beyond this.

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

↑