Advanced techniques
Self-Supervised Learning: Designing the Objective
Learn how predictive, reconstructive, contrastive, and bootstrap objectives create training signals from unlabeled data.
By the end you can
- Explain how self-supervised targets are derived from the input itself
- Compare predictive, reconstructive, contrastive, and teacher–student objectives
- Judge whether a pretext task preserves information needed downstream
- Design evaluation that separates representation quality from pretraining loss
Unlabeled does not mean objective-free
Self-supervised learning creates targets from structure already present in the data. A system might predict a missing token, reconstruct a masked image region, decide which views belong together, or predict a slowly updated target representation. These targets are generated without manual task labels, but they are not neutral. The objective defines what distinctions the model is rewarded for preserving and what variations it is encouraged to ignore.
The failure that follows is specific, and it has been measured. When random cropping was SimCLR's only augmentation, patches taken from a single image shared a colour distribution distinctive enough that a colour histogram was sufficient to tell images apart. The encoder could therefore satisfy the contrastive objective by matching colour rather than content. The loss fell either way. Nothing in the training curve separates the representation you wanted from the one that reads a colour histogram.
Objective design is therefore a representation-design decision. The question is not whether pretraining converges. It is whether the learned features support the downstream tasks and slices that matter.
The pretext task is a specification of what the representation should care about.
Visual
Four ways to manufacture a training signal
Different objective families make different assumptions about useful structure. Each has a result you can look up rather than a claim you have to accept.
Reconstruction gets interesting when you hide most of the input. Masked autoencoders, published in 2021, mask “a high proportion of the input image, e.g., 75%”, which yields “a nontrivial and meaningful self-supervisory task”. Training accelerated “by 3x or more”, and a vanilla ViT-Huge reached “the best accuracy (87.8%) among methods that use only ImageNet-1K data”. The saving is architectural as much as statistical. Their encoder “operates only on the visible subset of patches”: three quarters of the image never reaches it.
The bootstrap branch has a named result of the same kind. BYOL trains an online network to predict the representation of a slow-moving target network, and it does so with no negative pairs at all. The abstract states the claim plainly: “While state-of-the art methods rely on negative pairs, BYOL achieves a new state of the art without them.” DeepMind published it in 2020. It reached 74.3% ImageNet top-1 under linear evaluation with a ResNet-50, and 79.6% with a larger ResNet.
Unusually, the number survived an outside check. Table 4 of Chen and He's 2021 paper is their own reproduction of the competitors, and it puts BYOL at 74.3 after 800 epochs — the highest in the table, against SimCLR at 70.4, MoCo v2 at 72.2, SwAV at 71.8 and SimSiam at 71.3, all ResNet-50. The top row of that table is not the authors' own method.
Predictive
Predict a future, missing, or neighboring part from observed context.
Reconstructive
Encode corrupted input and recover the original or a target representation.
Contrastive
Bring related views together while separating selected alternatives.
Bootstrap / teacher–student
Match a target network or teacher without explicit human labels.
The objective family determines the information pressure placed on the encoder.
Example
Questions to ask before choosing a pretext task
These questions connect the raw-data structure to downstream requirements. Each of them has, at some point, been answered the wrong way in a published system, which is why they are worth asking on paper before a cluster is booked.
- What information must remain recoverable for the downstream task?
- Which transformations represent harmless variation, and which change the label semantics?
- Can the objective be solved through a local shortcut or metadata leak? Random cropping alone let a SimCLR encoder match colour histograms; relative patch location let Doersch and colleagues' network read chromatic aberration.
- Does the dataset contain enough diversity to make the task nontrivial?
- Will the representation be used frozen, fine-tuned, retrieved, or shared across tasks?
- How will representation quality be measured without relying on the pretraining loss?
Comparison
Pretext tasks and their common shortcuts
A self-supervised objective can be optimized without learning the abstraction you hoped for. The masking family is the clearest case of an idea that travels across modalities, and the honest way to see what it bought is to attach a label budget to it.
wav2vec 2.0 carried masked prediction into audio in 2020. It masks the speech input in latent space and solves a contrastive task over learned quantised units. Meta's own account of the release describes the rate directly: “About half the audio representations are masked before being fed into the transformer”. The result appears in the paper's abstract as a label budget rather than a loss: “Using just ten minutes of labeled data and pre-training on 53k hours of unlabeled data still achieves 4.8/8.2 WER.” Those are LibriSpeech clean and other. With the full labelled set the same abstract gives 1.8/3.3 WER.
The pair of numbers is a run, not a constant. Meta's blog announcing the release reported 5.2/8.6 for the same ten-minute setting — 5.2 percent on clean speech, 8.6 percent on noisy. Same system, same setting, two published pairs. Worth remembering when a headline WER is compared across write-ups.
Masked prediction
Hide part of the input and predict it from context.
- Scales well in language and vision
- Masking policy shapes difficulty
- May emphasize reconstruction detail
- Examples: BERT, masked autoencoders
Temporal prediction
Use past or nearby context to predict future or neighboring observations.
- Natural for audio, video, and sensors
- Can exploit trivial continuity
- Requires leakage-aware windows
- Useful for sequential representations
View consistency
Make augmented views of one item produce compatible representations.
- Encodes chosen invariances
- Augmentation design is critical
- May use negatives or a target network
- Strong for images and multimodal data
Case
BERT masks 15% of tokens, and not all of them the same way
The masking rate is a design decision, not a detail. BERT hides a fixed share of the tokens and predicts only those: “In all of our experiments, we mask 15% of all WordPiece tokens in each sequence at random”, and “we only predict the masked words rather than reconstructing the entire input”. Devlin and colleagues set that by policy in section 3.1, in 2018.
The chosen positions are then not treated alike. The token is replaced with “the [MASK] token 80% of the time”, with “a random token 10% of the time”, and with “the unchanged i-th token 10% of the time”. A single uniform rule would have been simpler. The split belongs to the objective rather than the optimizer: it changes what the encoder is asked to do at a position it cannot identify by its surface form.
Key idea
Representation collapse and trivial solutions
Some objectives admit degenerate behavior. If every input maps to the same vector, a naive view-matching loss can be minimized without learning useful distinctions. Contrastive negatives, architectural asymmetry, stop-gradient operations, target networks, normalization, or variance constraints are among the mechanisms used to avoid collapse in different methods.
SimSiam measured what one of those mechanisms is worth by switching it off. Architecture and hyper-parameters unchanged, only the stop-gradient removed. The loss fell to −1, its minimum possible value. The per-channel standard deviation of the l2-normalised output went to zero, which is collapse in its literal form. ImageNet linear-evaluation accuracy fell from 67.7±0.1% to 0.1%: “Solely removing stop-gradient, the accuracy becomes 0.1%, which is the chance-level guess in ImageNet.” Chen and He published that in 2021, and their abstract gives the general finding: “collapsing solutions do exist for the loss and structure, but a stop-gradient operation plays an essential role in preventing collapsing”. An independent group at KAIST re-analysed the same result the following year and summarised it the same way: “Without using negative samples, SimSiam solves the collapse problem via predictor and stop gradient”.
That run is the argument in one line: a perfect loss, chance-level accuracy, one deleted operation between them. Having such a mechanism does not guarantee a useful representation either. Monitor embedding variance, nearest neighbors, downstream probes, and sensitivity to augmentations rather than trusting a stable training curve alone.
A loss at its minimum can describe a trivial solution: without stop-gradient, SimSiam reached −1 and 0.1%.
Key idea
Every pretext task writes an invariance contract
Augmentations and prediction targets tell the encoder which changes should be ignored and which information must remain recoverable. SimCLR's is the clearest published case of a contract that had to be rewritten. Section 3.1 of the paper, in 2020, says why:
“We conjecture that one serious issue when using only random cropping as data augmentation is that most patches from an image share a similar color distribution. Figure 6 shows that color histograms alone suffice to distinguish images. Neural nets may exploit this shortcut to solve the predictive task. Therefore, it is critical to compose cropping with color distortion in order to learn generalizable features.”
The same section concludes that “no single transformation suffices to learn good representations”, and Google's own account of the work names the two that mattered: random cropping and random colour distortion. The repair was an augmentation, not an architecture.
The contract can also conflict with the downstream task, and colour is where that shows. Colour distortion is what forces the encoder to stop reading histograms. It is also what a clinically relevant colour signal cannot survive. Three researchers at Edinburgh put the general version of that cost on the record in 2021: “top self-supervised learners fail to preserve colour information as well as supervised alternatives”. That is the invariance contract being honoured exactly as written, and billed to whoever needed the colour.
Write the intended invariances before training, then test them with counterexamples. A representation is not task-agnostic merely because its targets were generated without manual labels.
Self-supervision replaces hand labels with designed assumptions; it does not remove supervision.
Steps
From pretraining idea to representation evidence
The evaluation plan should be chosen before expensive pretraining begins.
Step 3 has a canonical shape. SimCLR's headline evidence is a linear probe on frozen features, not a pretraining loss: “A linear classifier trained on self-supervised representations learned by SimCLR achieves 76.5% top-1 accuracy, which is a 7% relative improvement over previous state-of-the-art, matching the performance of a supervised ResNet-50.” That figure is the widest model, a ResNet-50 (4×); a standard-width ResNet-50 reached 69.3% under the same linear evaluation. Add a label budget and the probe becomes a fine-tuning result. Google's account of the same run reports that “When fine-tuned on only 1% of the labels, SimCLR achieves 63.0% / 85.8% top-1 / top-5 accuracy, compared to 52.7% / 77.9% from previous best (CPC v2)” — CPC v2 there being a ResNet-161. With standard width the 1%-label numbers were 48.3%/75.5%.
Step 6 is not a formality, and two large evaluations are the reason. The same Edinburgh study tested 13 top self-supervised models on 40 downstream tasks: “We find ImageNet Top-1 accuracy to be highly correlated with transfer to many-shot recognition, but increasingly less so for few-shot, object detection and dense prediction. No single self-supervised method dominates overall, suggesting that universal pre-training is still unsolved.” A second evaluation, from AI2 in 2021, came at it from another direction. It ran “over 700 training experiments including 30 encoders, 4 pre-training datasets and 20 diverse downstream tasks” and concluded that “ImageNet classification does not appear to be a strong indicator of self-supervised encoder performance for various computer vision tasks”. Two independent studies of that size, and in both the ranking changes with the task. One benchmark number is not a selection procedure.
1. Define downstream uses
List tasks, label budgets, and deployment shifts.
2. Specify invariances
State which transformations should preserve meaning.
3. Build cheap probes
Use linear evaluation, retrieval, or small-label fine-tuning during development.
4. Search for shortcuts
Inspect augmentations, metadata, temporal leakage, and local cues.
5. Compare supervised and random baselines
Measure what pretraining actually adds.
6. Evaluate transfer breadth
Test more than one downstream dataset or slice when broad reuse is claimed.
Visual
Counterfactuals for a pretext objective
A pretraining objective should be challenged with alternative tasks that expose the invariances it rewards. The surface-shortcut layer is not a thought experiment, and the earliest documented instance was a camera artefact rather than anything about the content of the data.
A network trained to predict the relative location of two image patches found another way to do it. Doersch and colleagues reported the discovery in 2015, in section 3.1: “However, even these precautions are not enough: we were surprised to find that, for some images, another trivial solution exists. We traced the problem to an unexpected culprit: chromatic aberration.” They proved it with an ablation rather than an intuition. A regressor trained to predict a patch's absolute (x, y) position reached RMSE .255 on the top 10% of images, against .371 for always predicting the image centre. Their 'projection' pre-processing blunted the cue and pushed that error back up to .321; colour dropping was the other fix. The shortcut was in the camera, not in the content.
The phenomenon reproduces on demand. Minderer and colleagues noted in 2020 that “Doersch et al. (2015) express their surprise at finding that convolutional neural networks learn to exploit chromatic aberrations to solve the task”, then built a synthetic version. On CIFAR-10 with the Rotation pretext task, an added chromatic-aberration shortcut cut downstream accuracy on frozen features from 81.8±0.30% on clean data to 19.3±2.42%. Their adversarial 'lens' recovered it to 73.5±1.23%. A shortcut took frozen-feature accuracy from 81.8% to 19.3%, and it was invisible in the pretext objective, which the network was solving better than ever.
- 01
Surface shortcut
Can the model solve the task through texture, metadata, or local frequency alone?
- 02
Representation test
Do frozen features support a simple downstream probe on the intended signal?
- 03
Transfer test
Does the advantage persist after fair fine-tuning and across target slices?
- 04
Ablation test
Which corruption, augmentation, or prediction target creates the observed gain?
A lower pretraining loss is evidence about the pretext task, not proof of a useful representation.
Key takeaways
- Self-supervised learning derives supervision from structure within raw data — a masking rate of 15% of WordPiece tokens or 75% of image patches is a design choice, not a default.
- The pretext task defines what information the representation preserves and discards.
- Predictive, reconstructive, contrastive, and bootstrap objectives create different inductive pressures; BYOL's 74.3% ImageNet linear-evaluation result shows the bootstrap family working without any negative pairs.
- Augmentation and corruption policies encode either useful invariance or harmful information loss: without colour distortion a SimCLR encoder matches colour histograms, and with it colour information is the thing that fails to survive.
- Collapse and shortcut solutions must be checked explicitly — removing only the stop-gradient took SimSiam from 67.7% to 0.1% while the loss reached its minimum of −1.
- Representation quality is established by downstream evidence, not the pretraining loss alone; across 13 models on 40 tasks and over 700 experiments on 20 tasks, no single method dominated.