L003 · How AI thinks · 1 min · Interactive

What a chatbot really does

A chatbot writes its answer one small piece at a time, each time picking a likely next word.

01 · The idea

Under the hood, ChatGPT, Claude and Gemini are large language models, or LLMs. Their core skill is simple: given some text, predict what comes next.

Ask for a recipe for pho and it does not look up a recipe. It writes one, word by word, choosing words that usually follow in texts like this. Because it learned from so much text, the result is often excellent.

This explains a lot. It is why answers sound fluent and confident. It is also why they can be wrong: a sentence can sound right and still be false.

Try it below: pick the next word yourself and watch how the odds change as the sentence grows.

02 · Think of it like this

It is like the word suggestions on your phone keyboard, but trained on a library-sized amount of text and able to keep going for pages.

03 · Try the toy

Try it

Guess the next word

Press Sample to let the AI add one word at a time. Then slide the temperature and try again.

The best thing about Monday is

What could come next

  • the37%
  • coffee22%
  • that18%
  • it11%
  • nothing7%
  • lunch5%

The AI never “knows” the next word. It gives every possible word a score, turns the scores into odds, then rolls weighted dice. Temperature changes how lopsided the dice are: at 0 it always takes the favourite, so you get the same sentence every time; turned up, long shots get a real chance and the writing gets surprising.

04 · Do it now

05 · Quick check

When you ask a chatbot a question, what is it mainly doing?