# Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation

RNN Encoder-Decoder maps phrases of any length for machine translation

Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk and 1 more · arXiv · 2014-6-3

- **Problem** Fixed-size neural phrase scorers for machine translation could not handle phrases of varying length. They padded short phrases with zeros and could not hold long ones.
- **Method** The RNN Encoder-Decoder encodes a source phrase into one fixed vector, then decodes that vector into a target phrase. Instead of a fixed window, both sides can have any length.
- **Results** Adding its phrase-pair scores to a Moses system raised test BLEU from 33.30 to 33.87. Combining them with the CSLM gave the highest test BLEU, 34.64.

## Why fixed-size phrase scorers fall short

Neural networks already help statistical machine translation, often by rescoring n-best lists or by scoring phrase pairs. Schwenk's feedforward phrase scorer took fixed-size inputs, seven words each, padded with zeros when a phrase was shorter. That design works only while the maximum phrase length stays small. Devlin et al. predicted one target word at a time, but they still had to fix the input length in advance.

The gap matters because phrases vary in length on both the source and the target side, so a fixed window either pads short phrases or cannot hold long ones. The authors instead build a model that maps a source sequence of any length to a vector and decodes that vector into a target sequence of any length.

## Encoder–decoder and the gated hidden unit

The core idea is to chain two RNNs: one reads the source phrase into a single vector, and the other writes the target phrase out of that vector. The encoder updates its hidden state at each symbol, and the final state serves as a summary c of the whole input. The decoder starts from c and from the previous target symbol, so each next-symbol probability depends on both.

Training maximizes the average conditional log-likelihood of target phrases given their source phrases, which is differentiable and so works with gradient-based updates. Once trained, the model can either generate a target sequence or score a given pair through \\( p\_\\theta(y \\mid x) \\).

The hidden unit is a simplified gated cell, inspired by the LSTM but with two gates instead of a memory cell and four gating units. The reset gate is a sigmoid of the current input and the previous state, and it scales the previous state before a candidate state is computed. The candidate uses \\( \\tilde h\_j^{\\langle t\\rangle} = \\phi(\[Wx\]\_j + \[U(r \\odot h^{\\langle t-1\\rangle})\]\_j) \\), and the paper uses tanh as this activation.

When the reset gate is close to 0, the state ignores the past and restarts from the current input. The new state interpolates between the old state and the candidate, \\( h\_j^{\\langle t\\rangle} = z\_j h\_j^{\\langle t-1\\rangle} + (1-z\_j)\\tilde h\_j^{\\langle t\\rangle} \\), with the update gate \\( z\_j \\) setting the mix. So the update gate decides how much old information carries forward, which helps the unit keep long-term information.

Units whose reset gates are often active tend to capture short-term dependencies, while units with mostly active update gates capture longer ones. In preliminary experiments the authors found that a tanh unit without gating gave no meaningful results, so they judged gating crucial.

## Adding the scores to the SMT system

The SMT decoder seeks the translation that maximizes a log-linear combination of features, and the weights are tuned to maximize BLEU on a development set. The phrase translation probabilities are already features in that model, and the RNN score is one more feature of the same kind. Training uses phrase pairs from the phrase table, and the normalized frequencies of the pairs are ignored.

Ignoring frequency keeps sampling cheap and stops the model from just learning how often each pair occurs. The existing table probability already reflects those frequencies, so the network's capacity goes to plausibility of translations.

The encoder and decoder used 1000 hidden units, and the vocabulary was limited to the 15,000 most frequent words in each language, covering about 93% of the data. After training, the authors add one new score per phrase pair to the table, which lets the existing tuning run with little extra cost.

## Translation gains from the RNN and CSLM scores

The Moses baseline scored 30.64 BLEU on development and 33.30 on test. Adding the RNN phrase scores alone raised test BLEU to 33.87. Neural features in general improved on the baseline in the configurations tested.

Combining the CSLM with the RNN scores gave the highest test BLEU, 34.64, compared to 33.30 for the baseline. The authors read this as a sign that the CSLM and RNN contributions are not strongly correlated, so each can be improved on its own. Adding the word penalty moved development BLEU from 31.48 to 31.50 but test BLEU from 34.64 to 34.54.

The CSLM was trained on 7-grams from the target corpus and reached a validation perplexity of 45.80. It scored partial translations during decoding, buffering n-grams so that scoring ran as matrix multiplications on GPU. All these numbers come from newstest2014, which has a single reference translation.

## Phrase scores compared with the translation model

The authors took long source phrases, both frequent and rare, and compared the top target phrases chosen by each scorer. The translation model relies only on corpus statistics, so it was expected to be weaker on rare phrases. In most cases the RNN's choices were closer to literal translations, and the RNN tended to prefer shorter phrases.

Many phrase pairs received similar scores from both scorers, while many others were scored very differently. The authors suggest the divergence may come from training on a set of unique phrase pairs, which discourages the model from learning raw frequencies, but this is offered as a possible cause.

For each source phrase the authors drew 50 samples from the RNN and ranked the top five by RNN score. The samples were well-formed target phrases produced without consulting the phrase table, and they did not fully overlap with the table's targets. The authors see this as a reason to study replacing part of the phrase table with the model.

## What the learned representations look like

The authors projected the learned word embeddings to two dimensions with Barnes-Hut-SNE, and semantically similar words clustered together. The phrase representation c is a 1000-dimensional vector, and phrases of four or more words were projected the same way.

In one bottom-left cluster most phrases concern the duration of time, while syntactically similar phrases grouped together. A bottom-right cluster groups phrases that are semantically similar, such as countries or regions, and the top-right plot shows syntactically similar phrases. The authors conclude that the model captures both semantic and syntactic structure, but the evidence here is a two-dimensional visualization.

## Limitations

Only rescoring of existing phrase pairs was studied, because replacing the phrase table would need an expensive repeated sampling procedure. The word penalty helped only on the development set, and the authors could not achieve better test performance with it. The frequency explanation for the divergence from the translation model is a hypothesis that this paper leaves open.

## Paper info

- **Authors**: Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, Yoshua Bengio
- **Venue**: arXiv · Preprint
- **First published**: 2014-6-3
- **Added**: 2026-11-11
- **Updated**: 2014-9-3
- **Version**: v3
- **arXiv**: 1406.1078
- **Category**: cs.CL · cs.LG · cs.NE · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1406.1078v3) · [PDF ↗](https://arxiv.org/pdf/1406.1078v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, Yoshua Bengio (2014). Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. arXiv:1406.1078v3. https://arxiv.org/abs/1406.1078v3

**BibTeX**

```
@misc{cho2014learning,
  title = {{Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation}},
  author = {Kyunghyun Cho and Bart van Merrienboer and Caglar Gulcehre and Dzmitry Bahdanau and Fethi Bougares and Holger Schwenk and Yoshua Bengio},
  year = {2014},
  eprint = {1406.1078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1406.1078v3}
}
```

## Other paper commentary

- [Effective Approaches to Attention-based Neural Machine Translation](https://refivu.com/en/papers/58ab56a7-1cd5-4c5e-be62-69ff9c1387c7-effective-approaches-to-attention-based-neural-machine.md)
- [Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions](https://refivu.com/en/papers/596b5353-6c04-4ada-a92e-25d0fee13147-natural-tts-synthesis-by-conditioning-wavenet-on-mel.md)
- [Universal Language Model Fine-tuning for Text Classification](https://refivu.com/en/papers/f2470a4a-1c9b-423c-8757-ba73cfe37b54-universal-language-model-fine-tuning-for-text-classification.md)
- [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://refivu.com/en/papers/13b055d5-7dcd-422f-b6d8-3704e3d48533-bart-denoising-sequence-to-sequence-pre-training-for.md)
- [Prefix-Tuning: Optimizing Continuous Prompts for Generation](https://refivu.com/en/papers/01cf041e-b71c-444b-8b44-e94ac976a9db-prefix-tuning-optimizing-continuous-prompts-for-generation.md)
- [Neural Machine Translation of Rare Words with Subword Units](https://refivu.com/en/papers/0950e659-f6cc-4852-b244-bbb2742bf059-neural-machine-translation-of-rare-words-with-subword.md)
- [A Unified Approach to Interpreting Model Predictions](https://refivu.com/en/papers/f0be20fa-d9a3-4802-80ea-831a1c564ae5-a-unified-approach-to-interpreting-model-predictions.md)
- [MobileNetV2: Inverted Residuals and Linear Bottlenecks](https://refivu.com/en/papers/db077330-ba7d-43fd-b0bb-608efe9dd258-mobilenetv2-inverted-residuals-and-linear-bottlenecks.md)
- [YOLOv3: An Incremental Improvement](https://refivu.com/en/papers/76557c51-abac-40af-bba3-56bb8d77246c-yolov3-an-incremental-improvement.md)
- [XGBoost: A Scalable Tree Boosting System](https://refivu.com/en/papers/e3112070-6898-4fad-83b9-27d6d96c62be-xgboost-a-scalable-tree-boosting-system.md)
- [DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs](https://refivu.com/en/papers/e76226cf-6d58-4173-918d-455579e5374d-deeplab-semantic-image-segmentation-with-deep-convolutional.md)
- [Rich feature hierarchies for accurate object detection and semantic segmentation](https://refivu.com/en/papers/0abb1ab7-a65a-475d-b57e-af628d8620f3-rich-feature-hierarchies-for-accurate-object-detection-and.md)

## Terms in this paper

- [Stochastic Gradient Descent](https://refivu.com/en/terms/a49650824022-stochastic-gradient-descent)
- [perplexity](https://refivu.com/en/terms/2b204e513801-perplexity)
- [BLEU](https://refivu.com/en/terms/42cd9b97719e-bleu)
- [recurrent neural network](https://refivu.com/en/terms/7df8352fc823-recurrent-neural-network)
- [newstest2014](https://refivu.com/en/terms/4ef4de9dc349-newstest2014)
- [LSTM unit](https://refivu.com/en/terms/ee4ad58f26b2-lstm-unit)
- [Moses](https://refivu.com/en/terms/7ec6fd928e49-moses)
- [log-linear model](https://refivu.com/en/terms/1e7a9293356f-log-linear-model)
- [reset gate](https://refivu.com/en/terms/a38201955cc7-reset-gate)
- [RNN Encoder–Decoder](https://refivu.com/en/terms/4bffe8986de0-rnn-encoder-decoder)
- [statistical machine translation](https://refivu.com/en/terms/1fb227f4cdce-statistical-machine-translation)
- [update gate](https://refivu.com/en/terms/8ab89d2d28b8-update-gate)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/a52e355d-5c49-4353-8d39-5013e656760c-learning-phrase-representations-using-rnn-encoder-decoder)
