LGCLMay 14, 2024

Improving Transformers with Dynamically Composable Multi-Head Attention

arXiv:2405.08553v29 citationsh-index: 4Has CodeICML
Originality Highly original
AI Analysis

This addresses efficiency and expressiveness problems in Transformers for NLP researchers and practitioners, offering a drop-in replacement with significant gains.

The paper tackles the low-rank bottleneck and redundancy issues in Multi-Head Attention by proposing Dynamically Composable Multi-Head Attention, which improves language modeling performance, matching models with 1.7x-2.0x compute, such as DCPythia-6.9B outperforming Pythia-12B.

Multi-Head Attention (MHA) is a key component of Transformer. In MHA, attention heads work independently, causing problems such as low-rank bottleneck of attention score matrices and head redundancy. We propose Dynamically Composable Multi-Head Attention (DCMHA), a parameter and computation efficient attention architecture that tackles the shortcomings of MHA and increases the expressive power of the model by dynamically composing attention heads. At the core of DCMHA is a $\it{Compose}$ function that transforms the attention score and weight matrices in an input-dependent way. DCMHA can be used as a drop-in replacement of MHA in any transformer architecture to obtain the corresponding DCFormer. DCFormer significantly outperforms Transformer on different architectures and model scales in language modeling, matching the performance of models with ~1.7x-2.0x compute. For example, DCPythia-6.9B outperforms open source Pythia-12B on both pretraining perplexity and downstream task evaluation. The code and models are available at https://github.com/Caiyun-AI/DCFormer.

Code Implementations2 repos
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes