This page is empty.So is our AI.

Here it is.

We are building a program that writes text by guessing what comes next. That, in the end, is what an AI is.

Version 1 knows nothing: every letter has the same chance.

knows nothing this is a jar: our AI. Empty. (drag it to spin it)

Empty. Like your GitHub contribution graph.Prof. Graves

Type anything and press ask.

Give it something to read.

New in version 2: it counts every letter in a text. More often, bigger slice.

This is all it will ever know:

The head guesses the next word. It read a lot of words, so the head guesses well. My mother read a lot of words too, and my mother guesses badly. The secret is not reading. The secret is counting. Count which word comes after the word you have, and you can guess the next word. Count enough words and the guesses start to sound like a person. A person who has never been outside, but a person. That is all the head does. It counts, it guesses, and it counts again. My mother counts too. She counts the days until I visit, and the head counts the words until you stop typing.

inside our AI: only counts

Teach it which letter comes next.

New in version 3: it looks at the letter it just wrote, and counts what came after it.

What it read:

Teach it words.

New in version 4: the same, with whole words instead of letters.

What it read:

Claude Shannon did it with books.

Shannon’s 1948 paper “A Mathematical Theory of Communication” built fake English by hand, from random letters up to word pairs: your ladder, run on paper. source

1948
1948. Claude Shannon asks how far counting can fake English.
By hand: a pencil and a pile of books.
the head head
Find “the”, copy the next word, “head”. Just two words of his, not our AI.
Again, from another book. His real 1948 text.
“The labor involved becomes enormous.” He stopped here.

Feed it your own words.

Paste anything you wrote: an email, a rant, your diary. It stays in your browser. It will write in your voice: it only knows what it read.

Now make it enormous.

The head you run from lesson 1 is qwen3:8b. It plays the same game. It read 36 trillion tokens. A token is a piece of text, often part of a word; the head reads and writes in tokens. source

Yours keeps a table: . qwen3 keeps no table: training tuned its 8,190,735,360 numbers, called parameters.

Yours
qwen3
looks back at
the last word
thousands of tokens
keeps
a table of counts
8.2 billion tuned numbers

yours, 1 mm a word: Earth Moon ×1 qwen3's tokens, 1 mm each

Yours fits on a napkin. Theirs reaches the Moon 94 times, or there and back 47. Try not to feel inadequate.Prof. Graves

One small sticky note in front of a tower of books so tall it leaves the picture, with a tiny man looking up at it
Your training data (one sticky note) vs qwen3’s (a tower of books).AI picture

That's an AI.

An AI like this is a program that guesses the next piece of text. An LLM (large language model) does it at huge scale. This course calls it the head.

the head: billions of tuned numbers in a jar. Drag it.

What you built, next to the head:

Your tiny AIThe head
letters and wordstokens, the pieces it reads. qwen3 cut the opening you read, , into tokens.
your count tableparameters: billions of tuned numbers, each like a volume knob.
counting oncetraining: after each wrong guess, every number moves a tiny bit toward the right answer. Trillions of times.
the wheelthe same wheel: a slice for every piece it could write next.

Yours never read your question. The head does: your question becomes the start of the text it continues. Lesson 1 sends it your first one.

Words from this lesson

Training
Reading examples and keeping score.
Training data
The examples it reads.
Model
The score it keeps.
Token
A piece of text, often part of a word; the head reads and writes text in tokens.
Agent
An AI that does a job in steps, not just chatting.
Parameter
One stored number inside a real model.
LLM, "the head"
A huge trained model that guesses the next piece of text.

Where your agent.py goes

  1. 1 it answers you
  2. 3 it remembers
  3. 5 it reads your files
  4. 6 it works in a loop
  5. 8 it searches your notes
  6. 11 it solves a problem of yours
Start lesson 1: make it answer you →

Ours is a parrot. Lesson 1 wakes up the one that read the internet.Prof. Graves

Professor Graves is made up. Claude, an AI (no relation to Shannon), writes and checks these lessons, and every fact on this page was checked against its source.