Test-Time Ensemble via Linear Mode Connectivity: A Path to Better Adaptation

Byungjai Kim, Chanho Ahn, Wissam J. Baddar, Kikyung Kim, Huijin Lee, Saehyun Ahn, Seungju Han, Sungjoo Suh, Eunho YangICLR 2025

Machine learning models often stumble when they encounter data that looks different from their training set due to distribution shifts. Test-Time Adaptation (TTA) attempts to fix this by updating the model's parameters using the very data it is currently predicting. However, TTA faces two major hurdles: model collapse (where the model spirals into predicting the same class for every image) and computational inefficiency (running multiple models for an ensemble is too slow and memory-intensive for real-time use).

This paper introduces Test-Time Ensemble (TTE), a framework that boosts the performance of models adapting to new data on the fly without the heavy computational cost of traditional ensembles. By leveraging the property of Linear Mode Connectivity, TTE averages model weights to capture diverse representations into a single model, while a novel de-biasing distillation scheme prevents model collapse.

The TTE Framework

The authors propose treating adaptation as a "weight-space" ensembling problem rather than an "output-space" one. Their approach rests on three pillars:

  1. Adaptive Weight-Space Ensemble: Based on the insight that models fine-tuned from the same starting point are "linearly connected," TTE maintains an ensemble network by taking an Exponential Moving Average (EMA) of the weights of the adapting network. Crucially, the "momentum" of this average is adaptive—it changes based on how much the two models' predictions diverge.
  2. Dropout Ensemble: To ensure the model explores a diverse range of features, high levels of dropout are applied during the adaptation phase. This forces the model to find multiple ways to represent the data, which are then captured into the ensemble network via weight averaging.
  3. De-biased and Noise-Robust Distillation: To prevent model collapse, TTE uses the ensemble network to "teach" the adapter network. A de-biasing scheme tracks accumulated class bias and subtracts it from the teacher's signal. They also use reverse KL divergence, which is more robust to the noisy, incorrect pseudo-labels common in unsupervised adaptation.
Overview of the Test-Time Ensemble (TTE) framework and its performance improvements over conventional TTA methods.

Key Insights: The "Ensemble for Free" Effect

The most striking insight is that you don't need to run five models to get the benefit of five models. Because of Linear Mode Connectivity, averaging the weights of a model at different points in its adaptation journey effectively "compresses" an ensemble into a single set of parameters.

Comparison of output-space and weight-space interpolation across different corruptions, demonstrating the effectiveness of linear mode connectivity.

Furthermore, the paper shows that standard KL divergence can overfit to noisy predictions. By using reverse KL, the gradient naturally penalizes incorrect predictions more effectively, acting as a stabilizer during the unsupervised learning process. This stability is crucial; even the best adaptation methods can fail catastrophically in continual settings, but TTE acts as a "safety rail," keeping the optimization stable even when the data stream is highly biased.

Experimental Results

The authors evaluated TTE across several challenging benchmarks, including ImageNet-C (artificial corruptions), ImageNet-S (sketches), ImageNet-R (renditions), and ImageNet-V2. They tested these under various "wild" scenarios like Label Shifts, Batch Size 1, and Continual TTA.

TTE was integrated into existing TTA methods (Tent, SAR, DeYO) and consistently improved them:

  • Accuracy Boost: On ResNet50-GN, integrating TTE with the DeYO baseline improved average accuracy by +9.9% in Label Shift scenarios and +11.1% in Mix Shift scenarios.
  • ViT Performance: When applied to a Vision Transformer (ViTBase) on ImageNet-C, TTE helped the Tent baseline jump from 30.9% to 46.6% accuracy—a massive gain for a "plug-and-play" module.
  • Efficiency: Unlike methods that use "dense augmentation" (running the same image through the model multiple times), TTE only requires one additional forward pass for the ensemble network, making it significantly faster than previous state-of-the-art stability methods.

Limitations and Future Work

While highly effective, TTE introduces several hyperparameters (like the de-biasing scale and temperature). Finding the optimal settings without access to labeled validation data at test time remains a general challenge. Additionally, the performance gains on ImageNet-V2 (which represents natural, subtle shifts) were much smaller (+0.1% to +1.0%) compared to the gains on artificial corruptions. This suggests that while TTE is excellent at handling synthetic corruptions, further research is needed to bridge "natural" domain gaps and develop unsupervised validation methods.

Summary updated

BibTeX
@inproceedings{kim2025test,
  author = {Byungjai Kim and Chanho Ahn and Wissam J. Baddar and Kikyung Kim and HUIJIN LEE and Saehyun Ahn and Seungju Han and Sungjoo Suh and Eunho Yang},
  title = {{Test-Time Ensemble via Linear Mode Connectivity: A Path to Better Adaptation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=4wk2eOKGvh},
}
Figure