Why Self-Attention? A Targeted Evaluation of Neural Machine Translation Architectures

Gongbo Tang, Mathias Müller, Annette Rios, Rico Sennrich
8/27/2018
cs.CL
transformer-attention

Official code: awslabs/sockeye (1,214 stars, Python, Apache-2.0, PyTorch, last commit 2024-10-24).

Abstract

Recently, non-recurrent architectures (convolutional, self-attentional) have outperformed RNNs in neural machine translation. CNNs and self-attentional networks can connect distant words via shorter network paths than RNNs, and it has been speculated that this improves their ability to model long-range dependencies.

Show full abstract

However, this theoretical argument has not been tested empirically, nor have alternative explanations for their strong performance been explored in-depth. We hypothesize that the strong performance of CNNs and self-attentional networks could also be due to their ability to extract semantic features from the source text, and we evaluate RNNs, CNNs and self-attention networks on two tasks: subject-verb agreement (where capturing long-range dependencies is required) and word sense disambiguation (where semantic feature extraction is required). Our experimental results show that: 1) self-attentional networks and CNNs do not outperform RNNs in modeling subject-verb agreement over long distances; 2) self-attentional networks perform distinctly better than RNNs and CNNs on word sense disambiguation.

View on arXivView PDF

Code Implementations(1)

awslabs/sockeyeOfficial100%
PyTorchApache-2.0

Sequence-to-sequence framework with a focus on Neural Machine Translation based on PyTorch

1,214319Python, JavaScriptJun 8, 20172 years agoApache-2.0
attention-is-all-you-needattention-mechanismattention-modeldeep-learningdeep-neural-networks+13 more

Similar Papers

Cite this paper

@article{tang2018selfattention,
  title  = {Why Self-Attention? A Targeted Evaluation of Neural Machine Translation Architectures},
  author = {Gongbo Tang and Mathias Müller and Annette Rios and Rico Sennrich},
  year   = {2018},
  eprint = {1808.08946},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1808.08946}
}

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

Discussion