Concept · Chapter 3: Machine Learning
Distribution Shift
Distribution shift is when the data a model meets in use differs from the data it was trained on, so its measured performance no longer applies.
The problem
Held-out testing assumes the future looks like the past — the same distribution of inputs and the same input–label relationship.
The solution
Monitor inputs and outcomes in production, evaluate on data from the deployment setting, retrain as the world changes, and test robustness to plausible shifts.
The consequence
A model's accuracy is a property of a model and a distribution together — which is why 'works on the benchmark' and 'works in the world' can differ sharply.
You should understand first
- The Turing Test
- Symbolic AI
- Logic and Rules
- Expert Systems
- Knowledge Representation
- The Knowledge-Acquisition Bottleneck
- From Rules to Learning
- Supervised, Unsupervised and Self-Supervised Learning
- Vectors
- Features, Labels and Tasks
- Loss Functions
- Derivatives and Gradients
- Gradient Descent
- Linear Regression
- Probability and Distributions
- Expected Value and Variance
- Sampling and Uncertainty
- Generalization, Overfitting and Underfitting
- Distribution Shift
Three kinds
| Kind | What changes | Example |
|---|---|---|
| Covariate shift | the inputs | a skin-lesion model trained on one hospital's cameras, deployed with another's |
| Label (prior) shift | how common each class is, | fraud rises during a holiday season |
| Concept drift | the relationship | what counts as spam changes as spammers adapt |
Why it matters for you
Models can fail badly on inputs unlike their training data while still producing confident outputs Established. In engineering terms: monitor the distributions of your features and predictions like you would monitor any data pipeline, and treat a sudden change as an alert.
For LLMs the question becomes: which of today's questions look like the training data, and which don't? Chapter 16 returns to robustness and calibration.
What to remember
- Covariate shift: inputs change (new customers, new camera).
- Label/prior shift: class frequencies change (fraud rate doubles).
- Concept drift: the input→label relationship itself changes.
- Monitor production data; a test-set score assumes no shift.