[Paper Review] Weighted Transformer Network for Machine Translation
Weighted Transformer replaces multi-head attention with learnable self-attention branches, achieving higher BLEU scores and 15-40% faster convergence than the baseline Transformer.
State-of-the-art results on neural machine translation often use attentional sequence-to-sequence models with some form of convolution or recursion. Vaswani et al. (2017) propose a new architecture that avoids recurrence and convolution completely. Instead, it uses only self-attention and feed-forward layers. While the proposed architecture achieves state-of-the-art results on several machine translation tasks, it requires a large number of parameters and training iterations to converge. We propose Weighted Transformer, a Transformer with modified attention layers, that not only outperforms the baseline network in BLEU score but also converges 15-40% faster. Specifically, we replace the multi-head attention by multiple self-attention branches that the model learns to combine during the training process. Our model improves the state-of-the-art performance by 0.5 BLEU points on the WMT 2014 English-to-German translation task and by 0.4 on the English-to-French translation task.
Motivation & Objective
- Motivate reducing training time and parameter inefficiency in Transformer-based NMT without sacrificing performance.
- Propose a branched self-attention mechanism to replace multi-head attention.
- Demonstrate improved BLEU scores on WMT 2014 EN-DE and EN-FR datasets and analyze regularization effects.
Proposed method
- Replace the Transformer’s multi-head attention with branched self-attention where each branch computes an Attention(QW_i^Q, KW_i^K, VW_i^V) and a learned projection bar{head}_i;
- Compute branch outputs as bar{head}_i = head_i W^{O_i} rac{_i}{}, with learned weights and that sum to 1 across branches;
- Aggregate branches as BranchedAttention(Q,K,V) = sum_{i=1}^M _i FFN(bar{head}_i) with constraints sum_i _i = 1 and sum_i _i = 1;
- Retain positional encoding, layer normalization, residual connections, and masking in the decoder;
- Train with label smoothing, dropout, and Adam with a warm-up schedule;
- Tie input embeddings to the output layer and batch sentences by length to reduce padding.
Experimental results
Research questions
- RQ1Does replacing multi-head attention with learned branched self-attention improve translation quality and training efficiency?
- RQ2How do the learned branch weights (, ) evolve during training, and do they indicate regularization or decorrelation among branches?
- RQ3What is the impact of the number of branches and other hyperparameters on BLEU scores and convergence speed?
- RQ4Is the Weighted Transformer robust across language pairs and model sizes compared to the baseline Transformer?
Key findings
- Weighted Transformer achieves higher BLEU than the Transformer on EN-DE and EN-FR across small and large configurations (e.g., small: EN-DE 28.4 vs 27.3; EN-FR 38.9 vs 38.1).
- The small Weighted Transformer reaches near or surpasses the large Transformer with substantially fewer parameters (e.g., small Weighted Transformer with 30% of Transformer parameters matching performance).
- Training converges 15-40% faster than the baseline Transformer.
- Learned branch weights show some branches are prioritized while others contribute over time, indicating decorrelation and regularization effects.
- Randomized or uniform test-time weights degrade performance, indicating learned weights are crucial for good results.
- Gating with hard top-k selection underperforms the proposed continuous weighting scheme, suggesting limited benefit from sparse gating in this setting.
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.