← Back to course
AI and You 9-12 / Week 03 / Tuesday
2/6
Week 03 Β· How Models Learn

Tuesday

Counting what comes next
// The crew trains Tiny Text by hand to see how training data becomes predictions
⏱ about 20 min

Tuesday: Counting What Comes Next

Wren deals six index cards onto the library table. Each card holds one short sentence about the school.

"Meet Tiny Text," he says. "A model so small we can build it by hand."

Comet reads the first card aloud. "The library opens at eight. That is not exactly exciting."

"It doesn't have to be exciting," Wren says. "It has to be countable. Which word follows which?"

Nova projects an empty tally table above the cards. "Would you like a hint?" she asks. "Take two words at a time, then slide over one word."

Comet grabs a pencil and passes another to you. "Reviewer, let's count the first three cards together."

Meet Tiny Text

Generative models make outputs that follow the statistical patterns of their training data.

Large language models predict the next word, or token, in a sentence.

Tiny Text is a made-up next-word model the crew trains by hand. Its training data is six sentences on index cards.

Real language models are enormously bigger. Some AI systems contain billions or even trillions of decision points.

CardTraining sentence
T1the library opens at eight
T2the library has quiet rooms
T3the lab opens at nine
T4the lab has new desks
T5the library opens at eight
T6the gym opens at seven

Next-word pairs

A next-word pair is two words side by side in a sentence. T1 has four pairs: the library, library opens, opens at, at eight.

Every card has five words, so every card has four pairs.

Tiny Text's model is a table that counts how often each word follows another. A model can be a table of patterns.

After this wordNext words in T1 to T3 (tally)Total
thelibrary 2, lab 13
libraryopens 1, has 12
labopens 11
opensat 22
ateight 1, nine 12
hasquiet 11
quietrooms 11
READ THE T1 TO T3 TALLIES
  • Read the question.
  • Tap your answer.
In T1 to T3, which word follows "the" most often?
How many next-word pairs are in T1 to T3 together?
In T1 to T3, what always comes after "opens"?
The "the" row and the "library" row add to 3 and 2. Do the totals of all seven rows add to 12?
StatementTrue or false?
Large language models predict the next word in a sentence.?
Generative models make outputs that follow patterns in their training data.?
Tiny Text is a real AI product.?
A model can be as simple as a table of patterns.?
Real language models are about the same size as Tiny Text.?
WHY THIS EXERCISEA tiny model you can count by hand shows the idea that much bigger models build on.
Large language models predict the next word, or ____, in a sentence.
The examples a model learns from are called ____ data.

Nice counting, reviewer. Tomorrow in the Explorer Lab you train all of Tiny Text.

← Monday