Back to Discover
Lesson

How AI Writes: Inside Language Models

You can explain how large language models generate text one token at a time, why the same prompt can produce different outputs, and where those words actually come from.

Before you enter

A complete interactive classroom, not just a preview.

Start when you are ready to enter this Stage's 10 scenes and explore, respond, and learn as you go.

10
Scenes
20 min
Estimated
Content language: en-US
Start this Stage
Sign-in may be required to play
What happens inside
  1. 01What Is AI Writing, Really?slide
    Orientation

    Set up the central mystery: when AI writes, what's happening inside? Introduce the learning journey.

    • AI writing feels magical
    • It's actually a predictable process
    • We'll peek under the hood
  2. 02Tokenize a Sentenceinteractive
    Model buildingObserve

    Learner feeds phrases into a tokenization simulator and watches text get sliced into tokens — seeing that tokens aren't always whole words.

    • Text breaks into tokens
    • Tokens can be word pieces
    • Same sentence → different token splits
  3. 03Tokens: The AI's Alphabetslide
    Model buildingExplain

    Connect the simulation to the bigger idea: tokens are the model's basic unit, and they shape everything the model does next.

    • Tokens, not characters or words
    • Why splitting matters
    • Foundation for prediction
  4. 04Predict the Next Tokeninteractive
    PredictionPredict

    Learner sees a partial sentence and must guess which token the model thinks comes next; the simulation reveals the model's probability distribution.

    • Model scores many options
    • Top tokens rise to the top
    • Probability ≠ certainty
  5. 05One Token at a Timeslide
    Model buildingExplain

    Reveal the core loop: the model writes by repeatedly picking a token, appending it, and predicting again — explaining why output builds word-by-word.

    • Generate → append → repeat
    • Each step depends on the last
    • This is how full essays appear
  6. 06Temperature Dial: Predictable vs Creativeinteractive
    Misconception repairChoose

    Learner turns a temperature slider and watches the same prompt produce outputs ranging from robotic-and-safe to wild-and-varied.

    • Low temp = safe, repetitive
    • High temp = varied, surprising
    • The model never changes — only the dial
  7. 07Where's It Coming From? Training Data Explorerinteractive
    Model buildingObserve

    A diagram showing the flow from massive training corpora → learned patterns → the model's output, helping learners see output originates from training data, not live lookup.

    • Trained on huge text
    • Outputs reflect patterns learned
    • No live internet lookup
  8. 08Spot the Hallucinationinteractive
    PracticeChoose

    Learner reads short AI outputs and pinpoints the confident-sounding but factually wrong claim, building intuition for when AI makes things up.

    • Confident ≠ correct
    • Plausible patterns can be false
    • Always verify surprising claims
  9. 09Why AI Gets Things Wrongslide
    SynthesisExplain

    Tie hallucination back to the core loop: the model picks plausible tokens, not true ones — so confident outputs can be fabricated.

    • Optimizes for plausibility
    • No truth-checker inside
    • Pattern ≠ fact
  10. 10Your Mental Model for AI Writingslide
    SynthesisExplain

    Pull the whole picture together: tokens → next-token prediction → temperature → training data → possible hallucination. Leave the learner with a portable mental model.

    • Tokens → predict → repeat
    • Temperature tunes risk
    • Verify when stakes are high
Discussion

Discussion threads for a Stage aren't available yet.

Where this leads
Explore more

More in Technology & Computing

See all