Skip to content

Week 12 — How Language Models Actually Work

At a glance

Date Friday, November 6, 2026
Unit 2 — AI Unmasked
Big idea Language models generate text by predicting likely next tokens from patterns in training data.
Goal Students experience next-token prediction by building a class sentence one word at a time.
Student accounts needed None. Teacher demo only if used.
Prep time 5 minutes

Why this lesson looks the way it does

Language models are easier to over-explain than to teach. The unplugged next-word activity gives every age group the core mechanism: a model does not need to "know" the whole answer in advance to produce a fluent sentence. It can repeatedly choose a likely next piece.

This lesson should not imply that modern language models are simple autocomplete. They are vastly more complex. But the classroom model is honest enough: text generation is driven by statistical patterns over pieces of language, and that creates both power and failure modes.

Your professional perspective can help students avoid two bad extremes: "it is just copying" and "it understands like a human." The better middle is: it learns rich patterns from enormous text data and uses them to generate plausible continuations.


CSTA 2026 standards

Concept area Connection
Algorithms & Design Students model an algorithm that repeatedly selects a next token.
Programming Students connect generation to step-by-step computational processes.
Data & Analysis Students use class voting data to predict likely next words.
Systems & Security Students discuss why generated text should not be treated as verified fact.
Computing & Society Students consider how language tools can be useful while still needing human judgment.

"I can…" objectives

By the end of today, students can say:

  • I can explain next-token prediction in my own words.
  • I can describe why a language model can sound fluent without guaranteeing truth.
  • I can tell the difference between a likely sentence and a verified fact.
  • I can connect language models to the training data they learned from.

Teacher prep — the 5-minute version

  1. No student computers needed at first. Keep screens closed until you choose to demo.
  2. Write on the board:

    Last Friday: missing examples can cause bias.
    Today: words are data too.

  3. Under that, write:

    Prompt: The robot walked into the classroom and saw ___

  4. Prepare three blank columns on the board:

    Candidate words | Votes | Sentence so far

  5. Optional teacher tab: your preferred free AI chatbot, projector only. If unavailable, skip it.

Minute-by-minute run sheet

0:00–0:04 — Anchor

"Last Friday we saw that image models learn from examples, and missing examples can make them fail. Seven days later, we are switching from images to words. Words are data too. A language model learns patterns from text, then predicts what text could come next."


0:04–0:12 — Mini-lesson: tokens without jargon overload

Write: The robot walked into the classroom and saw ___

Ask for possible next words. Write 5–6 on the board: a, the, students, pizza, dragon, because.

Say:

"A language model is doing a much more advanced version of this. It looks at the text so far and asks, 'What piece of language is likely next?' That piece might be a word, part of a word, punctuation, or even a space. We call those pieces tokens."

Important caveat:

"Modern models are not tiny word counters. They learn deep patterns across huge amounts of text. But the output still arrives one piece at a time. Likely next token, then likely next token, then likely next token."


0:12–0:36 — Paired work: class language model

Students become the model. The class builds two sentences.

Round 1 — predictable sentence

Start with:

"After school, I like to ___"

Pairs propose one next word. List candidates. Vote by hands. Add the winning word. Repeat 5–7 times.

After each word, ask:

"Did that word make the next word easier to predict or harder?"

Round 2 — weird but grammatical sentence

Start with:

"The invisible sandwich opened the ___"

Repeat the process. Let it get strange but keep grammar.

Say:

"Notice what happened. We produced a sentence by choosing one likely next word at a time. It may be funny. It may be fluent. That does not mean it is true."

Pair reflection during the activity

Give pairs two questions to answer verbally:

  1. What made a word feel likely?
  2. When did the class choose a surprising word, and how did it change the sentence?

Make older students work harder

Ask extenders to notice probabilities: "If 12 people voted for 'eat' and 3 voted for 'play,' what would happen if the model sometimes chose the less likely word?" This opens temperature/creativity without naming it unless you want to.


0:36–0:42 — Share-out

If using a teacher AI demo, type a harmless prompt such as:

"Write a silly two-sentence story about a robot in a classroom."

Before pressing enter, ask:

"What kinds of words do you predict will appear?"

Afterward:

"Did it produce something likely? Did it produce something true? Those are different questions."

If no demo, use the class sentence.


0:42–0:45 — Teaser + prompt

"Next Friday we will learn how to ask better questions of an AI system. Prompting is not magic wording. It is giving better context, constraints, and criteria."


Tiered challenges

  • 🟢 Starter (grades 5–6): Explain next-word prediction using the class sentence.
  • 🟡 Builder (grades 7–8): Explain why a sentence can sound right but still not be true.
  • 🔴 Extender (grades 9–10): Explain how choosing the most likely word every time might make writing dull, and how sometimes choosing a less likely word might make it creative or risky.

Share-out prompt

"What is the difference between a likely next word and a true statement?"

🤔 Think About This

When you type this week, notice autocomplete or suggested replies.

Ask: is it predicting what is true, or what is likely to come next?


🔌 Unplugged Plan B — if the internet is down

This lesson is already unplugged. Use the full paper version.

Time Activity
0:00–0:04 Same anchor: images last week, words this week.
0:04–0:12 Mini-lesson on tokens using the robot sentence.
0:12–0:24 Round 1 class sentence: predictable prompt, vote one word at a time.
0:24–0:34 Round 2 class sentence: strange prompt, vote one word at a time.
0:34–0:40 Pairs write a 6-token "model output" by passing paper: each person adds only the next word, then passes it on.
0:40–0:45 Share funniest fluent sentence and land: fluent is not the same as true.

Common problems & fixes

Problem Fix
Students say the model "knows" the answer Say: "It generated a likely continuation. Knowing and predicting are not the same thing."
Older students object that LLMs are more complex Agree: "Yes. This is a classroom model of the core output behavior, not the full architecture."
Sentence gets inappropriate Set the rule: classroom-safe words only; you can reject candidates without debate.
Students focus only on randomness Bring back training data: likely words come from patterns learned in text.
Teacher AI demo is blocked Skip it. The unplugged class model is the main lesson.

Vocabulary

  • Language model — an AI model that generates or analyzes text
  • Token — a piece of text, such as a word, word part, space, or punctuation
  • Next-token prediction — choosing a likely next piece of text based on what came before
  • Prompt — the input or instruction given to an AI system
  • Fluent — sounding smooth and natural as language

Reflection — fill in after class

  • Which sentence starter produced the clearest next-token moment?
  • Did students confuse likely with true?
  • Did the demo help, or was unplugged stronger?
  • Which students are ready for harder prompting work next week?

Next week: Week 13 — Prompt Engineering: Asking Better Questions