The transformer is the architecture underneath every significant AI model of the last several years, including the T in GPT. It was introduced in a 2017 paper by Google researchers, and it is the closest thing the current wave of AI has to a single origin point.
What problem did it solve?
Earlier language systems processed text in order, one word at a time, carrying a summary of what came before. Two problems followed. Information from early in a passage degraded by the time it was needed later. And because each step depended on the previous one, training could not be spread across many processors.
The second problem was the binding constraint. It meant training on very large collections of text was impractically slow no matter how much hardware you had.
What does attention do?
It lets every position in the text look directly at every other position and decide which ones matter. In the sentence about a trophy that would not fit in a suitcase because it was too large, resolving what it refers to requires looking back at the right noun. Attention does this in one operation rather than by carrying information forward step by step.
Each word effectively asks what should I pay attention to here, and the model has learned, from an enormous quantity of text, how to answer that question in different situations.
Why did parallel processing matter so much?
Because the whole passage can be handled at once, training could be distributed across thousands of processors. That turned a research constraint into an engineering one, and engineering constraints yield to money.
Everything that followed depended on this. The scaling that produced modern capabilities was only possible because the architecture allowed it, and no amount of investment would have produced the same result with the previous designs.
What is inside a transformer layer?
- Multi-head attention. Several attention mechanisms running in parallel, each learning to track different kinds of relationship.
- A feedforward network. Processing applied to each position, where a good deal of the model's factual knowledge appears to be stored.
- Residual connections. Paths allowing information to skip past a layer, which makes very deep networks trainable.
- Normalisation. Keeping values in a stable range so training does not diverge.
These blocks are stacked dozens or hundreds of times. The architecture is strikingly repetitive, which is part of why it scales so well.
How does it know word order?
Through positional encoding, added because attention by itself treats the input as an unordered set. Position information is mixed into each token's representation, so the model can distinguish the dog bit the man from the reverse.
Improvements to how position is represented are a large part of why context windows grew from a few thousand tokens to hundreds of thousands.
What is the main weakness?
Attention compares every position with every other position, so the work grows with the square of the input length. Doubling the context quadruples that part of the cost, which is why long context windows were expensive to achieve and why a great deal of research has gone into approximating attention more cheaply.
Do all models use the same variant?
No. The original design had an encoder and a decoder, intended for translation. Language models such as GPT use the decoder half only, which suits generating text one token at a time. Models built for understanding rather than generation, including many embedding models, use the encoder half.
The distinction explains why some models are good at producing text and others are good at classifying it, despite sharing an architecture name.
Is anything replacing it?
Alternatives exist and are actively researched, particularly state space models that scale linearly with length. Several are promising and none has displaced the transformer at the frontier.
For now, one paper from 2017 remains the foundation of the entire field, which is unusual and worth remembering when reading predictions about what happens next. The last decisive architectural change arrived without much fanfare and took five years to reach the public.