Kinds of learning
Self-Supervised Learning: Creating Training Signals From the Data Itself
Learn how masked prediction, contrastive objectives, temporal prediction, and reconstruction create representations without manual task labels.
By the end you can
- Define self-supervised learning through targets derived from the observations
- Distinguish reconstruction, masked prediction, contrastive, and predictive objectives
- Explain why pretext-task success may not transfer to downstream value
- Identify shortcuts, collapse, and data-governance risks in large-scale pretraining
The system generates its own training question
Self-supervised learning builds its prediction target out of the observation itself, or out of related observations. Predicting masked tokens, future frames, missing image regions, or the representation of another view are all the same construction.
No manual task label is required for the pretraining objective. Human choices still define masking, augmentations, positive pairs, architecture, data collection, and the downstream evaluation.
How far a target the data supplies itself can carry was measured in 2020. Geoffrey Hinton and three co-authors trained SimCLR on ImageNet with no labels at all. The only signal was pairs of differently augmented crops of the same image. A linear classifier fitted on the frozen representation reached 76.5% top-1 accuracy. That was a 7% relative improvement on the previous state of the art, and equal to a supervised ResNet-50. Fine-tuned on 1% of the labels, the same representation reached 85.8% top-5. Labels were not needed to learn the representation. They were still needed to find out whether it was any good.
Visual
Four families of self-supervised objectives
Pretext tasks are not interchangeable. Different ones push a representation to preserve different information — and none of them can be graded on its own.
A large-scale study established that in 2019, by crossing self-supervised methods against backbone architectures instead of testing either alone. Its finding: “Importantly, neither is the ranking of architectures consistent across different methods, nor is the ranking of methods consistent across architectures.” The best objective changed when the network changed. The best network changed when the objective changed. VGG19-BN was consistently the worst backbone for self-supervision, despite performing comparably to ResNet50 on standard supervised vision benchmarks. Its three authors concluded that pretext tasks “should not be considered in isolation, but in conjunction with underlying architectures”.
So read the four families below as a choice made together with the architecture, not before it. How much a single rule inside one family can matter is visible in masked prediction. Kaiming He and five co-authors reported in 2022: “Second, we find that masking a high proportion of the input image, e.g., 75%, yields a nontrivial and meaningful self-supervisory task.” Hiding 75% of an image's patches and reconstructing the missing pixels accelerated training by 3x or more. A vanilla ViT-Huge reached 87.8% ImageNet-1K accuracy, the best among methods using only ImageNet-1K data. Naming the family is not the design decision. The masking ratio is.
Reconstruction
Rebuild the original input or a corrupted version.
Masked prediction
Infer hidden parts from visible context.
Contrastive learning
Bring related views together and separate selected alternatives.
Predictive representation
Predict future or missing representations rather than raw observations.
Example
Self-supervision across data types
The generated target depends on the structure available in the modality. In three of these the exchange has been measured, and the measurement is the point: unlabeled data buys a representation, labels are still spent to find out what it is worth.
- Text: predict missing or next tokens from surrounding context. This is the masked-language-model objective BERT was pre-trained on in 2019, using unlabeled text. Its authors report: “It obtains new state-of-the-art results on eleven natural language processing tasks, including pushing the GLUE score to 80.5 (7.7 point absolute improvement), MultiNLI accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).”
- Images: infer masked patches or align augmented views of the same image. The 2022 masked autoencoder hid 75% of an image's patches and reconstructed the missing pixels. It trained 3x or more faster, and took a vanilla ViT-Huge to 87.8% ImageNet-1K accuracy.
- Audio: predict future acoustic representations or reconstruct masked segments. wav2vec 2.0, published in 2020, masks speech in latent space and solves a contrastive task over quantized latents. With all Librispeech labels it reached 1.8/3.3 WER on the clean and other test sets. Its authors add: “Using just ten minutes of labeled data and pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER.”
- Video: model temporal order, future clips, or cross-view consistency.
- Graphs: predict masked nodes, edges, or agreement across graph augmentations.
- Sensors: infer missing channels or future windows from multivariate history.
Comparison
Self-supervision, supervised pretraining, and autoencoding
The term should describe where the training signal comes from, not merely whether a large dataset is used. Self-supervised targets are generated from the input, or from relationships among inputs. Supervised pretraining takes human or operational labels as its source task. A reconstruction objective reproduces input information, and may or may not be self-supervised.
Each buys a different thing, and each carries its own failure. An objective the designer chose and may have chosen badly. A source label whose bias transfers with the features. A representation that preserves low-level detail and nothing you wanted.
Self-supervised pretraining
Targets are generated from the input or relationships among inputs.
- Scales to unlabeled corpora
- Objective is designer-chosen
- Supports reusable representations
- Can learn unwanted shortcuts
Supervised pretraining
Human or operational labels define the source task.
- Directly task-oriented
- Depends on label availability
- Can transfer useful features
- May inherit source-label bias
Reconstruction objective
The model learns to reproduce input information.
- May be self-supervised
- Preserves broad detail
- Can focus on low-level signals
- Needs downstream validation
Key idea
A pretext task can be solved for the wrong reason
An image model may match views using camera artifacts. An audio model may use background noise. A text model may exploit formatting. Low pretraining loss does not prove a useful or invariant representation.
Probe the learned space with downstream tasks, perturbations, data slices, and nearest-neighbor inspection. The objective must encourage the information you hope to reuse.
Automatic targets remove annotation labor, not the need to validate what was learned.
Case
A pretext task solved by the lens rather than the picture
A network trained in 2015 to predict the relative position of two patches cut from the same image ran into exactly this. Nearest-neighbor inspection kept returning patches from the same absolute position in unrelated photographs. The network had learned chromatic aberration: the slight separation of green from magenta that a lens produces away from the optical center, which makes the position task trivial.
Carl Doersch and his co-authors quantified the leak by training a regressor to predict a patch's absolute coordinates. It reached a root-mean-square error of 0.255 on the easiest tenth of the images, against 0.371 for always guessing the center. Projecting colors off the green–magenta axis, or dropping two of the three color channels at random, pushed that error back to 0.321. The pretext task was being solved. It was being solved by the lens.
Analogy
Practicing with puzzles made from a book
Sentences in a book can be covered and then reconstructed from context. The exercise can teach grammar and recurring ideas without an instructor labeling every page.
Self-supervision constructs tasks from available data in the same way. A reader who fills the gap has understood something. Or the gap was fillable from a superficial clue that will not transfer to the model's later job.
The pretext task teaches whatever its rules make useful.
Steps
Review a self-supervised objective before scaling it
Scale is not only an advantage. Large unlabeled corpora can magnify both useful structure and hidden defects. Six steps run from naming the invariance you want, through protecting semantics and searching for shortcuts, to monitoring collapse, evaluating transfer, and auditing the corpus. Two of them have already been measured for you.
Monitoring collapse has an exact demonstration. Xinlei Chen and Kaiming He trained SimSiam in 2021 with and without a single operation. With stop-gradient it scored 67.7% (± 0.1) on ImageNet linear evaluation. “Solely removing stop-gradient, the accuracy becomes 0.1%, which is the chance-level guess in ImageNet.” The failure had announced itself twice before the accuracy did. The training loss fell immediately to its minimum possible value. The per-channel standard deviation of the l2-normalized output went to zero. Keep both instruments on screen — a loss sitting on its floor, an output standard deviation going to nothing. A perfectly satisfied objective and a worthless representation can be the same run.
Auditing the corpus has a dated precedent. LAION-5B, the scraped image-text dataset used to train Stable Diffusion, was examined in December 2023 in a Stanford Internet Observatory report by David Thiel: “Through this process, we identified 3,226 dataset entries of suspected CSAM, much of which was confirmed as CSAM by third parties.” LAION took the dataset down. On 30 August 2024 it republished the set as Re-LAION-5B, with 5,526,641,167 pairs, after removing 2,236 links matched against hash lists supplied by the Internet Watch Foundation and the Canadian Centre for Child Protection. Nobody had labeled those 3,226 entries into the corpus, because nobody had labeled anything. That is what made the corpus cheap. It is also why the audit had to be run separately from the training.
1. Name the invariance
State what should remain stable across views, masks, or time.
2. Protect semantics
Ensure augmentations and corruptions do not change the intended downstream meaning.
3. Search for shortcuts
Test metadata, formatting, device, source, and near-duplicate signals.
4. Monitor collapse
Check whether representations become constant or lose meaningful variation.
5. Evaluate transfer
Use protected tasks, retrieval, linear probes, and slice analysis.
6. Audit the corpus
Review licensing, privacy, consent, imbalance, and harmful content.
Self-supervised does not mean self-correcting
The training targets are generated automatically. The model does not judge whether the learned representation is fair, factual, safe, or useful. Large-scale pretraining can encode both broad regularities and broad social biases.
Downstream adaptation may change behavior. It does not erase the pretraining distribution. Keep corpus provenance and evaluation attached to the model.
Case
Over 600 verbatim training passages recovered from GPT-2
What the corpus holds can also come back out of the model. In 2021 Nicholas Carlini and eleven co-authors queried the public GPT-2 model and generated 1,800 candidate samples across eighteen attack configurations. They confirmed with the model's creators that over 600 of them were verbatim passages from its training data. In the best configuration, 67% of candidates were verbatim.
One extracted sample carried a named individual's full name, physical address, email address, phone number and fax number. Of the memorised sequences generally, the paper notes that “each of the above sequences are included in just one document in the training data”. Provenance stops being paperwork when the model can recite the source.
Example
A representation needs more than one downstream exam
A broad scorecard settles a narrow question. Does pretraining help only one benchmark, or does it support reusable structure?
The first two exams below are listed separately because they have been shown to disagree. Alejandro Newell and Jia Deng evaluated self-supervised pretraining in 2020 across synthetic datasets, with full control of dataset difficulty and label budget. They reported: “We also find that linear evaluation does not correlate with finetuning performance.” The measurement the field uses as its standard yardstick does not tell you what happens once the encoder is allowed to move.
- Linear probe: test how much target information is accessible without changing the encoder — and read the number as one exam, not as the verdict Newell and Deng found it fails to be.
- Fine-tuning: measure adaptation quality with several labeled-data budgets, since the probe does not predict it.
- Retrieval: inspect nearest neighbors for semantics, shortcuts, and sensitive attributes.
- Robustness: test corruptions, devices, languages, and time periods not dominant in pretraining.
- Efficiency: compare labeled examples, compute, latency, and memory with simpler baselines.
- Safety slices: examine memorization, harmful associations, and subgroup degradation.
Key takeaways
- Self-supervised learning derives training targets from observations rather than manual task labels. SimCLR reached 76.5% top-1 on ImageNet with none of them.
- Reconstruction, masked prediction, contrastive, and predictive objectives preserve different information, and a 2019 study showed the ranking of methods flips with the architecture and back again.
- Pretext-task performance does not guarantee downstream usefulness. Newell and Deng report that linear evaluation does not correlate with finetuning performance.
- Shortcut features and representation collapse require explicit tests. Chromatic aberration solved a position task, and removing stop-gradient alone took SimSiam from 67.7% to 0.1%.
- Transfer evaluation should include protected tasks, retrieval behavior, perturbations, and slices, measured across several labeled-data budgets.
- Corpus provenance, privacy, licensing, and imbalance remain central: 3,226 suspected CSAM entries were found inside LAION-5B, and GPT-2 returned over 600 verbatim training passages.