AI & LLMs

Encoder-Decoder

also: seq2seq

An architecture that reads an input sequence into a representation (encoder) then generates an output from it (decoder).

An encoder-decoder model has two halves: the encoder maps an input sequence to a rich internal representation, and the decoder generates an output sequence from it — the classic design for translation and summarization (the original Transformer, T5).

Worked example: in translation the encoder reads the whole source sentence bidirectionally, then the decoder produces the target one token at a time, attending to the encoder’s output. Gotcha: most modern chat LLMs are decoder-ONLY (GPT-style) — they drop the separate encoder and just continue the sequence — so encoder-decoder is one family, not the only shape a transformer takes.