Unsupervised Learning
Unsupervised learning is a category of machine learning in which a model discovers structure in data without relying on labelled examples or explicit feedback signals. Instead of learning from input–output pairs, the model finds regularities on its own — grouping similar observations, reducing dimensionality, or modelling the underlying data distribution. Clustering algorithms, autoencoders, and self-supervised objectives used in large language model pretraining all fall under this umbrella.
Think of it like sorting a massive pile of foreign-language letters you cannot read. You cannot identify the meaning, but you can notice that some letters have the same handwriting, others share the same stamps, and certain paper sizes recur together — grouping by observable structure even without understanding the content.
A typical unsupervised task is clustering customer purchasing records to discover natural market segments:
from sklearn.cluster import KMeans
import numpy as np
X = np.load("customer_features.npy") # no labels provided
model = KMeans(n_clusters=5, random_state=42)
model.fit(X)
print(model.labels_[:10]) # e.g. [2, 0, 4, 2, 1, 3, 0, 4, 1, 2]
The five clusters emerge purely from feature similarity; no one told the model what the groups should mean.
Unsupervised learning is foundational to Pretraining, where models like BERT learn rich Embeddings from raw text before any labelled fine-tuning. It also underpins Latent Space representations in autoencoders and GANs, and connects directly to Fine-tuning — which typically refines an unsupervised pretrained model on a labelled downstream task.
You will encounter unsupervised learning whenever labelled data is scarce or expensive: exploratory data analysis, anomaly detection in logs, and the self-supervised pretraining stages of virtually every modern Foundation Model.