Concept
Decoder
Transformer half that generates output tokens autoregressively, attending to prior context.
Definition
A decoder uses causal self-attention to prevent each position from peeking at future tokens, making it suitable for generation. In encoder-decoder models it also cross-attends to the encoder's output. Most chat LLMs are pure decoder stacks (decoder-only architecture).
Common use cases
- Text generation
- Translation target side
- Image captioning