Post

Test Time Adaptation

Dynamic Adaptation: Goals and Correlation

Human capabilities include continuously learning over time, identifying and learning from unknown objects and environments, and identifying and learning from difficult or anomalous examples. These capabilities correlate with several machine learning approaches: Lifelong Continual Learning, Open World Learning, and Active Learning.

The Supervised Machine Learning Paradigm

The standard supervised machine learning setup involves providing a dataset and splitting it into training and testing partitions, often from the same underlying data distribution. During deployment, the system is trained offline on a static training set and deployed if test set performance is satisfactory.

However, significant problems arise in practice when we receive additional data, especially data from outside the original training distribution. The natural world is constantly evolving and changing, making it fundamentally not independent and identically distributed (I.I.D.).

Motivation and Setup

Pitfalls of Supervised Learning

Machine learning models typically assume i.i.d. training and test data, but real-world test data often comes from shifted distributions. This manifests in various scenarios:

  • Images with new lighting or weather conditions
  • Sensor drift in robotics applications
  • Domain changes in natural language processing tasks

Challenge at Test Time

A critical challenge emerges when labels $y$ are not available at test time. This raises the fundamental question: how can we adapt to distribution shift when we cannot rely on ground truth labels?

Challenges at Test Time

Challenges for Adaptations

Several key challenges complicate test-time adaptation:

  • Catastrophic forgetting: Models over-adapt on small batches, losing previously learned knowledge
  • Compute overhead: Gradient updates required at test time increase computational costs
  • Design choices: Decisions must be made about which parameters to adapt (BatchNorm layers, final layer, or entire network)

Catastrophic Forgetting

When we naively fine-tune or update a network using traditional gradient descent updates on new data, performance on previous tasks is abruptly lost. The network forgets everything it knew about previous classes in favor of performing well only on the new data. This is evident when MLP models with fine-tuning show performance dropping toward chance levels, while continual learning mechanisms maintain better performance across tasks.

Catastrophic Forgetting

Why Catastrophic Forgetting Happens?

The phenomenon can be understood through the Stability-Plasticity Dilemma (McCloskey and Cohen, 1989). This fundamental tension arises from two competing needs:

  • Stability: The network needs stable weights to preserve previous information and perform well on prior tasks
  • Plasticity: The network requires flexibility to adapt to new data and acquire new knowledge

The fundamental goal is to maintain a balance between the stability needed to remember old information and the plasticity required to acquire new information. When weights are preserved too much (frozen), the network loses adaptability, but without sufficient stability, catastrophic forgetting occurs.

This post is licensed under CC BY 4.0 by the author.

© . Some rights reserved.

Using the Chirpy theme for Jekyll.