[Paper Review] Multi-branch Attentive Transformer
This paper proposes Multi-Branch Attentive Transformer (MAT), a novel Transformer variant that enhances performance by averaging outputs from multiple independent multi-head attention branches. Using drop-branch regularization and proximal initialization from a pre-trained single-branch Transformer, MAT achieves significant gains across machine translation, code generation, and natural language understanding tasks, demonstrating the effectiveness of multi-branch attention in sequence learning.
While the multi-branch architecture is one of the key ingredients to the success of computer vision tasks, it has not been well investigated in natural language processing, especially sequence learning tasks. In this work, we propose a simple yet effective variant of Transformer called multi-branch attentive Transformer (briefly, MAT), where the attention layer is the average of multiple branches and each branch is an independent multi-head attention layer. We leverage two training techniques to regularize the training: drop-branch, which randomly drops individual branches during training, and proximal initialization, which uses a pre-trained Transformer model to initialize multiple branches. Experiments on machine translation, code generation and natural language understanding demonstrate that such a simple variant of Transformer brings significant improvements. Our code is available at \url{https://github.com/HA-Transformer}.
Motivation & Objective
- To explore the potential of multi-branch architectures in natural language processing, particularly for sequence learning tasks.
- To address the underutilization of multi-branch designs in Transformers despite their success in computer vision.
- To improve model generalization and performance through structured architectural expansion beyond standard multi-head attention.
- To develop effective training techniques—drop-branch and proximal initialization—for training deeper, multi-branch Transformer variants.
- To empirically validate MAT’s effectiveness across diverse NLP benchmarks including machine translation, code generation, and natural language understanding.
Proposed method
- MAT replaces the standard multi-head attention layer with multiple independent multi-head attention branches, whose outputs are averaged to form the final output.
- Each branch in MAT is a standard multi-head attention layer with shared input queries, keys, and values, but distinct learned parameters.
- Drop-branch regularization is applied during training, where individual branches are randomly dropped to prevent co-adaptation and improve generalization.
- Proximal initialization initializes the multiple branches of MAT using a pre-trained single-branch Transformer, stabilizing training and improving convergence.
- The architecture maintains the same input and output dimensions as standard Transformers, enabling direct comparison and plug-in replacement.
- The method leverages both concatenation (within each head) and averaging (across branches), forming a multi-branch attention mechanism.
Experimental results
Research questions
- RQ1Can a multi-branch attention mechanism, inspired by computer vision, improve performance in sequence learning tasks like machine translation and code generation?
- RQ2How does drop-branch regularization affect the training stability and generalization of multi-branch Transformers?
- RQ3Does proximal initialization from a pre-trained single-branch Transformer lead to better convergence and performance in MAT?
- RQ4Is the performance gain from multi-branch attention limited to attention layers, or does it extend to feed-forward networks as well?
- RQ5How do hyperparameters such as the number of branches and hidden dimension affect MAT’s performance across different NLP tasks?
Key findings
- MAT achieves significant improvements over standard Transformers on machine translation, with BLEU scores increasing by up to 0.60 on IWSLT En→De and 0.50 on IWSLT De→En.
- On the IWSLT Fr→En translation task, MAT with proximal initialization and drop-branch achieves a 1.33 BLEU point improvement over the baseline when using 3 branches and 1024 feed-forward dimensions.
- The variant using randomly dropping heads (a form of drop-branch) achieves a 0.48 BLEU point gain on IWSLT En→Fr with 4 branches and 2048 feed-forward dimensions.
- When applied to code generation, MAT outperforms the standard Transformer, demonstrating consistent gains across diverse NLP tasks.
- The study found that introducing multiple branches into feed-forward networks slightly hurts performance, indicating that multi-branch design is most effective in attention layers.
- Proximal initialization consistently improves MAT performance across all evaluated settings, with gains ranging from 0.15 to 1.33 BLEU points depending on the task and configuration.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.