Abstract
Test-time training (TTT) provides a new approach solving the problem of domain shift. In its framework, a test-time training phase is inserted between training phase and test phase. During test-time training phase, usually parts of the model are updated with test sample(s). Then the updated model will be used in the test phase. However, utilizing test samples for test-time training has some limitations. Firstly, it will lead to overfitting to the test-time procedure thus hurt the performance on the main task. Besides, updating part of the model without changing other parts will induce a mismatch problem. Thus it is hard to perform better on the main task. To relieve above problems, we propose to use mixup in test-time training (MixTTT) which controls the change of model's parameters as well as completing the test-time procedure. We theoretically show its contribution in alleviating the mismatch problem of updated part and static part for the main task as a specific regularization effect for test-time training. MixTTT can be used as an add-on module in general test-time training based methods to further improve their performance. Experimental results show the effectiveness of our method.
The Challenge of Model Mismatch
Deep learning models are notoriously brittle when they encounter domain shift—situations where the test data distribution differs from the training data (e.g., identifying cars in a snowstorm when trained only on sunny photos). Test-Time Training (TTT) addresses this by performing a quick "mini-training" session on test samples using an unsupervised auxiliary task, such as rotation prediction, before making a final prediction.
However, a critical flaw exists: Model Mismatch. Because TTT typically only updates the model's feature extractor while the classifier remains static, the feature extractor can overfit to the auxiliary task. This drift makes the extracted features unrecognizable to the original classifier, much like updating a phone's core software until old apps can no longer run on it.
The MixTTT Framework
To stabilize the adaptation process, we propose MixTTT, a plug-and-play add-on module. Instead of performing the auxiliary task solely on a new test sample ($x_t$), MixTTT creates a synthetic "mixed" sample by blending it with a random image from the original training set ($x_i$) using a ratio ($\lambda$):
$$\tilde{x} = \lambda x_i + (1-\lambda) x_t$$
By training on this mixture, the model adapts to the new domain while staying anchored to the source distribution. Theoretical analysis using Taylor expansion reveals that MixTTT implicitly introduces a regularization term that penalizes excessive gradients, ensuring the updated feature extractor remains compatible with the static classifier.
Visualizing Model Stability
The impact of MixTTT is most evident in the embedding space. Without regularization, test-time updates can cause well-defined clusters to diffuse and overlap—a state of "chaotic" adaptation.
As shown in the t-SNE visualizations of 1,000 test samples, MixTTT preserves the distinctness of class clusters throughout the adaptation process. This stability ensures that the feature extractor's output remains readable for the fixed classifier, preventing the performance degradation often seen in standard TTT.
Quantitative Performance
We evaluated MixTTT on the CIFAR-10-C and CIFAR-100-C benchmarks, focusing on severe (Level 5) corruptions. MixTTT serves as a universal add-on for various TTT strategies, including rotation prediction (TTT-R), entropy minimization (Tent), and contrastive learning (TTT++).
On CIFAR-10-C, adding MixTTT to the state-of-the-art TTT++ method reduced the average error rate from 11.06% to 9.88%. Similar gains were seen on CIFAR-100-C, where the error dropped from 31.95% to 30.36%. The method improved performance across nearly every corruption category, including Gaussian noise, fog, and contrast shifts.
Limitations and Future Work
MixTTT requires access to a small batch of original training data during the test phase, which may be a constraint for privacy-sensitive applications or edge devices with limited storage. Future research could explore more informative unsupervised tasks that more closely entangle the auxiliary and main tasks, potentially reducing the need for a static classifier. Additionally, further study is needed to balance the computational cost of these updates against the achieved accuracy gains.
Conclusion
MixTTT provides a simple yet effective mechanism to mitigate model mismatch in test-time training. By leveraging the implicit regularization of sample mixing, it ensures stable and consistent model adaptation under pressure. As a universal add-on, it significantly enhances the robustness of deep learning models facing real-world domain shifts.
Summary updated