How Large Language Models Work
How large language models such as ChatGPT, Claude and Gemini actually work: tokens, embeddings, next-word prediction, training by gradient descent, attention and the Transformer, scale, human feedback, hallucinations, tools and reasoning, with live demos you can play with.
How chatbots think
You type a question. A few seconds later, fluent text appears. What actually happens in between?
Cutting text into pieces
A computer cannot read letters. Everything has to become numbers first.
Meaning as direction
Words that are used in similar ways end up close together, and relationships become arrows.
Guessing the next word
The model never writes a whole answer at once. It picks one token, adds it to the text, and guesses again.
Billions of dials
Where do the probabilities come from? From a network of numbers that starts out random and is tuned, nudge by nudge.
Walking downhill in fog
Imagine every possible setting of the dials as a landscape. The height is the error. Training is a long walk downhill.
Attention
Which earlier words matter for this one? A Transformer asks that question for every word, all at once.
A tower of layers
Attention, then a small network for each token, then again. And again. Ninety-six times in GPT-3.
Bigger, and then bigger
More parameters, more text, more computing power. For years, simply scaling up kept making models better.
From text machine to assistant
A model trained only to continue text is not yet a helpful assistant. Two more rounds of training shape it.
The context window
A model has no memory of its own between conversations. It can only see the text in front of it.
Confidently wrong
The model always produces the next word. It has no built-in alarm that rings when it does not know.
Thinking before answering
Models that call calculators and search engines, and models that write out their reasoning before they reply.
Costs, rights and risks
The technology raises questions that engineering alone cannot answer.
Autocomplete, scaled up
A simple goal, predict the next token, plus vast data and computing power, produced something nobody fully predicted.
Read the full story as text · อ่านภาษาไทย
This interactive 3D film needs JavaScript. PlanetPast home