Skip to main content

A history of Transformers

From attention mechanisms to the Transformer architecture and modern LLMs

The 2017 Transformer did not emerge without predecessors. Its history combines attention mechanisms developed for neural machine translation, self-attention, sequence-to-sequence models, large-scale training, and different objectives across model families. This selective timeline highlights milestones; it is neither exhaustive nor a claim of a single causal path.

Placing LLMs in the AI landscape

This classification helps distinguish the kind of method an LLM belongs to from the problem domain in which it is used. It complements the timeline; it is not a step in a model’s computation.

flowchart TB
  subgraph AI["Artificial intelligence"]
    subgraph ML["Machine learning"]
      subgraph DL["Deep learning<br/>(neural networks)"]
        LLM["LLM"]
      end
    end
  end
  NLP["NLP: a domain of problems<br/>(rules, statistics, models, LLMs…)"]

  • Deep learning denotes a family of methods: neural networks with multiple layers. Current LLMs belong to it.
  • Natural language processing (NLP) denotes a domain of problems: processing or producing language. It is addressed by very different methods — linguistic rules, statistical models, specialized systems, and neural networks. LLMs are a dominant but not exclusive answer: a production system can combine rules, specialized models, document retrieval, tools, and LLMs.
  • The term LLM has no universal numerical threshold: it generally refers to language models trained at large scale, using substantial data and compute. The foundation model concept instead emphasizes reuse: a model serving as a base for many applications. The concepts are related, but they are not synonyms.

Timeline

The architecture families mentioned in these milestones are compared in the Transformer architecture overview.

Dates distinguish submissions, announcements, and releases. Milestones are grouped by research area; chronological order does not imply a single causal chain.

Attention and sequence modelling

  1. arXiv submission Research

    Learned attention for neural machine translation

    Introduces attention that lets the decoder use different source positions rather than relying on a single fixed-length vector.

    No dedicated LLM Lab concept page yet.

    Sources : Neural Machine Translation by Jointly Learning to Align and Translate

    Editorial note : A relevant precursor to Transformer attention, but a different mechanism and architecture.

Transformers and pretraining

  1. arXiv submission Research

    Transformer architecture

    Proposes an attention-based encoder-decoder architecture for sequence transduction, without recurrence or convolution in its central computation.

    Explore the concept : The Transformer in a GPT: architecture and computation · Scaled dot-product attention

    Sources : Attention Is All You Need

    Editorial note : The paper does not claim to invent attention; do not equate the original encoder-decoder Transformer with an autoregressive decoder-only model.

  2. Official announcement Research

    GPT generative pretraining

    Presents an unsupervised generative pretraining approach followed by supervised adaptation, using a Transformer decoder architecture.

    Explore the concept : The Transformer in a GPT: architecture and computation

    Sources : Improving language understanding with unsupervised learning

    Editorial note : This is the official announcement date, not a claim of absolute historical priority.

  3. arXiv submission Research

    BERT pretraining

    Demonstrates bidirectional Transformer encoder pretraining, notably with masked language modelling, followed by task adaptation.

    Explore the concept : Why can the same token have different contextualized representations?

    Sources : BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

    Editorial note : BERT is not an autoregressive generative model; distinguish arXiv submission from conference publication.

Scaling and post-training

  1. Release Model release

    GPT-2 staged checkpoint releases

    GPT-2 checkpoints are released in stages, from 124 million to 1.5 billion parameters.

    No dedicated LLM Lab concept page yet.

    Sources : Language Models are Unsupervised Multitask Learners · GPT-2: 6-Month Follow-Up · GPT-2: 1.5B Release · OpenAI GPT-2 repository and model card

    Editorial note : The 124M and 355M release months conflict across retrospective sources; show month-level precision and disclose the conflict. Use corrected counts 124M/355M/774M/1.5B, not the original erroneous counts.

Transformers and pretraining

  1. Official announcement Research

    GPT-2 research announcement

    Studies text-conditioned generation and zero-shot transfer with an autoregressive model trained on WebText.

    No dedicated LLM Lab concept page yet.

    Sources : Better Language Models and Their Implications · Language Models are Unsupervised Multitask Learners

    Editorial note : An OpenAI technical report, not a peer-reviewed paper; keep zero-shot claims tied to the evaluated tasks and benchmarks.

  2. arXiv submission Research

    T5 and the text-to-text framework

    Unifies many NLP tasks under a text-to-text formulation and systematically studies transfer-learning choices.

    No dedicated LLM Lab concept page yet.

    Sources : Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer

    Editorial note : T5 is an encoder-decoder model; do not place it solely in the GPT decoder-only lineage.

Scaling and post-training

  1. arXiv submission Research

    Empirical scaling laws

    Quantifies empirical relationships between loss, model size, data and training compute.

    No dedicated LLM Lab concept page yet.

    Sources : Scaling Laws for Neural Language Models

    Editorial note : Empirical findings whose practical implications were refined by later work; do not present them as universal laws.

  2. arXiv submission Research

    Retrieval-Augmented Generation (RAG)

    Combines parametric memory with non-parametric memory retrieved from a document index for selected NLP tasks.

    No dedicated LLM Lab concept page yet.

    Sources : Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

    Editorial note : Describe the original formulation; modern RAG systems vary and are not hallucination-free.

  3. arXiv submission Research

    GPT-3 and few-shot in-context learning

    Demonstrates few-shot performance across tasks from examples in the prompt context, without updating model weights at evaluation time.

    No dedicated LLM Lab concept page yet.

    Sources : Language Models are Few-Shot Learners

    Editorial note : Distinguish in-context learning from parameter fine-tuning; do not attribute all capabilities to scale alone.

  4. arXiv submission Research

    LoRA: low-rank adaptation

    Proposes efficient adaptation of a pretrained model by optimizing low-rank matrices rather than retraining all weights.

    No dedicated LLM Lab concept page yet.

    Sources : LoRA: Low-Rank Adaptation of Large Language Models

    Editorial note : LoRA is not QLoRA and does not by itself change the base architecture.

  5. arXiv submission Research

    InstructGPT and RLHF

    Studies instruction following using demonstrations, human preference rankings, a reward model and reinforcement learning.

    No dedicated LLM Lab concept page yet.

    Sources : Training language models to follow instructions with human feedback

    Editorial note : A research contribution distinct from ChatGPT's public launch.

  6. arXiv submission Research

    Chinchilla and compute-optimal training

    Shows that training-compute allocation depends jointly on model size and the number of training tokens.

    No dedicated LLM Lab concept page yet.

    Sources : Training Compute-Optimal Large Language Models

    Editorial note : Do not turn the study's proportions into a universal ratio independent of compute budget and training regime.

Efficiency and alternative architectures

  1. arXiv submission Research

    FlashAttention

    Presents an IO-aware exact attention algorithm that reduces data movement between GPU high-bandwidth memory and on-chip SRAM.

    No dedicated LLM Lab concept page yet.

    Sources : FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness

    Editorial note : Improves IO efficiency; it does not remove the quadratic arithmetic complexity of standard attention.

Reasoning, multimodality and ecosystem

  1. Official announcement Ecosystem

    Public launch of ChatGPT

    OpenAI makes a conversational interface based on the GPT family publicly available, accelerating broad adoption of conversational assistants.

    No dedicated LLM Lab concept page yet.

    Sources : Introducing ChatGPT

    Editorial note : A product and distribution milestone, distinct from InstructGPT research and from the invention of Transformers.

Scaling and post-training

  1. arXiv submission Research

    Direct Preference Optimization (DPO)

    Formulates preference optimization as a direct approach that, in its proposed procedure, avoids a separate reward model and explicit RL stage.

    No dedicated LLM Lab concept page yet.

    Sources : Direct Preference Optimization: Your Language Model is Secretly a Reward Model

    Editorial note : It removes neither preference data nor all concepts associated with RLHF; no direct InstructGPT-to-DPO lineage is asserted here.

Efficiency and alternative architectures

  1. arXiv submission Research

    Mamba and selective state-space models

    Proposes a sequence-model architecture based on selective state spaces as an alternative path to Transformers for processing long sequences.

    No dedicated LLM Lab concept page yet.

    Sources : Mamba: Linear-Time Sequence Modeling with Selective State Spaces

    Editorial note : An alternative research line, not a universal replacement for Transformers.

Which bottlenecks changed—and which remain

The timeline becomes more meaningful when we follow the problems researchers were trying to overcome. This is not a story in which each new architecture makes the previous one obsolete: each family addresses particular needs and retains trade-offs.

1. Recurrence: a dependency cost over time

In an RNN, the hidden state at position (t) depends on the state at (t-1). This imposes a computation order within an example: all positions cannot be computed simultaneously as though they were independent. It limits the parallelism available during training, especially for long sequences.

LSTMs and GRUs improved information flow and the learning of long-range dependencies; they did not remove the sequential dependency chain. Sequence-to-sequence models also used fixed-size states to summarize a sequence, which could become a bottleneck. Attention in neural machine translation let the decoder consult different parts of the source sequence rather than relying only on a single summary (Bahdanau et al., 2014).

2. 2017: changing the path of computation

The Transformer introduced by Vaswani et al. generalizes this idea by placing attention at the center of the architecture. In the encoder’s central computation, positions can be processed in parallel: they interact through attention rather than through a chain of recurrent states. This structural change is particularly well suited to parallel accelerators (Vaswani et al., 2017).

The advance has its own costs. Dense attention compares positions with one another; in its standard form, its compute and memory costs grow quadratically with sequence length. And in an autoregressive GPT, the next token still depends on previous ones: prefill processes the prompt in parallel, but decode produces new tokens one at a time.

3. From task-specific models to reusable models

Transfer learning was a major historical shift: instead of designing an independent model for every task, learned representations and parameters could be reused across downstream tasks. Pretrained word representations, followed by contextualized pretrained models, prepared this change. GPT-2 illustrated the potential of zero-shot transfer; GPT-3 made it especially visible through few-shot evaluations in which tasks and demonstrations were supplied in the prompt, without gradient updates (Brown et al., 2020).

This history leads to several mechanisms that should now be distinguished rather than collapsed into one timeline: - Transfer with adaptation: update parameters on a downstream task (fine-tuning). - Context-based adaptation: provide instructions or examples without changing parameters (zero-shot, few-shot, ICL). - External knowledge supply: retrieve information and transmit it to the model, for example through RAG; this is not parameter transfer.

Their mechanisms, conditions for success, and limitations are explored in LLM evolution and in-context learning. RAG and memory boundaries explain why retrieving information does not yet mean it is accessible to the model.

4. Scale, post-training, and observed capabilities

From the 2020s onward, progress was no longer only about architecture: model size, data quantity and quality, training compute, and optimization procedures became variables studied together. Scaling laws and compute-optimal allocation helped formalize these trade-offs (Kaplan et al., 2020; Hoffmann et al., 2022).

In parallel, post-training—especially instruction tuning and preference optimization—shaped pretrained models toward assistant-like behavior. Some capabilities also appear to emerge as scale increases, but interpretation depends on tasks and metrics: evaluation thresholds can make gradual progress look sudden (Schaeffer et al., 2023). These topics are examined in LLM evolution, scaling laws, emergence, and post-training.

What this history lets us conclude

The timeline highlights three mutually reinforcing but distinct transformations: the Transformer changes the path of computation; large-scale pretraining makes learned parameters reusable; later methods adapt a model through its parameters, through context, or by supplying external information. To compare generations and understand the dimensions evolving in parallel—multimodality, inference-time compute, efficiency, and tool-using systems—see From GPT-2 to contemporary LLM systems.

What the timeline should not imply

  • Transformer does not mean autoregressive LLM. The 2017 paper presents an encoder-decoder architecture for translation; BERT uses an encoder and a masked prediction objective.
  • Attention predates the Transformer. The 2017 paper assembles and reorganizes existing ideas into a coherent architecture; it did not invent the entire family of attention mechanisms.
  • Scale does not explain everything. Data, objectives, tokenization, architecture, training procedure, and evaluation also shape observed capabilities.
  • A publication date is not proof of absolute priority. This page selects a few pedagogical milestones and does not attempt to catalogue every parallel contribution.

Also read the Transformer’s original architecture diagram

This comparison uses concepts introduced in the Transformer lesson to introduce the encoder–decoder data flow.

If you have already come across the classic diagram from the founding paper (Attention Is All You Need), you will recognize the same building blocks here: the Multi-Head Attention, Feed Forward, and Add & Norm boxes correspond to the multi-head attention, the MLP, and the residual-plus-normalization pair introduced in the Transformer lesson and explained in depth in the contextualized-representations deep dive. The paper and its visualizations are referenced in the Deepen resources.

The GPT diagram in the Transformer lesson is not the historical diagram of every Transformer. To understand where the component names and block organization come from, also learn to read the 2017 paper Attention Is All You Need, which describes an encoder–decoder Transformer. Jay Alammar’s The Illustrated Transformer provides a step-by-step reading; it complements but does not replace the architectural distinction made here.

In the original diagram, follow two streams:

  • Encoder (left): embeddings and positional encoding, then a stack of layers with multi-head self-attention and a feed-forward network. Each encoder position can use information from the other input positions.
  • Decoder (right): shifted target-sequence embeddings, masked self-attention to prevent access to future target tokens, then encoder–decoder attention over encoder representations, followed by the feed-forward network.
  • Output: a linear projection to vocabulary scores, then softmax in the paper’s diagram to obtain a distribution.
Historical label What to understand Where to continue in LLM Lab
Input / Output Embedding Lookup of vectors associated with IDs; during training, decoder inputs use the shifted target sequence Embeddings, text and IDs
Positional Encoding Order information; the original paper uses sinusoidal functions Positional information, sinusoidal derivation
Multi-Head Attention Multiple heads computed from learned Q, K and V projections Q/K/V, attention
Masked Multi-Head Attention Decoder self-attention with a causal constraint Causal masking
Encoder–Decoder Attention Cross-attention: Q comes from the decoder, K and V from encoder outputs Cross-attention
Add & Norm Residual addition followed by normalization; the historical diagram is post-LN, unlike the pre-LN block in the deep dive Block deep dive, block walkthrough, tensors
Feed Forward An MLP applied independently at each position, with parameters shared across positions Block deep dive, block walkthrough
Linear / Softmax Projection to vocabulary logits, then conversion to probabilities Logits, probabilities

Do not conflate three architectures: the original encoder–decoder combines an encoder that reads the input and a decoder that produces an output conditioned on it; an encoder-only model (for example, BERT) builds input representations; a decoder-only model (for example, GPT) predicts sequence continuations using causal self-attention. GPT therefore does not contain the encoder–decoder attention block from the 2017 diagram. The architecture comparison explores these differences.

Guided reading route

Return to the diagram after studying Q, K, and V projections and causal masking. The five locate, explain, compare, transfer, and reconstruct questions are collected in the dedicated Transformer Practice page, keeping historical reading separate from exercises.

What the diagram does not show: tensor dimensions and axes, parameter sharing, projection details, memory and compute costs, training-versus-inference differences, or architectural variants introduced since 2017. The canonical lessons provide these details. Treat the diagram as a reading map, not an exhaustive specification of a modern model.

Primary source