How chatbots think — a beginner’s tour
Chatbots don’t “think” like people. They repeatedly guess the next little piece of text. Do that thousands of times and it can look like understanding.
Six stops · plain English · step by step
You read “spaceship” as one idea. A language model doesn’t start there. It turns your text into tokens — small chunks it can count and compare.
Tip: try a long word like “internationalization” — you’ll often see it split.
Each colored brick is one token. Inside the model, each brick is really just an ID number — the neural net never “sees” your sentence as a human would.
After it reads the tokens so far, it doesn’t jump to a finished paragraph. It asks one question over and over: “What token is most likely next?”
The tallest bar is the “safe” choice. Picking other bars is how writing stays interesting — and sometimes wrong.
Press Roll to pick one token from these odds. That’s called sampling.
Before guessing the next token, the model looks backward. Attention is how it decides which past words matter most right now.
Click any word to move the “cursor.” The bars on the right show who gets the spotlight.
Attention is like a fixed budget of “focus points.” The bars below show how that budget is split across earlier words.
Real models run many spotlights at once (attention heads) — one might track names, another grammar, another quotes. Same idea, lots of copies.
Everything the model can use for this answer must fit in a limited list of tokens: instructions, chat history, and what it’s writing now. That list is the context window.
Remember those probability bars? Temperature reshapes them before the model picks. Same favorites, different willingness to take risks.
Drag the slider, then sample. At low temp, “mat” should win almost every time.
If the chips all say the same word, temperature is low. If they’re mixed, temperature is high.
This is a tiny toy chatbot for learning — not ChatGPT. Real models are huge and much smarter, but they still follow the same basic loop.
Lower = safer, similar replies. Higher = more random wording. Same idea as District 5.
After each reply, read this board top to bottom. It’s the whole tour in one glance.
Send a message to fill this in.
Which words got more focus?
Which first words were most likely?
Click a suggested message, then match each board section to a district you already visited.