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.

Go to the course

What you'll see in this lesson

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Reasoning models: they think before they speak

    Before answering they write an internal reasoning draft, and that helps them solve multi-step problems better.

  8. 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.

  9. 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

Sign in with your Google account to access this lesson and the whole course.

Go to the courseSee the full syllabus

More lessons in this block