Why that word? Think of heat. Cold, and the model freezes onto its safest next character every time, so it loops and repeats itself. Hot, and its choices bounce around wildly, until the words stop making sense. One number sets how hot the model runs.
Now make a call
Turned cold, the model almost always takes its single most likely next character. Turned hot, it lets unlikely characters win too. In a moment you will turn this one dial yourself, from cold to hot, on the same line, changing nothing else. Before you do: which setting do you think writes something you would actually want to read?
The line for it to continue (change it to anything you like):
Write something with it yourself.
Type any opening line. The real model, running live, continues it one character at a time. Lower the dial and it plays safe; raise it and it takes chances. It is not recalling a memorized passage and it does not answer questions; it writes brand-new text in Shakespeare's style, the same move you watched above.
You've seen the whole machine.
- It reads by turning your text into numbers.
- It learns by making millions of tiny corrections.
- It pays attention to the earlier letters that matter most.
- It writes by sampling one character at a time.
The model you just operated and the giant ones behind the headlines are the same design. The only real difference is scale. You worked with about 10 million numbers. The large ones carry 175 billion. Same four moves, run wider and on far more text.
If this opened the box and you want to climb further in, these are the clearest guides we know.
- Andrej Karpathy, "Let's build GPT"The talk cutaway is built on. He writes this same model in code, line by line.
- Transformer Explainer (Georgia Tech)A full GPT-2 running live in your browser. Hover any word and watch the attention move.
- 3Blue1Brown, Neural NetworksThe most beautiful visual explanation of what is happening inside the math.