Class 8 · Unit 3: Generative AI · Lesson 3.1 · 40 min
What "generative" means
“I will come…” and the phone offers: home · tomorrow · later. “It knows what I want to say!” Does it?
Today you will: Build a next-word table by hand · Generate a sentence from it · See why it loops — and how a die fixes it
Story
Bilal is typing a message to his cousin. He types "I will come" — and the phone offers him three words before he has thought of any: home · tomorrow · later.
He taps tomorrow. Then the phone offers three more. He taps again. And again. In four taps he has a whole sentence he never actually wrote.
Bilal: “It knows what I want to say.”
Hiba is unconvinced. "It doesn't know you. It has just seen a lot of messages, and after I will come, people usually type one of those three."
Who is right? Today you build the thing inside the phone — by hand — and find out.
Watch
Predicting the next word — — scan code 8.3.1 in the printed book.
Warm up your fingers
Skill: typing whole paragraphs, Term 2 (5 min)
- On typing.com, open the paragraph practice your teacher has set for this term .
- Target this term: 30–35 WPM at 93% accuracy or better.
- Do not stop to fix every letter as you go. Finish the sentence, then read it back.
- Words for this unit:
generativepredictprobabilitysourceverify
On the laptop
You need: himal-story.txt (a short retelling of Himal and Nagrai) · LibreOffice Calc · next-word.ods · a die
Mission 1: Your mission
- ☐1
Read the story aloud in your pair.
- ☐2
next-word.odslists five words:the · king · snake · she · water. For each, write every word that comes straight after it in the story. You are the machine. - ☐3
In the last column, write the most common next word — the model's prediction.
- ☐4
Predict: if you always take the most common word, what will happen after ten words? Then generate from
the, one word at a time. - ☐5
Fix it the way real systems do: roll a die to choose between the top two or three words. Generate ten words again and compare.
- ☐6
Last row: what did the table know, and what didn't it know?
No laptop today?
Build the table on the blackboard from a printed story — each word's column filled by a different pair. Generate the sentence as a class, one student rolling the die.
Now you know
- Generative AI produces text, images and audio. A classifier asks which class?; this asks what comes next?
- Predict the next word, add it, repeat hundreds of times for a long answer.
- The predictions come from patterns counted in huge amounts of text. Nothing is looked up.
- Sometimes it picks a less likely word so the same question gives different answers.
- It predicts what's likely, not what's true Lesson 3.5.
🕌 From our heritage
Generating every possible word mechanically is an old idea. Al-Khalīl ibn Aḥmad al-Farāhīdī (d. c. 786), compiling the first Arabic dictionary, worked through the permutations of Arabic root letters to list every combination the language could form, then asked which of them were actually used and which were not. His machine-like step was generating the possibilities; the scholarship was knowing which ones meant anything. A language model is in the same position, and so are you when you read its output.
Source: al-Farāhīdī, Kitāb al-ʿAyn (8th century), the earliest known Arabic dictionary.
Debate it
Your next-word table was built from one short story, so it can only write about kings, snakes and water.
If a table were built from every book, message and web page in the world, what could it write about? And would any of it be checked by anyone?
Check yourself — practice, not a test
1. "Generative" means the model:
- ○ Sorts photos into groups
- ○ Produces new content, such as text or images
- ○ Measures how accurate another model is
- ○ Stores facts in a table
2. Put the steps of generating a sentence in order:
- 1. Repeat from the beginning of the new text
- 2. Add that word to the text
- 3. Predict the next word
- 4. Look at the text so far
3. A generative model looks up facts in a dictionary before answering.
- ○ True
- ○ False
4. Always picking the most likely next word makes the text go round in a ______.
5. You ask the same question twice and get two different answers. This is mainly because the model:
- ○ Has learned something new in between
- ○ Does not always choose the most likely next word
- ○ Is broken
- ○ Is asking another model
Remember
Predict, add, repeat. It writes what is likely, not what is true.