TL;DR
Contrastive learning models like CLIP are highly sensitive to misaligned or noisy data, but identifying problematic training samples is usually computationally prohibitive. This paper introduces ECIF (Extended Influence Function for Contrastive Loss), a novel framework that treats data points as both positive and negative samples to efficiently estimate their impact on model performance without the need for expensive retraining.
What Problem Does This Paper Address?
Multimodal models (like CLIP) rely on contrastive learning to align different data types—such as images and their text descriptions—into a shared semantic space. However, these models are often trained on massive, "noisy" datasets scraped from the web, which frequently contain mislabeled or semantically mismatched pairs. These misalignments lead to "hallucinations" and poor model robustness.
To fix this, researchers use data valuation to identify which samples are helpful and which are harmful. The gold standard for this is "leave-one-out" retraining (training the model again without a specific sample), but this is impossible for large-scale models. While Influence Functions (IF) offer a mathematical shortcut to estimate this impact using gradients, traditional IFs were designed for "pointwise" losses (where each sample has its own independent error). Contrastive loss is different: it is relational, meaning a single sample’s influence depends on its relationship to every other sample in its batch.
Methods
The authors propose ECIF, the first dual-perspective data valuation method specifically for contrastive learning. Its core innovation lies in how it decomposes a sample's influence:
- Influence as Positive Samples: Quantifies how much a pair (e.g., an image and its correct caption) helps the model pull those two representations together.
- Influence as Negative Samples: Quantifies how a sample acts as a "distractor" for other pairs in the batch, helping the model learn to push dissimilar concepts apart.
By combining these two perspectives into a closed-form approximation, ECIF can estimate how model parameters would change if a specific sample were removed. To handle the massive dimensionality of modern models, the authors utilize LOGRA (Low-rank Gradient Projection) to make the calculation of Hessian matrices (the "memory" of the model's loss surface) computationally feasible.
Datasets
The researchers evaluated ECIF across a diverse range of benchmarks to test its versatility:
- Fine-grained Recognition: FGVC-Aircraft, Flowers102.
- General Object Recognition: Food101, Cifar-10, Cifar-100, and Imagenette.
- Texture Analysis: Describable Textures Dataset (DTD).
- Real-World Noise: ANIMAL-10N, a dataset containing pairs of "confusing" animals (e.g., lynx vs. cat) with a 6% error rate in labels.
Key Insights and Ideas
- The "Interactive" Nature of Contrastive Learning: Unlike standard classification, where a bad label only affects one data point, a misaligned pair in contrastive learning "pollutes" the entire batch by providing incorrect negative signals to every other sample. ECIF is the first to mathematically capture this "negative influence."
- Beyond Similarity Scores: Traditional methods often use "CLIP scores" (simple cosine similarity) to find bad data. The authors found that ECIF is superior because it looks at the gradient—it identifies samples that actually confuse the model's learning process, rather than just samples that look visually dissimilar.
- Tracing Errors Back to Source: ECIF allows for "misprediction trace-back." If a model misclassifies a test image, ECIF can identify the specific training images that most likely "taught" the model that incorrect association.
Key Results
- High Fidelity and Significant Speedup: ECIF approximates the results of actual retraining with remarkable accuracy while drastically cutting computation time. For example, on the FGVC-Aircraft dataset (removing random samples), the difference in accuracy between an ECIF-edited model and a fully retrained model was only 0.30%. Furthermore, ECIF reduced the time required to update the model by over 2x compared to retraining.
- Effective Cleaning: Removing "harmful" samples identified by ECIF consistently improves model performance. On the Food101 dataset, removing these samples led to a ~1% accuracy boost over the original fine-tuned model.
- Superiority Over Baselines: When compared to other influence function methods (like IF-EKFAC, TRAK, and TracIN), ECIF is the only method that closely matches the gold-standard "Retrain" accuracy across multiple datasets.
- Noise Detection: In experiments with 20% mislabeled data, 8 out of the top 10 samples flagged by ECIF as "most influential" were confirmed to be the artificially introduced noisy samples.
Limitations and Future Work
While ECIF is a major step forward, the authors note some hurdles:
- Computational Complexity: Even with low-rank approximations, calculating influence for datasets with millions of samples remains a heavy lift for standard hardware.
- Modality Scope: The current paper focuses primarily on image-text pairs. While the authors claim the math generalizes to other modalities (audio, video), those experiments are not detailed here.
- Theoretical Bounds: The paper provides a theoretical error bound for the approximation, but this assumes a convex loss function, which doesn't perfectly describe the non-convex landscape of deep neural networks. Future work could involve tightening these bounds for more complex architectures.
Summary updated