Leaner Transformers: More Heads, Less Depth

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Saratchandran, Hemanth, Teney, Damien, Lucey, Simon
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910970391035904
author Saratchandran, Hemanth
Teney, Damien
Lucey, Simon
author_facet Saratchandran, Hemanth
Teney, Damien
Lucey, Simon
contents 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).
format Preprint
id arxiv_https___arxiv_org_abs_2505_20802
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Leaner Transformers: More Heads, Less Depth
Saratchandran, Hemanth
Teney, Damien
Lucey, Simon
Machine Learning
Computer Vision and Pattern Recognition
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).
title Leaner Transformers: More Heads, Less Depth
topic Machine Learning
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2505.20802