[论文解读] Test-Time Model Adaptation with Only Forward Passes
本文提出了一种仅前向传播的自适应方法(FOA),一种无需反向传播或权重更新的测试时自适应方法,适用于资源受限设备。通过使用无导数的CMA-ES学习可学习提示,并结合激活偏移,FOA在8位量化ViT上实现了ImageNet-C 66.3%的准确率,优于全精度模型上的基于梯度的TENT方法,同时将内存使用量减少至原来的1/24。
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.
研究动机与目标
- 在FPGA、智能手机和嵌入式系统等资源受限设备上实现测试时自适应,其中反向传播不可行。
- 解决基于梯度的TTA方法与边缘环境中常见量化和硬编码模型之间的不兼容性。
- 开发一种稳定、无监督的优化框架,避免梯度计算和模型权重更新。
- 在不修改模型权重或依赖监督信号的情况下,提升分布外泛化能力。
- 在保持或超越基于梯度方法性能的同时,降低内存和计算开销。
提出的方法
- 引入可学习输入提示作为唯一可学习参数,将自适应与模型权重更新解耦。
- 采用无导数的协方差矩阵自适应进化策略(CMA-ES)在无需反向传播的情况下优化提示。
- 设计一种新颖的无监督适应度函数,结合测试真实统计差异与模型预测熵,以指导优化过程。
- 提出一种激活偏移方案,直接重写分布外输入的激活值,使其与源域分布对齐。
- 仅在推理阶段应用该方法,仅需前向传播,无需反向传播。
- 通过避免梯度计算和权重修改,支持在8位量化ViT模型上部署。
实验结果
研究问题
- RQ1在资源受限的边缘设备上,是否可以无需反向传播实现有效的测试时自适应?
- RQ2像CMA-ES这样的无导数优化器能否在在线、无监督的测试时自适应中实现稳定?
- RQ3仅使用可学习提示是否能实现与基于梯度方法相当或更优的性能?
- RQ4激活偏移是否能在不修改模型权重的情况下提升自适应性能?
- RQ5所提方法是否可成功应用于8位量化模型,实现在极低内存开销下的高性能?
主要发现
- FOA在8位量化ViT上实现了ImageNet-C(级别5)66.3%的top-1准确率,优于全精度32位ViT上的基于梯度的TENT方法。
- 该方法将8位ViT的内存使用量降低至208 MB,相比TENT在32位ViT上的5,165 MB,减少24倍。
- 当种群规模为28时,FOA实现66.3%准确率和3.2% ECE,显著优于TENT(59.6%准确率,18.5% ECE)。
- 仅激活偏移组件即可将准确率从55.5%(NoAdapt)提升至59.1%,证明其有效性。
- 消融实验证明,当直接将CMA-ES应用于模型统计量或使用熵损失的提示时,优化失败;但采用所提出的适应度函数和提示设置后,优化成功。
- 该方法实现了在8位模型上的高性能自适应,证明了其在FPGA和边缘设备上部署的可行性,这些设备不支持反向传播。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。