How AI works
The maths and the ideas behind AI, from the very start.
99 lessons in 10 parts · 99 ready to watch
Unlock with ProNumbers and rules
Letters, rules and lines: the maths AI is written in.
- Variables
- Functions
- Graphs
- Slope
- Parameters
- Vectors
- Weighted sums
- Probability
A rule that learns
How a model guesses, measures its errors and gets better.
- A model
- Error
- Powers
- Sigma
- Loss
- The loss curve
- Slope at one point
- The derivative
- Gradient descent
- Learning rate
- Partial derivatives
- Adding and scaling vectors
- The gradient
- The training loop
- A model with many inputs
Choosing between answers
How a model picks one answer and says how sure it is.
- Classes
- Matrices
- Matrix times vector
- Logits
- Parts of a total
- Exponentials
- Softmax
- Logarithms
- Cross-entropy
- Learning to classify
Neural networks
Bends, neurons and layers: what a network is.
- ReLU
- A neuron
- Hidden units
- A layer
- Function composition
- The multilayer perceptron
- Matrix multiplication
- Batches
How a network learns
- The computation graph
- The chain rule
- Local derivatives
- The multivariable chain rule
- Backpropagation
- Mini-batches
- Square roots
- Mean and standard deviation
- The normal distribution
- Weight initialisation
- Vanishing and exploding gradients
- Residual connections
- Layer normalisation
- Momentum
- Adam
- Learning-rate schedule
New examples
- Overfitting
- Train and test split
- Validation set
- Early stopping
- Weight decay
Text becomes numbers
- Tokens
- Byte-pair encoding
- Embeddings
- Tensors and shapes
Guessing the next token
- Conditional probability
- The bigram model
- Sampling
- Autoregressive generation
- Self-supervised learning
- A neural language model
- Vector length and direction
- Dot product as similarity
- Embedding space
- The context window
- Temperature
- Top-k
- Top-p
Attention and the GPT
- Attention
- Queries and keys
- Values
- Scaled dot-product attention
- The transpose
- The attention formula
- The causal mask
- Positional embeddings
- Multi-head attention
- The feed-forward block
- The transformer block
- The output head
- Teacher forcing
- Parameter count
- The GPT architecture
From a GPT to an assistant
- Pretraining
- The chat template
- Fine-tuning
- Inference
- Hallucination
