A Layer Selection Approach to Test Time Adaptation

Authors

  • Sabyasachi Sahoo IID Université Laval Mila
  • Mostafa ElAraby Université de Montréal Mila
  • Jonas Ngnawe IID Université Laval Mila
  • Yann Batiste Pequignot IID Université Laval
  • Frédéric Precioso Université Cote d'Azur CNRS INRIA I3S Maasai
  • Christian Gagné IID Université Laval Mila Canada CIFAR AI Chair

DOI:

https://doi.org/10.1609/aaai.v39i19.34229

Abstract

Test Time Adaptation (TTA) addresses the problem of distribution shift by adapting a pretrained model to a new domain during inference. When faced with challenging shifts, most methods collapse and perform worse than the original pretrained model. In this paper, we find that not all layers are equally receptive to the adaptation, and the layers with the most misaligned gradients often cause performance degradation. To address this, we propose GALA, a novel layer selection criterion to identify the most beneficial updates to perform during test time adaptation. This criterion can also filter out unreliable samples with noisy gradients. Its simplicity allows seamless integration with existing TTA loss functions, thereby preventing degradation and focusing adaptation on the most trainable layers. This approach also helps to regularize adaptation to preserve the pretrained features, which are crucial for handling unseen domains. Through extensive experiments, we demonstrate that the proposed layer selection framework improves the performance of existing TTA approaches across multiple datasets, domain shifts, model architectures, and TTA losses.

Downloads

Published

2025-04-11

How to Cite

Sahoo, S., ElAraby, M., Ngnawe, J., Pequignot, Y. B., Precioso, F., & Gagné, C. (2025). A Layer Selection Approach to Test Time Adaptation. Proceedings of the AAAI Conference on Artificial Intelligence, 39(19), 20237–20245. https://doi.org/10.1609/aaai.v39i19.34229

Issue

Section

AAAI Technical Track on Machine Learning V