Unsupervised learning
Unsupervised learning is a type of machine learning where the model learns from data that has no labels or predefined answers. Instead of being told what's right or wrong, the algorithm explores the data on its own, looking for patterns, groupings, and structure that aren't obvious on the surface.
This is useful when you have large amounts of data but don't know what you're looking for yet. Unsupervised learning can reveal customer segments you didn't know existed, detect unusual behavior in a network, or organize thousands of documents by topic.
How does unsupervised learning work?
In supervised learning, the model trains on labeled examples and each input comes paired with the correct output. The model learns to map inputs to outputs. Unsupervised learning drops the labels entirely. The model only sees inputs and has to figure out what's meaningful on its own.
The way it does this depends on the algorithm, but the core idea is always the same: the model looks for statistical patterns in the data. Which data points are similar to each other? Which features tend to appear together? Which points look different from everything else?
Because there are no "correct answers" to evaluate against, unsupervised learning is harder to measure than supervised learning. You can't simply check accuracy. Instead, you evaluate the results based on whether the discovered patterns are meaningful and useful, which often requires human judgment or downstream task performance.
Types of unsupervised learning
Unsupervised learning algorithms generally fall into three categories, based on what they're trying to discover in the data.
Clustering groups similar data points together. The algorithm doesn't know what the groups should be because it discovers them based on patterns in the data. K-means clustering, for example, partitions data into a specified number of groups by minimizing the distance between data points and their cluster centers. Hierarchical clustering builds nested groups. DBSCAN finds clusters of varying shapes and identifies outliers. Clustering is used for customer segmentation, organizing document collections, grouping similar images, and identifying patterns in genomic data.
Dimensionality reduction simplifies complex datasets by reducing the number of features (variables) while preserving as much meaningful information as possible. When a dataset has hundreds or thousands of features, it becomes difficult to visualize, process, or train models on. Techniques like principal component analysis (PCA) and t-SNE compress the data into fewer dimensions, making it easier to work with. This is often used as a preprocessing step before applying other machine learning methods.
Association rule learning finds relationships between variables in large datasets. The classic example is market basket analysis: customers who buy bread and butter also tend to buy milk. These rules help businesses understand purchasing patterns, optimize product placement, and build recommendation systems.
Supervised vs. unsupervised learning
This is the most fundamental distinction in machine learning, and understanding it is key to knowing when to use each approach.
Supervised learning trains on labeled data. Every training example has an input and a known correct output. The model learns to predict outputs for new inputs. It's used for tasks with clear right answers: classifying emails as spam or not spam, predicting house prices, diagnosing diseases from medical images. You need labeled data to use it, and creating those labels can be expensive and time-consuming.
Unsupervised learning trains on unlabeled data. The model has no correct answers to learn from. Instead, it discovers patterns, groupings, and relationships in the data on its own. It's used for exploration: segmenting customers, detecting anomalies, organizing large datasets. You don't need labeled data, which makes it applicable to the massive amounts of raw data that organizations collect every day.
In practice, the two approaches often complement each other. You might use unsupervised learning to discover customer segments in raw transaction data, then use supervised learning to predict which segment a new customer belongs to. This combination is common in real-world machine learning pipelines.
Most modern large language models blur the line between these categories. LLM pre-training uses self-supervised learning, which is technically a form of unsupervised learning: the model generates its own labels by predicting masked or next tokens in unlabeled text. Post-training techniques like RLHF and supervised fine-tuning then add supervised and reinforcement learning on top.
Is reinforcement learning supervised or unsupervised?
Neither. Reinforcement learning is its own category; a third paradigm alongside supervised and unsupervised learning.
In reinforcement learning, a model (called an agent) learns by interacting with an environment and receiving feedback in the form of rewards or penalties. It doesn't train on a fixed dataset with labels (like supervised learning) or explore unlabeled data for patterns (like unsupervised learning). Instead, it learns through trial and error, gradually discovering which actions lead to the best outcomes.
Think of it like training a dog: you don't show the dog a dataset of correct behaviors. You let the dog try things, then reward the behaviors you want. Over time, the dog learns what to do. Reinforcement learning works the same way. The agent experiments, receives feedback, and adjusts its strategy.
Reinforcement learning is used for game playing (AlphaGo, chess engines), robotics, autonomous vehicles, and increasingly for AI alignment through techniques like RLHF, where human preferences act as the reward signal that shapes model behavior.
Is deep learning supervised or unsupervised?
Deep learning is an architecture. Deep learning refers to neural networks with many layers (hence "deep"), and it can be applied to supervised, unsupervised, or reinforcement learning depending on the task.
A deep neural network trained to classify images using labeled data is doing supervised deep learning. The same architecture used for clustering or dimensionality reduction on unlabeled data is doing unsupervised deep learning. A deep network trained with rewards to play a video game is doing deep reinforcement learning.
When people talk about "deep learning," they usually mean supervised learning applications, because that's where deep learning achieved its most visible breakthroughs (image recognition, speech recognition, language translation). But the architecture itself is flexible across all learning paradigms. Autoencoders and generative adversarial networks (GANs) are examples of deep learning applied in an unsupervised context.
Real-world examples of unsupervised learning
Unsupervised learning is at work in many systems you interact with daily.
Customer segmentation. Retailers and subscription services use clustering algorithms to group customers by behavior without predefined categories. These segments inform marketing strategy, product recommendations, and pricing decisions.
Anomaly detection. Cybersecurity systems use unsupervised learning to identify unusual network traffic that could indicate a breach. Fraud detection systems at banks work the same way; they learn what "normal" transactions look like and flag anything that deviates significantly.
Recommendation engines. When Spotify suggests new music or Netflix surfaces shows you might like, unsupervised learning algorithms are often part of the pipeline; grouping content and users into clusters based on behavior patterns.
Medical research. Unsupervised learning helps researchers identify subtypes of diseases by clustering patient data, which can lead to more targeted treatments. It's also used to analyze genomic data, grouping genes with similar expression patterns.
Natural language processing. Topic modeling algorithms (like LDA) use unsupervised learning to organize large text collections by theme; useful for analyzing customer feedback, research papers, or news archives at scale.
FAQs
What is unsupervised learning?
Unsupervised learning is a type of machine learning where the model trains on data without labels or predefined answers. It discovers patterns, groupings, and structure in the data on its own, making it useful for tasks like clustering, anomaly detection, and dimensionality reduction.
What's the difference between supervised and unsupervised learning?
Supervised learning uses labeled data (inputs paired with correct outputs) to train a model. Unsupervised learning uses unlabeled data and discovers patterns without knowing the "right answers." Supervised learning is for prediction; unsupervised learning is for exploration. → Learn more about supervised learning
Is reinforcement learning supervised or unsupervised?
Neither. Reinforcement learning is a separate paradigm where a model learns by interacting with an environment and receiving rewards or penalties. It doesn't use labeled datasets (supervised) or explore unlabeled data for structure (unsupervised). → Learn more about RLHF
Is deep learning supervised or unsupervised?
Deep learning can be either, or both. It refers to neural networks with many layers, not a specific learning paradigm. Deep learning is used for supervised tasks (image classification), unsupervised tasks (clustering, generative models), and reinforcement learning (game playing, robotics).
How is unsupervised learning used in LLMs?
LLM pre-training is essentially self-supervised learning, a form of unsupervised learning. The model trains on massive unlabeled text datasets, generating its own training signal by predicting the next token. Post-training then layers supervised and reinforcement learning on top. → Learn more about training/pre-training
What are the main types of unsupervised learning?
The three main types are clustering (grouping similar data points), dimensionality reduction (simplifying complex data by reducing features), and association rule learning (discovering relationships between variables). Each serves different analytical goals.
Candidates
Hiring
Content