An Analysis of Encoder Representations in Transformer-Based Machine Translation
By Alessandro Raganato, Jörg Tiedemann. 2018
304 citations recorded by the source corpus.
The attention mechanism is a successful technique in modern NLP, especially in tasks like machine translation. The recently proposed network architecture of the Transformer is based entirely on attention mechanisms and achieves new state of the art results in neural machine translation, outperforming other sequence-to-sequence models. However, so far not much is known about the internal properties of the model and the representations it learns to achieve that performance. To study this question, we investigate the information that is learned by the attention mechanism in Transformer models with different translation quality. We assess the representations of the encoder by extracting dependency relations based on self-attention weights, we perform four probing tasks to study the amount of syntactic and semantic captured information and we also test attention in a transfer learning scenario. Our analysis sheds light on the relative strengths and weaknesses of the various encoder representations. We observe that specific attention heads mark syntactic dependency relations and we can also confirm that lower layers tend to learn more about syntax while higher layers tend to encode more semantics.
Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Natural Language Processing, Representation & Self-Supervised Learning
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Yonatan Belinkov
- Graham Neubig
- Luke S. Zettlemoyer
- Mohit Bansal
- Kyunghyun Cho
- Felix Stahlberg
- Noah A. Smith
- Christopher D. Manning
In Computer Vision and Pattern Recognition
- Felix Stahlberg
- Graham Neubig
- Yonatan Belinkov
- Orhan Firat
- Kyunghyun Cho
- Rico Sennrich
- Luke S. Zettlemoyer
- Mohit Bansal
In Natural Language Processing
- Yonatan Belinkov
- Graham Neubig
- Kyunghyun Cho
- Samuel R. Bowman
- Luke S. Zettlemoyer
- Felix Stahlberg
- Philipp Koehn
- Yoav Goldberg
In Representation & Self-Supervised Learning
- Yonatan Belinkov
- Samuel R. Bowman
- Graham Neubig
- Jesse Vig
- Omer Levy
- Ivan Titov
- Christopher D. Manning
- Jason Phang
Citations in the corpus
- The Bottom-up Evolution of Representations in the Transformer: A Study with Machine Translation and Language Modeling Objectives (2019, background): “…of linguistic analysis have been considered including morphology (Belinkov et al., 2017a; Dalvi et al., 2017; Bisazza and Tump, 2018), syntax (Shi et al., 2016; Tenney et al., 2019b) and semantics (Hill et al., 2017; Belinkov et al., 2017b; Raganato and Tiedemann, 2018; Tenney et al., 2019b).”
- Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned (2019, methodology): “Despite the model’s widespread adoption and recent attempts to investigate the kinds of information learned by the model’s encoder (Raganato and Tiedemann, 2018), the analysis of multi-head attention and its importance for translation is challenging.”
- Probing Classifiers: Promises, Shortcomings, and Advances (2021, background): “These scores may come from attention weights ( Raganato and Tiedemann 2018; Clark et al. 2019; Mareˇcek and Rosa 2019; Htut et al. 2019) or from distances between word representations, perhaps including perturbations of the input sentence (Wu et al. 2020).”
- What Does BERT Look at? An Analysis of BERT’s Attention (2019, background): “Raganato and Tiedemann (2018) evaluate the attention heads of a machine translation model on dependency parsing, but only report overall UAS scores instead of investigating heads for specific syntactic relations or using probing classifiers.”
- Are Sixteen Heads Really Better than One? (2019, background): “, 2018) and that some heads are predictive of dependency structures (Raganato and Tiedemann, 2018).”
- A Multiscale Visualization of Attention in the Transformer Model (2019, background): “shows that attention in the Transformer correlates with syntactic constructs such as dependency relations and part-of-speech tags (Raganato and Tiedemann, 2018; Voita et al., 2019; Vig and Belinkov, 2019).”
- Analyzing the Structure of Attention in a Transformer Language Model (2019, background): “Past work suggests that attention heads in the Transformer may specialize in particular linguistic phenomena (Vaswani et al., 2017; Raganato and Tiedemann, 2018; Vig, 2019).”
- Information-Theoretic Probing with Minimum Description Length (2020, background): “attention weights (Voita et al., 2018; Raganato and Tiedemann, 2018; Voita et al., 2019b; Clark et al., 2019; Kovaleva et al., 2019) or individual neurons (Karpathy et al.”
- exBERT: A Visual Analysis Tool to Explore Learned Representations in Transformers Models (2019, background): “…this challenge, some research has focused on understanding whether BERT learns linguistic features such as Part Of Speech (POS), Dependency relationships (DEP), or Named Entity Recognition (NER) [e.g., Tenney et al., 2019a, Vig and Belinkov, 2019, Raganto and Tiedemann, 2018, Tenney et al., 2019b].”
- Do Attention Heads in BERT Track Syntactic Dependencies? (2019, methodology): “To extract complete valid dependency trees from the attention weights for a given layer and head, we follow the approach of Raganato and Tiedemann (2018) and treat the matrix of attention weight tokens as a complete”
- On Identifiability in Transformers (2019, background): “Our results suggest that some of the conclusions in prior work (Vaswani et al., 2017; Vig, 2019; Marecek & Rosa, 2018; Clark et al., 2019; Raganato & Tiedemann, 2018; Voita et al., 2019; Tang et al., 2018; Wangperawong, 2018; Padigela et al., 2019; Baan et al., 2019; Lin et al., 2019; Dehghani et…”
- Investigating Multilingual NMT Representations at Scale (2019, background): “, 2018), attention based methods (Raganato and Tiedemann, 2018) or task analysis (Zhang and Bowman, 2018) and is primarily focused on understanding the linguistic features encoded by a trained model.”
- Probing Classifiers: Promises, Shortcomings, and Alternatives (2021, background): “These scores may come from attention weights (Raganato and Tiedemann 2018; Clark et al. 2019; Mareˇcek and Rosa 2019; Htut et al. 2019) or from distances between word representations, perhaps including perturbations of the input sentence ( Wu et al. 2020).”