Unsupervised learning

Unsupervised learning trains a model to find patterns, such as groups or structure, in data that has no labels or correct answers attached.

In supervised learning every example comes with the right answer. Unsupervised learning has no answers at all: the model is given raw data and has to find structure in it by itself. Google's machine learning glossary says the most common use is clustering, sorting data into groups of similar examples, such as grouping songs by their musical properties so the clusters can feed a recommendation service.

Other standard tasks include dimensionality reduction, which compresses data with many measurements into a few that capture most of the variation; anomaly detection, which flags data points that fit no normal pattern; and density estimation, which models how likely different data points are. Well-known methods include k-means clustering, principal component analysis and autoencoders. Google gives an example of principal component analysis applied to millions of shopping baskets revealing that baskets containing lemons often also contain antacids.

The appeal is that unlabelled data is cheap and plentiful. Text crawled from the web, for example through Common Crawl, costs little compared with a hand-labelled dataset such as ImageNet. Google notes that clustering is particularly useful in areas such as anti-abuse and fraud, where good labels are scarce and groupings help people understand what is in the data.

The weakness is that there is no answer key to check against. A clustering algorithm will always find groups, whether or not they mean anything, so people have to judge whether the patterns are real and useful. The boundaries of the term are also blurred: self-supervised learning, which builds prediction tasks from unlabelled data and underpins the pre-training of large language models, is counted by some researchers as a form of unsupervised learning.

Common questions

What is the difference between supervised and unsupervised learning?

Supervised learning learns from examples paired with correct answers and predicts those answers for new inputs. Unsupervised learning has no answers and instead finds structure in the data, such as clusters of similar items or unusual outliers. Supervised learning needs labelled data; unsupervised learning does not.

What are examples of unsupervised learning?

Grouping customers into segments by their buying behaviour, detecting unusual transactions that might be fraud, compressing data with many variables into a few key dimensions, and finding which products tend to be bought together are all common examples.

Are large language models trained with unsupervised learning?

Their pre-training uses unlabelled text, which is why it is sometimes described as unsupervised. More precisely it is self-supervised: the text supplies its own prediction targets, because the model learns to predict the next token. Later stages use supervised fine-tuning and reinforcement learning.

How do you evaluate an unsupervised model?

With difficulty, because there are no correct answers to compare against. Practitioners use statistical measures of how tight and well separated clusters are, test whether the results help with a later task, and ask domain experts whether the patterns make sense.

Finding more

Search for "unsupervised learning", "clustering", "k-means", "principal component analysis" or "anomaly detection" to find explanations and tutorials. Reliable sources include Google's machine learning glossary and courses, scikit-learn's documentation and university course notes. Be wary of claims that an unsupervised system discovered hidden truths in data: look for evidence that the patterns were checked against outcomes or expert judgement.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.