Skip to main content

What is the difference between supervised and unsupervised learning?

Machine learning basics · Beginner 1

Short answer

Supervised learning trains on examples with known answers, such as emails labelled spam or not, and learns to predict the label. Unsupervised learning has no labels and finds structure on its own, such as grouping customers into segments. Language model pre-training is often called self-supervised: the next word is the label.

Deeper answer

In supervised learning you have input and output pairs and measure success by comparing predictions with the true outputs, for example classification and regression. In unsupervised learning you only have inputs and look for patterns: clustering, dimensionality reduction, anomaly detection.

Self-supervised learning sits between them: the labels come from the data itself. Predicting the next token in text needs no human labelling, which is why models can train on enormous corpora. Fine-tuning a model on labelled examples is then supervised again.

What a strong answer covers

Answer it out loud in the mock interview about 1 min

Follow-ups to expect

Common mistakes

Learn it

Unsupervised learning

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.