Skip to content
Road to Intelligence

Concept · Chapter 6: Language Before Transformers

Sequence-to-Sequence Models

Must knowKnow well15 minDifficulty

A sequence-to-sequence model uses an encoder to read one sequence and a decoder to produce another, possibly of a different length.

The problem

Translation, summarization and similar tasks need an output sequence whose length need not match the input.

The solution

An encoder turns the source sequence into a representation, and a decoder generates the target one step at a time.

The consequence

The encoder-decoder pattern generalizes beyond next-word prediction, but early versions forced all source information through one fixed-size vector.

Read first, then write

For translation, an encoder reads "the blue house" and a decoder writes "la maison bleue". The source and target have different word order and may have different lengths. The decoder uses its own previous output and the encoder's representation to decide what comes next.

Cho and colleagues' 2014 RNN encoder-decoder and Sutskever and colleagues' sequence-to-sequence LSTMs established influential versions of this pattern. The latter reversed source sentences during training, which shortened some input-output dependency paths. Both early approaches relied on a single fixed-size source representation passed to the decoder.

That architecture is more flexible than one classifier with a fixed-size output, but it creates the next problem: where does the detail of a long input go?

What to remember

  • The encoder reads the source; the decoder writes the target. Their lengths can differ.
  • Early RNN encoder-decoders passed a single final vector between the two halves.

Key papers

Essential

Sequence to Sequence Learning with Neural Networks

Ilya Sutskever, Oriol Vinyals, Quoc V. Le · 2014 · NeurIPS 2014

Established the encoder–decoder pattern: read an input sequence into a vector, then generate an output sequence from it. Its central weakness motivated attention.

How to read it: Notice the trick of reversing the source sentence — a hint that long-range dependencies were the real problem.

~45 min readarXiv:1409.3215✓ verified 2026-09-26