不计算梯度就能模拟微调,实现快速高效少样本适应。
HyperFlow: Gradient-Free Emulation of Few-Shot Fine-Tuning
- 用微分方程建模梯度下降,训练辅助网络预测任务变化方向。
- 在跨域分类任务中性能超越非微调基线,仅需标准微调1%的计算量。
- 适合资源受限或实时场景,无需目标模型反向传播。
测试时微调虽有益于少样本学习,但多次反向传播在实时或低资源环境下代价过高。为此,我们提出一种无需计算梯度即可模拟梯度下降的方法,实现高效测试时适配。具体地,将梯度下降建模为常微分方程(ODE)的欧拉离散化形式,训练一个辅助网络,仅使用少量支持集样本预测任务相关的漂移项。适配过程简化为一次数值积分(如欧拉法),只需对辅助网络进行几次前向传播,完全无需目标模型的梯度或前向计算。在Meta-Dataset和CDFSL跨域少样本分类基准上的实验表明,该方法显著提升域外性能,同时内存开销仅为标准微调的6%,计算时间仅占0.02%,在直接迁移与全微调之间建立实用折中方案。
原文摘要 · Abstract (English)
While test-time fine-tuning is beneficial in few-shot learning, the need for multiple backpropagation steps can be prohibitively expensive in real-time or low-resource scenarios. To address this limitation, we propose an approach that emulates gradient descent without computing gradients, enabling efficient test-time adaptation. Specifically, we formulate gradient descent as an Euler discretization of an ordinary differential equation (ODE) and train an auxiliary network to predict the task-conditional drift using only the few-shot support set. The adaptation then reduces to a simple numerical integration (e.g., via the Euler method), which requires only a few forward passes of the auxiliary network -- no gradients or forward passes of the target model are needed. In experiments on cross-domain few-shot classification using the Meta-Dataset and CDFSL benchmarks, our method significantly improves out-of-domain performance over the non-fine-tuned baseline while incurring only 6\% of the memory cost and 0.02\% of the computation time of standard fine-tuning, thus establishing a practical middle ground between direct transfer and fully fine-tuned approaches.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。