Classical ML

Supervised, Unsupervised & Self-Supervised

The fundamental taxonomy of learning paradigms: from explicit labels to hidden patterns and self-supervised pretraining.

🟢 beginner4 min readfundamentals
Supervised Learning trains models on labeled input-output pairs (X, Y) for classification and regression. Unsupervised Learning finds inherent structural patterns, clusters, or lower-dimensional representations in unlabeled data (X). Self-Supervised Learning bridges the gap by automatically generating pseudo-labels from raw data structure (e.g. Next-Token Prediction, Masked Autoencoders), serving as the foundational engine for modern Foundation Models and LLMs.

Comparison Matrix

       Supervised                       Unsupervised                     Self-Supervised
  Data: (X, Y)                     Data: (X)                        Data: (X) -> Auto-generated Y
  Goal: Map X -> Y                 Goal: Discover P(X) / Structure  Goal: Predict masked/future X
  Examples: Linear, GBDT, ResNet    Examples: k-Means, PCA, GMM      Examples: GPT, BERT, MAE
DimensionSupervisedUnsupervisedSelf-Supervised
Input DataLabeled pairs (X, Y)Unlabeled data (X)Unlabeled raw data (X)
ObjectiveMinimize prediction loss L(f(X), Y)Minimize reconstruction error / WCSSPredict part of X from remaining X
Key TasksClassification, Regression, Object DetectionClustering, Dimensionality Reduction, Anomaly DetectionLLM Pretraining, Vision Pretraining (ViT)
Data CostHigh (Human annotation required)Low (Raw unannotated data)Low (Leverages internet-scale data)
Human SupervisionHighZeroZero (Implicit self-generated targets)

Self-Supervised Learning: The Foundation Model Engine

Self-supervised learning reformulates unsupervised data into a supervised task by creating proxy tasks:

  1. Autoregressive / Causal LM (GPT): Mask future text tokens; task model to predict next token P(x_t | x_<t).
  2. Masked Autoencoders (BERT / MAE): Mask 15% of text tokens or 75% of image patches; task model to reconstruct missing content.
  3. Contrastive Learning (SimCLR / CLIP): Pull positive augmented views of same image together in embedding space while pushing different images apart.

After self-supervised pretraining on massive data, models are fine-tuned on small supervised datasets via SFT / LoRA.

Say this out loud

"Supervised learning maps features X to human labels Y for classification and regression. Unsupervised learning discovers latent structures, clusters, and low-dimensional representations in unlabeled X. Self-supervised learning bridges both by creating automated supervisory targets from raw data—like next-token prediction in LLMs—enabling pretraining on internet-scale datasets before task-specific supervised fine-tuning."

Follow-ups to expect

Check yourself

Question 1 of 3

Which learning paradigm powers modern Large Language Models (LLMs) like GPT-4 and LLaMA during pretraining?

More in Classical ML

See all →
Bias–Variance Tradeoff4 minOverfitting vs Underfitting3 minLinear Regression4 min