Abstract
OpenAI’s CLIP (Contrastive Language-Image Pre-training) has set a new standard for zero-shot recognition and image-text retrieval. However, fine-tuning CLIP on specific downstream datasets typically results in "catastrophic forgetting," where the model loses its general-purpose capabilities. This paper introduces VR-LwF (Learning without Forgetting via Replayed Vocabulary), a novel approach that uses randomly synthesized "pseudo-sentences" to anchor pre-trained knowledge. Our results demonstrate that VR-LwF allows CLIP to learn new tasks while remaining a robust zero-shot powerhouse.
Introduction: The Fine-Tuning Dilemma
CLIP’s strength lies in its dual-tower architecture, which learns from 400 million image-text pairs to create a shared embedding space. This allows for "zero-shot" tasks—recognizing unseen objects by matching them to text descriptions. However, for industrial or niche applications, researchers often need to fine-tune CLIP on specialized data.
Standard fine-tuning causes the model's weights to shift significantly, destroying the "common sense" acquired during pre-training. The challenge addressed here is: Can we update CLIP for new tasks without breaking its original zero-shot magic?
Methodology: VR-LwF
The authors evaluated several Continual Learning (CL) algorithms, including LwF, GeoDL, and IMM, adapted for CLIP’s architecture. The primary contribution, VR-LwF (Learning without Forgetting via Replayed Vocabulary), addresses the impossibility of replaying the original 400M-pair dataset.
Instead of images, VR-LwF generates pseudo-sentences by randomly sampling words from the CLIP vocabulary. During fine-tuning, the model is forced to ensure that its embeddings for these "nonsense" sentences remain consistent with those of the original model. This acts as a "knowledge anchor" for the entire embedding space. A key insight is that CLIP’s retrieval capability is largely preserved even with shuffled word order, justifying the use of random word-stacks for distillation.
Experimental Setup
The method was tested using a rigorous protocol:
- MSCOCO: Used for the "Updated Task" by cropping 80 object classes for classification.
- tiered-ImageNet: Used to evaluate Zero-Shot Learning (351 classes).
- Flickr30k: Used to test image-text retrieval stability.
- Benchmarks: Two settings were introduced: One-Session Training (OST) and Multi-Session Training (MST), where classes are learned sequentially across eight stages.
Key Results and Insights
The study found that updating the Whole Model (WM) while applying CL constraints yields the best performance balance.
- Mitigating Forgetting: In the OST setting, standard fine-tuning saw zero-shot accuracy on tiered-ImageNet drop from 62.62% to 44.17%. VR-LwF-WM maintained it at 62.03% while improving performance on the new task.
- Retrieval Stability: VR-LwF preserved high R@k scores on Flickr30k, whereas naive fine-tuning caused retrieval performance to plummet (e.g., TR@1 dropped from ~69% to ~32%).
- Superiority over Baselines: In MST, VR-LwF achieved an average accuracy of 60.97%, significantly outperforming adapted versions of LwF (55.54%) and GeoDL (56.68%).
Conclusion
VR-LwF provides a simple yet effective mechanism for the continual learning of CLIP models. By using the text encoder as a proxy for the entire concept space through replayed vocabulary, the model can adapt to new domains without sacrificing its foundational capabilities. Future work will focus on closing the performance gap between continual learning and joint training on the newly updated tasks.
Summary updated