无梯度自适应:仿射统计传输及其证书能告诉你的

·

研究论文 · 2026/09/03

测试时适应(TTA)通常假设推理时可以更新模型参数,但这对于仅推理加速器、冻结或第三方模型以及内存受限部署而言过于严格,且基于批归一化的TTA在无批归一化架构上可能失效。本文研究模型必须保持冻结时的适应问题,提出无梯度方法CASTER:在判别性子空间中存储源类统计量,从目标批次矩估计类共享仿射变换,并在分类前解析地迁移源类分布。CASTER无需反向传播、优化器状态或源特征库。在四个骨干网络和七个数据集上,它在28个骨干-数据集设置中的27个上优于基于相同冻结特征的k-NN,且状态中位数减少18倍。仿射迁移并非总是可靠:在ImageNet-C上,当批次仅含64个样本对应1000个类别时,无条件迁移损失21.2个top-1点。为此引入经验性的残差-边际可迁移性证书。在307个评估单元中,每个损失超过10点的迁移其证书值均高于3.9,尽管良性区域与破坏性区域并非完全分离。门控将无条件迁移的平均-3.35点效应转为+1.69点增益,且在宽阈值范围内性能保持在最佳阈值的0.3点以内。最后,该证书具有机制特异性:应用于Tent时,仅接受4.3%的更新并保留Tent可用增益的0.6%。这些结果使CASTER成为冻结模型部署的轻量级适应机制,并明确说明了其安全信号何时有效、何时无效。

本文针对测试时适应中模型必须冻结的实际约束,提出无梯度方法CASTER,并系统评估其性能与局限性。引入的可迁移性证书为安全部署提供了实用工具,且揭示了证书的机制特异性,对后续研究具有重要参考价值。实验覆盖多骨干、多数据集,结果详实,适合关注高效推理、模型部署和鲁棒性的读者。

Test-time adaptation (TTA) typically assumes that model parameters can be updated at inference time. This assumption is restrictive for inference-only accelerators, frozen or third-party models, and memory-constrained deployments, and standard BatchNorm-based TTA configurations may also become inactive on architectures without BatchNorm. We study adaptation when the learned model must remain frozen. We introduce CASTER, a gradient-free method that stores source class statistics in a discriminative subspace, estimates a class-shared affine transformation from target-batch moments, and analytically transports the source class distributions before classification. CASTER requires no backward pass, optimizer state, or stored source feature bank. Across four backbones and seven datasets, it outperforms k-NN on identical frozen features in 27 of 28 backbone-dataset settings while retaining a median of 18x less state. Affine transport is not always reliable. On ImageNet-C, where batches contain only 64 samples for 1000 classes, unconditional transport loses 21.2 top-1 points. We therefore introduce an empirical residual-to-margin transportability certificate. Across 307 evaluation cells, every transport losing more than 10 points has certificate value above 3.9, although benign and destructive regimes are not perfectly separated. Gating converts an average -3.35-point effect of unconditional transport into a +1.69-point gain, and performance remains within 0.3 points of the best threshold over a broad threshold range. Finally, we show that this certificate is mechanism-specific: when applied to Tent, it accepts only 4.3% of updates and preserves 0.6% of Tent's available gain. These results position CASTER as a lightweight adaptation mechanism for frozen-model deployment, together with an explicit account of when its safety signal is informative and when it is not.

阅读原文

参与讨论