SAFT: Towards Out-of-Distribution Generalization in Fine-Tuning

Bac Nguyen, S. Uhlich, Fabien Cardinaux, Lukas Mauch, Marzieh Edraki +1 more
2/14/2026

No confident code implementation found for this paper.

Abstract

Handling distribution shifts from training data, known as out-of-distribution (OOD) generalization, poses a significant challenge in the field of machine learning. While a pre-trained vision-language model like CLIP has demonstrated remarkable zero-shot performance, further adaptation of the model to downstream tasks leads to undesirable degradation for OOD data. In this work, we introduce Sparse Adaptation for Fine-Tuning (SAFT), a method that prevents fine-tuning from forgetting the general knowledge in the pre-trained model. SAFT only updates a small subset of important parameters whose gradient magnitude is large, while keeping the other parameters frozen. SAFT is straightforward to implement and conceptually simple. Extensive experiments show that with only 0.1% of the model parameters, SAFT can significantly improve the performance of CLIP. It consistently outperforms baseline methods across several benchmarks. On the few-shot learning benchmark of ImageNet and its variants, SAFT gives a gain of 5.15% on average over the conventional fine-tuning method in OOD settings.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nguyen2026saft,
  title  = {SAFT: Towards Out-of-Distribution Generalization in Fine-Tuning},
  author = {Bac Nguyen and S. Uhlich and Fabien Cardinaux and Lukas Mauch and Marzieh Edraki and Aaron C. Courville},
  year   = {2026},
  eprint = {2407.03036},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2407.03036},
  journal = {ECCV 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.03036.svg)](https://codeofpaper.com/paper/2407.03036)

Discussion