Home Knowledge Base Decoder-Only Transformer

Decoder-Only Transformer is the dominant architecture for large language models that processes input sequences left-to-right using causal (autoregressive) masking — generating tokens one at a time where each token can only attend to previous tokens in the sequence, unifying both "understanding" (processing the input prefix) and "generation" (producing new tokens) in a single model stack, as used by GPT-4, Claude, LLaMA, Gemini, and virtually all modern LLMs.

What Is a Decoder-Only Transformer?

Why Decoder-Only Dominates

Decoder-Only vs. Encoder-Decoder

AspectDecoder-Only (GPT)Encoder-Decoder (T5)
AttentionCausal (left-to-right)Bidirectional (encoder) + Causal (decoder)
Input ProcessingUnidirectionalBidirectional (full context)
Training ObjectiveNext-token predictionSpan corruption / seq2seq
GenerationContinue from prefixDecode from encoder output
ScalingProven to 1T+ parametersLess explored at extreme scale
InferenceKV cache for efficiencyCross-attention adds complexity
Dominant ModelsGPT-4, Claude, LLaMA, GeminiT5, BART, mBART

Decoder-only transformers are the architecture powering the current generation of large language models — using causal masking and autoregressive generation to unify language understanding and generation in a single model that scales predictably to hundreds of billions of parameters, establishing the dominant paradigm for AI systems from chatbots to code generation to reasoning.

decoder onlycausalautoregressive

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.