See how examples influence which words seem likely to come next, without assuming that the most likely word is certain.
When you type a message or a search, the computer often suggests the next word. Is it guessing what you mean, or using patterns from examples?
A sentence can have more than one sensible next word. A text generator needs a way to choose between possibilities.
Make your prediction first. Help opens once you've locked it in.
Write down one ending of your own before looking at any examples. Why did you choose it? Keep your answer to revisit later.
Start with mat = 3, chair = 2, roof = 1. Predict the most frequent ending, then add five more lines containing roof. Press Update examples and explain why the prediction changes.
Add five roof examples and update the model.
Use the board. This ticks when you get there.
Look at the original six examples and identify the ending that occurs most often.
Explain why the most frequent ending is not guaranteed to be chosen.
Complete the reflection using the evidence from the examples.
A simple model can count which words followed a phrase in its examples. More examples of one ending make that ending more frequent, but not certain. Select Show fractions and percentages on the board if you want to describe these frequencies numerically: mat is 3 out of 6, chair 2 out of 6 and roof 1 out of 6. If a generator samples endings in proportion to these counts, those fractions become its probabilities.
A probability is not a promise. The most likely choice is not the only possible choice.
Modern language models use tokens, neural networks and much more complex learned representations of context. Our small counting model is a way to investigate one idea: possible next words can have different probabilities.
Discuss: does changing the examples change the meaning of the sentence, or just the pattern our model has learned from them?
Without looking at the table, explain why a text generator might produce different endings for the same beginning. Then return to your first prediction: would you change it? Why?
An AI writing assistant suggests mat to finish “The cat sat on the”. Compare these two reactions:
Which reaction shows better judgement? Explain what you would check before accepting a suggested word. The suggestion above is a prepared example.
Looking ahead: Our model uses one fixed phrase and a small set of examples, so we can see both why it favours an ending and where it struggles. Modern language models predict tokens using much richer context and learned patterns. Their responses can be far more useful and convincing, but they still have blind spots — often harder to identify or explain. Treat an AI suggestion as something to evaluate, not automatically accept: does it fit your purpose, and what would you need to check?
Next: use dice to make a choice according to these probabilities.
Lesson done. You've finished every step you need.
Count example endings and distinguish a frequent next word from a certain one. About 25 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
Use the board as a transparent fixed-context model, not a miniature modern LLM. No AI account is required. The Explain it to me clip is an optional scaffold after prediction. Formal fractions and percentages are an optional extension, not a prerequisite: start with counts and bars. Ask learners to justify answers using counts rather than guesses about the writer's intentions. Common misconceptions: most likely means certain; the generator understands what the writer intends; changing the examples cannot change the prediction.
Students may read 'most common' as 'must come next'.
Stretch: Explain where the toy model differs from a modern AI assistant (tokens, much longer context, learned patterns).
Support: Use the prepared examples, read the explanation aloud and repeat a small trial.
Unit 1, lesson 2 uses a die to choose an ending by its chance. A physical die helps; no online AI account is needed.