/ click — next  ·  back
F fullscreen  ·  R restart
01a_small_question

Ask it something easy.

Elon Musk wants to colonize
Elon Musk wants to colonize Mars.

It gets it right. But nothing was looked up. There is no database in there, no row that reads Musk → Mars, and the file does not change while you type.

So where, exactly, is that fact? We are going to go and find it — because every word an AI has ever written came out of the same trip, and once you have seen it you can tell the difference between a model that knows something and one that is just pattern-matching well.

So where did that word come from? It came out of a file. Let’s open it.

02the_search_area

It is in here somewhere.
175 billion numbers, four kinds of table.

Open the file and the numbers are not a jumble. They sort into four kinds of table, each doing exactly one job. Learn the four and you have the map.

the dictionary turns a word into numbers 617 million written W_E the lookup “which other words matter right here?” 58 billion  ·  96 copies written W_Q W_K W_V W_O the memory “what do I know about this thing?” 116 billion  ·  96 copies written W_up W_down the vote turns numbers back into a word 617 million written W_U Those W names are just labels people gave the tables — nothing is hiding in them. Our fact is not in the dictionary and not in the vote. Hold that thought.

But a table of numbers is not a word. How does “colonize” even get in?

03first_stop

“colonize” becomes 12,288 numbers — which is really an arrow.

The dictionary hands each word a long list of numbers. A list that long is just an arrow, pointing somewhere in a very large space.

The useful thing about that space is not where words sit. It is which way you travel to change them. One direction means "more feminine". Another means "make it plural". Nobody designed these — they fell out of training.

Which is why the famous trick works. It is the space showing you its filing system:

king − man + woman ≈ queen

To ask "how much of this idea does that arrow carry?", multiply the two lists together and add it all up. One number. Big means aligned. Hold on to that operation — the rest of the machine is mostly that, over and over.

a flat sketch of 12,288 dimensions man woman king queen the same step, twice that step is the direction meaning “more feminine”

Hold on. That is only 12,288 numbers per word. Is there even room?

04but_wait

Only 12,288 numbers.
So how does everything fit?

Fair objection. If every idea needed its own perpendicular direction, this model could hold 12,288 of them — and it plainly knows millions of things. Rocket launches and Kubernetes and the Ming dynasty.

The way out is a fact about big spaces that is genuinely strange. Add a dimension and you do not just get one more direction — you get room for far more, and they all stay nearly at right angles to each other, which is what keeps them from blurring together.

Watch the circle fill. The count climbs; the angle between any two barely moves off 90°.

You never have to arrange any of this. In a big space, near-perpendicular is simply what two directions already are — so you keep adding ideas and they keep staying apart. That is superposition. (The circle is a flat stand-in: a real 12,288-dimension space cannot be drawn. The ± figure is exact.)

1 dimension
any two directions: 0° or 180° — never square
a line. one axis, and nothing can sit at right angles to it.

Fine — the ideas fit. But how does the machine use them?

05the_route

Each word's arrow rides a straight track, collecting edits.

Now the search gets a shape. Every word in your sentence gets an arrow, and each one travels the whole length of the model on its own track. The track has a name: the residual stream.

The tables along the way never replace the arrow. Each one reads it, works out a small correction, and adds that correction in. Ninety-six times.

So the arrow above the blank starts out meaning almost nothing and arrives meaning "a particular planet". Nothing overwrote it. It just got nudged, ninety-six times.

Our fact gets added somewhere along this track. Two kinds of table are doing the adding — and they are not doing the same job.

the track “in” — means little yet the lookup + the memory + …that pair, ninety-six times… layer 96 + …now points at Mars

Two tables do that adding, and they do different jobs. Here is the first.

06table_one_of_two

The lookup: which words even matter here?

Before it can recall anything, the blank has to work out what it is completing. "is in" could follow a person, a year, a company. It needs to notice that this is about Elon Musk, and about going somewhere.

So every word's arrow is multiplied by three different tables, making three new arrows with three different jobs:

what I want — what am I looking for?
what I have — what do I offer?
what I’d add — what do I contribute if picked?

Match every "what I want" against every "what I have" — that dot product again. A high score means listen. Then blend what the winners offer and add it to the track. That is one head; there are 96 per layer, each hunting for something different.

the blank what I want the query — Q what I have the key — K what I’d add the value — V how much the blank listens to each word: Musk 0.62 colonize 0.27 The 0.04 now it knows what it is about

Now it knows the topic. But it still doesn’t know Mars. Who does?

07found_it

The memory: here is where Mars was kept.

The lookup worked out what we are talking about. It knows no facts at all. The table sitting right after it does — and this is the end of our hunt.

Its structure is almost comically literal. The first table is a wall of questions, one per neuron: "is this Elon Musk, and is it about space?" Each scores the arrow, and any score that comes out negative is thrown away — so a neuron either fires or stays quiet.

The second table is the answer sheet. For every neuron that fired, it adds that neuron's stored direction to the track — "…then add Mars."

That is it. The fact does not live as text or as a row in a table. It lives as a direction that gets added whenever one particular question is answered yes — and millions of other facts share the same space, by superposition.

first table — a wall of questions “…is this Elon Musk, and is it about space?” “…is this a plural noun?” “…is this about a person?” 49,152 questions per layer — a “no” is thrown away one fires second table — the answer sheet add the “Mars” direction to the track a fact, stored as a direction

Found it. Which also settles a number in the file that looks like a mistake.

08so_that_is_why

Two-thirds of the file is filing cabinet.

If facts are kept in those memory tables, there had better be a great many of them. There are. And every explanation of transformers you have ever read is busy talking about the other part.

175,000,000,000 numbers — one column, to scale the memory 116 billion — 66% where Mars was the lookup 58 billion — 33% the part everyone talks about dictionary + vote — 1.2 billion, barely over 1% Two-thirds of a language model is a filing cabinet. The lookup decides what is relevant. The memory holds what is known. So "how many parameters" was never a measure of cleverness. It is mostly a measure of how many facts fit.

So the fact is in there, as a direction. Now it has to be said out loud.

09back_to_a_word

The arrow now points at a planet. Turn it back into language.

After ninety-six rounds of adding, the arrow above the blank has quietly accumulated everything the model worked out. Getting a word out of it takes one last operation.

Dot it against every row of the vote table — one row per word it knows. Fifty thousand dot products, fifty thousand scores. Those get turned into percentages, and one word is drawn.

Then the whole journey runs again for the next word, with what it just said added to the input.

Which is the part worth sitting with: every sentence you have read from a model is this trip, repeated once per word, each time from scratch.

the final arrow the vote one row per word it knows — 50,257 ↓ a score per word, turned into percentages Mars 0.88 space 0.06 Venus 0.03 …50,254 more, all very close to zero draw one → append → do it all again

That is the entire trip. So what was Mars, in there?

10we_found_it

Mars was a direction.

Not a row in a table, not a sentence stored somewhere. A direction in a space of 12,288 numbers, added to a running total the moment one neuron out of 49,152 decided that yes, this is Elon Musk and this is about space.

Everything a model knows is kept that way. Which is also why it can be so right and so confidently wrong using the identical machinery — nothing in there marks the difference between a fact and a very well-worn pattern.

dictionary lookup + memory ×96 vote Mars

You have seen what it is.
The course is about what to do with it.

This was the architecture. The six sessions are the engineering — how to steer it, how to measure whether it is right, how to hand it your own documents, how to let it take actions, and how it gets attacked.

Figures are GPT-3's published architecture — 175 billion numbers, 96 layers, 96 heads,
12,288 numbers per token, 50,257 words in the vocabulary. Attention weights and probabilities are illustrative, not measured.