AI and machine learning explained
How machines get better at a task: by trying, scoring and adjusting, or by looking things up before they answer.
Every ai & machine learning concept
Retrieval-augmented generation (RAG)
Find the relevant passages first, then let the model answer from them.
OPEN LESSON
Q-learning
Learning the value of each move by trial, error and one update rule.
OPEN LESSON
Support vector machines
Find the widest street between two groups of points, then bend it with a kernel.
OPEN LESSON
Cross-validation
Score a model five times on rows it never saw, and average the results.
OPEN LESSON
Precision, recall and F1
Why 92% accuracy can hide a filter that misses half the spam, and what to measure instead.
OPEN LESSON
Confusion matrix
Count every prediction by what it was and what the model called it.
OPEN LESSON
Neural networks
Follow numbers through one tiny network by hand, and see why the bend matters.
OPEN LESSON
The perceptron
One artificial neuron learns OR by nudging a line, then meets XOR, which it cannot split.
OPEN LESSON
Recurrent neural networks and LSTMs
A network with a loop remembers a sequence, forgets too fast, and gains gates to fix it.
OPEN LESSON
The attention mechanism
A word scores every other word, turns the scores into shares, and blends what they offer.
OPEN LESSON
Temperature and sampling
How a language model picks its next word: weighted dice, a temperature dial and two cut-offs.
OPEN LESSON
Pre-training vs fine-tuning
Train once on a mountain of raw text, then briefly on a small labelled set for one job.
OPEN LESSON
RLHF
People compare answers, a scorer learns their taste, and the model is tuned to match it.
OPEN LESSON
Diffusion models
Bury an image in noise, learn to predict the noise, then run it backwards from static.
OPEN LESSON
Reinforcement learning
An agent on a small grid learns by trial and error which moves earn the most reward.
OPEN LESSON
Quantization of models
Weights go from 32-bit floats to 8-bit integers: a smaller, faster, slightly less exact model.
OPEN LESSON
Mixture of experts
A router wakes two of eight experts per token: more weights, about the same work.
OPEN LESSON