Attention Weights in Transformer NMT Fail Aligning Words Between Sequences but Largely Explain Model Predictions
Javier Ferrando, Marta R. Costa-juss\`a

TL;DR
This paper analyzes Transformer NMT models, revealing that attention weights often misalign words due to reliance on uninformative tokens, but still largely explain model predictions and can be improved for better alignment accuracy.
Contribution
It demonstrates that attention weights in Transformer NMT models often produce alignment errors but remain useful for interpretability and can be improved to enhance alignment accuracy.
Findings
Attention weights rely on uninformative tokens for alignment.
Attention mechanisms are effective for interpreting model predictions.
Proposed methods significantly reduce alignment error rates.
Abstract
This work proposes an extensive analysis of the Transformer architecture in the Neural Machine Translation (NMT) setting. Focusing on the encoder-decoder attention mechanism, we prove that attention weights systematically make alignment errors by relying mainly on uninformative tokens from the source sequence. However, we observe that NMT models assign attention to these tokens to regulate the contribution in the prediction of the two contexts, the source and the prefix of the target sequence. We provide evidence about the influence of wrong alignments on the model behavior, demonstrating that the encoder-decoder attention mechanism is well suited as an interpretability method for NMT. Finally, based on our analysis, we propose methods that largely reduce the word alignment error rate compared to standard induced alignments from attention weights.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Software Engineering Research
MethodsAttention Is All You Need · Linear Layer · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Dropout · Dense Connections · Label Smoothing · Residual Connection · Adam · Multi-Head Attention
