Self-Attentive Residual Decoder for Neural Machine Translation

Lesly Miculicich Werlen, Nikolaos Pappas, Dhananjay Ram, Andrei Popescu-Belis · DOI

TL;DR

This paper introduces a Self-Attentive Residual Decoder for Neural Machine Translation (NMT) that overcomes the "recency bias" of standard RNN decoders. By using a self-attention mechanism over all previously translated word embeddings, the model creates a dynamic "summary vector" that acts as a long-range residual connection, significantly improving translation quality and capturing latent syntactic structures.

What Problem Does This Paper Address?

Standard NMT architectures (like the Bahdanau-style encoder-decoder) are excellent at attending to the source sentence. However, their target-side context is often a bottleneck.

In a typical RNN decoder, the information about what has already been translated is compressed into a fixed-length hidden state. This leads to two main issues:

  1. Recency Bias: The model tends to over-emphasize the most recently predicted word ($y_{t-1}$) when choosing the next one ($y_t$).
  2. Vanishing Context: It struggles to capture non-sequential dependencies—relationships between words that are far apart in the target sentence.

The authors aim to break this bottleneck by allowing the decoder to "look back" at everything it has written so far, not just the last word.

Methods

The core innovation is the Self-Attentive Residual Connection.

In a standard decoder, the probability of the next word is calculated using the current hidden state ($s_t$), the source context ($c_t$), and the previous word embedding ($y_{t-1}$). The authors propose replacing $y_{t-1}$ with a summary vector $d_t$ that represents the entire decoded history.

Figure 1: Comparison between the decoder of the base- line NMT and the proposed decoder with self-attentive residual connections.

They explored two main ways to calculate this summary $d_t$:

  • Mean Residual Connections: A simple average of all previous word embeddings.
  • Self-Attentive Residual Connections: A weighted average where the weights are determined by a self-attention mechanism.

Crucially, the authors found that attending to word embeddings (the actual words chosen) was more effective than attending to the decoder's hidden states. This makes the connections independent of the recurrent layer's internal representations, facilitating a cleaner flow of information from the distant past.

Datasets

The models were evaluated on three language pairs with varying amounts of training data to test robustness:

  • English-to-Chinese (En-Zh): 0.5M sentence pairs from the UN parallel corpus.
  • Spanish-to-English (Es-En): 2.1M sentence pairs from WMT 2013.
  • English-to-German (En-De): 4.5M sentence pairs from WMT 2016.

Key Insights and Ideas

  • Embeddings > Hidden States: Unlike previous "Memory RNNs" that attend to past hidden states, this model attends to past output embeddings. This avoids overloading the hidden states with the dual task of maintaining recurrence and managing attention simultaneously.
  • Syntactic Discovery: Without any explicit linguistic supervision, the self-attention mechanism learns to group words into "syntactic-like" structures. By applying a simple splitting algorithm to the attention weights, the authors could generate binary parse trees that outperformed trivial baselines.
  • Simplicity Wins: The "Content" scoring function (which only looks at the word embeddings themselves) performed better and generalized more easily than the "Content+Scope" function (which also looked at the current hidden state).
  • Density over Time: When unfolded, this architecture effectively becomes a densely connected residual network, creating direct paths for gradients to flow from the current prediction back to any point in the generated sequence.

Key Results

The proposed model consistently outperformed the NMT baseline and other advanced variants like Memory RNNs across all datasets:

  • En-Zh: Improved BLEU from 22.6 to 24.0 (+1.4).
  • Es-En: Improved BLEU from 25.4 to 26.3 (+0.9).
  • En-De: On Newstest 2014, it achieved 23.2 BLEU, outperforming several context-aware and variational NMT baselines.

Qualitatively, the model showed a much broader distribution of attention compared to Memory RNNs, which almost exclusively focused on the immediate predecessor.

Figure 2: Percentage of words that received maximum attention at a given relative position, ranging from −1 to −50 (maximum length).

Limitations and Future Work

  • Computational Overhead: While the performance gains are significant, the self-attention mechanism adds a small amount of computational complexity that grows with sentence length.
  • Positional Information: The current attention mechanism doesn't explicitly account for the relative distance between words. The authors suggest incorporating relative positional information as a future improvement.
  • Key-Value Structures: They also plan to explore key-value-prediction techniques to further enrich the memory capacity of the decoder.

Summary updated

BibTeX
@inproceedings{werlen2018self,
  author = {Lesly Miculicich Werlen and Nikolaos Pappas and Dhananjay Ram and Andrei Popescu-Belis},
  title = {{Self-Attentive Residual Decoder for Neural Machine Translation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/n18-1124},
}
Figure