Supervised and unsupervised learning
Two ways a machine learns: from examples with answers, or by finding patterns on its own.
In supervised learning, every training example comes with the right answer attached, called a label. Thousands of emails marked "spam" or "not spam", photos of skin marked "benign" or "malignant", past apartments with their sale price. The model studies the pairs and learns a rule that maps input to answer, so it can predict the label for something new. Sorting into categories is called classification; predicting a number, like a price, is regression.
In unsupervised learning, there are no answers. The model gets raw data and looks for structure: customers that behave alike (clustering), transactions that look nothing like the rest (anomaly detection, useful against fraud), or a simpler way to describe the data. Nobody tells it what the groups mean; a person has to look at them and decide whether they are useful.
The difference matters because labels are expensive: someone has to write them, often by hand. That is why a third approach became central: self-supervised learning, where the data labels itself. Large language models learn this way, by hiding the next word of a real text and trying to guess it, which turns the whole internet into practice material without anyone labeling it.
Keep in mind
- Supervised: examples come with labels; the model learns to predict them.
- Unsupervised: no labels; the model finds groups and outliers.
- Labeling data is slow and costly, so it often decides which approach is used.
- LLMs are trained mostly with self-supervised learning on plain text.
Go deeper
- Supervised vs. unsupervised learning (IBM)
- Supervised learning on Wikipedia
- Unsupervised learning on Wikipedia