Probability — the basics
Calculate probabilities for simple events, combine independent events, and interpret the probability output of a model — for example, '83% cat'.
Practise in Mattegrafen ↗ · Sannolikhet och statistikPrerequisites
Intuition
Probability is a number between 0 (impossible) and 1 (certain). Dice: P(six) = 1/6. Roll two dice: P(two sixes) = 1/6 · 1/6 = 1/36, because the rolls are independent.
The probabilities of all possible outcomes always sum to 1. This is one of the most important rules — and the one AI models rely on constantly.
Formal
When an image model says 'cat 0.83, dog 0.15, other 0.02', it is providing a probability distribution over categories: the sum is 1. The model is not certain — it distributes its confidence.
A language model does the same for the next word: a distribution over the entire vocabulary. "The cat's tail is …" → long 0.31, soft 0.22, striped 0.08 … To 'generate text' is to draw words from such distributions, one at a time.
Basic rules: P(A or B) = P(A) + P(B) if A and B cannot happen at the same time; P(A and B) = P(A) · P(B) if they are independent; P(not A) = 1 − P(A).
Mastery means
- Calculates probability as favourable outcomes divided by possible outcomes
- Multiplies probabilities for independent events
Sign in to do the exercises and build your mastery up.
Sources
Leads to
- DConditional probability
- DHow a language model is trained — at upper-secondary level
- DLogistic regression and decision trees
- DLoss functions
- DPrecision, recall, F1 and ROC
- DProbability distributions
- Dn-gram language models
- EMulti-armed bandits
- EGenerative models — an overview
- EInformation theory: entropy and KL divergence
- EIntegrals in probability: the expectation
- EReinforcement learning — the basics
- FCalibration and uncertainty in models
Part of the goals (30)
- AI in production
- Statistics for experiments
- The mathematics behind the models
- Language models in practice
- Understand how generative AI works
- Train an agent with reward
- Classical machine learning in practice
- Generative models in depth
- Responsible AI in practice
- Build a voice interface
- Fine-tune and run your own models
- Train your first neural network
- Classical ML for real
- Interpreting a language model
- Deep reinforcement learning
- AI safety in practice
- Training neural networks for real
- Run models more cheaply: quantisation
- Build an NLP system end to end
- Multimodal systems
- Build a RAG system you can trust
- Frontier Lab — an independent research project
- Evals in practice
- Build a transformer from scratch
- Fine-tune a model with LoRA
- Build an agent you can trust
- An AI service in operation
- Build a memory system for an agent
- Build an AI service that survives production
- Reproduce a paper