Years 4–7 · How a chatbot writes00 Start

How a chatbot writes

A chatbot reads one long line of numbers and guesses the next one. Chats, stories, homework help: it all comes from that one idea. Let’s take it apart.

The journey · about 50 minutes

  1. 01Your words become numbersTokens
  2. 02One token at a timePrediction
  3. 03What did it read?Training data
  4. 04How does it learn?Learning
  5. 05A chat is one long tapeConversation
  6. 06The words you don’t seeHidden context
  7. 07When it doesn’t knowMaking things up
  8. 08Better words in, better guesses outTakeaways

Running it with a class? Put it on the big screen with P (present mode) and move with ← →. Students can follow along on their own devices.

Everything here is real: a real tokenizer, real training data and real model probabilities, recorded or running in your browser. Nothing students type is sent anywhere.

1 of 9