Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformer

Javier Ferrando, Gerard I. Gállego, Belen Alastruey, Carlos Escolano, Marta R. Costa-jussà
5/23/2022
cs.CL
transformer-attention

Official code: mt-upc/transformer-contributions-nmt (18 stars, Jupyter Notebook, Apache-2.0, last commit 2022-10-06).

Abstract

In Neural Machine Translation (NMT), each token prediction is conditioned on the source sentence and the target prefix (what has been previously translated at a decoding step). However, previous work on interpretability in NMT has mainly focused solely on source sentence tokens' attributions.

Show full abstract

Therefore, we lack a full understanding of the influences of every input token (source sentence and target prefix) in the model predictions. In this work, we propose an interpretability method that tracks input tokens' attributions for both contexts. Our method, which can be extended to any encoder-decoder Transformer-based model, allows us to better comprehend the inner workings of current NMT models. We apply the proposed method to both bilingual and multilingual Transformers and present insights into their behaviour.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
187Jupyter Notebook, PythonJan 26, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{ferrando2022towards,
  title  = {Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformer},
  author = {Javier Ferrando and Gerard I. Gállego and Belen Alastruey and Carlos Escolano and Marta R. Costa-jussà},
  year   = {2022},
  eprint = {2205.11631},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.11631}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.11631.svg)](https://codeofpaper.com/paper/2205.11631)

Discussion