Abstract
Self-Supervised Learning (SSL) is crucial for real-world applications, especially in data-hungry domains such as healthcare and self-driving cars. In addition to a lack of labeled data, these applications also suffer from distributional shifts. Therefore, an SSL method should provide robust generalization and uncertainty estimation in the test dataset to be considered a reliable model in such high-stakes domains. However, existing approaches often focus on generalization, without evaluating the model's uncertainty. The ability to compare SSL techniques for improving these estimates is therefore critical for research on the reliability of self-supervision models. In this paper, we explore variants of SSL methods, including Jigsaw Puzzles, Context, Rotation, Geometric Transformations Prediction for vision, as well as BERT and GPT for language tasks. We train SSL in auxiliary learning for vision and pre-training for language model, then evaluate the generalization (in-out classification accuracy) and uncertainty (expected calibration error) across different distribution covariate shift datasets, including MNIST-C, CIFAR-10-C, CIFAR-10.1, and MNLI. Our goal is to create a benchmark with outputs from experiments, providing a starting point for new SSL methods in Reliable Machine Learning.
Introduction
In high-stakes fields like healthcare or autonomous driving, machine learning models must be "reliable." This means they shouldn't just be accurate; they should also know when they are likely to be wrong (uncertainty estimation) and perform well even when the test data looks different from the training data (robust generalization).
Self-Supervised Learning (SSL)—where models learn from unlabeled data by solving "pretext" tasks—has shown great promise for generalization. However, most research ignores how SSL affects calibration: the alignment between a model's predicted confidence and its actual accuracy. This paper fills the gap by benchmarking common SSL methods across various "covariate shifts" (changes in input distribution, like noise or blur).
Methodology
The authors evaluate SSL across two domains: Computer Vision and Natural Language Processing (NLP).
Computer Vision
In vision tasks, SSL is utilized as an auxiliary task. The model is trained to solve the main classification task (e.g., identifying an object) while simultaneously solving a pretext task. Four variants were tested:
- Jigsaw Puzzles: Reassembling shuffled image patches.
- Context Prediction: Predicting the relative position of image patches.
- Rotation Prediction: Predicting if an image was rotated by 0, 90, 180, or 270 degrees.
- Geometric Transformations (Affine): Predicting transformations like scaling, shearing, and translation.
Natural Language Processing
For NLP, the study evaluates the standard pre-training and fine-tuning pipeline using BERT (encoder-only) and GPT-2 (decoder-only) architectures on Natural Language Inference (NLI) tasks.
Experimental Setup
The study utilizes several datasets specifically designed to test robustness and uncertainty under shift:
- MNIST-C & CIFAR-10-C: Standard datasets corrupted with 15-19 types of noise (blur, weather effects, digital artifacts) at five levels of intensity.
- CIFAR-10.1: A test set for CIFAR-10 containing real-world images designed to minimize distribution shift, yet often revealing drops in model performance.
- MultiNLI: Used for language tasks, comparing written language (in-distribution) against transposed verbal language (out-of-distribution shift).
Key Results and Analysis
The primary metrics used are Accuracy (for generalization) and Expected Calibration Error (ECE) (for uncertainty estimation).
Robustness to Distributional Shift
Among vision SSL methods, Jigsaw Puzzles emerged as the most stable and reliable. It consistently provided the best balance of high accuracy and low calibration error across shifted datasets. On CIFAR-10-C, SSL models (specifically Jigsaw and Rotation) improved accuracy by over 5% and reduced ECE by 0.04 compared to standard Empirical Risk Minimization (ERM).
The "Overconfidence" Problem
While SSL generally improves reliability on complex images (CIFAR), it actually hurt performance on simpler images like MNIST-C. Furthermore, even when SSL improved calibration, models remained "confidently wrong" on out-of-distribution data. Ideally, a model should show high predictive entropy (uncertainty) when it sees something it doesn't recognize. Instead, SSL models often gave low-entropy, high-confidence predictions for shifted data, failing to signal that they were out of their depth.
NLP Trade-offs
In the language domain, a distinct trade-off was observed: BERT generalized better to shifted data (higher accuracy), but GPT-2 was significantly better calibrated. GPT-2 achieved an impressively low ECE of 0.031 on out-of-distribution language tasks, compared to BERT’s 0.1661.
Conclusion
This benchmark demonstrates that while SSL moves the needle in the right direction for reliability, it does not yet produce a "good enough" model for high-stakes deployment. The models still fail to recognize when they are operating on out-of-distribution data. Future work should focus on developing SSL pretext tasks that specifically encourage the model to "know what it doesn't know," perhaps by incorporating more explicit out-of-distribution detection mechanisms into the training objective.
Summary updated