NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contrastive Learning with Data Misalignment: Feature Purity, Training Dynamics and Theoretical Generalization Guarantees

Jiawei Sun, Shuai Zhang, Hongkang Li, Meng Wang

Contrastive learning has revolutionized how we build Vision-Language Models (VLMs) like CLIP, but its success has largely outpaced our theoretical understanding—especially when it comes to the "messy" reality of web-scraped data. This paper provides a rigorous theoretical look at how data misalignment affects what these models actually learn.

TL;DR

This paper provides the first theoretical analysis of multimodal contrastive learning under data misalignment. It proves that while noisy web data causes neurons to learn "entangled" representations of true and spurious features, a process of recaptioning and filtering restores "feature purity," leading to significantly better zero-shot generalization.

What Problem Does This Paper Address?

State-of-the-art VLMs are typically trained on massive datasets scraped from the web. However, these image-text pairs are often poorly aligned. For instance, an image of a car might be paired with a caption listing its price and dealership location—details that are "spurious" because they don't describe the visual content.

Comparison of theoretical contributions in contrastive learning literature.

While practitioners have found that "recaptioning" (using a model like BLIP-2 to rewrite captions to be more descriptive of the image) works wonders, we haven't had a solid theoretical explanation for why it works. Previous theoretical studies often assumed perfectly aligned data or relied on simplified linear models. This paper bridges that gap by analyzing the training dynamics of nonlinear encoders under realistic, misaligned data conditions, setting its contributions apart from prior literature.

Methods

The authors employ a rigorous mathematical framework to study the joint training of two nonlinear encoders (specifically, two-layer ReLU networks).

  1. Data Model: They use a sparse coding framework, where images and text are generated from a set of latent features (dictionaries). Misalignment is modeled by allowing text features to be missing or spuriously correlated with image features.
  2. Training Dynamics: They analyze Stochastic Gradient Descent (SGD) on a spectral contrastive loss. Unlike previous works that only looked at a single encoder or linear networks, this analysis captures the complex "dance" between two nonlinear encoders as they learn to align.
  3. The Recaptioning Pipeline: They theoretically model a four-stage process: pre-training on raw (noisy) data, generating synthetic captions, filtering the dataset based on cosine similarity, and re-training on the purified data.

Key Insights and Ideas

  • The Concept of "Feature Purity": This is the paper's central contribution. Feature purity refers to the extent to which a single neuron aligns with a single semantic concept.
  • Spurious Entanglement: The authors prove that when trained on raw, misaligned data, neurons inevitably learn a mixture of true and irrelevant features. This "entanglement" is what kills zero-shot performance; the model can't distinguish the "car-ness" of a car from the "price-ness" of its caption.
  • Recaptioning as a Semantic Filter: The "aha moment" is the proof that recaptioning suppresses spurious features. By generating text grounded in the image's visual features, the process effectively "denoises" the training signal.
  • Joint Nonlinear Analysis: This is one of the first papers to successfully analyze the training dynamics of two nonlinear encoders being trained simultaneously, a significant step up in theoretical complexity.

Key Results

The authors provide theorems formally proving that SGD converges to a near-optimal loss even in the nonlinear case. Crucially, they show that training on raw data leads to low feature purity and failure in zero-shot tasks, whereas training on recaptioned/filtered data restores feature purity and ensures high-probability success.

Impact of data filtering on feature purity, downstream accuracy, and silhouette scores.

Empirically, the models trained on filtered data showed higher Silhouette Scores, confirming that the learned embeddings were more distinct and better clustered by semantic category. In practical tests across standard benchmarks (like ImageNet, Food-101, CIFAR-10/100), models utilizing recaptioning consistently outperformed standard CLIP. For example, on the CC12M dataset, LaCLIP improved zero-shot accuracy on Food-101 from 50.8% to 60.7% and on CIFAR-10 from 64.9% to 75.1%.

Limitations and Future Work

While a major step forward, the authors acknowledge a few areas for growth:

  • Architectural Gap: The theory uses two-layer ReLU networks, while state-of-the-art models use massive Transformers. Extending these proofs to attention mechanisms remains a grand challenge.
  • Task Diversity: The current analysis focuses on zero-shot classification. Future work could extend this to more complex tasks like Visual Question Answering (VQA) or image retrieval.
  • Data Distribution: The sparse coding model is a standard theoretical tool, but real-world data distributions are likely even more complex and hierarchical.

Paper Citation: Sun, J., Zhang, S., Li, H., & Wang, M. (2025). Contrastive Learning with Data Misalignment: Feature Purity, Training Dynamics and Theoretical Generalization Guarantees. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

Summary updated

BibTeX
@inproceedings{sun2025contrastive,
  author = {Jiawei Sun and Shuai Zhang and Hongkang Li and Meng Wang},
  title = {{Contrastive Learning with Data Misalignment: Feature Purity, Training Dynamics and Theoretical Generalization Guarantees}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=JMlYzOMDxI},
}
Figure