Difficult Examples Hurt Unsupervised Contrastive Learning: A Theoretical Perspective
Yi-Ge Zhang (Peking University), Jingyi Cui (Peking University), Qiran Li, Yisen Wang
International Conference on Learning Representations 2026 · Oral
Overview
In the realm of machine learning, the role of "difficult examples"—data points near a decision boundary or those that are challenging to classify—has long been a subject of intense study. While in supervised learning, these examples are often considered crucial for robust model generalization, their impact in unsupervised settings, particularly unsupervised contrastive learning, has remained less clear. This talk, delivered by Yi-Ge Zhang and Jingyi Cui from Peking University, unveils a counter-intuitive and universally observed phenomenon: difficult examples actively harm the performance of unsupervised contrastive learning models. The presentation introduces a novel theoretical framework that meticulously explains this detrimental effect and proposes three effective solutions to mitigate it, offering significant implications for the design and training of self-supervised models.

Key moments
- 0:00 Introduction and the core problem statement
- 1:45 Empirical evidence: Mixed images hurt performance
- 2:15 Theoretical framework: Augmentation graph model
- 3:15 Core theoretical result: Difficult examples worsen error bounds
- 4:00 Three proposed solutions: Removal, margin, temperature scaling
- 5:50 Practical method for identifying difficult examples
- 6:30 Talk conclusion: Universal findings and effective solutions
- 7:00 Q&A: Why difficult examples hurt contrastive learning
Difficult Examples Hurt Unsupervised Contrastive Learning: A Theoretical Perspective
Speakers: Yi-Ge Zhang (Peking University); Jingyi Cui (Peking University); Qiran Li; Yisen Wang
Conference: ICLR 2026
YouTube: https://slideslive.com/39062194
Overview
In the realm of machine learning, the role of "difficult examples"—data points near a decision boundary or those that are challenging to classify—has long been a subject of intense study. While in supervised learning, these examples are often considered crucial for robust model generalization, their impact in unsupervised settings, particularly unsupervised contrastive learning, has remained less clear. This talk, delivered by Yi-Ge Zhang and Jingyi Cui from Peking University, unveils a counter-intuitive and universally observed phenomenon: difficult examples actively harm the performance of unsupervised contrastive learning models. The presentation introduces a novel theoretical framework that meticulously explains this detrimental effect and proposes three effective solutions to mitigate it, offering significant implications for the design and training of self-supervised models.
The research challenges a widely held intuition by demonstrating that removing seemingly valuable, complex data points can lead to superior model performance. This finding is not dataset-specific, suggesting a fundamental property within the mechanics of unsupervised contrastive learning. By providing both empirical evidence through clever data mixing experiments and a rigorous theoretical foundation, the speakers highlight a critical area for improvement in current self-supervised learning paradigms. Their work opens new avenues for optimizing data curation and loss function design to unlock the full potential of contrastive methods.
Background
▶ Watch: Introduction and the core problem statement (0:00)
Contrastive learning has emerged as a dominant paradigm in unsupervised representation learning, enabling models to learn powerful, general-purpose features without requiring explicit human annotations. Techniques like SimCLR, MoCo, and BYOL have achieved state-of-the-art results by training networks to pull augmented views of the same instance closer together in an embedding space, while pushing different instances apart. The core idea revolves around maximizing agreement between different augmented views of the same data point, effectively learning what makes an instance unique and distinct from others.
In traditional supervised learning, "difficult examples" are often defined as samples with high loss or large gradients, typically residing close to the decision boundary. These examples are frequently leveraged in strategies like hard negative mining, boosting, or support vector machines, where they are believed to contribute most significantly to model generalization by refining decision boundaries. The intuition is that learning from these ambiguous cases forces the model to develop more nuanced and precise representations.
However, unsupervised contrastive learning operates without explicit labels or predefined decision boundaries. This fundamental difference raises questions about whether the beneficial role of difficult examples from supervised learning translates directly to the unsupervised domain. Without ground truth labels, identifying truly "difficult" examples becomes ambiguous, and their potential contribution to representation quality is not guaranteed. Prior work has sometimes suggested that including a wide range of training examples, even those that seem challenging, doesn't necessarily hurt performance. This talk directly confronts and refutes that assumption for unsupervised contrastive learning, positing that the unsupervised nature of the task fundamentally alters how these challenging examples impact the learning process, leading to detrimental effects rather than beneficial ones.
Key Findings
▶ Watch: Theoretical framework: Augmentation graph model (2:15)
The central and most impactful finding of this research is that difficult examples consistently hurt unsupervised contrastive learning performance across multiple benchmarks. This is a universal observation, challenging common beliefs and previous findings in related fields. The speakers demonstrate that removing difficult examples, even resulting in fewer training samples, leads to better performance. This counter-intuitive result is not an artifact of specific datasets but a general phenomenon observed across various experiments.
To empirically validate this, the researchers conducted a "mixing image experiment" using the CIFAR-10 dataset. They synthetically created difficult examples by mixing images (e.g., cat and dog) using an omega function applied to pixel values, effectively generating images that are ambiguous and fall closer to classification boundaries. The results were striking:
- Adding difficult examples (mixed samples with higher
omega) consistently led to a drop in performance. - Removing these difficult examples resulted in performance recovery and, often, even better results with fewer total examples.
Beyond these empirical observations, the research provides a rigorous theoretical framework based on an augmentation graph model. This framework formally proves that the presence of difficult examples strictly worsens the linear probing error bounds of a contrastive learning model. The theory posits that in an unsupervised setting, difficult examples, which may have slightly higher similarity to incorrect classes than typical negative examples, can cause incorrect clustering during pre-training. This misguidance provides "false priors" to downstream tasks, thereby deteriorating overall model performance. This theoretical validation underpins the empirical observations, providing a deep understanding of why difficult examples are detrimental in this specific context.
Technical Deep Dive
▶ Watch: Three proposed solutions: Removal, margin, temperature scaling (4:00)
The theoretical foundation of this work is built upon an augmentation graph framework, which models the similarity relationships between augmented views of data. In this graph, nodes represent augmented views of samples, and edges represent their similarities. The core assumption is that positive examples (different augmented views of the same original instance) should exhibit higher similarity than negative examples (augmented views of different instances).
The researchers extend this framework by specifically distinguishing difficult examples. They introduce three key similarity values:
- Alpha ($\alpha$): The similarity between same-class positive examples. This represents the desired high similarity for genuinely related views.
- Beta ($\beta$): The average similarity between negative examples from different classes. This represents the baseline low similarity for unrelated views.
- Gamma ($\gamma$): The similarity between difficult examples. Crucially, the model assumes that $\gamma$ is slightly higher than $\beta$ (i.e., $\beta < \gamma$), but still significantly lower than $\alpha$ (i.e., $\gamma < \alpha$). This captures the essence of a "difficult" example: it's not a true positive, but it's ambiguously closer to other classes than typical negatives.
These similarity values are reflected in the adjacency matrix of the similarity graph. If $X_1$ and $X_3$ are difficult examples, their similarity would be $\gamma$.
The core theoretical result lies in comparing the downstream error bounds of a contrastive learning model with and without difficult examples. The paper rigorously demonstrates that when difficult examples exist, an extra term, $(\gamma - \beta)$, appears in the error bound. This term is always positive because $\gamma > \beta$, meaning the error bound is strictly worse in the presence of difficult examples. Furthermore, the theory shows that as samples become "more difficult" (i.e., $\gamma$ increases, making the $(\gamma - \beta)$ term larger), the error bound becomes progressively worse.
The intuition behind this mathematical result is critical: in a purely unsupervised setting, the slightly elevated similarity ($\gamma$) of difficult examples can lead to incorrect clustering during pre-training. The model, lacking explicit semantic guidance, might mistakenly group these difficult examples with instances they are not truly related to, effectively forming "false priors." These false priors then propagate to downstream tasks, leading to suboptimal feature representations and, consequently, worse performance.
To counteract this detrimental effect, the paper proposes three distinct solutions, each with theoretical underpinnings:
- Removal of Difficult Examples:
- This is the most straightforward approach. The theoretical analysis shows that the error bound for a model trained after removing difficult examples is similar to the clean case, but with the total sample size $N$ replaced by $N - N_{difficult}$. Although this reduces the number of training samples, the removal of the $(\gamma - \beta)$ term can lead to a better overall error bound than training with all examples, especially when difficult examples are particularly harmful.
- Margin Tuning:
- This solution modifies the widely used InfoNCE loss function. It involves adding additional margins to the difficult examples. Conceptually, this re-weights the contribution of difficult examples in the loss calculation.
- Theoretically, margin tuning is approximately equivalent to subtracting a certain fraction from the adjacency matrix entries corresponding to difficult examples, effectively reducing their $\gamma$ value.
- The theory provides an optimal choice for this margin, indicating that a larger margin should be selected when difficult examples are more difficult (i.e., when $(\gamma - \beta)$ is larger), pushing their perceived similarity further down.
- Temperature Scaling:
- Similar to margin tuning, this method also modifies the InfoNCE loss. Instead of adding margins, it assigns a smaller temperature to the selected difficult pairs. The temperature parameter in InfoNCE controls the sharpness of the distribution over negative samples; a smaller temperature makes the distribution sharper, effectively increasing the penalty for high similarity with negatives.
- Theoretically, temperature scaling is approximately equivalent to multiplying the $\gamma$ values in the adjacency matrix by a smaller factor, thereby reducing their influence.
- The optimal temperature selection is also theoretically derived and is inversely related to the level of difficulty: more difficult examples should be assigned a smaller temperature to mitigate their negative impact.
Finally, the talk outlines a simple and efficient method for identifying difficult examples in practice. This involves:
- Computing the cosine similarity between all sample pairs in the embedding space.
- Establishing two thresholds: a higher threshold for identifying positive pairs (same class, high similarity) and a lower threshold for identifying typical negative pairs (different classes, low similarity).
- Examples whose similarity falls between these two thresholds are classified as difficult examples. This pragmatic approach allows practitioners to apply the proposed solutions without requiring explicit labels.
Experimental Setup & Results
▶ Watch: Practical method for identifying difficult examples (5:50)
The experimental validation of this research was conducted across multiple datasets and methodologies, reinforcing the universality of the findings. The primary illustration of the problem involved a synthetic experiment using the CIFAR-10 dataset.
Synthetic Difficult Example Generation:
- Method: Images from CIFAR-10 were mixed using an
omegafunction, which controls the pixel-wise power of the mixing. For instance, images of a cat and a dog were combined, creating ambiguous examples that lie near the decision boundary in the feature space. Higher values ofomegaresulted in more "difficult" or ambiguous mixed images. - Observations: When these synthetically generated difficult examples were included in the training set, the performance of the contrastive learning model consistently dropped. This performance degradation was more pronounced with higher
omegavalues, indicating that "more difficult" examples indeed caused worse outcomes.
Validation of Solutions:
- The researchers then evaluated the effectiveness of their three proposed solutions: removal of difficult examples, margin tuning, and temperature scaling.
- Results from Removal: When the identified difficult examples (both synthetic and naturally occurring based on cosine similarity thresholds) were removed from the training set, model performance recovered significantly. In many cases, even with a reduced number of training samples, the models achieved better overall performance than when trained on the full, unfiltered dataset. This directly supports the core finding that difficult examples hurt learning.
- Results from Margin Tuning and Temperature Scaling: Both margin tuning and temperature scaling, when applied to the InfoNCE loss function, also proved effective. These methods preserved data utilization (no examples were removed) while mitigating the negative influence of difficult examples. The talk stated that "all the method works," indicating consistent improvements across these techniques.
- Combined Methods: The study also explored combined approaches, suggesting that these could potentially yield further benefits.
- Generalizability: The findings were not limited to CIFAR-10 or synthetic data. The paper reports that these effects and solutions were observed "among all the dataset and among all the method," demonstrating a universal finding across "multi-benchmarks."
- Further Evaluations: The talk briefly mentioned additional evaluations in "long-tail conditions" and with "larger dataset," implying that the robustness of the findings extends to more complex and realistic data distributions, though specific numbers or dataset names were not detailed in the presentation due to time limits.
In summary, the experimental results provide strong empirical evidence that difficult examples are detrimental to unsupervised contrastive learning. Furthermore, the proposed theoretical solutions—data removal, margin tuning, and temperature scaling—are practically effective in improving model performance by addressing this issue.
Practical Implications
▶ Watch: Q&A: Why difficult examples hurt contrastive learning (7:00)
The findings presented in "Difficult Examples Hurt Unsupervised Contrastive Learning" carry substantial practical implications for researchers, infrastructure teams, model builders, and anyone deploying self-supervised learning systems. The core message—that judicious handling of difficult examples can significantly boost performance—challenges existing paradigms and offers actionable strategies.
For Practitioners and Model Builders:
- Rethinking Data Curation: Unlike supervised learning where data augmentation and hard negative mining often involve creating or seeking out challenging examples, this research suggests a need for "easy example mining" or "difficult example filtering" in unsupervised contrastive learning. Practitioners might consider pre-processing their datasets to identify and remove or down-weight ambiguous samples before or during pre-training.
- Modified Loss Functions: The proposed solutions of margin tuning and temperature scaling offer direct ways to modify the InfoNCE loss (or similar contrastive losses) to inherently account for difficult examples. Instead of simply training on all available data, model builders can integrate these modifications to improve the quality of learned representations without discarding data.
- Improved Pre-training Efficiency: By removing or mitigating the impact of detrimental examples, models might converge faster or achieve higher performance ceilings with fewer training epochs or less computational resources, as they are not being misled by "false priors."
- Trade-offs in Data Utilization: While removing difficult examples can lead to better performance, it inherently reduces the total amount of training data. Practitioners must weigh this trade-off. Margin tuning and temperature scaling offer a way to preserve full data utilization while still addressing the problem, potentially making them more attractive for scenarios where data scarcity is a concern.
For Infrastructure Teams:
- Data Pipeline Considerations: Infrastructure teams might need to adapt data pipelines to incorporate mechanisms for identifying and filtering or re-weighting difficult examples. This could involve pre-computing cosine similarities, implementing dynamic thresholding, or integrating specialized loss functions into their training frameworks.
- Computational Overhead: Identifying difficult examples (e.g., computing all-pair cosine similarities) might introduce additional computational overhead during the data preparation or training phase. Infra teams should consider the scalability and efficiency of these operations, especially for very large datasets.
Limitations and Future Work:
- The talk highlights that the method for identifying difficult examples relies on cosine similarity and thresholds, which might require tuning for different datasets. Future work could explore more adaptive or robust methods for identification.
- While the theoretical framework is robust, its direct applicability to all variants of contrastive learning (e.g., those without explicit negative pairs like BYOL or SimSiam) might require further investigation.
- The term "difficult example" itself is context-dependent. This research defines it based on ambiguous similarities in the embedding space. Further exploration into other definitions of "difficulty" in unsupervised settings could yield additional insights.
In essence, this work provides a crucial insight that unsupervised learning is not simply a label-free version of supervised learning; the optimal strategies for handling data, particularly challenging examples, can be fundamentally different. Adopting these new strategies can lead to more robust, efficient, and higher-performing self-supervised models.
Key Takeaways
- Counter-Intuitive Finding: Unlike supervised learning, difficult examples consistently hurt the performance of unsupervised contrastive learning models.
- Universal Phenomenon: This detrimental effect is not dataset-specific but a general property observed across multiple benchmarks.
- Theoretical Validation: An augmentation graph framework formally proves that difficult examples introduce an extra term in the error bound, strictly worsening downstream performance.
- Three Effective Solutions: The research proposes and validates three methods to mitigate this issue:
- Removing difficult examples (improves performance, even with fewer samples).
- Margin Tuning the InfoNCE loss (preserves data, adjusts contribution).
- Temperature Scaling the InfoNCE loss (preserves data, re-weights influence).
- Practical Identification: Difficult examples can be identified by analyzing cosine similarities between sample pairs, falling between specific thresholds.
- Implications for Practice: Practitioners should consider filtering or adaptively re-weighting difficult examples in their contrastive learning pipelines to achieve better representation quality and model generalization.
About the Speaker(s)
The talk was delivered by Yi-Ge Zhang and Jingyi Cui, both affiliated with Peking University. Their collaboration on this research, alongside Qiran Li and Yisen Wang, underscores a strong academic contribution from a leading institution in the field of artificial intelligence and machine learning. While specific titles were not detailed in the transcript, their presentation clearly demonstrated deep expertise in theoretical machine learning, particularly in the domain of unsupervised contrastive learning and its underlying mechanisms. Their work reflects a commitment to understanding the fundamental properties that govern the success (or failure) of modern AI models.
Reviews
- Maya Iyer (Theoretical ML Researcher) — MUST SEE ★★★★★
→ Top-rated talks at International Conference on Learning Representations 2026
All talks from International Conference on Learning Representations 2026