Reading order
You do not have to read everything, or read it in textbook order. Pick the line closest to what you are doing and follow it. When something does not make sense, the table at the bottom says where to go back to.
Building a product on an LLM
What you need to build a service that retrieves documents and hands them to an LLM. The only math is vectors and the dot product.
- Vectors in n dimensions
- Dot product
- Embeddings
- Vector search
- RAG
- Chunking
- Keyword and hybrid search
- Retrieval metrics
- AI agents
How an LLM writes text
From text cut into tokens to the next token being picked.
- Tokenization
- Embeddings
- Attention
- Transformers and LLMs
- Encoders and decoders: three kinds of transformer
- Embedding models: one vector per sentence
- How LLMs are trained
- Softmax and sampling
- Context windows and the KV cache
- Structured output
- Fine-tuning and LoRA
- Hallucination and evaluating LLMs
How a model learns
Measure how wrong the model is, then nudge the weights to make it less wrong.
- Functions and graphs
- Derivatives and the chain rule
- Partial derivatives and the gradient
- Neural networks
- Backpropagation
- Gradient descent
- Overfitting and generalization
- Normalization and standardization
Models that answer with probabilities
A model's answer is a probability. How to read one and how to score it.
- Probability and Bayes' theorem
- Normal distribution
- Entropy and cross-entropy
- Logistic regression
- Softmax and sampling
Linear algebra from the start
The textbook order, from linear systems to the singular value decomposition.
- Linear systems and elimination
- Matrix basics
- Matrix multiplication
- Inverse matrix
- Determinant
- Cramer's rule
- Vectors
- Dot product
- Cross product
- Vectors in n dimensions
- Vector spaces and subspaces
- Linear combinations and span
- Basis and change of coordinates
- Rank
- Linear transformations
- Eigenvalues and eigenvectors
- Orthogonal matrices and inner product spaces
- Projection and least squares
- Singular value decomposition
- Tensors and shapes: axes, shape and broadcasting
Calculus from the start
From functions to slopes, areas, and many inputs.
- Functions and graphs
- Limits and continuity
- Derivatives and the chain rule
- Integrals
- Partial derivatives and the gradient
- Taylor approximation
- Jacobian and Hessian
Images and other ways of learning
Networks that read images, models that make them, and learning from reward.
Statistics from the start
From summarizing data to tests and designing experiments.
- Descriptive statistics
- Samples, sampling distributions and the standard error
- Confidence intervals
- Hypothesis testing and the p-value
- Type I and type II errors, and statistical power
- The t-test
- Analysis of variance (ANOVA)
- The chi-square test
- Nonparametric tests
- Correlation and regression
- Multiple comparisons
- Risk, relative risk and odds ratio
- Survival analysis
- Diagnostic tests and the ROC curve
- Sample size calculation
- Randomization and control groups
- Block designs
- Factorial designs and interaction
- Repeated measures and crossover designs
- Confounding and bias
- Clinical trial design
When a deep network will not train
What to check, one by one, when training does not work.
- The training loop: one step, one epoch
- Activation functions
- Vanishing and exploding gradients
- Weight initialization
- Batch norm and layer norm
- Residual connections (ResNet)
- Learning rate schedules
- Batch size and gradient accumulation
- Dropout
- Weight decay and L1/L2 regularization
- Early stopping and reading learning curves
- Data splits and leakage
- Confusion matrix, precision, recall and F1
Models for images
From convolution to detection, segmentation and vision transformers, then on to video and 3D.
- Convolution and CNNs
- Pooling and receptive fields
- Reading CNN architectures
- Batch norm and layer norm
- Residual connections (ResNet)
- Data augmentation
- Transfer learning and fine-tuning
- Object detection
- Detector architectures: the R-CNN family and YOLO
- Image segmentation
- Vision Transformer (ViT)
- Self-supervised learning: representations without labels
- Metric learning: learning a distance
- Multimodal learning: how CLIP puts images and text in one space
- Video classification: convolution with a time axis
- 3D vision: voxels, point clouds and NeRF
- Registration: from rigid to non-rigid
If you get stuck
Read the topics on the right first.