arXiv:2609.00374cs.LGAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.00374

Adapting Without Gradients: Affine Statistics Transport and What Its Certificate Can Tell You

Salim Khazem, Ibrahim Mohamed Serouis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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 18× 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. Code is available in https://github.com/salimkhazem/Caster.git

Figure

Figure 1. CASTER at test time. Source class moments are transported to the target batch by a class-shared affine map estimated from batch statistics. The transported Gaussian discriminant is used only when the transportability certificate passes; otherwise CASTER returns the frozen model-head prediction. No gradients are computed and no source feature bank is stored.

1. Introduction

Test-time adaptation (TTA) aims to recover accuracy under distribution shift by using unlabeled target data available only at inference time. Strong methods such as Tent [16], EATA [9], CoTTA [18], and SAR [10] update model parameters online and can be highly effective when a backward pass and mutable model state are available. In many deployments, however, those assumptions are restrictive: inference-only accelerators may not expose backward computation, frozen binaries or external APIs may not expose trainable parameters, and optimizer state can violate latency or memory budgets. Forward-only TTA such as FOA [11] relaxes the backward-pass requirement through derivative-free prompt optimization, but still performs a test-time search. We study a stricter regime in which the learned network parameters remain frozen and adaptation is performed analytically in feature space.

A second practical issue is architectural. In the standard implementations evaluated here, Tent and EATA collect BatchNorm affine parameters. Consequently, on our four LayerNorm backbones ConvNeXt-T, ViT-B/16, DeiT-B, and Swin-T their eligible parameter set is empty and their predictions reduce exactly to the frozen source model. SAR differs because it can update BatchNorm, GroupNorm, or LayerNorm parameters. This distinction matters when reporting TTA results across modern architectures: an average that mixes active and inert configurations can obscure what a method is actually adapting.

We propose CASTER, a gradient-free TTA method based on class-shared affine statistics transport. Our hypothesis is that many practically relevant shifts approximately transform a source-trained feature space by a single affine map shared across classes. CASTER stores only source class moments in a discriminative subspace. For each target batch, it estimates a shrinkage-stabilized map from source and target batch moments, transports the source class Gaussians through that map, and evaluates the resulting Gaussian discriminant. The feature extractor and learned network parameters are never updated, no source feature bank is retained, and no optimizer state is required.

Analytic transport is not unconditionally safe. Its weakest regime is also easy to diagnose: when the number of classes is large relative to the target batch, pseudo-class coverage is too sparse to support reliable class geometry. On ImageNet-C, for example, a batch contains 64 samples for 1000 classes, and unconditional transport loses 21.2 top-1 points relative to the frozen head. CASTER therefore includes a transportability certificate: after inverse transport, confident pseudo-class centroids must remain small relative to the minimum source-class margin, measured in the same Mahalanobis geometry.

A central result of this paper is a precise characterization of what that certificate does and does not justify. It reliably identifies the catastrophic transport regime: every admissible evaluation cell that loses more than 10 points has certificate value above 3.9. The induced policy is also insensitive to the exact threshold; across a roughly fourfold interval, performance stays within 0.3 points of the best threshold. However, the raw certificate score does not rank adaptation benefit within the non-degenerate regime: its correlation with the gain from transport is positive, whereas a score used to prefer beneficial updates would need the opposite ordering. We therefore present the certificate as a safety floor for the transport mechanism, not as a general predictor of how much adaptation will help.

That distinction becomes sharper when the same gate is applied to a different adaptation mechanism. On matched CIFAR-10-C cells, the certificate admits only 4.3% of Tent updates and preserves just 0.6% of Tent's available gain; a more permissive source-statistic referee accepts 46.3% and still keeps only 32.3%. At the cell level, the certificate's acceptance rate decreases as Tent's ungated gain increases ( ρ=−0.86\rho = -0.86), whereas the analogous relationship is positive for CASTER's own transport. The failure is structural: a criterion computed from the pre-update frozen representation cannot, in general, certify the benefit of a mechanism

that changes that representation.

Contributions. We make three contributions. (i) We introduce CASTER, an analytic, gradient-free TTA mechanism that stores per-class moments rather than a source feature bank. On identical frozen features it outperforms k-NN in 27 of 28 backbone-dataset cells, with an 18×18\times smaller median retained state, and it remains applicable to architectures on which the BatchNorm-only Tent/EATA configurations evaluated here are inert. (ii) We derive a scale-consistent residual-to-margin certificate and empirically separate two claims that are often conflated: detecting degenerate transport and ranking adaptation benefit. The certificate supports the former, not the latter. (iii) We show that this certificate does not transfer to a feature-updating mechanism, providing both matched experiments and a structural explanation for the failure. All reported aggregates are regenerated from raw logs by a fail-closed verification script to reduce silent evaluation errors.