How does an AI think?
It only ever predicts the next word, from a ranked list of guesses.
The cat drinks ___
Nobody programmed those guesses. Where did they come from, and how does it answer about TODAY?
0.2 From the internet to your answerCommon questions
What is "How does an AI think?" about?
What question does this lesson answer?
What will I be able to do after this lesson?
What comes next?
What this lesson shows
It only ever predicts the next word, from a ranked list of guesses.
The question it opens with
An AI finishes your sentence as if by magic. What is it actually doing?
The walkthrough, in the lesson's own words
- One move, on repeat. That's a language model.
- Now watch it do that one move over and over to write a whole sentence.
- A chatbot writes a long, fluent answer one word at a time, and you can watch it stream in. What is it actually doing under the hood?
- The same one move on a loop: score every word that could come next, take the top one, add it, then ask again. Fluency is that single predict-and-append step repeated, not a plan written out in advance.
- One caveat: "think" is a metaphor. There's no inner voice or awareness here, just this one predict-the-next-word step, on a loop. The whole course is about that mechanism, not a mind.
- Nice, the model ranked “milk” first too. It didn't know; it just judged “milk” the most likely next word.
- Same machine, new context: it now ranks a different word first. Nothing was looked up; it just rescored every word for this sentence.
- Reasonable guess, and not wrong! The model also weighed your word, it just scored the top word a little higher. There's no single right answer, only a ranking.
- Change the sentence and predict again, the bars re-rank live.
- Illustrative scores, a recording of how a model ranks, not a live model.
- This replay always takes the top word; real chatbots often sample from the top few (lesson 4.1).
Key takeaway
The 'magic' is one move repeated: score the next word, pick the top one, again and again.
What you can do after this lesson
You can explain what an LLM is really doing: predicting the next word, on repeat.
Check yourself: At its core, what is an LLM doing when it writes?
- Predicting the next token, over and over(correct)
- Looking answers up in a database
- Following hand-written grammar rules
- Copying sentences from training data
It only ever scores the likely next token and picks one, then repeats. There is no database lookup or stored sentences, just that one move on a loop.
Prefer reading first? This lesson has a companion explainer: How LLMs work
Where it leads: Nobody programmed those guesses. Where did they come from, and how does it answer about TODAY?
This is the written summary. The lesson itself is interactive: you predict, drag and operate the mechanism above, and the reveal answers you.