Module 2 · Lesson 5
Supervised learning starts with examples that already have target answers. Unsupervised learning looks for structure without those targets. Modern language models rely heavily on a third idea: self-supervised learning.
The key insight is simple. Instead of asking people to label every example, we design a task where the data itself provides the answer.
The data becomes both the question and the answer
Consider the sentence:
The rain began to fall, so she opened her umbrella.
A training system can show the model part of that sequence and ask it to predict what comes next. The original text already tells us the correct next token. No person has to create a separate label for that training example.
Across a very large corpus, this produces an enormous number of training examples automatically.
Why this matters for language models
Many autoregressive language models are pre-trained by predicting the next token from the tokens that came before it. That objective may sound narrow, but succeeding at it repeatedly requires the model to learn useful statistical structure about syntax, semantics, style, facts, code, and relationships within the training data.
This does not mean next-token prediction is identical to human understanding. It means the prediction task creates a scalable learning signal from raw text.
Self-supervised is not the same as unsupervised
The two terms are sometimes used loosely, but there is a useful distinction.
- Unsupervised learning typically searches for structure without an explicit prediction target for each example.
- Self-supervised learning constructs a prediction target from the input data itself.
Masked-token prediction, next-token prediction, predicting missing image regions, and contrastive objectives are examples of tasks that can create supervision from otherwise unlabeled data.
One level deeper: where the learning signal comes from
During training, the model produces a probability distribution over possible outputs. The known target derived from the data lets us calculate a loss. Backpropagation then computes gradients, and the optimizer updates the model's parameters.
raw data
↓
create a prediction task from the data
↓
model prediction
↓
compare with target derived from the same data
↓
loss → gradients → parameter update
This is the bridge from a pile of text to large-scale pre-training. The corpus supplies the experience, the self-supervised objective supplies the training signal, and optimization turns repeated prediction errors into learned parameters.
With that idea in place, the next lessons can focus on the neural networks and transformer architecture that make this kind of learning useful at scale.