Minideas

Idea 9 of 15 · Generative AI

How a chatbot writes

It guesses the next word, adds it, and guesses again.

The cat sat on the …mat62%sofa18%floor12%moon1%how likely each next word is
1 / 4

It guesses the next word

Give it some text and it scores every word that could come next. After “The cat sat on the”, “mat” scores high and “moon” scores low. The scores come from patterns in everything it has read.

1Thecatsatonthemat2Thecatsatonthematand3Thecatsatonthematandpurredadd the word, guess again
2 / 4

Then it does it again

It adds the chosen word and guesses the next one, then the next. Every answer, from an email to a poem, is built one piece at a time. (Strictly, the pieces are often parts of words, called tokens.)

The cat sat on the …try 1… mat and purred.try 2… sofa and fell asleep.same start, different endings
3 / 4

A little luck in every pick

It doesn’t always take the top word. A bit of randomness keeps the writing natural, which is why the same question can get a different answer each time.

You:AI:You:AI:it rereadsall of thisbefore eachnew word
4 / 4

A chat is one long document

Your messages and its replies are joined into one text, and it keeps continuing it. It rereads all of it before each new word, up to a limit, which is why very long chats can lose track of the beginning.

Swipe the card, or use the arrow keys.

Go deeper

Each card stack gives you the idea. These open resources go into the detail.