Unboxed · Chapter 4 · Auf Deutsch

Who looks at whom

In the last chapter, our model only looked at the last word. That’s how “The emperor eats bacon with icing sugar” could come out: “with” didn’t know that bacon came before it.

Real models do it differently. Before they guess the next word, every word looks at the words before it and asks: which of you matter to me? Experts call this attention. It is the idea behind the transformer, the design of almost all of today’s language models. The T in ChatGPT stands for exactly that.

Try it: pick a sentence and tap the word underlined in red. The stronger a word is shaded, the more attention it gets.


One word, two places

On the map from the first chapter, “bank” would have a problem: does it belong by the river or with the money? With attention, it doesn’t have to decide once and for all. In the sentence with the river it moves towards the water, in the sentence with the money towards the cash counter. A word only gets its exact place on the map inside a sentence.

Who is “she”?

The same helps with words like “she”, “he” or “it”. On their own they say nothing. Only the look back at “empress” reveals who is tired.

That covers the most important parts inside the box: the map, the guessing, writing word by word, and attention. The next chapters are about what can go wrong.