Study Guide Instructor view
How Language Models Write
Teaching notes for Lesson 8.2, with controls for presenting it.
Keep this page on your own screen. Share only the lesson window. The lesson window holds no teaching notes, so sharing it cannot show them.
Presenting
- Open the lesson in its own window and share that window, not this one.
- Use Next and Previous here, or the lesson’s own, to move through the lesson. Next reveals one thing at a time: the next idea, or the answer to the question on screen, then the next step. Previous takes the last reveal back. The line below says what is on screen and what Next will show.
- Reveal hints and answers when the class is ready, and reset a demonstration before using it again.
The controls need JavaScript and a browser that supports BroadcastChannel. Without them, open the lesson in presentation mode and use its own controls.
The two windows talk to each other only inside this browser, on this device. Nothing is sent to a server, and no account is needed. A second device (a phone or another tablet) cannot follow the lesson window yet.
Now on the lesson window
- On screen
- Next teaching point
Guidance for this point
Lesson plan
- Level
- Beginner
- Time
- About 55 minutes; the steps below add up to 54
Learners discover next-token prediction from their own experience of finishing a sentence before any technical term is used. The lesson then names what they did (language model, token, training, inference), uses it to explain why fluent answers can be wrong, and finishes with sampling and temperature. The central message to protect: a language model writes what is likely, and likely is not the same as true.
Objectives
- Explain how a language model writes text by repeatedly predicting and choosing a likely next token
- Describe what a token is, and why a token is not always a whole word
- Explain the difference between training a model and using it, which is called inference
- Explain why a fluent, confident answer can still be wrong
- Explain what temperature changes, and why a low temperature does not make an answer accurate
- Explain the difference between a model and the application built around it
Before the lesson
- Open this page on your own screen and use “Open the lesson window” to open the lesson in a second window. Share only that second window.
- Try both panels once yourself, then reset them from this page so the class sees them fresh.
- Decide whether the two “Apply it” questions are done in class or set for another day. They count towards a learner’s mastery only when answered on a later day than the understanding checks.
Steps
Introduction Opening
On the lesson window now
On screen: the lesson’s title, module and number; Next adds its objectives and key terms, as the lesson page lists them; Next again begins the first step.
Objectives on screen
- Explain how a language model writes text by repeatedly predicting and choosing a likely next token
- Describe what a token is, and why a token is not always a whole word
- Explain the difference between training a model and using it, which is called inference
- Explain why a fluent, confident answer can still be wrong
- Explain what temperature changes, and why a low temperature does not make an answer accurate
- Explain the difference between a model and the application built around it
Purpose: Learners discover next-token prediction from their own experience of finishing a sentence before any technical term is used. The lesson then names what they did (language model, token, training, inference), uses it to explain why fluent answers can be wrong, and finishes with sampling and temperature. The central message to protect: a language model writes what is likely, and likely is not the same as true.
1. Finish the sentence Think 4 min
On the lesson window now
Purpose: Start from a familiar experience: everyone can finish a sentence, and doing so is a prediction based on learned patterns.
Ask
- Write down one word to finish the sentence, without discussing it.
- Why that word? Where did your sense that it fits come from?
- Did any other words come to mind?
Responses to expect
- Most will say “books”; some “laptops”, “notebooks” or “planners”.
- Reasons such as “that is what usually happens in lessons” are exactly the idea of learned patterns: draw that out.
Misconceptions to challenge
- A learner may believe: “There is one right answer.” Respond: Ask several learners for their word. Different sensible answers show that the best we can do is say which words are more likely.
Discussion pause: Collect five or six answers aloud before revealing anything.
In the lesson window
- Think it through: What one word would you put next, and why that word?
2. More than one possible next word Predict 4 min
On the lesson window now
Purpose: Turn the class’s different answers into the idea of a set of possible next words, each with a probability, adding up to 100%.
Ask
- If we asked 100 people, would they all agree?
- Why would “umbrellas” be rare but not impossible?
Responses to expect
- Most will choose the middle option. If the room’s own answers were varied, point to them as evidence.
Misconceptions to challenge
- A learner may believe: “A word with a small probability can never be chosen.” Respond: Small means rare, not never. Someone, somewhere, will write “umbrellas”; the table gives it 2%.
If the explanation does not land: Use a quick show of hands for three or four candidate words and write the counts on the board as percentages.
In the lesson window
- Think it through: If 100 different people finished the same sentence, what would you expect?
3. A language model makes the same kind of prediction Experiment 6 min
On the lesson window now
Purpose: Give the predict, choose, add, repeat loop a concrete form, and establish that a reply is generated rather than retrieved.
Ask
- Who would like to choose the next word? Why that one?
- Press “Take the most likely word” until the end. Would it ever come out differently?
- Now press “Pick at random, by probability” a few times from the start. What changes?
Responses to expect
- Learners notice that most-likely always gives “books at page ten.” and random picks give varied, sometimes odd sentences.
Misconceptions to challenge
- A learner may believe: “The model looks the answer up somewhere.” Respond: Point at the loop: at no step does anything get fetched. The whole reply is built one piece at a time.
- A learner may believe: “This is just the phone keyboard.” Respond: Same principle, far bigger scale: the real model reads the whole text, not only the last word. The panel’s note says so.
Discussion pause: Ask a learner to describe the four moves in their own words before moving on.
In the lesson window
- Next-word demonstration
4. Pieces of words: tokens Discover 5 min
On the lesson window now
Purpose: Introduce tokens as the real unit, reasoning from the problem (new words, names, typing mistakes) rather than from a definition.
Ask
- How would you design a model that can write a word it has never seen?
- What would go wrong with one letter at a time?
Responses to expect
- The fixed word list fails on new words; letters work but are slow. Reusable pieces are the compromise.
Misconceptions to challenge
- A learner may believe: “One token is one word.” Respond: Often, for common words, but rarer words are split, and punctuation is a token too.
- A learner may believe: “Every model splits text the same way.” Respond: Each model has its own way. The illustrative split of “unbelievably” is not any real model’s output.
In the lesson window
- Think it through: A model must be able to write any text, including names it has never seen, new slang and spelling mistakes. Which approach would work best?
5. Where the probabilities come from Explain 7 min
On the lesson window now
Purpose: Explain parameters, training and inference at the level the rest of the lesson needs, and separate training from use.
Ask
- How did you know “books” was likely without remembering one particular sentence?
- When you ask a chat assistant a question, is the model being trained or used?
Responses to expect
- Learners may pick “searches the internet”: acknowledge that some applications do search, then separate the application from the model.
- Some will think chatting trains the model; the comparison panel answers this.
Misconceptions to challenge
- A learner may believe: “The model is a database of answers.” Respond: It is a set of numbers capturing patterns. It can sometimes repeat memorised text, but it is not looking anything up.
- A learner may believe: “It learns from my conversation as I type.” Respond: Not the model’s parameters. An application may store and reuse a conversation, which is different.
If the explanation does not land: Compare training to years of reading that shaped your sense of what sounds right, and inference to using that sense to finish one sentence now.
In the lesson window
- Think it through: The model has almost certainly never seen your exact sentence about the teacher. How can it still give “books” a high probability?
6. The model and the app around it Explain 4 min
On the lesson window now
Purpose: Separate the model from the application around it, so that later claims about memory and live search make sense.
Ask
- When you use a chat assistant, what is there besides the model?
- What if What if two apps use the same model but only one can search the web?
Responses to expect
- The chat window, added instructions, memory, search
- Only that one can answer about recent events
Misconceptions to challenge
- A learner may believe: “The model learns from my conversation as we chat.” Respond: Its parameters stay fixed during use. An app may save notes and show them to the model later; that is the app, not learning.
On the board or with the pen
- Draw a box labelled “model” inside a larger box labelled “app”; add arrows for your message, the added instructions and any search results going in.
In the lesson window
- Check your understanding: Two apps use the same model. Asked about yesterday’s football results, one gives the right scores and the other says it does not know. What is the most likely reason?
7. Fluent is not the same as true Discover 6 min
On the lesson window now
Purpose: Let learners derive hallucination from what they already know, through a fictional worked example, and turn it into a checking habit.
Ask
- Before reading step 4: what kind of word is most likely after “…Brindle Vale Academy was”?
- Why did the famous school get a correct answer from the same process?
Responses to expect
- “A name”, “a person”. Once they say this, the invented answer is no surprise.
Misconceptions to challenge
- A learner may believe: “The model is lying.” Respond: Lying needs an intention and knowledge of the truth. The model is predicting likely text and has neither.
- A learner may believe: “Newer assistants do not hallucinate.” Respond: They hallucinate less, through extra training and searching, but the writing is still prediction.
Discussion pause: Ask: where in your own work would a fluent wrong answer do the most harm?
In the lesson window
- Check your understanding: Why can a language model give a confident, well-written answer that is wrong?
8. Choosing: the most likely, or not? Predict 4 min
On the lesson window now
Purpose: Show why always taking the most likely token is not ideal, and introduce sampling as the reason answers vary.
Ask
- If the most likely word is the best guess, why not always take it?
Responses to expect
- Many will predict “the best writing”; send them back to the first panel’s most-likely button.
Misconceptions to challenge
- A learner may believe: “Different answers mean the AI is broken.” Respond: Variation is designed in, through sampling.
In the lesson window
- Think it through: Imagine a model that always picks the single most likely next token. What would you expect from it?
9. Temperature: how adventurous the choice is Experiment 6 min
On the lesson window now
Purpose: Predict, then manipulate and observe how temperature reshapes the probabilities, and separate predictability from accuracy.
Ask
- Commit to a prediction for “umbrellas” at 2.0 before anyone touches the slider.
- Set 0.2 and sample twenty words. Then 2.0. What do you notice?
- Which setting would you want for extracting facts from a policy, and which for naming a school club?
Responses to expect
- At 0.2 almost every pick is “books”; at 2.0, five or six different words appear.
Misconceptions to challenge
- A learner may believe: “Higher temperature makes the model more creative in a deeper sense.” Respond: It only flattens the probabilities. The model knows nothing new.
- A learner may believe: “Temperature 0 gives the right answer.” Respond: It gives the most likely answer every time, which is consistent, not necessarily correct.
If the explanation does not land: If the arithmetic helps, open the “Go deeper” table and work one row of the squaring through together.
In the lesson window
- Think it through: Before you move the slider below: what do you think happens to the probability of “umbrellas”, the least likely word, when the temperature goes up from 1.0 to 2.0?
- Temperature demonstration
10. Check your understanding Check 4 min
On the lesson window now
Purpose: Learners show they understood the lesson’s key distinctions, with feedback that redirects rather than tells.
Ask
- Answer individually first, then compare with a neighbour before revealing.
Responses to expect
- The temperature question is the one most often missed; give the hint before revealing.
Discussion pause: Reveal answers only after most of the room has committed.
In the lesson window
- Check your understanding: A colleague says: “Set the temperature as low as it will go and the assistant will stop making mistakes.” What is the best response?
- Check your understanding: Which statement about tokens is accurate?
- Check your understanding: A school uses an AI assistant to draft letters to parents. Which of these is inference?
11. Apply it in a new situation Apply 2 min
On the lesson window now
Purpose: Set up independent application in new situations, ideally answered on a later day for spaced practice.
Ask
- Who would like to try these now, and who will come back to them later this week?
Responses to expect
- If answered in class, expect the second question to split the room between checking and asking again at a lower temperature: link it back to the previous step.
In the lesson window
- Apply it: Two members of staff ask the same AI assistant exactly the same question about the school’s data retention policy, a minute apart, and get differently worded answers. What is the most likely explanation?
- Apply it: An IT technician asks an AI assistant to summarise a long security incident report. The summary says the incident began on 14 March. What should the technician do before putting that date in an email to the head teacher?
12. What to remember Consolidate 2 min
On the lesson window now
Purpose: Pull the lesson together in six sentences, and address the commonest misunderstandings directly.
Ask
- Without looking, what are the four moves a language model repeats?
- Finish the sentence: likely is not the same as…
- Explain how a chat assistant writes a reply in three sentences; then, which move makes answers vary? (the closing questions)
Responses to expect
- Predict, choose, add, repeat. True.
- Predict, choose (by sampling), add, repeat, with nothing checking truth; variety comes from the choose step
In the lesson window
- Think it through: Without looking back, explain to someone who missed this lesson how a chat assistant writes a reply, in no more than three sentences.
- Check your understanding: In predict, choose, add, repeat, which move is the main reason one question can get differently worded answers?
Lesson recap Closing
On the lesson window now
On screen: the lesson’s objectives again; Next adds the closing question, which asks the class to explain each one in their own words without looking back. It says nothing about what anyone has learnt: use the answers to decide what to revisit.
Points to listen for
- A language model predicts how likely each possible next token is, and writes by repeating predict, choose, add, repeat.
- Training sets the parameters from huge amounts of text; inference uses them and does not normally change them.
- Fluent is not the same as true: check names, numbers, dates and references against a reliable source.
- Sampling makes answers vary; temperature controls how much, and a low temperature means predictable, not accurate.
Consolidation
- A language model predicts how likely each possible next token is, and writes by repeating predict, choose, add, repeat.
- Training sets the parameters from huge amounts of text; inference uses them and does not normally change them.
- Fluent is not the same as true: check names, numbers, dates and references against a reliable source.
- Sampling makes answers vary; temperature controls how much, and a low temperature means predictable, not accurate.