# My First Language Model

> Train a language model on grid paper, roll dice to generate new text, and see why ChatGPT works the same way. Runs in 60, 90 or 120 minutes.

Participants count word patterns in a real text, record them as tally
marks on <GlossaryTerm id="grid">grid paper</GlossaryTerm>, and roll a d10 to generate new text from those
patterns. By the time they read their generated sentences out loud, the
connection is clear: <GlossaryTerm id="chatbot">ChatGPT</GlossaryTerm> works the same way at a much larger scale.

We've delivered it to school students, undergraduates, teachers, and senior
executives in industry and government. It needs no coding and no maths beyond
counting and percentages.

## Choose your length

Each length keeps everything from the one before it and adds a module:

| Length     | Modules                                                             | Adds                                           |
| ---------- | ------------------------------------------------------------------- | ---------------------------------------------- |
| 60 minutes | [Training](https://www.llmsunplugged.org/modules/training/) + [Generation](https://www.llmsunplugged.org/modules/generation/) | the core train-then-generate loop              |
| 90 minutes | + [Pre-trained Model Generation](https://www.llmsunplugged.org/modules/pretrained-generation/)   | what happens with a bigger model and more data |
| 2 hours    | + [Agentic AI](https://www.llmsunplugged.org/modules/agentic-ai/)                                | how models use tools to act on the world       |

Every length opens with a quick icebreaker and scene-setting (who's used
ChatGPT? how do you think it works?) and closes with a "scaling up"
discussion connecting the paper model to modern <GlossaryTerm id="llm">LLMs</GlossaryTerm>, then Q&A.

## Suggested timing (90-minute version)

- **0:00 kick-off**: icebreaker, then explain that we are building a small
  language model by hand using the same approach as large ones
- **0:20 [Training](https://www.llmsunplugged.org/modules/training/)**: tally word patterns from a text
  into the grid
- **0:40 [Generation](https://www.llmsunplugged.org/modules/generation/)**: roll dice to generate new
  text from the grid; share back with dramatic readings
- **1:00 [Pre-trained Model Generation](https://www.llmsunplugged.org/modules/pretrained-generation/)**:
  same dice game, using a printed booklet trained on a whole book
- **1:20 close**: scaling up (how this connects to ChatGPT, and how it changes
  how you use these tools)

For the 60-minute version, drop the pre-trained booklet section and tighten
the close. For the 2-hour version, add
[Agentic AI](https://www.llmsunplugged.org/modules/agentic-ai/) after the pre-trained section (about 20
minutes) and give the discussions more time.

## You will need

For each pair (or small group) of participants:

- pen or pencil
- a printed [grid template](https://pdf.llmsunplugged.org/worksheets/grid.pdf) (or any grid
  paper)
- a d10 die (any die works with a little improvisation)
- some training text: the
  [opening of _Green Eggs and Ham_](https://pdf.llmsunplugged.org/worksheets/green-eggs-and-ham-text.pdf)
  is ready to print, or bring your own kids' books and give each pair a page or
  two of a different one (short and repetitive is best, as the grid has room for
  32 words)
- **90 minutes and up:** a pre-trained model <GlossaryTerm id="booklet">booklet</GlossaryTerm>; the
  [Materials](https://www.llmsunplugged.org/tools/#booklets-for-dice-generation) page has ready-to-print
  booklets for several texts, or you can
  [generate your own](https://www.llmsunplugged.org/tools/#generate-your-own)

Plus a projector for the slides.

## Before you deliver

- print the grid templates and the training text, and the booklets if you're
  running 90 minutes or longer (one per pair; a mix of different texts makes the
  share-backs more fun). The printouts download at the top of this page has all
  of them, with a README saying which length needs what
- if you have extra time, add the [Sampling](https://www.llmsunplugged.org/modules/sampling/) module after
  generation to show how <GlossaryTerm id="temperature">temperature</GlossaryTerm> changes the output without
  changing the model

## Running it for teachers

To train teachers to run it themselves (senior secondary teachers, say), 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 Q&A for stepping out of
the student role: what running it in class takes, and where it fits in the
Australian Curriculum. Allow an extra 10--15 minutes.

<UsingTheSlides
  decks={[
    {
      slug: "my-first-language-model-60min",
      label: "My First Language Model (60 min)",
    },
    {
      slug: "my-first-language-model-90min",
      label: "My First Language Model (90 min)",
    },
    {
      slug: "my-first-language-model-2h",
      label: "My First Language Model (2 hours)",
    },
  ]}
/>

Source: <https://www.llmsunplugged.org/lessons/my-first-language-model/>\
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
