AI engineering glossary · Transformers LLM architecture
What is decoder?
Decoder: The part of a Transformer that generates output one token at a time, using causal self-attention over what it has produced so far and, in encoder-decoder models, cross-attention to the encoder output. It ends with a layer that converts vectors into next-token probabilities.
Decoder: an example
A translation decoder produces Hindi tokens one by one, each conditioned on earlier Hindi tokens and the English encoding.
Related terms
More Transformers LLM architecture terms
- Decoder-only model
- Decoding
- Dense model
- Diverse beam search
- ELECTRA
- Encoder
- Encoder-decoder model
- Encoder-only model
Where you learn it
Decoder is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.