Can Transformer be Too Compositional? Analysing Idiom Processing in Neural Machine Translation

Verna Dankers, Christopher G. Lucas, Ivan Titov
5/30/2022
cs.CL
transformer-attention

Official code: vernadankers/mt_idioms (6 stars, NewLisp, last commit 2022-06-13).

Abstract

Unlike literal expressions, idioms' meanings do not directly follow from their parts, posing a challenge for neural machine translation (NMT). NMT models are often unable to translate idioms accurately and over-generate compositional, literal translations.

Show full abstract

In this work, we investigate whether the non-compositionality of idioms is reflected in the mechanics of the dominant NMT model, Transformer, by analysing the hidden states and attention patterns for models with English as source language and one of seven European languages as target language. When Transformer emits a non-literal translation - i.e. identifies the expression as idiomatic - the encoder processes idioms more strongly as single lexical units compared to literal expressions. This manifests in idioms' parts being grouped through attention and in reduced interaction between idioms and their context. In the decoder's cross-attention, figurative inputs result in reduced attention on source-side tokens. These results suggest that Transformer's tendency to process idioms as compositional expressions contributes to literal translations of idioms.

View on arXivView PDF

Code Implementations(1)

Repository for the analysis of idiom processing in MarianMT Transformer, for models translating English into 1 of 7 European target languages.

62NewLisp, Jupyter NotebookFeb 9, 20214 years ago
attention-mechanismidiomsinterpretabilitymachine-translationtransformer

Similar Papers

Cite this paper

@article{dankers2022transformer,
  title  = {Can Transformer be Too Compositional? Analysing Idiom Processing in Neural Machine Translation},
  author = {Verna Dankers and Christopher G. Lucas and Ivan Titov},
  year   = {2022},
  eprint = {2205.15301},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.15301}
}

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.15301.svg)](https://codeofpaper.com/paper/2205.15301)

Discussion