Quick Stats
Completed
0
Time Spent
0m
Streak
0
User
Transformers (Language and Beyond)
The architecture behind LLMs.
Attention is the idea
The transformer is the architecture behind essentially all of today's leading AI — every major LLM, plus much of modern vision and audio. Its breakthrough is one mechanism: self-attention. As the model processes a sequence (say, the words of a sentence), attention lets every token look at every other token and weigh how relevant each is. In "the animal didn't cross the street because it was tired," attention is what links "it" back to "animal" rather than "street."
Why attention beat the old way
Earlier sequence models read text strictly left to right, one step at a time, and struggled to connect words far apart — by the end of a long sentence, the start had faded. Attention fixes both problems at once:
- Long-range context — any token can directly attend to any other, however distant, so meaning isn't lost across distance.
- Parallelism — because tokens are processed together rather than one by one, transformers train enormously faster on modern GPUs, which is what made training on internet-scale data possible.
That combination — better context and faster training — is why transformers swept the field.
Beyond language
Though invented for translation, the transformer turned out to be a general-purpose pattern learner. Treat image patches like tokens and it does vision; treat audio chunks like tokens and it does speech. This generality is why one architecture now underlies text, images, audio, and multimodal models alike.
The big picture
You don't need the matrix math to hold the essential idea: a transformer is a stack of attention layers that repeatedly let every piece of the input gather context from every other piece, refining the representation at each layer.
Grasp one sentence and modern AI clicks into place: a transformer lets every token attend to every other, in parallel, capturing context at scale. Every LLM you've used is this idea, scaled up.
Try this: Read "the trophy didn't fit in the suitcase because it was too big" and ask: does "it" mean the trophy or the suitcase? Your brain resolves it from context — and self-attention is how a transformer does the very same thing.