Abstract
Recently, contrastive learning approaches (e.g., CLIP) have received huge success in multimodal learning, where the model tries to minimize the distance between the representations of different views (e.g., image and its caption) of the same data point while keeping the representations of different data points away from each other. However, from a theoretical perspective, it is unclear how contrastive learning can learn the representations from different views efficiently, especially when the data is not isotropic. In this work, we analyze the training dynamics of a simple multimodal contrastive learning model and show that contrastive pairs are important for the model to efficiently balance the learned representations. In particular, we show that the positive pairs will drive the model to align the representations at the cost of increasing the condition number, while the negative pairs will reduce the condition number, keeping the learned representations balanced.
Introduction
In multimodal learning, the objective is to align disparate data types, such as text and images, into a shared representation space. Contrastive learning achieves this by pulling "positive pairs" (matching samples) together and pushing "negative pairs" (mismatched samples) apart. While empirical success is evident, a theoretical gap exists regarding the necessity of negative pairs. Without them, models often suffer from "dimensional collapse," focusing only on dominant features. This paper investigates how contrastive loss manages inhomogeneous data—where feature strengths vary—and demonstrates that negative samples are essential for learning balanced, high-rank representations.
Methods
The authors analyze the training dynamics of a multimodal model using a linear data-generating framework, tracking weight evolution during Stochastic Gradient Descent (SGD). The analysis is divided into two stages: Alignment (Stage 1), where positive pairs are matched, and Balancing (Stage 2), where negative pairs refine the representation.
A key metric used is the condition number of the feature matrices. A high condition number indicates a model dominated by a few features, while a low condition number (approaching 1) signifies a balanced representation across diverse features. The model explicitly incorporates batch normalization, reflecting standard practices in architectures like CLIP. Validation is performed through synthetic simulations and real-world experiments on the MSCOCO-2014 dataset using pre-trained RoBERTa and ResNet101 backbones.
Key Insights: The Balancing Act
The study reveals a fundamental trade-off between alignment and uniformity. Positive pairs, while necessary for alignment, actually increase the condition number by pulling the model toward the most dominant features. Negative pairs act as a critical regularizer, exerting a counter-force that reduces the condition number and forces the model to distribute attention across all latent features.
Without negative pairs (non-contrastive learning), the model converges toward a low-rank solution. It becomes an expert at the most prominent features but remains blind to the nuances of the data. In contrast, contrastive loss allows the model to achieve both near-perfect alignment and near-perfect balance.
Results and Empirical Validation
Mathematical proofs (Theorem 4.3) show that contrastive loss leads to a condition number near 1, whereas non-contrastive loss leads to collapse. Empirical results on MSCOCO confirm these dynamics: while alignment occurs rapidly, the "balance score" and zero-shot accuracy improve gradually, identifying the balancing phase as a distinct, long-term component of training.
As shown in Figure 1, non-contrastive training (left) results in a wide spread of singular values, indicating an unbalanced representation dominated by a few features. In contrast, the contrastive regimes (middle and right) show singular values converging over time, demonstrating the "balancing" effect of negative samples which forces the model to learn a more diverse set of features.
Discussion and Limitations
While the theoretical model is primarily linear to allow for rigorous proof, it provides a foundational understanding of contrastive dynamics. Future work should extend these findings to non-linear architectures like Transformers and investigate how advanced non-contrastive techniques (e.g., BYOL, SimSiam) avoid collapse through alternative mechanisms like stop-gradients. Additionally, the role of the "temperature" parameter throughout the training process remains an area for further exploration.
Summary updated