Where Do Scarce Labels Belong? Evaluating Contrastive Pretraining under Equal Compute and Realistic Label Budgets

Mahmoud Alyosify, Mirna Imbabi, Natalie Nashed, Hazem M. AbbasarXiv 2026

TL;DR

When you have a small pile of labeled images and a mountain of unlabeled ones, should you feed those scarce labels into your contrastive pretraining loss, or save them for afterwards? This paper shows that putting labels inside the contrastive loss only buys early speed, not a better final model. Given enough pretraining, label-free pretraining on all images (SimCLR) overtakes supervised contrastive learning (SupCon)—and if you have the unlabeled data, semi-supervised learning like FixMatch beats both.

What Problem Does This Paper Address?

Contrastive learning teaches an image encoder by pulling together different augmented views of the same image and pushing apart views of different images. When labels are available, SupCon (Supervised Contrastive Learning) uses them to pull together all images of the same class. With 100% of the labels, SupCon beats label-free SimCLR.

In practice, however, labels are usually scarce. Previous studies trying to answer where those few labels belong have stumbled over two hidden confounds:

  1. Unequal compute: Counting budgets in "epochs" over a 5,000-image labeled pool versus a 50,000-image unlabeled pool means one method takes ten times as many gradient steps as the other.
  2. Unrealistic evaluation: The standard test for a pretrained encoder is a linear probe trained on all 50,000 training labels—an "oracle" evaluation that a practitioner with only 5,000 labels cannot actually run.

Methods

The authors strip away both confounds with a compute-matched $2 \times 2$ experimental design:

  • Labels in the loss: Label-free (SimCLR) vs. label-using (SupCon).
  • Pretraining pool: Labeled subset only vs. all images (giving SimCLR-sub and SupCon+U, a semi-supervised variant of SupCon).

Every arm is trained for the exact same number of gradient steps (from 970 to 97,000 steps, processing 1,024 augmented views per step). Crucially, each encoder is evaluated both with the oracle-label probe (all training labels) and with label-budget protocols that only touch the available scarce labels: a linear probe (LP-5k), full fine-tuning (FT-5k, tested across default, selectable, and oracle hyperparameter recipes), and semi-supervised fine-tuning (FixMatch-init).

Datasets

  • CIFAR-10 & CIFAR-100: 50,000 training images, 10,000 test images (32 px), tested primarily at 10% labels (5,000 labeled images) and across fractions from 1% to 100%.
  • STL-10: 5,000 labeled training images, 8,000 test images, and 100,000 unlabeled images (96 px) drawn from a broader, uncurated distribution.
  • Tiny-ImageNet: 100,000 training images across 200 classes (64 px) at 10% labels.

Experiments use ResNet-18, with a ResNet-50 check on CIFAR-10.

Key Insights and Ideas

  • Labels buy speed, not a better end point: SupCon races ahead early because it quickly separates the 5,000 labeled images by class. Once separated, however, the loss has little left to learn, and SupCon plateaus. SimCLR keeps climbing and eventually overtakes it.
  • The evaluation protocol flips the winner: An oracle-label probe makes label-using encoders look stronger than they are to a real practitioner. Because SupCon and SupCon+U already separate their 5,000 labeled images during pretraining, reusing those same labels for linear probing or fine-tuning causes the classifier to overfit to those specific examples—and even breaks standard validation-based recipe selection (hitting 100% validation accuracy across the grid).
  • The "seen/unseen" tightness gap: Measuring class-distance normalised variance (CDNV) reveals that label-using encoders collapse their labeled training images into clusters several times tighter than their unlabeled or test images. For SupCon+U, the unlabeled images it trains on end up no tighter than unseen test images.
  • Semi-supervised learning wins overall: When unlabeled data is available, semi-supervised methods like FixMatch and MixMatch outperform every pretrain-then-fine-tune pipeline. At equal total compute, FixMatch from scratch matches FixMatch initialized from a contrastive encoder.
Figure 1: CIFAR-10, 10% labels, ResNet-18: test accuracy against the number of gradient steps for the four arms of the 2 × 2 design. Mean and standard deviation over seeds (five at 9,700 and 19,400 steps, three elsewhere). (a) With the oracle-label probe, SupCon is far ahead early, level with SimCLR at 9,700 steps and behind afterwards. (b) With LP-5k, the three are within about a point at 9,700 steps and SimCLR is ahead of both label-using methods from 19,400 steps on. (c) After fine-tuning with the default recipe, SimCLR is ahead from 9,700 steps on (at 9,700 steps, with the best recipe of the grid, SimCLR is 0.6 points ahead of SupCon, not significant, and 0.9 ahead of SupCon+U; with a recipe chosen on held-out labels SupCon is level and SupCon+U 1.3 points behind; Section 5). Fine-tuning was run from 9,700 steps on.

Key Results

  • The crossover on CIFAR-10 (10% labels, ResNet-18): Under the oracle-label probe, SupCon leads SimCLR by 13.3 points at 970 steps (80.5% vs. 67.1%), ties at 9,700 steps (84.1% vs. 83.7%), and trails by 6.6 points at 97,000 steps (83.9% vs. 90.6%). After fine-tuning on the 5,000 labels, SimCLR leads by 8.3 points (90.5% vs. 82.2%).
  • Protocol disagreement at 9,700 steps: The oracle-label probe puts SupCon+U 1.9 points ahead of SimCLR (85.6% vs. 83.7%). Fine-tuning on the 5,000 labels puts SupCon+U behind under every recipe—by 3.9 points with the default recipe, and 1.3 points even when holding out 1,000 labels to tune the recipe.
  • Generalization: The same crossover pattern holds on CIFAR-100, STL-10, Tiny-ImageNet, and with ResNet-50.
  • Semi-supervised baselines: On CIFAR-10, FixMatch from scratch (at 3x budget) reaches 94.8%, matching SimCLR + FixMatch (94.3%) and beating SimCLR + fine-tuning (89.4% with a selected recipe).

Limitations and Future Work

The authors note that their findings are established in a specific regime: class-balanced datasets, in-distribution or mildly out-of-distribution unlabeled images, and small ResNet architectures (ResNet-18 and ResNet-50). Additionally, some recipe-search and ablation runs used one to three seeds, meaning between-seed variance is estimated coarsely in those secondary checks.

Summary updated

BibTeX
@misc{alyosify2026where,
  author = {Mahmoud Alyosify and Mirna Imbabi and Natalie Nashed and Hazem M. Abbas},
  title = {{Where Do Scarce Labels Belong? Evaluating Contrastive Pretraining under Equal Compute and Realistic Label Budgets}},
  year = {2026},
  eprint = {2612.02929},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.02929},
}
Figure