# Demystifying large language models

> A 15-minute talk in which the whole audience becomes a bigram language model built from three unnamed books and generates a sentence nobody wrote

# Demystifying large language models

> **notes:** Hands up: used one this week. Keep them up if you could explain to a ten-year-old what it did.
>
> Most hands come down.

---

> **notes:** SAY: we got the tool before we got the story about the tool.
>
> It happened too fast for the explanation to keep up.

---

> **notes:** SAY: one story says it's basically a mind. The other says it's just autocomplete.
>
> Two opposite stories that both say: beyond you or beneath you, either way don't look inside.

---

it's hard to have an opinion\
on a machine you've never seen **inside**

> **notes:** Cue the house lights up and the ushers to start handing out the sheets, because together we're going to look inside an actual language model.
>
> Take one, pass the rest along, try not to leave any that aren't in someone's hand.

---

a page of **token pairs**

a **token** is one word or one punctuation mark

> **notes:** Hold one up: a sheet of token pairs. The boxed token is the one that came before; the one beside it is what followed, somewhere in the text. Mostly words, some punctuation. Every token keeps the same colour wherever it appears, so you scan by colour and confirm by reading.
>
> Read the definition off the slide: a token is one word or one punctuation mark. From here on it's "token" for everything on the sheets.
>
> Why is it shuffled? In text order these pages would just be the book with boxes drawn round it. Shuffled, nobody here is holding a story.
>
> Ten seconds to scan the sheet, then eyes up.

---

## the algorithm

1. I **call out** the last token we wrote (and its colour)
2. **hands up** if it's the _boxed_ token on your page
3. I **pick a hand at random** --- you read out the token beside it
4. I **write it down**, and we go again

> **notes:** Walk it once, slowly.
>
> Step 2: one hand each. More than one match? Go with the first one you spot.
>
> Step 3: I pick at random. Taking the fastest hand would sample the quickest reader in the room rather than the text.
>
> For the seed: someone near the front reads out any one pair from their sheet, boxed token first. Pulling it off a sheet means the room supplies the first two tokens as well as every token after them. Take whatever pair they give you, even a full stop or a token that appears once. It can't dead-end.

---

> **notes:** Shift-W (or click the board and type), write the volunteer's two tokens, call out the second of them, go. Aim for 12--15 tokens, written BIG for the back of the room. Keep the rounds moving.
>
> Narrate two things while it runs. First, the hands are the distribution: call a common token and a forest goes up; call a rare one and you get two. The number of hands for a continuation is how often it happens in the text, so the room is doing weighted sampling without being taught it. (If someone asks: a person holding several matches for one context raises one hand, which flattens the busiest tokens slightly.) Second, the choice is a coin toss: when five hands are up, the four I don't pick were all real continuations. Pick a different hand, get a different sentence, which is why the "regenerate" button gives a different answer.
>
> Every distinct token is boxed somewhere, so hands will go up every round unless a sheet went home with an empty seat. If the room goes quiet, say that's why and reseed from the brief on page 1 (avoid restarting from a full stop).
>
> Stop around 15 tokens and read the sentence back.

---

we just ran a **language model**

> **notes:** Say it flatly. The actual mechanism, at human speed, with arithmetic small enough to see.

---

## what role did you play?

each word or full stop → a **token**

the pairs on your page → the **parameters** of the model

the hands in the air → the **probability distribution** over next tokens

my random pick → **sampling**

the sentence I wrote → **generation**

> **notes:** Now they have a physical referent for the jargon. Go down the list quickly.
>
> Token: one word or one punctuation mark, which is why full stops were getting picked like everything else. (If it comes up: real models chop rarer words into sub-word pieces so they can spell words they haven't seen.) Parameters and weights are two names for the same thing. When a researcher says a model has a trillion parameters, they mean a very large pile of what's on your lap. Give the total number of pairs in the room from the brief.

---

the sentence we wrote is in **no book**

> **notes:** Nobody wrote it: there was no lookup in a big database of sentences, and nobody pulled out their phone and searched the web. Everything was decided by the token pairs on our collective sheets.
>
> So where did they come from?

---

## three books

“He was an old man who fished alone in a skiff in the Gulf Stream.”— Ernest Hemingway, The Old Man and the Sea (1952)
“TRUE! nervous, very, very dreadfully nervous I had been and am.”— Edgar Allan Poe, The Tell-Tale Heart (1843)
“The sun did not shine. It was too wet to play.”— Dr. Seuss, The Cat in the Hat (1957)

> **notes:** Each token pair on the sheets came from one of these three books. Click them in one at a time and read each out.
>
> The sheets (the model) had no indicator of which token came from which book. It worked because the books share tokens: `the`, `and`, and `.` are in all three, and the chain drifts from one book into another through them.

---

a hall full of people just did\
the thing you're told needs a **data centre**

> **notes:** Who now thinks they could give a better answer to a ten-year-old about how language models do what they do?
>
> It still takes some simplification, but it's neither beyond them nor beneath them to understand.

---

it doesn't make you an expert

it makes you **harder to bullsh\*t**

> **notes:** It doesn't make you an expert: even with a billion dollars in your pocket you can't go out and build your own Claude-level model from scratch.
>
> But it might make you harder to bullshit.
>
> LLMs Unplugged is for helping people tell accurate stories about how this technology works.

---

(qr: <https://www.llmsunplugged.org/talks/demystifying-large-language-models/>)

> **notes:** This talk (with its running order and what to print), the workshops, the printable materials, and the tool that made your sheets are all at that address, free and CC-licensed. Hold here long enough for the room to scan it, then finish on the School mark.

---

(qr: <https://anu.au1.qualtrics.com/jfe/form/SV_cA2ioVFWoQRj0KW>)

> **notes:** Feedback QR: give them a moment to scan before you wrap up.

Source: <https://www.llmsunplugged.org/decks/demystifying-large-language-models/>\
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
