SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.11631 · EMNLP · 2022

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

Javier Ferrando, Marta Costa-Jussà, Carlos Escolano, Gerard Gállego, Belen Alastruey

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 8 functions out of this paper's own repositories and ran 8 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
mt-upc/transformer-contributions-nmt canonical 8 of 8
FunctionStatusWhere it lives
contrib_tok2words Ran mt-upc/transformer-contributions-nmt/alignment/align.py
code served (permissive licence) · get_code("b0fe901062fe44a7")
contrib_tok2words_partial Ran mt-upc/transformer-contributions-nmt/alignment/align.py
code served (permissive licence) · get_code("ccfc9acc2f460939")
contribution_source Ran mt-upc/transformer-contributions-nmt/wrappers/helper.py
code served (permissive licence) · get_code("ee46b90a0484d484")
get_greedy_decoding Ran mt-upc/transformer-contributions-nmt/wrappers/helper.py
code served (permissive licence) · get_code("b6c6b6eaf480d4b6")
get_normalized_rank Ran mt-upc/transformer-contributions-nmt/wrappers/utils.py
code served (permissive licence) · get_code("83bb8ecb1a22ea52")
get_translation Ran mt-upc/transformer-contributions-nmt/wrappers/helper.py
code served (permissive licence) · get_code("fa9a832d249635ca")
get_word_word_attention Ran mt-upc/transformer-contributions-nmt/alignment/align.py
code served (permissive licence) · get_code("4c5f47f52afaaae6")
spearmanr Ran mt-upc/transformer-contributions-nmt/wrappers/utils.py
code served (permissive licence) · get_code("1b48822629bead35")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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. 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2205.11631")
get_code_for_paper("2205.11631")
have("2205.11631")

Connect an agent — have() is free.