# How AI writes stories

> A 60- or 90-minute school lesson (ages 10-16) where students generate stories from a finished paper language model, see how its tally marks were made, and in the longer version train their own from a new text and pool the class's models into one story.

The model in this lesson lives on **<GlossaryTerm id="ledger">ledger sheets</GlossaryTerm>**: a table with one row per word, tally
marks beside each word that followed it, and a coloured box around every
tally. <GlossaryTerm id="generation">Generation</GlossaryTerm> uses a cup of coloured counters: put in one counter per tally mark in
the box's colour, draw one, and read the word beside that colour. The cup handles
the probability of "more common means more likely". <GlossaryTerm id="training">Training</GlossaryTerm> is tallying by
hand from a printed text.

Groups start with a **finished** model and generate from it first, so when they
see one being made they already know what every mark is for. Each group's
finished model is a different picture book, and you can hear the book in each
group's story during the shareback.

The 90-minute deck is the 60-minute one with two parts added: each group
training its own model from a new text, and the class pooling its models into
one story.

## Lesson plan

Allow five minutes for arrival and settling first. In the 90-minute
version, drop the class story if you're running over.

| Part                                                                  | 60 min | 90 min |
| --------------------------------------------------------------------- | ------ | ------ |
| **What is AI?**: discussion, plus an AI writes the class a story      | 12     | 12     |
| **Four key words**: AI, language model, training, generation          | 4      | 4      |
| **Read the sheet**: one row read aloud as a sentence                  | 5      | 5      |
| **Generation**: stories from the pre-tallied sheets, then shareback   | 22     | 20     |
| **Where did the marks come from?**: the class trains one row together | 8      | 8      |
| **Training**: each group tallies a new text onto blank sheets         |        | 12     |
| **One story, all together**: the class pools its models (optional)    |        | 10     |
| **Wrap-up**: what did we learn? Q&A                                   | 6      | 5      |

**Reading the sheet** comes before anyone touches a counter: a whole sheet goes up on the screen, then one row of it is read aloud as
a sentence ("after _the_, this book said _magpie_ six times"). Every group then finds
a row of their own and does the same. The colours come with that row: a box's
colour names its place in the row, and the counters come in those four colours.

**Generation** runs the [Generation](https://www.llmsunplugged.org/modules/generation/) module with the cup. The
slides walk through one book (_The magpie_) draw by draw, then every
group generates from its own. The shareback asks the room to guess each group's
book from its first sentence, and asks two groups holding the same book why
their stories differ.

**Where did the marks come from?** is answered by the whole class. The slides
start from the bare text of _The magpie_, split it into words, then build the
start of its sheet pair by pair. Then the presenter reads the first half of the
book aloud, the class shouts the word after every "the", and a helper tallies
them on the whiteboard, then checks the tallies against the row on screen.
Every row on every sheet was made this way.

**Training** (90 minutes) has each group make a model of its own. Every group gets a different
short text (one of the six training texts in the printouts) and blank sheets; one
person reads the text two words at a time from the printout, and the
group writes each new word into a spare row and tallies beside it. Nothing is
printed on the sheets, so agree first that a new word is claimed out loud; if
two people keep separate counts of the same word, the group's model breaks.

**One story, all together** pools those models, on butchers paper up the front. Call out the current word
(the last word of the class story); every group whose sheets have a row for it puts a hand up;
pick one, and that group reads out the colours and tallies on its row. Do the
draw up the front with a single cup while the room watches, and have the group
whose row it is read out the word beside the colour drawn. The class story can
contain words only one group's text had, so it says things no single group's
model could.

## You will need

- one pre-tallied picture-book set per group, five sheets and four colours, a
  different book per group: `the-magpie` (a short story written for this lesson,
  and the book the slides walk through), `the-wombat` (another written for it),
  `the-very-hungry-caterpillar`, `were-going-on-a-bear-hunt` and
  `the-cat-in-the-hat`
- counters in four colours (red, blue, green, yellow), at least six of each per
  group (the largest tally in any set), a paper cup per group, and a tub per
  group to tip the cup back into between draws
- a whiteboard and a helper to tally on it, a projector, and access to a
  <GlossaryTerm id="chatbot">chatbot</GlossaryTerm> for the opening
- for the 90-minute version: blank sheets, one per person, a different
  training text per group, butchers paper for the class story, and pen and
  paper per group

## Printing it

The [printouts download](https://pdf.llmsunplugged.org/packs/how-ai-writes-stories.zip)
holds the five picture-book models one after another, one blank sheet, the six
training texts (one to a page, and two to a page to cut in half), the counters
page and a one-page instruction sheet. Its README says what to print and which pages go to which
group; the 60-minute version needs only the picture books, the counters and the
instructions. To make sheets from a book of your own, use the generator on the
[Materials](https://www.llmsunplugged.org/tools/#generate-your-own) page.

## Before you deliver

- with more than five groups the books repeat, and past six the training texts
  do too; spread the repeats so that groups sharing a book or a text aren't
  side by side
- the story slide in the opening has fill-in boxes for the teacher's name, the
  year level, and the three class words

## Running it for teachers

To train teachers to run it themselves, add `?teachers` to the deck's URL. The
workshop stays pitched at their students, so the teachers do it the way their
class will. It adds one slide after the introductions saying so, and a short
block before the wrap-up for stepping out of the student role: what running it
in class takes, where it fits in the Australian Curriculum, and how to answer
"so is ChatGPT just counting?". Allow an extra 10--15 minutes.

<UsingTheSlides
  decks={[
    {
      slug: "how-ai-writes-stories-60min",
      label: "How AI writes stories (60 min)",
    },
    {
      slug: "how-ai-writes-stories-90min",
      label: "How AI writes stories (90 min)",
    },
  ]}
/>

Source: <https://www.llmsunplugged.org/lessons/how-ai-writes-stories/>\
Licence: [CC-BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)\
Cite as: Swift, B. (2026). _LLMs Unplugged: Understand how AI language models work by building one yourself._ https://doi.org/10.5281/zenodo.17403824
