Decoder
Part of the Transformer that generates text one token at a time. The heart of all modern LLM.
How it Generates
flowchart LR
A[Start] --> B[Predict Token]
B --> C[Add to Text]
C --> B
The decoder predicts the next token, adds it, and repeats until it generates a stop token. This is why models like GPT are called decoder-only: they do not have an encoder.
Why LLMs are Decoder-Only
Text generation only requires predicting the next token. An encoder is not needed for this, and its absence simplifies the architecture and speeds up inference.