arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.20802cs.LGcs.CV
收藏

精简Transformer:多头少深度

Leaner Transformers: More Heads, Less Depth

Australian Institute for Machine Learning, University of Adelaide(澳大利亚机器学习研究所,阿德莱德大学);Idiap Research Institute(Idiap研究机构)

Hemanth Saratchandran, Damien Teney, Simon Lucey

AI总结:

本文挑战“越大越好”观念,发现多头注意力可改善条件数,据此增加头数并减少深度,在多种视觉与语言任务上以30-50%参数削减保持准确率。

摘要:

Transformer通过利用注意力机制捕获大型数据集中的复杂模式,重塑了机器学习领域,带来了显著的性能提升。这一成功助长了“越大越好”的观念,导致模型规模不断增大。本文通过展示许多现有Transformer可能不必要地过大,挑战了这一观念。我们发现了一个重新定义多头注意力作用的理论原理。多头的一个重要好处在于改善注意力模块的条件数。我们利用这一理论洞见,重新设计了流行的架构,增加了头的数量。在实践中,条件数的改善被证明非常显著,以至于可以减少模型深度,在保持准确率的同时将参数数量减少高达30-50%。我们在多种规模不同的基于Transformer的架构上,以及在计算机视觉(ImageNet-1k)和语言与序列建模(GLUE基准、TinyStories和Long-Range Arena基准)任务中,均获得了一致的收益。

英文摘要:

Transformers have reshaped machine learning by utilizing attention mechanisms to capture complex patterns in large datasets, leading to significant improvements in performance. This success has contributed to the belief that "bigger means better", leading to ever-increasing model sizes. This paper challenge this ideology by showing that many existing transformers might be unnecessarily oversized. We discover a theoretical principle that redefines the role of multi-head attention. An important benefit of the multiple heads is in improving the conditioning of the attention block. We exploit this theoretical insight and redesign popular architectures with an increased number of heads. The improvement in the conditioning proves so significant in practice that model depth can be decreased, reducing the parameter count by up to 30-50% while maintaining accuracy. We obtain consistent benefits across a variety of transformer-based architectures of various scales, on tasks in computer vision (ImageNet-1k) as well as language and sequence modeling (GLUE benchmark, TinyStories, and the Long-Range Arena benchmark).

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

↑