LinkedIn analytics tracking pixel for AIDOLS AI consulting website performance measurement
Models

Encoder-Decoder

An encoder-decoder model is a neural architecture with two stacks: an encoder that compresses input into a representation and a decoder that generates output from it, with cross-attention linking the two.

Full definition

Encoder-decoder transformers (T5, BART, the original 2017 transformer) excel at sequence-to-sequence tasks where input and output have different shapes — translation, summarization, structured extraction. Encoder-only models (BERT) are best for classification and embedding. Decoder-only models (GPT, Llama) are best for open-ended generation. The choice of stack determines latency, training objective, and the kind of fine-tuning that works.

Why it matters

Vendor pitches often blur architectural details. Knowing whether a model is encoder-only, decoder-only, or encoder-decoder tells procurement which workloads it suits — encoder-decoder for translation pipelines, decoder-only for chat, encoder-only for retrieval embeddings.

Example

Google T5 is an encoder-decoder transformer that frames every NLP task as text-to-text — translation, classification, summarization all use the same model with different prompts.

Source & further reading

Primary source: Raffel et al. — "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer" (JMLR) (2020).

Citation policy: this entry is part of the AIDOLS AI Implementation Glossary and may be quoted for research, journalism, and education with attribution to aidolsgroup.com/nl/glossary/encoder-decoder/.