How AI Works — concept library
A set of quick, interactive explainers. Open whichever you have time for. The Foundations group is the core story; “Reality checks” and the optional deep-dive are great if time allows.
AI learns by example — not by rules
Nobody writes down “a cat has pointy ears.” We show the machine thousands of examples and it finds the pattern itself. Drop your own examples and watch it learn where the line goes.
Try it
Pick a colour, then click the board to drop examples. It redraws the dividing line every time — it was never told the rule.
Drop a few of each colour
Then switch to “Test a point” and click anywhere — it guesses the colour from what it learned.
Inside the “brain”: signals & weights
An AI is a web of simple units — “neurons” — wired in layers. Every wire carries a weight it learned from examples. A neuron adds up what reaches it and passes the signal on. Flip the clues and watch the answer flip.
Give it clues
Toggle what the network “sees.” Signals flow left → right and the output leans toward an answer.
Pick some clues
The point
No rule says “pointy ears = cat.” It learned the weights from examples. That’s all a neural net is: weighted connections turning inputs into an answer.
It taught itself by filling in blanks
Before it could chat, it read a huge slice of the internet and played one game billions of times: hide a word, guess it, peek at the answer, adjust. Do that enough and it learns how language works.
The fill-in-the-blank game
Hide a word → guess → reveal the truth → nudge its settings. Repeat at scale and accuracy climbs.
Progress
It reads in chunks, not letters
AI doesn’t see individual letters — it breaks text into chunks called “tokens.” Common chunks stay whole; rare ones get split smaller. That’s why it writes essays easily but trips on “how many R’s in strawberry.”
Try these
Watch how a word splits. The AI never sees the separate letters inside a chunk.
Why are the chunks uneven?
The chunks aren’t fixed-size. The tokenizer learned them from how often letter-sequences appear in training text: common sequences (“the”, “ing”, “play”) become a single token, while rare ones get chopped into smaller pieces — sometimes single letters. Hit “Colour by commonness” to see it.
You already predict — like a farmer
A farmer forecasts tomorrow's weather from past seasons and today's signs, to decide when to plough, plant and harvest. AI does the very same thing: learn from the past, read the present, predict what's next.
tomorrow
What the farmer notices
The plan
Same trick — meet AI
It predicts the next word — it doesn’t “know”
Chatbots, captions, code — same trick underneath: guess the next word, then the next. Because it’s a guess, the same start can finish differently every time.
Watch it guess
The bars are how likely each word is. Predict rolls the dice, weighted by the bars.
Predictability
Balanced — sometimes surprising
Ready
Run it a few times from the same start. Different endings = why it’s never boring, and why it sometimes makes things up.
Meaning is a map
The AI turns every word into a point in space, so related words sit near each other. The wild part: directions have meaning too. Run the classic “king − man + woman” and watch where it lands.
Word arithmetic
The arrow from one word to another is a “meaning direction.” Apply it elsewhere and you land on the matching word.
Pick an example
Similar words cluster; the “gender” and “capital-of” directions are consistent across the whole map.
What AI can actually do
It’s not just chat. The same core idea now powers six big things — tap each to see it move. We’ll go deep on these all week.
It got good by getting big
For years AI was clumsy. Then we fed it far more data and computing power — and new abilities emerged on their own. Drag the slider to grow the model.
A handful of “neurons”. Output is basically noise.
Why it makes things up
It’s built to produce a plausible answer, not a true one — and it has no built-in “I don’t know.” Ask about something that doesn’t exist and it’ll confidently invent details. Always verify.
Try a made-up thing
None of these exist. Watch it answer anyway, fluent and sure of itself.
Confidence
Notice it stays high even when the answer is invented. Confidence ≠ correctness.
It has no live knowledge
A model only knows what it read during training — everything after its “cutoff” date is a blank. That’s why modern tools bolt on web search. Flip the switch to see the difference.
Training cutoff
Think of a wall: it learned everything up to a date, then stopped. New events fall on the far side of the wall.
Why it matters
Off = it can’t know recent events. On = it searches, reads, then answers. That search step is doing the heavy lifting.
Bias in, bias out
It mirrors its training text — including our lopsided habits. If the data mostly pairs “nurse” with “she” and “engineer” with “he,” the model picks that up. Cleaner data, fairer output.
Switch the training data
Same model, different diet of examples. Watch the “she / he” guess shift.
The lesson
The model isn’t “sexist” on purpose — it copied a pattern from us. That’s why who curates the data matters, and why we check outputs.
It was taught manners
Straight out of training, a model just continues text — often unhelpful or unsafe. People then rate its answers 👍/👎 until it learns to be helpful, polite, and to refuse harmful stuff. Press to train it.
Two stages
Stage 1: predict text (raw). Stage 2: humans reward good answers until it behaves like an assistant.
Why it matters
This stage is why assistants are polite, helpful, and decline dangerous requests. It’s a layer of human values on top of raw prediction.
Its memory has limits
It can only “see” a limited window of recent text. In a long chat, the earliest things scroll out of view — and it genuinely forgets them. Add messages and watch the window slide.
Window size
Remembers the last 4 messages
Faded messages are forgotten
Bigger windows remember more but cost more. This is why very long chats start to “lose the thread.”
Who decides the chunks?
Nobody picks them by hand. The tokenizer starts with single letters and repeatedly glues together the most common neighbouring pair. Frequent combos become chunks — which is why “play” ends up whole but rare strings stay in pieces.
Build the vocabulary
Each step merges the most common adjacent pair into a new chunk and saves it to the vocabulary.
Learned chunks
The payoff
Do this across billions of words and common ones (“the”, “ing”, “play”) become single tokens, while rare words break into pieces. That’s why chunk sizes come out uneven.
Old way vs AI way
The old way: a human writes exact rules — fine until something unusual shows up. The AI way: show it thousands of examples and it learns to handle the messy real world. Send test cases through both and watch.
and has_whiskers:
→ "cat"
cats, dogs, foxes…
→ learned the pattern
Send cases through both
Same input to each. Watch the rigid rules trip on anything unusual.
The shift
Rules are clear but brittle — every exception needs a new rule, forever. Learning from examples bends to the real world. That flip is why modern AI took over.
It learns from its mistakes
Training isn’t magic — it’s a downhill walk. The AI measures how wrong it is, then nudges its settings in the direction that lowers the error. Repeat millions of times and it slides to the bottom.
Roll downhill
Each step moves the setting toward less error. The slope tells it which way is “downhill.”
Step size (learning rate)
Current error: —. Too big and it overshoots; too small and it crawls.
Everything becomes numbers
Text, images, sound — before the AI can use anything, it’s turned into a long list of numbers. That’s why one kind of AI can handle words, pictures and audio: underneath, it’s all just numbers.
Pick an input
See it converted into the numbers the AI actually reads.
Why it matters
Once everything is numbers, the same maths works on all of it — and the AI can mix them: describe a picture, caption a sound, draw from a sentence.
Anatomy of a good prompt
You control the output by how you ask. Four ingredients do most of the work — role, context, task, format. Toggle them and watch a vague answer turn into exactly what you wanted.
Add ingredients
Each part you add steers the answer closer to what you need.
Answer quality: vague
Same AI, wildly different result — just from a clearer prompt. The #1 skill we’ll use all week.
Why your feed feels personal
Spotify, TikTok and Netflix all do one trick: every song or show is a dot on a giant “map of taste,” and they recommend the ones nearest to what you already like. Tap a few favourites and watch your feed build.
Tap what you like
Click dots on the map. The app finds the closest ones you haven't tried — that's your feed.
Your “For You”
Same trick — meet AI
Training a puppy
A puppy doesn't read a rulebook. You give a command, reward the good tries with a treat, and after enough 👍 it learns. AI assistants are taught to be helpful and polite the exact same way — people reward the good answers.
Give a command
Pick a command…
Same trick — meet AI
The forgetful witness
Someone glimpses a street for two seconds, then swears to details they never really saw — confidently filling the gaps with what seems likely. AI does the same: it gives a fluent, confident answer even when it's guessing. Sounding right isn't the same as being right.
Be the witness
…
Glance, then start asking.
Same trick — meet AI
The waiter's memory
A great waiter holds your order in their head — but only so many at once. As new orders come in, the earliest slips away. AI is the same: it remembers a limited window of recent messages, and older ones fade out.
Run the café
Memory size
Holds the last 4 orders