Block I · Foundations · Lesson 2
How an AI model thinks (and gets things wrong)
You'll understand what happens inside, from the moment you type until it answers: what tokens, the context window and temperature are, why some models reason before answering and why they sometimes make up facts with total confidence.
- 10 min
- 9 animated slides
- 4-question quiz
- Narrated in 6 languages
What you'll see in this lesson
- From your question to its answer, token by token
A language model doesn't look the answer up anywhere: it writes it piece by piece, predicting what comes next.
- Tokens: the Lego bricks of language
The model doesn't read letters or whole words, but tokens: common chunks of text that fit together like bricks.
- Like your phone's autocomplete, but giant
For each gap, the model calculates the probability of thousands of possible tokens and picks one of the most likely.
- Training and inference: studying versus taking the exam
The model learns once, over months; every time you ask it something, it just applies what it learned. That's inference.
- The context window: its work desk
It's everything the model has in front of it when answering. What isn't on the desk doesn't exist for it.
- Temperature: the pinch of salt of creativity
It controls how much risk the model takes when picking the next token: low, the most likely; high, more varied options.
- Reasoning models: they think before they speak
Before answering they write an internal reasoning draft, and that helps them solve multi-step problems better.
- Why it makes things up so confidently
A hallucination is a false fact stated with conviction. It isn't a rare glitch: it comes from how it learns and is evaluated.
- Summary: how it thinks and why it gets things wrong
A model is a very well-trained token predictor: understanding how it works helps you ask better and be wary in time.
Tools and concepts
- Tokenizer
- Reasoning
- Temperature
Sign in with your Google account to access this lesson and the whole course.