Overcoming the Pitfalls of Vision-Language Model Finetuning for OOD Generalization

Yuhang Zang, Hanlin Goh, Joshua M. Susskind, Chen Huang

Introduction: The Specialization Trap

Large-scale vision-language models (VLMs) like CLIP have revolutionized computer vision with their zero-shot capabilities. By aligning visual and textual representations, these models can recognize novel concepts without explicit training. However, to achieve peak performance on specific downstream tasks, researchers often employ "prompt learning" or finetuning.

While finetuning boosts accuracy on the training set's "known" classes, it often leads to a "specialization trap." As the model becomes hyper-specialized, its decision boundaries collapse around the training data, causing a significant drop in Out-of-Distribution (OOD) generalization. This phenomenon is characterized by a widening gap between "known" and "unknown" class accuracy as training progresses.

Finetuning setup and the performance gap between known and unknown classes over time.

The OGEN Framework

To address this pitfall, this paper introduces OGEN (OOD GENeralization), a framework designed to maintain the open-domain flexibility of VLMs during finetuning. OGEN employs a two-pronged strategy:

1. Class-Conditional Feature Generator

Since images for unknown classes are unavailable during training, OGEN synthesizes "fake" visual features. It leverages the inherent alignment in CLIP's embedding space. Given the name of an unknown class, the system identifies its $k$-nearest neighbors among known classes. A lightweight Multi-Head Cross-Attention module then extrapolates these known features to hallucinate what a visual feature for the unknown class would look like. These synthetic features act as effective "hard negatives," preventing the model from over-optimizing its boundaries solely for known data.

Architecture of the OGEN Class-Conditional Feature Generator.

2. Adaptive Local Mean Teacher (ALMT)

OGEN also utilizes an adaptive self-distillation mechanism. An Exponential Moving Average (EMA) of the model's past states acts as a "teacher" to guide the current "student" model. To ensure the teacher remains a high-quality reference, OGEN uses a sliding time window that expands as training matures, preventing early underfit versions from polluting the distillation process.

Experimental Results and Insights

The researchers evaluated OGEN across 11 diverse datasets, including ImageNet, EuroSAT (satellite imagery), and UCF101 (action recognition). The results demonstrate that OGEN effectively flattens the overfitting curve.

Key findings include:

  • Significant OOD Gains: OGEN improved accuracy on "new" classes by an average of 6.32% across all benchmarks. In specialized domains like EuroSAT and DTD, the gains reached up to 18.77%.
  • Efficiency: Synthesized features proved to be 3.5x to 7.5x more data-efficient than replaying real images from massive external datasets like LAION-400M, as they are specifically tailored to the task's decision boundaries.
  • No Performance Trade-off: Unlike standard regularization, OGEN often maintained or slightly improved performance on the base (known) classes while simultaneously boosting OOD generalization.

Conclusion

OGEN provides a robust solution to the specialization trap in VLM finetuning. By synthesizing task-specific OOD features and employing adaptive self-distillation, the framework allows models to achieve high task-specific accuracy without sacrificing their fundamental ability to generalize to the unknown. Future work may extend these principles to other finetuning paradigms like adapter tuning and uncertainty modeling.

Summary updated

BibTeX
@inproceedings{zang2024overcoming,
  author = {Yuhang Zang and Hanlin Goh and Joshua M. Susskind and Chen Huang},
  title = {{Overcoming the Pitfalls of Vision-Language Model Finetuning for OOD Generalization}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=PKICZXVY9M},
}
Figure