SNAP: Low-Latency Test-Time Adaptation with Sparse Updates

Hyeongheon Cha, Dong Min Kim, Hye Won Chung, Taesik Gong, Sung-Ju Lee

TL;DR

SNAP (Sparse Network Adaptation) is a framework that enables deep learning models to adapt to new environments on low-power edge devices by updating only 1% of the time. By strategically selecting "representative" data samples and using a clever inference-time normalization trick, SNAP reduces latency by up to 93% while keeping accuracy within 3% of much heavier, full-adaptation methods.

What Problem Does This Paper Address?

Deep learning models are notoriously brittle; a model trained to recognize objects in sunny weather might fail miserably in a snowstorm—a phenomenon known as domain shift. Test-Time Adaptation (TTA) is the standard solution, allowing a model to update itself using the unlabeled data it sees "in the wild."

However, there is a major catch: standard TTA algorithms are computationally expensive. They often require backpropagation and data augmentation for every single batch of data. On resource-constrained edge devices like a Raspberry Pi or an IoT sensor, this creates a massive "inference lag." If the model takes 5 seconds to adapt to a frame but the camera is feeding it 30 frames per second, the system quickly falls behind, making it useless for real-time applications like autonomous driving or health monitoring.

While you could simply adapt less frequently (Sparse TTA), "naïve" skipping usually leads to a catastrophic drop in accuracy because the model isn't seeing enough of the right data to stay aligned with the changing environment.

Methods

The authors propose SNAP, a lightweight framework designed to make Sparse TTA (STTA) actually work. It consists of two main "plug-and-play" components that can be integrated into existing TTA algorithms (like Tent or CoTTA).

Overview of the SNAP framework, highlighting the CnDRM and IoBMN components.
  1. Class and Domain Representative Memory (CnDRM): Instead of picking random samples to learn from, SNAP maintains a small memory buffer of "representative" samples. It looks for two things:
  2. Class Representativeness: Samples with high pseudo-label confidence that are balanced across different classes.
  3. Domain Representativeness: Samples that are statistically "central" to the new environment. It calculates the Wasserstein distance in the feature space of the model's early layers to find samples closest to the "domain centroid."
  4. Inference-only Batch-aware Memory Normalization (IoBMN): This is the "secret sauce" for the periods between model updates. Even when the model isn't running backpropagation, IoBMN dynamically adjusts the normalization layers during inference. It uses the statistics of the representative samples in memory to "correct" the features of the current incoming batch, keeping the model aligned with the target domain even when its weights are frozen.

Datasets

The researchers evaluated SNAP across a rigorous suite of benchmarks:

  • Image Corruptions: CIFAR10-C, CIFAR100-C, and ImageNet-C (standard datasets with 15 types of artificial noise/weather effects).
  • Abstract Shifts: ImageNet-R (renditions/artistic styles) and ImageNet-Sketch.
  • Real-world Sensors: The HARTH dataset, which contains human activity recognition data from wearable accelerometers.
  • Hardware Testbeds: Performance was measured on real edge hardware: Raspberry Pi 4, Raspberry Pi Zero 2 W, and NVIDIA Jetson Nano.

Key Insights and Ideas

  • The "Easy Sample" Hypothesis: In standard supervised learning, "hard" samples (those near decision boundaries) are often best for training. However, the authors found that in sparse, unsupervised TTA, the opposite is true. At low sampling rates, "easy," highly representative samples provide a much more stable signal for adaptation.
  • Early Layers as Domain Anchors: The paper leverages the fact that early layers in a CNN or Vision Transformer (ViT) capture low-level textures and styles that are highly domain-specific. By monitoring these layers, SNAP can identify which samples best represent the new environment.
  • Normalization as a Bridge: IoBMN acts as a bridge between sparse weight updates. It proves that you don't always need expensive gradient descents to handle distribution shifts; sometimes, simply re-centering your feature distributions based on a small memory of "good" samples is enough to maintain high performance.

Key Results

Latency and accuracy comparison of standard TTA methods versus their SNAP-integrated counterparts.
  • Massive Latency Gains: On a Raspberry Pi 4, SNAP reduced the latency of the state-of-the-art CoTTA algorithm by 93.12%.
  • Accuracy Resilience: Even when adapting on only 1% of the data stream, SNAP maintained accuracy levels very close to "full" adaptation (e.g., achieving ~77-81% accuracy where full adaptation reached 80.4%).
  • Efficiency: The memory overhead is negligible, typically accounting for less than 1.74% of the model's original memory usage.
  • Versatility: SNAP was shown to work not just on standard CNNs (ResNet), but also on Vision Transformers (ViT) by adapting its normalization strategy to LayerNorm.

Limitations and Future Work

  • Fixed Adaptation Rates: Currently, the user must set the adaptation rate (e.g., 0.1 or 0.01) manually. The authors suggest that future versions could dynamically adjust this rate based on the "severity" of the domain shift or the current system load.
  • Threshold Tuning: The confidence threshold for selecting samples is also fixed. Automating the tuning of this threshold based on data characteristics could further improve stability.
  • PyTorch Constraints: The current implementation is somewhat limited by how deep learning libraries handle backpropagation blocks; the authors note that explicitly optimizing the backpropagation delay at the compiler level could yield even more speed.

Paper Citation: Cha, H., Kim, D. M., Chung, H. W., Gong, T., & Lee, S.-J. (2025). SNAP: Low-Latency Test-Time Adaptation with Sparse Updates. 39th Conference on Neural Information Processing Systems (NeurIPS 2025). Source Code

Summary updated

BibTeX
@inproceedings{cha2025snap,
  author = {Hyeongheon Cha and Dong Min Kim and Hye Won Chung and Taesik Gong and Sung-Ju Lee},
  title = {{SNAP: Low-Latency Test-Time Adaptation with Sparse Updates}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8JwMjKDppz},
}
Figure