TL;DR
This paper investigates the "modality gap" in multi-modal models like CLIP, where images and text embeddings form separate clusters. They demonstrate that this gap, surprisingly, is not a bug but a feature that enhances robustness to noise. Crucially, they propose a simple post-processing technique to reduce this gap, significantly improving robustness without sacrificing accuracy.
What Problem Does This Paper Address?
Modern multi-modal models, particularly those trained with contrastive learning (like CLIP), aim to create a shared embedding space where different data modalities (e.g., images and text) are aligned. However, a consistent observation is the "modality gap": images and text embeddings, despite being trained for alignment, tend to form distinct, linearly separable clusters in this shared space. While this phenomenon is well-documented, its cause and its impact on downstream task performance have remained unclear. Some research suggests it's a bug that hinders performance, while others argue it might be a feature. This paper seeks to definitively understand the modality gap's origin and its relationship with model robustness, particularly in the face of noisy inputs.
Methods
The authors provide a theoretical framework to explain the formation of an orthogonal modality gap. They show that under certain conditions, minimizing the contrastive loss naturally leads to a solution where a global gap vector exists and is orthogonal to the embeddings of both modalities. This is achieved through a combination of analyzing the gradient dynamics of the contrastive loss and making assumptions about initialization (e.g., distinct clusters) and the resulting double-stochasticity of intermediate matrices.
Building on this theoretical understanding, they propose a simple, computationally inexpensive post-processing algorithm. This algorithm effectively "closes" the modality gap by translating one modality's embeddings towards the other's mean, specifically along a direction that is orthogonal to the modality's affine subspace. This ensures that the translation primarily reduces the gap without significantly altering the relative positions of embeddings within a modality.
Datasets
- MS-COCO: Used for visualizing CLIP embeddings and for retrieval tasks.
- ImageNet: Used for experiments related to caption rephrasing and robustness.
- CIFAR10/CIFAR100: Used for zero-shot classification experiments.
- A-OKVQA: Used for visual question answering (VQA) tasks.
- Flickr30k: Used for empirical evidence of assumptions.
The paper does not introduce new datasets but utilizes standard benchmarks for multi-modal tasks.
Key Insights and Ideas
- The Modality Gap as a Robustness Feature: The most striking insight is that the modality gap, particularly an orthogonal one, is not detrimental but rather beneficial for robustness. As the gap increases, models become less sensitive to small, semantically irrelevant perturbations in the embedding space.
- Orthogonal Gap Formation: The paper provides a theoretical explanation for how an orthogonal gap emerges from contrastive learning, even without dimensional collapse, stemming from initialization and gradient dynamics.
- Simple Post-Processing Solution: A key takeaway is that a significant improvement in robustness can be achieved with a simple, non-retraining approach: translating one modality's embeddings towards the other's mean along a carefully chosen direction.
- Robustness vs. Accuracy Trade-off: The proposed method demonstrates that it's possible to improve robustness substantially without sacrificing clean accuracy, challenging the notion that robustness improvements always come at a cost.
Key Results
- Theoretical Proofs: The authors provide theoretical guarantees that under specific conditions, minimizing contrastive loss leads to an orthogonal gap, and that closing this gap along a specific direction improves robustness without affecting clean accuracy.
- Empirical Validation: Experiments on various models (CLIP, SigLIP) and datasets (ImageNet, MS-COCO, CIFAR10/100, A-OKVQA) show that closing the modality gap significantly increases robustness to various noise types (Gaussian, quantization, rephrasing).
- Robustness Gains: For Gaussian noise, robustness improvements of up to 10% were observed with negligible accuracy loss.
- No Accuracy Degradation: The proposed post-processing method consistently maintained or negligibly affected clean accuracy across tested tasks and models.
Limitations and Future Work
- Assumptions for Theoretical Guarantees: The theoretical proofs rely on certain assumptions, such as initialization with distinct clusters and the emergence of double-stochasticity in intermediate matrices. While empirically supported, these assumptions might not hold in all real-world scenarios.
- Noise Characteristics: The theoretical benefits are most pronounced for noise that is orthogonal to the modality's affine subspace and has zero mean. While experiments show benefits even with correlated noise (like rephrasing), the theoretical guarantees are stronger for specific noise types.
- Future Work: The authors suggest further investigation into the effect of their theory and algorithm on real-world noise scenarios and encourage exploring settings where their simple algorithm can improve downstream performance. They also hint at extensions for non-zero mean noise and general covariance structures.
Summary updated