Computer science
How does ChatGPT pick the next word?
It doesn't look up a ready-made answer. It gives every word that could come next a chance, picks one, adds it to the reply, and does it again.
In this lesson
A chat reply, and the chances for its next word.
Your notebook page
- Score every possible next word.
- Likelier words get bigger chances.
- Pick one, add it, repeat.
- No plan for the whole sentence.
Where you'll see it today
A chat reply streaming in, your keyboard's suggestion bar, an email app finishing your sentence.
The course
Build your own ChatGPT
Every lesson adds a part. Finish them all to build the Pocket chatbot.
- 1Next wordsHow does ChatGPT pick the next word?
- 2Keyboard guessesHow does your keyboard guess your next word?
- 3TokensWhy does ChatGPT chop words into pieces?
- 4Meaning mapsHow does AI know “king” is close to “queen”?
- 5AttentionHow does AI know what “it” means?
- 6Learning from mistakesHow does a neural network learn from mistakes?
- 7TemperatureWhy does ChatGPT sometimes make things up?
- 8Build the chatbotCan you train a mini chatbot?
