XYZNOT

Papers · arXiv 1409.0473

Neural Machine Translation by Jointly Learning to Align and Translate

Published cs.CLcs.LGcs.NEstat.ML arXivPDF

Read with translation and AI

Summary in three lines

  1. 🎯 Standard encoder-decoder NMT models compress full source sentences into a fixed-length vector, degrading performance sharply on long sentences.
  2. 🔧 The authors introduce an attention mechanism where a bidirectional RNN encoder produces word annotations, and a decoder calculates soft alignment weights dynamically via an MLP.
  3. 📈 On English-to-French translation, RNNsearch-50 achieves a BLEU score of 28.45 on all test sentences and 36.15 on sentences without unknown words, outperforming phrase-based Moses (35.63).

Abstract

Neural machine translation is a recently proposed approach to machine translation. Unlike the traditional statistical machine translation, the neural machine translation aims at building a single neural network that can be jointly tuned to maximize the translation performance. The models proposed recently for neural machine translation often belong to a family of encoder-decoders and consists of an encoder that encodes a source sentence into a fixed-length vector from which a decoder generates a translation. In this paper, we conjecture that the use of a fixed-length vector is a bottleneck in improving the performance of this basic encoder-decoder architecture, and propose to extend this by allowing a model to automatically (soft-)search for parts of a source sentence that are relevant to predicting a target word, without having to form these parts as a hard segment explicitly. With this new approach, we achieve a translation performance comparable to the existing state-of-the-art phrase-based system on the task of English-to-French translation. Furthermore, qualitative analysis reveals that the (soft-)alignments found by the model agree well with our intuition.

Reading guide

Problem and motivation

Standard neural machine translation (NMT) architectures, such as the basic RNN Encoder–Decoder, compress the entirety of a variable-length source sentence into a single fixed-length vector . From this fixed context vector, the decoder generates the target translation. This creates an informational bottleneck: as sentence length increases, compressing all source semantics into a fixed-size representation becomes increasingly difficult, causing translation quality (BLEU score) to deteriorate significantly for longer sentences.

Key ideas

  • Sequence of Annotations Instead of a Single Vector: Instead of forcing the encoder to compress the entire sentence into one vector, the model preserves a sequence of hidden state vectors (annotations) across the source sentence using a Bidirectional Recurrent Neural Network (BiRNN).
  • Soft Alignment Mechanism (Attention): Rather than treating alignment as a discrete or latent variable requiring heuristic extraction, the decoder calculates a continuous "soft alignment" weight over the source annotations at each output step.
  • Differentiable End-to-End Training: Because the alignment is parameterized as a small feedforward neural network, the entire system—encoder, attention mechanism, and decoder—is trained jointly via backpropagation.

Method

1. Encoder (Bidirectional RNN)

The source sequence is processed by a forward RNN and a backward RNN using gated hidden units: The annotation for source word concatenates both directions:

2. Decoder with Soft Attention

To generate target word , the decoder calculates a distinct context vector as a weighted sum of encoder annotations: where the alignment weight is computed using a softmax over energy scores : The energy score represents how well decoder state aligns with source annotation and is parameterized as a single-layer feedforward network: Here is the decoder hidden state, updated via: The next-word probability distribution is conditioned on the current state, previous token, and the dynamic context:

Results

On the WMT '14 English-to-French benchmark (news-test-2014, 3,003 sentences):

  • Robustness to Length: While the basic encoder-decoder (RNNencdec-50) suffers a severe BLEU drop as sentence length exceeds 30 words, RNNsearch-50 maintains consistent BLEU scores even beyond 50 words.
  • Translation Quality:
    • On all test sentences, RNNsearch-50 scores 26.75 BLEU (and 28.45 BLEU when trained longer as RNNsearch-50*), outperforming RNNencdec-50 (17.82 BLEU).
    • On sentences containing no unknown words (No UNK), RNNsearch-50* reaches 36.15 BLEU, outperforming the conventional phrase-based translation baseline Moses (35.63 BLEU), despite Moses using additional monolingual data (418M words).
  • Alignment Visualizations: Heatmaps of reveal intuitive linguistic alignments, handling phrase reorderings (e.g., English noun-adjective order into French adjective-noun order) and multi-word phrases naturally.

Limitations and open questions

  • Computational Complexity: Computing requires evaluations per sentence pair, which is computationally expensive for very long sequences.
  • Handling Rare/Unknown Words: The model relies on a fixed vocabulary (30,000 most frequent words), mapping out-of-vocabulary words to [UNK], which harms performance on open test sets.
  • Monolingual Data Utilization: Unlike phrase-based statistical systems that easily leverage massive target-side monolingual corpora via separate language models, purely end-to-end NMT was limited to parallel data.

Key terms

RNNsearch
The proposed neural machine translation architecture that uses a bidirectional RNN encoder and an attention-based decoder to jointly align and translate.
soft alignment
A continuous probability distribution over source positions computed dynamically by an attention model, as opposed to a discrete or hard 1-to-1 mapping.
context vector
A time-step-specific vector formed as a weighted sum of source annotations, representing the relevant source information needed to generate target word .
bidirectional RNN (BiRNN)
An encoder consisting of forward and backward recurrent passes whose hidden states are concatenated to capture both preceding and following context around each source word.
alignment model
A feedforward neural network parameterized as that scores the relevance between source annotation and decoder hidden state .
RNNencdec
The standard RNN Encoder–Decoder architecture that condenses an entire source sentence into a single fixed-length vector before decoding.
gated hidden unit
A recurrent unit featuring reset and update gates (similar to an LSTM) designed to retain long-term dependencies and mitigate vanishing gradients.

Questions

Why does the standard RNN Encoder-Decoder struggle with long sentences?

It forces all information from a variable-length sentence into a single fixed-length vector, creating an informational bottleneck that fails to preserve fine details for long or complex inputs.

How does Bahdanau attention differ from previous sequence alignment methods like Graves (2013)?

Graves' handwriting synthesis alignment forced attention weights to move monotonically in one direction, whereas Bahdanau attention computes scores across all source positions non-monotonically, allowing flexible word reordering.

How is the computational cost of the alignment model kept manageable?

Since the source transformation term does not depend on the decoder step , it is precomputed once for all source tokens before decoding begins.

What vocabulary size was used in the experiments?

The models used a shortlist of the 30,000 most frequent words for each language; any token outside this shortlist was replaced with a special [UNK] token.

The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.

Read with translation and AI