Jargonautica
Language Models Specifically

Encoder, Decoder and Encoder-Decoder

Also called: Encoder, Decoder, Encoder-Decoder

Three arrangements of the transformer, suited to different jobs. An encoder reads a whole passage at once and produces a representation of it, which suits classification and search. A decoder generates text one token at a time and can only see what came before, which suits writing. An encoder-decoder reads one thing and writes another, which suits translation. Nearly all the models people talk about today are decoders.

Technical view

Encoder-only models such as BERT use bidirectional attention and masked language modelling, and remain the workhorse for embeddings, retrieval and classification, where they are far cheaper than a generative model. Decoder-only models use causal masking so each position attends only to earlier ones, and dominate general-purpose generation. Encoder-decoder models such as T5 keep cross-attention from decoder to encoder and stay competitive on tightly defined sequence-to-sequence tasks.


Part of AI Terminology Index, section: Language Models Specifically.

How it connects

Encoder, Decoder and Encoder-Decoder links to 8 other terms. The faint lines are links between those terms. See it in the full graph.

TransformerTransformerEmbeddingsEmbeddingsAttentionAttentionPositional EncodingPositional EncodingLarge Language ModelLarge Language ModelSemantic SearchSemantic SearchMasked Language ModellingMasked Language Mod…Machine TranslationMachine TranslationEncoder, Decoder and Encoder-Decoder