ElemedexA pocket encyclopedia of AI architectures
No. 022

Seq2seq

Sequence-to-sequence learning (encoder–decoder RNN)

Thought Vector

It swallows the whole sentence and keeps it in a single vector, like someone memorizing a very long phone number without writing it down. Then it gives it back in another language, word by word. It prefers to read backwards: it says that way it better remembers how things began.

Height
4 + 4 LSTM layers (encoder + decoder)
Weight
≈ 1.5 GB (fp32)
Parameters
384 M (≈ 240 M in embeddings)
Context
One sentence, squeezed into 8,000 numbers
Training data
WMT'14 EN→FR: 12 M sentence pairs (304 M + 348 M words)
Year
2014
Generation
3 · Deep learning
Creators
Sutskever, Vinyals & Le (Google); in parallel, Cho, Bahdanau, Bengio et al. (Université de Montréal)
Kind
Architecture

Base stats

Total
186

Approximate, ordinal scales meant for comparing species with each other; the hard numbers are in the data sheet.

Weaknesses

  • Everything has to fit into a fixed-size vector, whether the sentence is short or long.
  • Closed vocabulary: any word outside the list becomes UNK.
  • It processes word by word: it cannot be parallelized along the sentence.
  • It does not show which part of the source it used to produce each word of the translation.

Habitat

It grew up on the parallel corpora of the WMT'14 collection (parliamentary proceedings, UN documents, translated news), inside one of Google's eight-GPU machines. Today it is rarely seen in its pure form: its encoder–decoder scheme survives in machine translation systems and in transformers such as T5.

Moves

Abilities

Thought vector
The encoder's final state (8,000 numbers in Google's model) is the only bridge between the source sentence and the translation.
Free lengths
Input and output may differ in length and order: the decoder decides when to stop by emitting an end-of-sentence symbol.
Reading backwards
Reversing the input sentence brings its beginning close to the beginning of the translation and makes training much easier.

Anatomy

Seq2seq as in Sutskever et al. (2014): a four-layer LSTM reads the reversed source and leaves its final state as the only summary; another LSTM starts from that state and generates the translation word by word, receiving at each step the word it has just emitted.

Evolution chain

  • two LSTMs: one reads, one writes015 LSTM
022 Seq2seq

Seq2seq (sequence to sequence) is an architecture for turning one sequence into another of a different length: a recurrent network, the encoder, reads the input sentence word by word and summarizes it in a single vector; a second network, the decoder, unfolds that vector into the output sentence. It was proposed almost simultaneously in 2014 by Sutskever, Vinyals and Le at Google (Sutskever et al., 2014) and by Cho and Bengio's group in Montreal, who called it the RNN Encoder–Decoder (Cho et al., 2014). Its proving ground was machine translation.

How it works

The encoder is an LSTM that consumes one token per step and keeps rewriting its hidden state; at the end, that state is a composite reflecting which words occurred and in what order (Buckner, 2024, pp. 269–270). The decoder is another LSTM that works as a conditioned language model: it starts from the encoder's vector, emits a word, receives it as input at the next step, and goes on until it produces the end symbol <EOS> (Sutskever et al., 2014, sec. 2; Alammar & Grootendorst, 2024, pp. 11–12). In probabilistic notation: p(y₁…y_T′ | x₁…x_T) = ∏ₜ p(yₜ | v, y₁…yₜ₋₁), where v is the vector left by the encoder. The translation is chosen with beam search; a beam of size 2 already delivered most of the benefit (Sutskever et al., 2014, sec. 3.2).

Google's model had four layers of 1,000 cells on each side, 1,000-dimensional embeddings, and vocabularies of 160,000 words (English) and 80,000 (French). Of its 384 million parameters, only 64 million were recurrent connections: most of the rest were the embedding tables and the output softmax layer. The whole input sentence was squeezed into 8,000 numbers (Sutskever et al., 2014, sec. 3.4). It was trained on 12 million sentence pairs from the WMT'14 English–French corpus, for about ten days, on a machine with eight GPUs (Sutskever et al., 2014, secs. 3.1 and 3.5).

One trick proved decisive: reading the source backwards. Reversing the order of the input words lowered perplexity from 5.8 to 4.7 and raised BLEU from 25.9 to 30.6. The authors conjecture that this puts the first source words close to the first words of the translation, shortening the dependencies that backpropagation has to traverse, though they admit they lack a complete explanation (Sutskever et al., 2014, sec. 3.3).

What changed

A single LSTM can map sequences to sequences easily when it is known in advance which output corresponds to which input; translation offers no such luxury, since lengths differ and word order changes (Sutskever et al., 2014, sec. 2). Seq2seq solves this by separating reading from writing. Until then, neural networks entered translation mostly as auxiliary parts of statistical phrase-table systems (Bahdanau et al., 2015, sec. 6.2); seq2seq translated end to end. An ensemble of five LSTMs scored 34.8 BLEU against 33.3 for the statistical baseline, and when used to rescore that system's 1,000 best hypotheses it reached 36.5, half a point from the best published result (Sutskever et al., 2014, sec. 3.6). In 2016, Google Translate, which had run on statistical translation since 2006, switched to a neural encoder–decoder system (M. Mitchell, 2019, ch. 12; Mollick, 2026).

The recipe, moreover, knew nothing about languages: the authors predicted that it would work for any sequence-to-sequence task with enough data (Sutskever et al., 2014, sec. 5).

Limits

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Bahdanau, D., Cho, K., & Bengio, Y. (2015). Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations (ICLR 2015). https://doi.org/10.48550/arXiv.1409.0473 §
  • Buckner, C. J. (2024). From deep learning to rational machines: What the history of philosophy can teach us about the future of artificial intelligence. Oxford University Press. https://doi.org/10.1093/oso/9780197653302.001.0001 §
  • Cho, K., van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder–decoder for statistical machine translation. In A. Moschitti, B. Pang, & W. Daelemans (Eds.), Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 1724–1734). Association for Computational Linguistics. https://doi.org/10.3115/v1/D14-1179 §
  • Fodor, J. A., & Pylyshyn, Z. W. (1988). Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1–2), 3–71. https://doi.org/10.1016/0010-0277(88)90031-5 §
  • Mitchell, M. (2019). Artificial intelligence: A guide for thinking humans. Pelican Books. §
  • Mollick, E. (2026). Built for something else: Sources and notes [Sources companion to the video "Built for something else: How a chain of accidents built ChatGPT"; written by Claude Opus 5.5, supervised by E. Mollick]. Retrieved September 30, 2026, from https://built-for-something-else.netlify.app/ §
  • Sutskever, I., Vinyals, O., & Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems (Vol. 27). Curran Associates. https://proceedings.neurips.cc/paper_files/paper/2014/hash/5a18e133cbf9f257297f410bb7eca942-Abstract.html §
  • Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., & Polosukhin, I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems (Vol. 30). Curran Associates. https://proceedings.neurips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html §