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 Pro

Numbers and rules

Letters, rules and lines: the maths AI is written in.

  1. Variables
  2. Functions
  3. Graphs
  4. Slope
  5. Parameters
  6. Vectors
  7. Weighted sums
  8. Probability

A rule that learns

How a model guesses, measures its errors and gets better.

  1. A model
  2. Error
  3. Powers
  4. Sigma
  5. Loss
  6. The loss curve
  7. Slope at one point
  8. The derivative
  9. Gradient descent
  10. Learning rate
  11. Partial derivatives
  12. Adding and scaling vectors
  13. The gradient
  14. The training loop
  15. A model with many inputs

Choosing between answers

How a model picks one answer and says how sure it is.

  1. Classes
  2. Matrices
  3. Matrix times vector
  4. Logits
  5. Parts of a total
  6. Exponentials
  7. Softmax
  8. Logarithms
  9. Cross-entropy
  10. Learning to classify

Neural networks

Bends, neurons and layers: what a network is.

  1. ReLU
  2. A neuron
  3. Hidden units
  4. A layer
  5. Function composition
  6. The multilayer perceptron
  7. Matrix multiplication
  8. Batches

How a network learns

  1. The computation graph
  2. The chain rule
  3. Local derivatives
  4. The multivariable chain rule
  5. Backpropagation
  6. Mini-batches
  7. Square roots
  8. Mean and standard deviation
  9. The normal distribution
  10. Weight initialisation
  11. Vanishing and exploding gradients
  12. Residual connections
  13. Layer normalisation
  14. Momentum
  15. Adam
  16. Learning-rate schedule

New examples

  1. Overfitting
  2. Train and test split
  3. Validation set
  4. Early stopping
  5. Weight decay

Text becomes numbers

  1. Tokens
  2. Byte-pair encoding
  3. Embeddings
  4. Tensors and shapes

Guessing the next token

  1. Conditional probability
  2. The bigram model
  3. Sampling
  4. Autoregressive generation
  5. Self-supervised learning
  6. A neural language model
  7. Vector length and direction
  8. Dot product as similarity
  9. Embedding space
  10. The context window
  11. Temperature
  12. Top-k
  13. Top-p

Attention and the GPT

  1. Attention
  2. Queries and keys
  3. Values
  4. Scaled dot-product attention
  5. The transpose
  6. The attention formula
  7. The causal mask
  8. Positional embeddings
  9. Multi-head attention
  10. The feed-forward block
  11. The transformer block
  12. The output head
  13. Teacher forcing
  14. Parameter count
  15. The GPT architecture

From a GPT to an assistant

  1. Pretraining
  2. The chat template
  3. Fine-tuning
  4. Inference
  5. Hallucination