Key points
- A transformer stops lining words up in a queue and gathers them at one table to look at each other at once. Almost every conversational AI sits on this design.
- Every word holds a question, a name tag and a folder. Pulling more from the folders of words whose tags match your question is what attention means.
- The meeting runs in several parallel versions and repeats through dozens of stacked layers. Lower layers tend to catch nearby links, upper ones the drift of the whole text.
- Facing each other all at once erases order, so every word is also handed a seat number.
- In a conversational model, all that machinery ends in one small act: scoring each candidate for the next word, then picking one, repeated a few hundred times.
The analogy
"The bank was closed, so I sat on the bank and fished." Put that sentence on a round table. Instead of standing in a queue waiting their turn, four words sit facing one another. Neighbor or across the table, a glance reaches anyone.
There is one item on the agenda: who do I need to hear from before I know what I mean? The second bank studies fished and settles into being the edge of a river. The first bank leans on closed and stays a place that keeps money. That measured glance, deciding who to watch and how closely, is attention.
Nobody waits for a turn. All four words look around at the same moment, and when the round ends each carries a sharper sense of itself. The "bank" that leaves the table is no longer the blank, two-meaning word that arrived. Seeing in both directions like this describes the side that reads a sentence in. In a conversational model that writes out the next word, each word can see only the words placed before it.
In detail
No queue
The older approach lined words up and read them one at a time, each passing what it had gathered to the next. Long sentences faded at the front: the more handoffs, the blurrier the opening became. And since each step waited for the one before it, the whole thing crawled.
The round table fixes both problems. The last word sees the first directly, so distance costs nothing. In "I left the umbrella I bought yesterday on the train," the phrase about leaving reaches straight back and grabs the umbrella. Because every word scores every other simultaneously, the many calculation units inside a graphics chip can all work at once. This seating plan played a big part in making training on enormous piles of text practical.
Matching questions against name tags
Each word at the table carries three things: a question in hand, a name tag on its chest, and a folder in front of it. The question says what it is looking for. The tag advertises what it can offer. The folder holds what it would actually hand over.
The second bank is holding a question about the verb that would explain it. It carries that question around the table and compares it with every tag. The tag on fished matches well and scores high. The tag on closed matches poorly and scores low. Scoring is not an election with one winner. It is a split: seventy to one word, twenty to another, the rest scattered.
Once the split is fixed, the folders are collected in those proportions. A generous helping from the high scorer, a spoonful from the low one, all blended into a fresh sense of itself. The question is the query, the tag is the key, the folder is the value.
Every word does this at the same instant. Four words, four simultaneous rounds of comparison, and a thousand words work exactly the same way.
More than one meeting
Several meetings run in parallel with the same words in the same seats. Each version cares about something different. One tracks which word pairs with which. Another follows what modifies what. A third keeps chasing a name mentioned two sentences back.
A single meeting sees too little. Watch grammar and you miss meaning; watch meaning and you miss grammar. Run eight or twelve versions, let each look somewhere else, then pool the results, and one word holds several relationships at once. If one version wanders off, the others cover for it. Each parallel meeting is called a head.
Without seat numbers, everything scrambles
Facing each other simultaneously also means losing track of order. A round table has no front and no back. "Dog bites man" and "man bites dog" use the same bag of words and mean opposite things. Strip order away and the two look identical.
So each word is told which seat it is in, as part of the calculation. The original design blended seat information into each word's list of numbers; many recent models instead let the seat gap show up when questions and name tags are matched at each layer. Either way, the same word gets handled a little differently depending on where it sits. Putting in seat information like this is called positional encoding.
Stacking layers, ending in one word
One meeting settles very little. The words carry their revised senses upstairs and hold the identical meeting again, through dozens of floors. Downstairs the focus is close at hand, links to neighboring words. Upstairs it tends to widen to the argument of a paragraph and the tone of a document. Nobody assigns those jobs. The division, roughly, emerges during training.
What comes out of the top floor is surprisingly plain: a list of candidate next words, each with a score. After "so I sat on the bank and," the word "fished" scores high and "sprinted" scores low. One candidate is chosen, pinned to the end of the sentence, and the table meets again over the now-longer sentence. A few hundred rounds of that produce one long answer.
This is also why a name mentioned early in a chat can still be used much later. Every time a new word is chosen, the entire text so far is consulted again. In practice the model stores the name tags and folders of the earlier words and only matches the new word's question against them.
More precisely
There is no table and there are no folders. Words are first converted into lists of numbers called embeddings, and attention is multiplication and addition over those numbers. Question, tag and folder are bundles of numbers named query, key and value. Because words consult others inside their own text rather than a separate one, this is called self-attention. A layer is not attention alone, either: a calculation stage follows, where each word chews over what it collected. A large share of the model's numbers (parameters) sits in this stage.
The previous design, RNN (Recurrent Neural Network), processed tokens in order, which made the work hard to divide up and left long-range links weak. The transformer solved both, though not for free. Scoring every pair of words means doubling the length quadruples the arithmetic of attention scoring, which is exactly why there is a ceiling on how much text fits at once.
The original design was built for translation, pairing an encoder that reads the input with a decoder that writes the answer. An encoder sees the whole sentence in both directions, while a decoder cannot peek at the part not yet written. Most conversational models today stack decoders only, predicting the next token from the words already in place.
Try it yourself
- Transformer Explainer (how it works) ailearn.space Type a sentence and open up the attention math where words score each other, then follow how the next word gets picked
- Attention Viz (the whole attention map) ailearn.space Compare what every attention head is watching, many meetings side by side in one view
- LLM Visualization (a 3D dissection) ailearn.space Spin a stack of transformer layers in 3D and follow one token all the way through
Common misconceptions
It's easy to think the model reads a sentence one word at a time from the left, but actually it spreads the whole input out at once and computes the relationships together. Words appear one at a time when it writes, not when it reads.
It's easy to think a transformer is one company's chatbot, but actually it is a blueprint shared across many systems. A translation tool and a chat assistant can stand on the same plan.
It's easy to think this design only handles language, but actually patches of an image and slices of sound become tokens too and pass through the same machinery. The same round table sits inside tools that draw pictures and hear speech.
One-line summary
A transformer seats words at a round table, has them score how much to look at each other, and repeats that meeting through dozens of layers, and in a conversational model ends by picking the next single word.
Spotted an error or have a better analogy? Suggest an edit · Last updated 2026-10-17