How language models work
A reply is built one word at a time, by guessing what comes next from patterns learned in text.
In this course
Explain the next-word loop and why it can sound human without thinking like a person.

The sky is
You type a few words. The machine reads them.
One word at a time
A language model does not read your whole question and then write a whole answer in one go. It writes one word, then looks at everything again, then writes the next word. The reply appears word by word because that is literally how it is being made.
The loop is simple: read the text so far, guess the most likely next word, add it, and repeat. The “text so far” includes your message, the instructions the app gave the model, and every word it has already generated. When the answer looks finished, or when it hits a limit, it stops.
This is why a long answer can drift. Each new word becomes part of the context for the next guess, so a small early choice can shape the rest of the reply.
Where the guess comes from
Before it ever talked to you, the model read an enormous amount of text. It did not memorize a list of correct answers. It learned statistical patterns: which words tend to appear near each other, which phrases tend to follow which openings, and which kinds of sentences tend to complete a thought.
When it sees “The sky is”, a small set of words feel natural: blue, grey, dark, clear. The model assigns each a likelihood based on those patterns and picks one. It is not checking the sky. It is continuing a pattern it has seen before.
The same prompt can produce different answers because the model samples from likely options rather than always taking the single most likely one. That is part of why it can be creative, and part of why it can be unpredictable.
Guess a word. Add it. Read it all again.
Try the loop
Read the sentence so far. Pick the word that feels most likely. There is no penalty for choosing a surprising word; the point is to notice what your brain does before you click.
What happens next?
Put the loop in order. Each pass through it produces one more word.
Steps
Your order
Pick a step to place it first.
Why it can sound human
Do this across billions of examples, and the patterns become very rich. The model can write a poem, explain a joke, plan a trip, or switch tone. It can produce a reply that feels like it understands you.
But sounding human is not the same as thinking like a human. The model does not have a private model of the world, a memory of your last conversation, or a plan for the whole answer. It has a very good feel for what comes next.
The surprising part is that next-word prediction, done at enough scale, starts to look like reasoning. The useful part is to enjoy the fluency without mistaking it for understanding.
What it is not doing
It is not looking up facts, unless the app gives it a search tool. It is not remembering you, unless the app sends the conversation history. It is not deciding what is true; it is deciding what is likely to come next.
Keeping those limits in mind makes its mistakes easier to understand. A confident paragraph is not proof that the model checked anything. It is proof that the next-word pattern was strong.
Quick check
1 of 2What does a language model do after writing one word?
What you learned
- A reply is generated one word at a time.
- Each word is a guess based on patterns in text.
- Enough good guessing starts to look like thinking.
That is “How language models work.”
If the idea clicked, mark it complete. Your progress and badges stay on this device.
Badge
The Guessing Game
You can explain the next-word loop.
Already know this material? Skip the rest of the foundation.
See your achievementsBadges mark completion, not mastery. They are self-reported course completions saved on this device.