# Seq2Seq: Encoder-decoder learning for variable-length sequences

> Seq2Seq uses one deep LSTM to encode a variable-length input and another to generate output. Reversing source sentences improves optimization, reaching 34.8 BLEU on WMT14 English-French.

- URL: https://dmxsf.com/en/blog/sequence-to-sequence-learning-with-neural-networks/
- [DMXSF](https://dmxsf.com/en/about/)
- Published: 2014-09-20
- Updated: 2026-11-13
- Paper notes
- Paper: [Sequence to Sequence Learning with Neural Networks](https://arxiv.org/abs/1409.3215) (Ilya Sutskever, Oriol Vinyals, Quoc V. Le · NeurIPS 2014, 2014)

Seq2Seq established one neural framework for inputs and outputs of different lengths. The encoder summarizes the source in a fixed vector and the decoder emits tokens conditionally.

## How it works

Deep LSTMs maximize target-sequence likelihood and decode with beam search. Reversing the English source shortens early source-target dependencies without reversing the target.

## What the evidence shows

The paper reports 34.8 BLEU on WMT14 English-French and meaningful sentence representations. The fixed vector becomes a long-sentence bottleneck, later addressed by attention over encoder states.

## A reproducible check

This snippet checks a public formula or configuration; it does not reproduce full training.

```python
source = "ABC"
target = "WXYZ"
print("reversed source =", source[::-1])
print("target unchanged =", target)
print("reported BLEU =", 34.8)
```

```text
reversed source = CBA
target unchanged = WXYZ
reported BLEU = 34.8
```

The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.

## Limitations and common misreadings

The score depends on data, vocabulary and beam settings. Source reversal is an optimization trick rather than a universal requirement.

## The key takeaway

Seq2Seq established encoder-decoder learning, and its information bottleneck directly motivated attention.

## Further reading

- [Sequence to Sequence Learning with Neural Networks](https://arxiv.org/abs/1409.3215)
- [Attention Is All You Need](https://dmxsf.com/en/blog/attention-is-all-you-need/)
- [T5](https://dmxsf.com/en/blog/t5-exploring-the-limits-of-transfer-learning/)

## FAQ

### What are its two components?

An encoder reads the source into a representation and a decoder generates the target.

### Why reverse the source?

It shortens early corresponding-word dependencies and improves optimization in the experiments.

### What is its main bottleneck?

The fixed vector must retain the entire input, especially difficult for long sentences.
