Lesson 5 6 min

Play the next-word game

Try guessing a next word using the words you already heard.

Learning goal

I can use the start of a sentence to guess a word that fits.

How it works

A language model learns patterns from many examples of language. Many models make text one small piece at a time. In this game we use whole words as the pieces.

Think of it like this

Think of joining in with a song you know. What you hear helps you guess the next word. A song may have set words. A language model can pick from different pieces that fit.

Worked example

At Fern Camp, a friend says, “I put my book on the …”. You might say “shelf”. Books often go on shelves. Another friend might say “desk”. That fits too. If you add “shelf”, your next guess uses all of “I put my book on the shelf”.

What to remember

The words that come first help you guess what comes next.

  1. Start a sentence“I put my book on the …”
  2. Find things that fitShelf and desk both fit the start.
  3. Add one word“Shelf” gives us new words to work from.
The first words give you a clue, and there can be more than one good guess.

Key words

Language model
A model that learns patterns in language. Many text-generating language models use earlier text to predict likely next pieces of text.
Prediction
A guess based on information, such as guessing how many people will visit a booth next week.
More Language Models lessons

Activity

Finish the line

Materials A partner or a piece of paper.

  1. Say or write “I hung my coat on the …”. Think of two words that fit.
  2. Pick “hook” and add it to the line. Try adding one more word, such as “by”.
  3. Try “I hung my hat on the …”. Talk about what stayed the same and what new word could fit.

Talk it through How did the earlier words help? They pointed to things a coat could hang on, even when both hook and peg fit.

Quick check

1. Which word fits “The rabbit ate a …”?
Answer and explanation

Carrot. A carrot is something a rabbit could eat. The earlier words give you a clue.

2. If “hook” and “peg” both fit, what could happen?
Answer and explanation

Either word could come next. A sentence can have more than one likely next word.