The two names describe the same idea from two angles. “Sequence-to-sequence”, or seq2seq, describes the task: a sequence goes in and a different sequence comes out, often of a different length. “Encoder-decoder” describes the architecture usually built for it. This page covers both because the terms are used together in the papers and documentation.
Everyday example. A translation tool receives the French sentence “Le chat dort.” The encoder reads the whole sentence and turns it into internal vectors that capture its meaning. The decoder then writes “The cat is sleeping.” one token at a time, looking back at the encoder’s vectors at every step. Summarizing a long email into one line and turning speech audio into a transcript follow the same pattern.
History. In 2014, Sutskever, Vinyals and Le and Cho et al. built seq2seq translators from recurrent neural networks. Early versions squeezed the whole input into one fixed-length vector, which made long sentences hard. The attention mechanism let the decoder look at every encoder position instead. In 2017 the original transformer was itself an encoder-decoder model.
How it compares to today’s chatbots. Most current large language models are decoder-only: they drop the separate encoder and treat the prompt and the answer as one continuous text, generating with an autoregressive model. Encoder-only models such as BERT go the other way and keep only the reading half. Encoder-decoder models remain common in machine translation, speech recognition and some summarization systems.
Why it matters. Knowing which half a model has tells you what it is good for. Encoders are built to understand and represent an input, decoders to generate. Editorial synthesis: when a vendor says it uses “a transformer”, asking whether it is encoder-only, decoder-only or encoder-decoder is a quick way to understand its likely strengths, cost and latency.
Sources
- Sutskever, Vinyals and Le: Sequence to Sequence Learning with Neural Networks — 2014 paper that used one LSTM to map an input sentence to a fixed vector and a second LSTM to decode the output, applied to English-French translation; checked October 24, 2026
- Cho et al.: Learning Phrase Representations using RNN Encoder-Decoder — 2014 paper that named the RNN Encoder-Decoder, with one network encoding a sequence and another decoding it; checked October 24, 2026
- Vaswani et al.: Attention Is All You Need — 2017 paper that introduced the transformer as an encoder-decoder model built on attention; checked October 24, 2026
- Hugging Face Transformers documentation: Encoder Decoder Models — Library documentation describing a sequence-to-sequence model assembled from a pretrained encoder and a pretrained autoregressive decoder; checked October 24, 2026