Skip to main content
Models

Transformer Architecture (Components)

Transformer architecture is the internal design of a transformer model: a stack of identical blocks, each combining multi-head self-attention, a position-wise feed-forward network, residual connections and layer normalization, arranged as an encoder, a decoder or both. For what the transformer is and why it dominates AI, see Transformer.

AIDOLS Research Team · Editorial standards

Full definition

A transformer block combines multi-head self-attention, a position-wise feed-forward network, residual connections, and layer normalization. Variants include encoder-only (BERT), decoder-only (GPT family, Llama), and encoder-decoder (T5, original 2017 design). Decoder-only autoregressive transformers dominate generative AI in 2024–2025. Scaling laws from Kaplan et al. (2020) and Hoffmann et al. (Chinchilla, 2022) describe how transformer loss decreases predictably with parameters, data, and compute.

Why it matters

Transformers are the substrate of every frontier model — GPT, Claude, Gemini, Llama. Their parallelism is what turned AI training from CPU-bound to GPU-bound, making the trillion-dollar AI capex cycle possible. Understanding the architecture is required to evaluate any vendor model card.

Example

Llama 3 70B is a decoder-only transformer with 80 layers, 64 attention heads, and SwiGLU feed-forward layers — the same template as GPT-2, scaled and refined.

Next steps

More models terms

Source & further reading

Primary source: Vaswani et al. — "Attention Is All You Need" (NeurIPS) (2017).

Citation policy: this entry is part of the AIDOLS AI Implementation Glossary and may be quoted for research, journalism, and education with attribution to aidolsgroup.com/en/glossary/transformer-architecture/.