Step 3 of 15 · Module 2: Core AI
Attention & Transformers: The Idea Behind Every Modern AI Model
The last module compared ChatGPT, Claude, and Gemini from the outside — as products. This one starts underneath all three. Every one of them, and nearly every serious AI model released in the last several years, shares one idea at its core, first described in a 2017 paper memorably titled "Attention Is All You Need." That idea is , and once you see what it's actually doing, a lot of what these models can do stops feeling mysterious.
The problem it solves
Consider the sentence: "The trophy didn't fit in the suitcase because it was too big." What does "it" refer to — the trophy, or the suitcase? You resolved that instantly, using context from elsewhere in the sentence. Now change one word: "...because it was too small" — and the answer flips, even though "it" is grammatically identical in both cases.
For a model to handle language well, it needs to do the same thing at every single word: look around at the rest of the sentence — sometimes the rest of a whole document — and figure out which other words actually matter for understanding this one. That's the problem attention was built to solve.
What attention actually does
For every word, attention computes a relevance score against every other word, then uses those scores to blend information from across the sentence into that word's representation. Words that matter a lot get weighted heavily; words that don't barely contribute at all. Try it on the ambiguous sentence below.
Click a word to see what it attends to
Illustrative weights, not real model output — but this is roughly the question attention asks: for the word “it,” which other words actually matter? Click other words to see their pattern too.
Do this for every word, and the model ends up with a representation of the sentence where each word "knows" which other words are relevant to it — without anyone having hand-coded a single grammar rule. The pattern was learned entirely from being shown enormous amounts of text and adjusting until its predictions got better.
Why this replaced older approaches
Before attention, the standard approach processed text one word at a time, in order, carrying forward a summary of everything seen so far. Two problems followed directly from that design: information from early in a long passage tended to fade by the time the model reached the end, and — because each step depended on the previous one — the whole thing had to run sequentially, word by word, which made it slow to train on the huge datasets modern models need.
Attention looks at the whole sequence at once. Every word can connect directly to every other word, regardless of distance, and those connections can all be computed simultaneously rather than one after another. That combination — better handling of long-range context, and a computation that parallelizes well — is a large part of why this became the default architecture almost everywhere.
The transformer, briefly
A is the full architecture built around this idea: layers of attention stacked on top of each other, interleaved with simpler processing steps, repeated dozens of times. Each layer refines the representation a little further — early layers tend to pick up on local patterns like grammar, later layers on more abstract relationships like meaning and intent. Stack enough of these layers, train on enough text, and you get a system that can hold a coherent conversation, write working code, and explain its own reasoning — all built from the same repeated operation: for every word, decide what else matters, and by how much.
Quick knowledge check
1. What core problem does attention solve?
2. Why did attention-based models replace the older word-by-word approach?
3. What does "multi-head" attention mean?
Continue the path
Step 4 of 15 · Core AI
Parameters: What "a 70B Model" Actually Means
Spot something wrong, outdated, or confusing?
Suggest an edit