🤖 AI Summary
This work reveals the detrimental mechanism by which “hard-to-learn sample pairs” impair downstream classification generalization in unsupervised contrastive learning. Addressing the lack of theoretical analysis, we first establish a spectral-graph-theoretic framework for bounding generalization error in contrastive learning and rigorously prove that hard pairs degrade representation quality and loosen the generalization upper bound. Building on this insight, we propose Spectral Contrastive Learning (SCL), a novel paradigm that identifies hard examples via similarity modeling and enables robust optimization through three synergistic components: hard-sample filtering, margin-adaptive tuning, and temperature scaling. On standard benchmarks—including ImageNet and CIFAR—removing hard pairs consistently improves linear evaluation accuracy by +1.2–2.7%. Concurrently, the theoretical generalization bound tightens, and empirical results align closely with theoretical predictions.
📝 Abstract
Unsupervised contrastive learning has shown significant performance improvements in recent years, often approaching or even rivaling supervised learning in various tasks. However, its learning mechanism is fundamentally different from that of supervised learning. Previous works have shown that difficult-to-learn examples (well-recognized in supervised learning as examples around the decision boundary), which are essential in supervised learning, contribute minimally in unsupervised settings. In this paper, perhaps surprisingly, we find that the direct removal of difficult-to-learn examples, although reduces the sample size, can boost the downstream classification performance of contrastive learning. To uncover the reasons behind this, we develop a theoretical framework modeling the similarity between different pairs of samples. Guided by this theoretical framework, we conduct a thorough theoretical analysis revealing that the presence of difficult-to-learn examples negatively affects the generalization of contrastive learning. Furthermore, we demonstrate that the removal of these examples, and techniques such as margin tuning and temperature scaling can enhance its generalization bounds, thereby improving performance. Empirically, we propose a simple and efficient mechanism for selecting difficult-to-learn examples and validate the effectiveness of the aforementioned methods, which substantiates the reliability of our proposed theoretical framework.