For educators
Learn AI Layer by Layer explains how modern AI works, built up from first principles. It's written for curious learners from about age 12 to adults, and the only background it assumes is arithmetic.
It's free, with no ads and no accounts. Students never need to sign up or give any personal information. The site uses standard analytics (Google Analytics) to count visits and see which chapters work.
Fitting it into a course
Each chapter builds on the ones before it, so students should work through them in order. The 15 chapters fall into four parts, which make natural units. At one chapter per class session or homework assignment, that's 15 sessions — about 6–8 weeks at two a week — and about 5 hours of student time in total. Times below are estimates for one student reading and trying the widgets.
Part 1: The building blocks
about 1.5 hoursHow a machine made of numbers can learn to do things nobody told it how to do.
- 1ComputationEverything is numbers20 min
- 2OptimizationThe power of incremental improvement25 min
- 3Neural NetworksBuilding a brain30 min
Part 2: Meaning as numbers
about 1.5 hoursHow words become something a computer can reason about, and why predicting the next word requires understanding.
- 4VectorsDescribing the world with numbers30 min
- 5EmbeddingsFrom words to meanings30 min
- 6Next-Word PredictionUnderstanding by predicting20 min
Part 3: The transformer
about 1 hoursThe architecture behind every modern chatbot, built from the pieces you already have.
- 7AttentionLetting words look at each other20 min
- 8Positional EncodingWhere am I?25 min
- 9TransformersOne architecture to rule them all15 min
Part 4: From model to assistant
45 minHow a document-continuing machine becomes something that chats, reasons, and gets things done.
- 10Post-TrainingTeaching a model to be useful15 min
- 11ConversationsOne long document, pretending to be a chat10 min
- 12ReasoningThinking by talking to yourself10 min
- 13AgentsGetting things done10 min
Part 5: AI in the world
40 minWhat AI is doing to the society around it, and the realistic ways it could go badly wrong.
- 14AI and SocietyChanging the shape of the world15 min
- 15Catastrophic RiskCould AI go badly wrong?25 min
The introduction is a two-minute read about why I wrote this; it's optional.
Teaching tips
- Try each chapter yourself first. You'll see where students are likely to get stuck, and how long the widgets take — students who like to tinker take longer than the estimates.
- Pair students on one device. The widgets are playgrounds, not demos, and talking about what happens when you change something is where much of the learning is.
- Use the end-of-chapter quiz as a check. Every chapter finishes with a short quiz on its key ideas, which works as an exit ticket or a homework check.
- Stretch students who code. Each chapter links to a Python notebook in Google Colab that runs the same ideas with real PyTorch code.
Assigning it
- Every chapter has a permanent link, such as learnai.robennals.org/attention, that you can paste into Google Classroom, Canvas, or any other learning platform.
- Nothing requires an account, so students can start straight from the link.
- Quiz answers are saved in the student's own browser. They're kept if the student comes back on the same device, but they don't follow the student to another device, and I can't see them.
Using it with a class? Tell me
It helps me a lot to know who is teaching with this, and it shapes what I write next. It only takes a minute.
Questions?
If you'd like help fitting this into your course, or have any other questions, email me at rob.ennals@gmail.com. I usually reply.