Learning Without Labels
Nobody tells these dots which group they belong to. The algorithm finds the groups entirely on its own.
Every lesson so far has handed the machine the answers — “this is a cat, that isn't.” But often nobody knows the answers. Sometimes you just have a pile of data and a hunch that there's structure hiding in it.
Think of a shop with thousands of customers and no idea how to group them, or a telescope with a million unlabelled galaxies. There are no labels to learn from. The task isn't to predict a known answer — it's to discover the groups that were there all along. This is unsupervised learning.
The dots below have no colours, no categories, nothing. Watch a classic method called k-means find the clusters with an almost suspiciously simple loop.
k-Means Live
Press Step a few times, then Auto-run
Big markers are cluster centres. Each step: colour every point by its nearest centre, then move each centre to the middle of its colour.
No one labelled these points. The algorithm finds structure on its own — that's unsupervised learning.
Tap Step and watch the centres lurch toward the crowds, the colours snapping into place until everything stops moving. With k = 4 it cleanly recovers the four blobs. Try k = 2 (it merges them) or k = 5 (it splits one). Hit Re-seed a few times — occasionally it settles into a worse grouping. That's not a bug.
How it finds groups with no teacher
k-means just alternates two moves: assign every point to its nearest centroid, then updateeach centroid to the average of its assigned points. Repeat until nothing moves. It's guaranteed to settle — but, like the loss valleys from gradient descent, it can settle into a localbest that depends on where the centres started. That's why re-seeding sometimes gives a worse answer.
Not all learning needs labelled answers. Given only raw data, algorithms can surface groups, outliers, and structure entirely on their own. This powers customer segmentation, fraud and anomaly detection, and — crucially — the “self-supervised” pre-training that lets language models learn from oceans of unlabelled text by quizzing themselves on the next token.
That self-supervised trick is the secret link back to LLMs: the data labels itself. Hide the next word and the text becomes its own answer key — no human annotators required, which is the only reason training on the whole internet is even possible.
So we've seen learning with labels and learning with nolabels. There's one more flavour, and it's how AI masters games and controls robots: learning from nothing but reward— trial, error, and the occasional treat. That's next.
Feel like you get it?
Continue to “Trial & Error” →