Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Gradient-Sign Masking for Task Vector Transport Across Pre-Trained Models

About

When a new release of a foundation model is published, practitioners typically need to repeat fine-tuning, even if the same task was already tackled in the previous version. A promising alternative is to reuse the parameter changes (i.e., task vectors) that capture how a model adapts to a specific task. However, these vectors often fail to transfer across different pre-trained models because their parameter spaces are misaligned. In this work, we show that successful transfer depends strongly on the gradient-sign structure of the new model. Based on this insight, we propose GradFix, which approximates the ideal sign structure and leverages it to transfer knowledge using only a handful of labeled samples. Notably, this requires no additional fine-tuning: we only compute a few target-model gradients without parameter updates and mask the source task vector accordingly. This yields an update that is locally aligned with the target loss landscape, effectively rebasing the task vector onto the new pre-training. We provide a theoretical guarantee that our method ensures first-order descent. Empirically, we demonstrate significant performance gains on vision and language benchmarks, consistently outperforming naive task vector addition and few-shot fine-tuning. We further show that transporting task vectors improves multi-task and multi-source model merging. Code is available at https://github.com/fillo-rinaldi/GradFix.

Filippo Rinaldi, Aniello Panariello, Giacomo Salici, Fengyuan Liu, Marco Ciccone, Angelo Porrello, Simone Calderara• 2025

Related benchmarks

TaskDatasetResultRank
Image ClassificationDTD
Accuracy66.95
419
Image ClassificationSVHN
Accuracy74.41
359
Image ClassificationGTSRB
Accuracy73.14
291
Image ClassificationRESISC45
Accuracy76.97
263
Text ClassificationRTE
Accuracy54.25
78
Image ClassificationEuroSAT
Accuracy75.59
34
Text ClassificationMNLI
Accuracy49.68
32
Image ClassificationMulti-task and Multi-source Vision Suite (EUROSAT, SVHN, GTSRB, RESISC45, DTD) ViT-B/16 (test)
EUROSAT Accuracy65.96
15
Text ClassificationQNLI
Accuracy (%)60.5
15
Text ClassificationSNLI
Accuracy68.06
6
Showing 10 of 11 rows

Other info

Follow for update