Test-Time Training with Self-Supervision for Generalization under Distribution Shifts
Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, Moritz Hardt
TL;DR
This work introduces Test-Time Training (TTT), a principled approach to improve model generalization under distribution shifts by performing self-supervised updates on unlabeled test samples before predicting. TT T uses a shared feature extractor and two task branches (main and self-supervised) and optionally supports an online variant that updates sequentially in a data stream. Empirically, TT T yields substantial robustness gains across CIFAR-10-C, ImageNet-C, VID-Robust, and CIFAR-10.1, while preserving or marginally improving original-distribution performance; theory shows that gradient correlation between the two losses guarantees improvement in convex settings, with empirical evidence extending to deep networks. The results suggest a practical, deployment-time adaptation paradigm and motivate further exploration of task-design and efficiency for broader robustness applications.
Abstract
In this paper, we propose Test-Time Training, a general approach for improving the performance of predictive models when training and test data come from different distributions. We turn a single unlabeled test sample into a self-supervised learning problem, on which we update the model parameters before making a prediction. This also extends naturally to data in an online stream. Our simple approach leads to improvements on diverse image classification benchmarks aimed at evaluating robustness to distribution shifts.
