Symmetric Dot-Product Attention for Efficient Training of BERT Language Models

Martin Courtois, Malte Ostendorff, Leonhard Hennig, Georg Rehm


Abstract
Initially introduced as a machine translation model, the Transformer architecture has now become the foundation for modern deep learning architecture, with applications in a wide range of fields, from computer vision to natural language processing. Nowadays, to tackle increasingly more complex tasks, Transformer-based models are stretched to enormous sizes, requiring increasingly larger training datasets, and unsustainable amount of compute resources. The ubiquitous nature of the Transformer and its core component, the attention mechanism, are thus prime targets for efficiency research.In this work, we propose an alternative compatibility function for the self-attention mechanism introduced by the Transformer architecture. This compatibility function exploits an overlap in the learned representation of the traditional scaled dot-product attention, leading to a symmetric with pairwise coefficient dot-product attention. When applied to the pre-training of BERT-like models, this new symmetric attention mechanism reaches a score of 79.36 on the GLUE benchmark against 78.74 for the traditional implementation, leads to a reduction of 6% in the number of trainable parameters, and reduces the number of training steps required before convergence by half.
Anthology ID:
2024.findings-acl.476
Volume:
Findings of the Association for Computational Linguistics: ACL 2024
Month:
August
Year:
2024
Address:
Bangkok, Thailand
Editors:
Lun-Wei Ku, Andre Martins, Vivek Srikumar
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8002–8011
Language:
URL:
https://aclanthology.org/2024.findings-acl.476
DOI:
10.18653/v1/2024.findings-acl.476
Bibkey:
Cite (ACL):
Martin Courtois, Malte Ostendorff, Leonhard Hennig, and Georg Rehm. 2024. Symmetric Dot-Product Attention for Efficient Training of BERT Language Models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 8002–8011, Bangkok, Thailand. Association for Computational Linguistics.
Cite (Informal):
Symmetric Dot-Product Attention for Efficient Training of BERT Language Models (Courtois et al., Findings 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.findings-acl.476.pdf