HyperFlow: Gradient-Free Test-Time Adaptation for Cross-Domain Few-Shot Classification
Abstract
While test-time fine-tuning is beneficial in cross-domain few-shot classification, the need for multiple backpropagation steps can be prohibitively expensive in resource-constrained environments. We propose HyperFlow, a gradient-free test-time adaptation method that amortizes fine-tuning dynamics into a lightweight conditional drift network. During offline training, which uses standard backpropagation, HyperFlow learns from gradient-based fine-tuning trajectories collected on meta-training tasks. Once trained, it adapts a selected PEFT parameter subspace (e.g., bias or LoRA parameters) for a new task by numerical ODE solving, requiring only forward passes of the drift network and no gradient computation at test time. In experiments on Meta-Dataset and CD-FSL benchmarks, our method improves out-of-domain performance over the direct transfer approach while using only 6–14\% of peak memory and about 1\% of the FLOPs of standard fine-tuning, positioning HyperFlow as an accuracy–efficiency trade-off between direct transfer and fine-tuning. Code is available at https://github.com/GitGyun/HyperFlow.