Improving Vision Transformers by Overlapping Heads in Multi-Head Self-Attention

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Zhang, Tianxiao, Luo, Bo, Wang, Guanghui
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915132067545088
author Zhang, Tianxiao
Luo, Bo
Wang, Guanghui
author_facet Zhang, Tianxiao
Luo, Bo
Wang, Guanghui
contents Vision Transformers have made remarkable progress in recent years, achieving state-of-the-art performance in most vision tasks. A key component of this success is due to the introduction of the Multi-Head Self-Attention (MHSA) module, which enables each head to learn different representations by applying the attention mechanism independently. In this paper, we empirically demonstrate that Vision Transformers can be further enhanced by overlapping the heads in MHSA. We introduce Multi-Overlapped-Head Self-Attention (MOHSA), where heads are overlapped with their two adjacent heads for queries, keys, and values, while zero-padding is employed for the first and last heads, which have only one neighboring head. Various paradigms for overlapping ratios are proposed to fully investigate the optimal performance of our approach. The proposed approach is evaluated using five Transformer models on four benchmark datasets and yields a significant performance boost. The source code will be made publicly available upon publication.
format Preprint
id arxiv_https___arxiv_org_abs_2410_14874
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Improving Vision Transformers by Overlapping Heads in Multi-Head Self-Attention
Zhang, Tianxiao
Luo, Bo
Wang, Guanghui
Computer Vision and Pattern Recognition
Vision Transformers have made remarkable progress in recent years, achieving state-of-the-art performance in most vision tasks. A key component of this success is due to the introduction of the Multi-Head Self-Attention (MHSA) module, which enables each head to learn different representations by applying the attention mechanism independently. In this paper, we empirically demonstrate that Vision Transformers can be further enhanced by overlapping the heads in MHSA. We introduce Multi-Overlapped-Head Self-Attention (MOHSA), where heads are overlapped with their two adjacent heads for queries, keys, and values, while zero-padding is employed for the first and last heads, which have only one neighboring head. Various paradigms for overlapping ratios are proposed to fully investigate the optimal performance of our approach. The proposed approach is evaluated using five Transformer models on four benchmark datasets and yields a significant performance boost. The source code will be made publicly available upon publication.
title Improving Vision Transformers by Overlapping Heads in Multi-Head Self-Attention
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2410.14874