Lune

EMNLP Findings2021

Attention Weights in Transformer NMT Fail Aligning Words Between Sequences but Largely Explain Model Predictions

Javier Ferrando, Marta R. Costa-jussà

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.

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · 3 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers3

  1. From the Detection of Toxic Spans in Online Discussions to the Analysis of Toxic-to-Civil TransferJohn Pavlopoulos, Léo Laugier, Alexandros Xenos, Jeffrey Sorensen et al.ACL 2022 · 35 citations
  2. Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the TransformerJavier Ferrando, Gerard I. Gállego, Belen Alastruey, Carlos Escolano et al.EMNLP 2022 · 18 citations
  3. Optimal Transport for Unsupervised Hallucination Detection in Neural Machine TranslationNuno Miguel Guerreiro, Pierre Colombo, Pablo Piantanida, André F. T. MartinsACL 2023 · 8 citations

Builds on6

  1. On Identifiability in TransformersGino Brunner, Yang Liu, Damian Pascual, Oliver Richter et al.ICLR 2020 · 210 citations
  2. Attention is Not Only a Weight: Analyzing Transformers with Vector NormsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2020 · 138 citations
  3. Fixed Encoder Self-Attention Patterns in Transformer-Based Machine TranslationAlessandro Raganato, Yves Scherrer, Jörg TiedemannEMNLP Findings 2020 · 88 citations
  4. Accurate Word Alignment Induction from Neural Machine TranslationYun Chen, Yang Liu, Guanhua Chen, Xin Jiang et al.EMNLP 2020 · 56 citations
  5. Learning to Deceive with Attention-Based ExplanationsDanish Pruthi, Mansi Gupta, Bhuwan Dhingra, Graham Neubig et al.ACL 2020 · 17 citations

Related papers

  1. Attention Calibration for Transformer in Neural Machine TranslationYu Lu, Jiali Zeng, Jiajun Zhang, Shuangzhi Wu et al.ACL 2021
  2. On the Sub-Layer Functionalities of Transformer DecoderYilin Yang, Longyue Wang, Shuming Shi, Prasad Tadepalli et al.EMNLP Findings 2020 · 24 citations
  3. Alignment-Enhanced Transformer for Constraining NMT with Pre-Specified TranslationsKai Song, Kun Wang, Heng Yu, Yue Zhang et al.AAAI 2020 · 49 citations
  4. What Works and Doesn't Work, A Deep Decoder for Neural Machine TranslationZuchao Li, Yiran Wang, Masao Utiyama, Eiichiro Sumita et al.ACL Findings 2022 · 2 citations
  5. Explaining How Transformers Use Context to Build PredictionsJavier Ferrando, Gerard I. Gállego, Ioannis Tsiamas, Marta R. Costa-jussàACL 2023 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines