Feature Protection For Out-of-distribution Generalization
Lu Tan, Huei Zhou, Yinxiang Huang, Zeming Zheng, Yujiu Yang
TL;DR
Fine-tuning large pre-trained models on small downstream datasets often improves ID accuracy but harms OOD generalization. The authors diagnose this by showing that fine-tuning distorts semantic representations in $f=[\boldsymbol{\Phi}, \boldsymbol{v}]$, and they compare several feature-preserving strategies, including $L1$/$L2$ regularization, LoRA, knowledge distillation, and WiSE-FT (model averaging). The key finding is that regularization and KD can mitigate forgetting, while WiSE-FT provides the strongest OOD gains, sometimes outperforming the original pre-trained model and full fine-tuning on both ImageNet- and DomainNet-based tasks. This work offers practical guidance for robust deployment of fine-tuned models under distribution shifts by preserving pre-trained features during adaptation.
Abstract
With the availability of large pre-trained models, a modern workflow for building real-world machine learning solutions is to fine-tune such models on a downstream task with a relatively small domain-specific dataset. In such applications, one major challenge is that the small fine-tuning dataset does not have sufficient coverage of the distribution encountered when the model is deployed. It is thus important to design fine-tuning methods that are robust to out-of-distribution (OOD) data that are under-represented by the training data. This paper compares common fine-tuning methods to investigate their OOD performance and demonstrates that standard methods will result in a significant change to the pre-trained model so that the fine-tuned features overfit the fine-tuning dataset. However, this causes deteriorated OOD performance. To overcome this issue, we show that protecting pre-trained features leads to a fine-tuned model more robust to OOD generalization. We validate the feature protection methods with extensive experiments of fine-tuning CLIP on ImageNet and DomainNet.
