{
  "id": "transformer",
  "code": "PTL-0268",
  "term": "Transformer",
  "aliases": [
    "Transformer architecture",
    "transformer model",
    "decoder-only transformer"
  ],
  "category": "foundations",
  "definition": "The Transformer is a neural network architecture that processes sequences with self-attention, letting every position draw information directly from every other position instead of through recurrence or convolution. Most large language models are built on it.",
  "description": "Vaswani et al. introduced the Transformer in 2017 as an encoder-decoder model for machine translation, built from stacked layers of multi-head self-attention and position-wise feed-forward networks, with residual connections, layer normalization and positional encodings to represent token order. Because attention over a whole sequence can be computed in parallel, it trains much faster than recurrent networks. The authors reported 28.4 BLEU on WMT 2014 English-to-German and a single-model 41.8 BLEU on English-to-French after training for 3.5 days on eight GPUs. Most large language models use a decoder-only variant trained to predict the next token. The cost of standard self-attention grows quadratically with sequence length, which has motivated variants such as sliding window, grouped-query and multi-head latent attention, and kernels such as FlashAttention.",
  "example": null,
  "broader": [],
  "narrower": [
    "sliding-window-attention",
    "multi-head-latent-attention",
    "looped-transformer"
  ],
  "related": [
    "large-language-model",
    "token",
    "context-window",
    "kv-cache",
    "rotary-position-embedding",
    "grouped-query-attention",
    "flashattention",
    "mixture-of-experts"
  ],
  "introduced": 2017,
  "added": "2026-11-27",
  "sources": [
    {
      "title": "Attention Is All You Need",
      "authors": "Vaswani et al.",
      "year": 2017,
      "url": "https://arxiv.org/abs/1706.03762"
    }
  ],
  "url": "https://protologue.com/t/transformer/",
  "citation": "Protologue. (2026). Transformer. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.9.1, PTL-0268). https://protologue.com/t/transformer/"
}