Skip to main content
QUICK REVIEW

[Paper Review] Why Self-Attention? A Targeted Evaluation of Neural Machine Translation Architectures

Gongbo Tang, Matthias Müller|arXiv (Cornell University)|Aug 27, 2018
Topic ModelingComputer Science19 references36 citations
TL;DR

This paper evaluates RNNs, CNNs, and Transformers in neural machine translation by testing their ability to model long-range dependencies (via subject-verb agreement) and extract semantic features (via word sense disambiguation). Results show no empirical advantage for Transformers or CNNs over RNNs in long-distance dependency modeling, but Transformers significantly outperform others in semantic feature extraction, indicating their strength lies in semantics rather than shorter path lengths.

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

Motivation & Objective

  • To empirically test the theoretical claim that shorter network paths in CNNs and Transformers improve long-range dependency modeling compared to RNNs.
  • To investigate whether the superior performance of non-recurrent models in NMT is due to better semantic feature extraction rather than path length.
  • To evaluate the impact of multi-head attention on modeling long-distance phenomena in Transformers.
  • To compare the performance of RNNs, CNNs, and Transformers on two contrastive NLP tasks: subject-verb agreement and word sense disambiguation.
  • To isolate architectural effects by minimizing differences across models using shared configurations.

Proposed method

  • The study uses contrastive test sets: Lingual97 for subject-verb agreement and ContraWSD for word sense disambiguation.
  • Models are trained and evaluated on subject-verb agreement over increasing distances to assess long-range dependency modeling.
  • Word sense disambiguation is evaluated using accuracy on the ContraWSD dataset to measure semantic feature extraction capability.
  • Recurrent, convolutional, and self-attentional models are retrained with identical configurations (6-layer encoders/decoders, multi-head attention, layer normalization) to minimize architectural differences.
  • The impact of the number of attention heads in Transformers is analyzed by varying head count in ablation studies.
  • BLEU scores, perplexity, and task-specific accuracies are reported to compare model performance across architectures.

Experimental results

Research questions

  • RQ1Do Transformers and CNNs outperform RNNs in modeling long-range dependencies, as suggested by shorter path length theory?
  • RQ2Is the strong performance of Transformers in NMT due to superior semantic feature extraction rather than path length advantages?
  • RQ3How does the number of attention heads in multi-head attention affect a Transformer’s ability to model long-distance dependencies?
  • RQ4Do architectural components like multi-head attention and residual connections explain part of the performance gap in word sense disambiguation?
  • RQ5Can minimizing architectural differences reveal the true strengths and weaknesses of RNNs, CNNs, and Transformers?

Key findings

  • Transformers and CNNs do not outperform RNNs in subject-verb agreement over long distances, contradicting the theoretical path-length hypothesis.
  • The retrained RNN model achieved 96.9% accuracy on long-distance subject-verb agreement, outperforming both CNN and Transformer models in the same setup.
  • Transformers significantly outperform RNNs and CNNs on word sense disambiguation, achieving the highest accuracy on the ContraWSD benchmark.
  • The number of attention heads in multi-head attention is critical for modeling long-distance dependencies; insufficient heads impair performance.
  • Architectural components like multi-head attention, layer normalization, and feed-forward scaling contribute to the WSD performance gap, but even with minimal differences, Transformers still outperform others.
  • The study concludes that BLEU scores alone are insufficient to understand architectural strengths, and that trade-offs between dependency modeling and semantic feature extraction must be considered.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.