The modern recipe: GPT-2 to 2026

A 2026 open model is still GPT-2’s skeleton: embed, a stack of attention and feed-forward blocks on a residual stream, then predict the next token. Almost every part inside has been swapped: RMSNorm, SwiGLU, RoPE, shared or compressed keys and values, mixtures of experts, no biases, QK-norm, bigger vocabularies and contexts a thousand times longer. Here is each change, model by model.

Key idea
Same skeleton; swapped parts: LayerNorm → RMSNorm (pre-norm), GELU → SwiGLU, learned positions → RoPE (→ none), MHA → GQA / MLA / hybrid, dense → MoE, biases removed, QK-norm added, untied embeddings, 50K → 130–160K vocabularies, 1K → 128K–1M context
Real world
A 1960s car and a 2026 car both have four wheels, an engine, brakes and a steering wheel. Almost every part has been redesigned (fuel injection, disc brakes, airbags), but a mechanic from 1965 would still recognise the layout.
In an LLM
GPT-2 XL (2019): 1.5B parameters, 1,024-token context, every parameter used for every token. Kimi K3 (2026): 2.8T parameters, 104B used per token, 1M-token context. Both turn a list of tokens into next-token probabilities through a stack of blocks.

Same skeleton

Everything in the block lesson still holds. A token becomes a vector; a stack of blocks updates it on the residual stream; each block mixes information between tokens (attention or something like it) and then processes each token on its own (a feed-forward network); a final layer turns the vector into logits. Training is still next-token prediction.

What changed is the parts. Compare any two of five landmark open models:

from
to
GPT-2 XL (2019)Kimi K3 (2026)
▾AttentionMHA, 25 headshybrid: 69 KDA + 24 gated MLA layers
Full multi-head attention caches a key and value for every head. GQA shares them across groups of heads; MLA caches one compressed latent. Kimi K3 makes three in four layers linear attention with a fixed-size state. Efficient attention →
GPT-2 XL (2019)
token embedding + learned position
LayerNorm
× 48 layers
Multi-head attention· with biases
+ add to stream
LayerNorm
MLP (GELU)
+ add to stream
LayerNorm, then output layer (tied to embedding)
Kimi K3 (2026)
token embedding
RMSNorm
× 93 layers
KDA ×3, then gated MLA· no position encoding
add to stream (AttnRes)
RMSNorm
MoE: router → 16 of 896 + 2 shared
add to stream (AttnRes)
RMSNorm, then output layer
9 design choices differ between GPT-2 and Kimi K3: Normalisation, MLP activation, Positions, Attention, Feed-forward, Bias terms, QK-norm, Tied embeddings, Residual stream. Yet the skeleton is the same: embed, then a stack of norm → attention → add, norm → feed-forward → add, then a final norm and the output layer.
Pick two models to compare. Amber marks a design choice that differs between them (sizes always differ, so they aren’t marked). Click a row for the reason and the lesson that explains it.

The changes, one by one

Normalisation: RMSNorm, before each sub-layer. GPT-2 had already moved LayerNorm to the start of each sub-layer (“pre-norm”), which trains more stably than the 2017 design. Later models switched to RMSNorm, which only rescales the vector by its root mean square and has no mean or bias to learn. See normalization.

Activation: SwiGLU. The MLP in GPT-2 was “expand, apply GELU, shrink”. Since PaLM and Llama it has been SwiGLU (Shazeer, 2020): two expansions, one passed through a smooth gate (SiLU) and multiplied by the other. It has three weight matrices instead of two, so the hidden size is usually made smaller to compensate: 8/3 of the width in the original Llama, 3.5 times in Llama 3 8B (14,336 for a width of 4,096), against GPT-2’s 4 times. Kimi K3 bounds both branches with tanh to stop rare huge activations.

Positions: RoPE, then nothing at all. GPT-2 learned one vector per position, up to 1,024. RoPE rotates queries and keys instead, so scores depend on distance and can be stretched for longer contexts. Kimi K3 goes further: its full-attention layers use no position signal at all, and its linear-attention layers, which read tokens in order, supply it.

Attention: share or compress the keys and values. Every GPT-2 head had its own keys and values. GQA and MLA share or compress them, cutting the KV cache 4 to 70 times. Hybrids make most layers linear attention with a fixed-size state.

Feed-forward: mixture of experts. Since DeepSeek-V3, most large open models replace the MLP with many experts and a router. Kimi K3 picks 16 of 896 per token.

No biases. GPT-2 added a learned bias vector after every matrix multiplication. Modern models drop them all (Qwen kept them on queries, keys and values through Qwen2.5 and dropped them in Qwen3). They cost little but add nothing at this scale, and removing them helps stability.

QK-norm. Qwen3 normalises every query and key before the dot product (Dehghani et al., 2023), which stops attention scores from blowing up mid-training; Kimi K3’s linear layers normalise them too.

Untied embeddings. GPT-2 used one matrix both to look up tokens and to score them at the output. Large models now keep two; small ones (Qwen3 up to 4B, Llama 3.2 1B and 3B) still tie them to save memory.

Bigger vocabularies. 50,257 tokens in GPT-2; 128,256 in Llama 3; 151,669 in Qwen3; 163,840 in Kimi K3. Fewer tokens per text, especially for code and non-English languages. See vocabulary size.

Longer contexts. 1,024 tokens in GPT-2; 128K became normal in 2024; 1M in DeepSeek-V4 and Kimi K3 in 2026. Every other change on this list (RoPE scaling, smaller KV caches, FlashAttention, hybrids) was needed to get there.

example · the car

A car from 1965 and one from 2026: four wheels, engine at the front, steering wheel, pedals. But the carburettor became fuel injection, drum brakes became discs, the radio became a touchscreen, and many engines now share the job with an electric motor. Each change was small enough to adopt on its own, and they add up to a different machine with the same layout. Transformer architectures evolved the same way: one swapped part at a time, each tested on its own.

example · reading a config file

Open a model’s config.json on Hugging Face and the recipe is there in plain text. Llama 3 8B: "num_attention_heads": 32, "num_key_value_heads": 8 (GQA), "hidden_act": "silu" (SwiGLU), "rope_theta": 500000.0 (RoPE), "tie_word_embeddings": false. DeepSeek-V3: "kv_lora_rank": 512 (MLA), "n_routed_experts": 256, "num_experts_per_tok": 8, "n_shared_experts": 1 (MoE). Every cell in the table above was checked against these files and the models’ papers.

What has not changed

  • Next-token prediction with a softmax over the vocabulary, trained with cross-entropy.
  • The residual stream: blocks still mostly add their output to a running vector. (Kimi K3’s Attention Residuals and DeepSeek-V4’s hyper-connections are the first big changes here in years; it is too early to say whether they become standard.)
  • Softmax attention in at least some layers. Even the most aggressive hybrids keep a full attention layer every few, for exact recall.
  • Byte-pair-encoded tokens. Bigger vocabularies, same idea (see beyond tokens for the experiments that try to drop them).

Where it is heading

Three trends run through 2025–26:

  1. Sparser everything. More and smaller experts (a few percent of weights active per token), sparse attention that reads a few thousand keys out of a million (DeepSeek), and linear layers with fixed state.
  2. Hybrids. Qwen3.5 and Kimi K3 put linear attention in three of every four layers. DeepSeek-V4 instead keeps compressed sparse attention everywhere. Which approach wins is still open.
  3. Designed for low precision. Models are trained or fine-tuned to run in 8-bit or 4-bit (Kimi K3 ships with 4-bit MXFP4 weights and 8-bit activations; DeepSeek-V4 with 4-bit experts and 8-bit elsewhere), because at trillions of parameters memory is the limit. See quantization.
going deeper

Sources for every cell

GPT-2 XLLlama 3 8BDeepSeek-V3Qwen3-235B-A22BKimi K3
ReleasedFeb 2019 (full model Nov 2019)Apr 2024Dec 2024Apr 2025Jul 2026
Sourcepaper, configpaper, configpaper, configpaper, configreport, card
Total / active1.5B8.0B671B / 37B235B / 22B2.8T / 104B
Layers, width48, 1,60032, 4,09661, 7,16894, 4,09693, 7,168
Heads2532 Q / 8 KV128 (MLA)64 Q / 4 KV96
Vocabulary50,257128,256129,280 in config (“128K”)151,669 tokens (151,936 embedding rows)163,840 (“160K”)
Context1,0248,192 (131,072 in 3.1)128K (YaRN from 4K)32,768 (131,072 with YaRN)1,048,576

Notes: GPT-2’s paper describes the move to pre-norm and an extra final LayerNorm (section 2.3). Llama 3.1 is the same architecture as Llama 3 with RoPE scaling for 128K. DeepSeek-V3’s 671B excludes its 14B multi-token-prediction module. Kimi K3’s exact counts in its report are 2.78T total and 104.2B active.

Other 2026 open models, briefly

  • Qwen3.5-397B-A17B (Feb 2026): 60 layers, 3 Gated DeltaNet : 1 gated attention, 512 experts (10 routed + 1 shared), RoPE on a quarter of each head, 248,320-token vocabulary, 262,144-token native context.
  • DeepSeek-V4-Pro (Apr 2026): 1.6T total / 49B active, 384 experts (6 + 1 shared), compressed sparse attention, hyper-connections, 1M context.
  • GLM-5 (Feb 2026): 744B / 40B, MLA with DeepSeek Sparse Attention, 256 experts (8 + 1 shared).

From each model’s config.json and card on Hugging Face.

Related

  • rope - Almost every modern LLM marks word order by rotating queries and keys. Each pair of numbers is turned by an angle that grows with the token’s position, so the attention score between two tokens depends only on how far apart they are. Stretching those angles is how models are extended to longer texts.
  • efficient-attention - Attention’s two costs are the KV cache, which grows with every token, and the score matrix, which grows with the square of the length. Modern models share keys and values between heads (GQA, MLA), let most layers look only at recent tokens, compute attention in tiles that never store the full matrix (FlashAttention), and pick a few keys to read per query (sparse attention).
  • moe - A mixture-of-experts layer replaces one big feed-forward network with many smaller ones, the experts, and a router that sends each token to only a few of them. The model stores hundreds of billions of parameters but uses only a few percent per token. The hard parts are keeping the experts evenly used and moving tokens between GPUs.
  • beyond-attention - Linear attention, state space models such as Mamba, and delta-rule layers replace the growing KV cache with a fixed-size state that is updated token by token. They are fast and cheap on long texts but can’t recall everything exactly. The 2025–26 answer is the hybrid: mostly linear layers, with a full attention layer every few.
  • the-block - Put the pieces together: LayerNorm, attention, add; LayerNorm, MLP, add. That is one transformer block, and a model is a stack of identical blocks between an embedding table and an output layer. Here is one block computed number by number, and an exact parameter count for real models.