Hi โ I'm Sean Egan. Somewhere along the way I fell completely for AI and machine learning. I built this site for a friend who asked me, over a drink, how ChatGPT actually works โ not the hand-wavy version, the real one. If you've ever asked the same question, this is for you too.
Here's my promise: you need zero math background. Not algebra-class memories, not calculus, nothing. Part I teaches every mathematical idea we use, from scratch, with pictures and things you can drag. By the end you won't just have a vague feel for what a language model does โ you'll be able to follow the actual equations, and check some of them by hand.
Take it slowly. Watch the videos. Play with the interactive bits โ they're not decorations, they're the point. And if a chapter feels dense, that's the material, not you. We go one honest step at a time.
How to read this site
The chapters build on each other like floors of a building โ Part I is the foundation, and everything after stands on it. If you're new to all of this, go in order; each chapter opens with a short list of the ideas it needs, linked back to where they were taught. If you already know some linear algebra, you can start at Part II and treat Part I as a reference.
Coming from AI/ML from the Ground Up? Its Math Toolkit chapter covered Part I in brief โ vectors, dot products, matrices, curves, slopes, probability. The six chapters here are that same material at walking pace, with the pictures and the pencil work. Skim them as reinforcement, or go straight to Part II and come back when a symbol stops being obvious. Nothing later needs you to have read them twice.
Three kinds of things appear alongside the text: videos (short, narrated animations of the key ideas โ watch them, they carry real weight), interactives (drag things, break things, get a feel), and worked examples (small numbers you can verify with a pencil โ I mean it: get a pencil). When you finish, there are two more sites to climb into: AI/ML from the Ground Up zooms out from language models to the whole field, and How AI Makes Images โ the third and newest โ points the same machinery at pictures and builds an image generator from pure static. The math you learn here carries into both.
Part I
The Math You Need
Six short chapters that build every mathematical idea this site uses โ from zero.
-
1Numbers That PointVectors: arrows, coordinates, and why direction is information
2Measuring SimilarityThe dot product: one number that says how much two arrows agree
3Grids That TransformMatrices: machines that turn one vector into another
4Functions and Curvesf(x), exponentials, logarithms โ the shapes the math is made of
5Slopes and DescentDerivatives: which way is downhill, and how steep?
6Chance and ChoiceProbability: spreading belief across possibilities
Part II
Inside an LLM
What is actually happening, mathematically, when a model reads and writes.
-
7Text Becomes NumbersTokens: chopping language into countable pieces
8Meaning as DirectionEmbeddings: every token becomes an arrow, and nearby arrows mean similar things
9The Prediction GameOne job: guess the next token
10AttentionHow words look at each other
11The TransformerStacking attention into a thinking machine
Part III
How It Learns
Where the numbers in those matrices come from.
-
12Measuring WrongnessLoss: turning 'bad guess' into a single number
13Rolling DownhillGradient descent: learning as finding low ground
14Blame Flows BackwardBackpropagation: how millions of weights each learn their share
15The Training RunTrillions of tokens, thousands of GPUs, one falling curve
16From Parrot to PartnerFine-tuning, RLHF, and how a text predictor becomes an assistant
Part IV
Beyond the Basics
The advanced ideas you hear about โ with their actual math.