Abstract
Image-text contrastive models such as CLIP are useful for a variety of downstream applications including zero-shot classification, image-text retrieval and transfer learning. However, these contrastively trained vision-language models often fail on compositional visio-linguistic tasks such as Winoground with performance equivalent to random chance. In our paper, we address this issue and propose a sample-efficient light-weight method called SDS-CLIP to improve the compositional visio-linguistic reasoning capabilities of CLIP. The core idea of our method is to use differentiable image parameterizations to fine-tune CLIP with a distillation objective from large text-to-image generative models such as Stable-Diffusion which are relatively good at visio-linguistic reasoning tasks. On the challenging Winoground compositional reasoning benchmark, our method improves the absolute visio-linguistic performance of different CLIP models by up to 7%, while on the ARO dataset, our method improves the visio-linguistic performance by upto 3%. As a byproduct of inducing visio-linguistic reasoning into CLIP, we also find that the zero-shot performance improves marginally on a variety of downstream datasets. Our method reinforces that carefully designed distillation objectives from generative models can be leveraged to extend existing contrastive image-text models with improved visio-linguistic reasoning capabilities.
Introduction: The Reasoning Gap in Contrastive Models
Contrastive Language-Image Pre-training (CLIP) models have become foundational in computer vision, enabling powerful zero-shot classification and retrieval. However, these models suffer from a "bag-of-words" limitation: they excel at identifying individual objects but struggle to understand the spatial and compositional relationships between them. For example, CLIP often fails to distinguish between "a dog wearing a hat" and "a hat next to a dog."
In contrast, generative models like Stable Diffusion demonstrate superior visio-linguistic reasoning because their training objective requires a deep understanding of scene structure to synthesize coherent images. However, using generative models for inference is computationally prohibitive—often up to 18 times slower than CLIP. The goal of this work is to distill the reasoning capabilities of generative models into the efficient CLIP architecture.
Methodology: SDS-CLIP
The proposed method, SDS-CLIP, utilizes Score Distillation Sampling (SDS) to transfer knowledge from a teacher (Stable Diffusion) to a student (CLIP).
- Distillation Objective: During fine-tuning, CLIP’s image embeddings are mapped into the latent space of Stable Diffusion’s UNet. A denoising diffusion loss ($L_{SDS}$) is calculated, which measures how effectively the image embedding guides the generative model in understanding the scene.
- Regularization: This $L_{SDS}$ term is added to CLIP’s standard contrastive loss to ensure the model retains its original discriminative power while gaining reasoning capabilities.
- Parameter Efficiency: To maintain a lightweight footprint, only the LayerNorm parameters of CLIP (approximately 8 million parameters) are fine-tuned. This prevents catastrophic forgetting and allows for efficient training on a relatively small dataset of 118k image-text pairs from MS-COCO.
Experimental Results
The researchers evaluated SDS-CLIP across several challenging benchmarks designed to test visio-linguistic reasoning and general zero-shot performance.
Reasoning Benchmarks
- Winoground: A dataset featuring image pairs with identical word sets but different semantic meanings (e.g., "some truck in some grass" vs. "some grass in some truck").
- ARO (Attributing and Relating Objects): Tests for attribute binding and relational understanding.
As shown in the results table below, SDS-CLIP consistently outperforms standard CLIP backbones. For the ViT-B/16 model, Winoground performance improved by an absolute 7%, while ARO scores saw a 1-3% boost.
Zero-Shot Generalization
Crucially, the induction of reasoning capabilities did not degrade CLIP's zero-shot classification performance. On datasets like MNIST, zero-shot accuracy actually improved by 8%, suggesting that better structural understanding can aid general classification tasks.
Conclusion and Future Work
SDS-CLIP demonstrates that the structural knowledge inherent in generative models can be successfully distilled into contrastive models without sacrificing inference speed. While the method significantly improves compositional reasoning, limitations remain in handling purely linguistic nuances (e.g., complex grammatical ordering). Future research will explore scaling this distillation approach to larger state-of-the-art models and investigating more sophisticated text-to-image teachers to further bridge the reasoning gap.
Summary updated