LLMs Unplugged

How AI writes stories

Acknowledgement of Country

EddieBenColeThomasHannahMaiaSungyeonSafiyaSuiLorenn

What is AI?

Think → pair → share

when you hear the words artificial intelligence, what comes to mind?

think on your own, then share with the person next to you

Let’s ask one to write us a story

we need three words or ideas — hands up!

That was a language model

What just happened?

no person on the other side wrote that story for us

the language model learned patterns from huge amounts of text, then copied those patterns to make something new

today we’ll build our own language models — without a computer

Predict the next word

we humans are good at spotting patterns

I’ll start a sentence — hands up if you know the next word

So how do we teach a model?

humans pick up patterns from listening, reading, watching

a language model has to learn them from text

Some words we’ll use

artificial intelligence (AI) — technology that mimics some human abilities, like writing stories or answering questions

language model — a system that predicts what word comes next, using patterns it learned from text

training — building a model by finding patterns in text

training data — the text used to train a language model

Training

Start with a text

And I will eat them here and there. Say! I will eat them anywhere!

I do so like green eggs and ham!

— Dr Seuss, Green Eggs and Ham

Tidy up the text

andiwilleatthemhereandthere.say!iwilleatthemanywhere!idosolikegreeneggsandham!

lowercase everything, and note that we’ve separated . and ! from the word they’re next to

A pair of words is a cutout

andiwilleatthemhereandthere.say!iwilleatthemanywhere!idosolikegreen eggsandham!
green eggs

Every pair becomes a cutout

and ii willwill eateat themthem herehere andand therethere .. saysay !! ii willwill eateat themthem anywhereanywhere !! ii dodo soso likelike greengreen eggseggs andand hamham !

Now they’re just a pile

there .green eggsham !will eatand hamhere anddo soi dolike greenthem anywhereeat themand there! iwill eateat themi willsay !them hereso like. say! ianywhere !eggs andi willand i

Now they’re just a pile

eat themi doi will. sayham !eggs andand ithem hereand theredo sowill eat! isay !will eatlike greenthere .green eggsi willhere andand hameat themthem anywhereso like! ianywhere !

Now they’re just a pile

and hamanywhere !i willthere .will eatham !so likethem herehere andwill eati dodo soeat them! i! ieat themsay !and theregreen eggslike greenand ieggs andi will. saythem anywhere

Now they’re just a pile

eat themi willthem anywherethere .green eggssay !eat themand hameggs andi dowill eat. saythem heredo sohere and! iham !i willlike green! iand ianywhere !will eatso likeand there

Now they’re just a pile

and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Train your model

with your group you’ll need printed cutouts, scissors, and a clear table

cut out the cutouts for your text and spread them on the table—each cutout pairs a next word with its previous word:

green eggs

that’s it—the spread is your trained language model

Training

10:00

Generation

Your goal

generate new text by chaining cutouts together—write a word, find a cutout whose previous-word box matches, write its next word, then hunt for the next match:

will eat eat them them here

the chain grows (like dominoes)

Choose a starting cutout

your page
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Choose a starting cutout

your page willeat
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeat
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeat
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeat them
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthem
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthem
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthem
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthem here
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhere
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhere
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhere and
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhereand
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhereand
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhereand
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

Find the next cutout

your page willeatthemhereand ham
and iwill eatwill eatdo solike greenand therethem anywhere. sayeat themham !eat them! isay !eggs andanywhere !i willso likei dogreen eggs! ithem herei willhere andthere .and ham

“will eat them here and ham”

a hint of the original, not a copy

You will need

with your group

your trained cutouts spread (already on the table)

pen and paper to write down the generated text

Activity

generate as much text as you can from your spread—keep chaining words until you run out of time!

Generation

10:00

Shareback

How did it go?

did your stories always make sense? why or why not?

can any of your models write a story about a crocodile?

One story, all together

Everyone is a word hunter

we’ll pick one starting word for the whole class

everyone hunts for it in their own cutouts

if you find a match, raise your hand — we’ll pick one and read out the next word, and that becomes the new word to hunt for

One story, all together

About your stories

what would help our paper language models write better stories?

when you get a language model to write a story for you, is it thinking about how to write the best possible story?

if you started with the same starting word, would you generate the same story again?

Questions?