[Paper Review] Test-Time Model Adaptation with Only Forward Passes
This paper proposes Forward-Only Adaptation (FOA), a test-time adaptation method that enables model adaptation on resource-limited devices without backpropagation or weight updates. By learning a learnable prompt via derivative-free CMA-ES and applying activation shifting, FOA achieves 66.3% accuracy on ImageNet-C with 8-bit quantized ViT, outperforming gradient-based TENT on full-precision models while reducing memory use by up to 24-fold.
Test-time adaptation has proven effective in adapting a given trained model to unseen test samples with potential distribution shifts. However, in real-world scenarios, models are usually deployed on resource-limited devices, e.g., FPGAs, and are often quantized and hard-coded with non-modifiable parameters for acceleration. In light of this, existing methods are often infeasible since they heavily depend on computation-intensive backpropagation for model updating that may be not supported. To address this, we propose a test-time Forward-Optimization Adaptation (FOA) method. In FOA, we seek to solely learn a newly added prompt (as model's input) via a derivative-free covariance matrix adaptation evolution strategy. To make this strategy work stably under our online unsupervised setting, we devise a novel fitness function by measuring test-training statistic discrepancy and model prediction entropy. Moreover, we design an activation shifting scheme that directly tunes the model activations for shifted test samples, making them align with the source training domain, thereby further enhancing adaptation performance. Without using any backpropagation and altering model weights, FOA runs on quantized 8-bit ViT outperforms gradient-based TENT on full-precision 32-bit ViT, while achieving an up to 24-fold memory reduction on ImageNet-C.
Motivation & Objective
- To enable test-time adaptation on resource-limited devices such as FPGAs, smartphones, and embedded systems where backpropagation is infeasible.
- To address the incompatibility of gradient-based TTA methods with quantized and hard-coded models commonly deployed in edge environments.
- To develop a stable, unsupervised optimization framework that avoids gradient computation and model weight updates.
- To improve out-of-distribution generalization without altering model weights or requiring supervised signals.
- To reduce memory and computational overhead while maintaining or exceeding the performance of gradient-based methods.
Proposed method
- Introduces a learnable input prompt as the sole learnable parameter, decoupling adaptation from model weight updates.
- Employs a derivative-free covariance matrix adaptation evolution strategy (CMA-ES) to optimize the prompt without backpropagation.
- Designs a novel unsupervised fitness function combining test-truth statistic discrepancy and model prediction entropy to guide optimization.
- Proposes an activation shifting scheme that directly rewrites activations from out-of-distribution inputs to align with the source domain's distribution.
- Applies the method exclusively during inference, requiring only forward passes and no backward passes.
- Supports deployment on quantized 8-bit ViT models by avoiding gradient computation and weight modification.
Experimental results
Research questions
- RQ1Can test-time adaptation be effectively performed without backpropagation on resource-constrained edge devices?
- RQ2Can a derivative-free optimizer like CMA-ES be stabilized for online, unsupervised test-time adaptation?
- RQ3Can a learnable prompt alone achieve performance comparable to or better than gradient-based methods?
- RQ4Does activation shifting improve adaptation performance without modifying model weights?
- RQ5Can the proposed method be successfully applied to quantized 8-bit models, enabling high performance with minimal memory overhead?
Key findings
- FOA achieves 66.3% top-1 accuracy on ImageNet-C (level 5) using a quantized 8-bit ViT, outperforming gradient-based TENT on full-precision 32-bit ViT.
- The method reduces memory usage to 208 MB for 8-bit ViT, a 24-fold reduction compared to TENT’s 5,165 MB on 32-bit ViT.
- With a population size of 28, FOA achieves 66.3% accuracy and 3.2% ECE, significantly outperforming TENT (59.6% accuracy, 18.5% ECE).
- The activation shifting component alone improves accuracy from 55.5% (NoAdapt) to 59.1% on ImageNet-C, demonstrating its effectiveness.
- Empirical ablation shows that CMA-ES fails when applied directly to model statistics or prompts with entropy loss, but succeeds with the proposed fitness function and prompt-based setup.
- The method enables high-performance adaptation on 8-bit models, demonstrating feasibility for deployment on FPGAs and edge devices where backpropagation is not supported.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.