In contrastive learning, a model learns by pulling "positive" pairs (like two views of the same image) together while pushing "negative" pairs (the anchor and a different image) apart. For years, empirical success in this field has been driven by a simple heuristic: use more negative samples. Systems like MoCo famously utilize queues of over 65,000 negatives to achieve state-of-the-art results.
However, until recently, a significant gap existed between this practice and our theoretical understanding. Traditional learning theory suggested that increasing the number of negative samples should eventually degrade performance, either by increasing the risk of "class collisions"—where a negative sample actually belongs to the same semantic category as the anchor—or by making the model's generalization bounds explode.
Recent research has resolved this paradox, providing a rigorous mathematical foundation for why "more is better" in contrastive learning.
The Surrogate Gap and the $O(K^{-1})$ Rate
The primary goal of contrastive learning is often to serve as a "proxy" or surrogate for a downstream task, such as classification. We want the contrastive loss to be a good stand-in for the supervised loss we actually care about.
Han Bao, Kento Nozawa, and their colleagues addressed this by analyzing the "surrogate gap"—the mathematical distance between contrastive and supervised objectives. In On the Surrogate Gap between Contrastive and Supervised Losses, they established that this gap shrinks at a rate of $O(K^{-1})$, where $K$ is the number of negative samples.
This finding is crucial because it holds regardless of whether the number of negatives is smaller or larger than the total number of classes. It provides a unified mechanism explaining how increasing the density of negative samples directly improves the alignment between the contrastive objective and the ultimate classification goal.
Resolving the Class Collision Paradox
A common fear in early contrastive learning research was the "class collision" problem: if you sample too many negatives from an unlabeled dataset, you will eventually pick a sample that is semantically identical to your anchor, confusing the model.
Kento Nozawa and Issei Sato challenged this intuition in Understanding Negative Samples in Instance Discriminative Self-supervised Representation Learning. They reframed the problem using the coupon collector’s problem. In their view, more negatives are actually beneficial because they help the model "see" at least one representative from every underlying latent class in the dataset. By proving a new theoretical bound, they showed that the benefit of covering the entire data distribution far outweighs the localized cost of occasional class collisions.
From Linear to Logarithmic Generalization
Perhaps the most significant theoretical hurdle was the "generalization gap." Standard statistical learning theory often predicted that the complexity of the learning task—and thus the potential for overfitting—would scale linearly with the number of negative samples. If this were true, using 65,000 negatives would make the model's performance on new, unseen data highly unstable.
A series of papers by Yunwen Lei, Tianbao Yang, and Yiming Ying resolved this by deriving "sharper" bounds. In Generalization Analysis for Contrastive Representation Learning, they demonstrated that the generalization error actually scales logarithmically ($O(\log K)$) rather than linearly with the number of negative samples.
By exploiting the Lipschitz continuity of contrastive loss functions, they proved that model stability does not degrade significantly as more negatives are added. This explains why practitioners can scale up negative batches to massive sizes without seeing the "vacuous" theoretical guarantees predicted by older models.
Adaptive and Robust Sampling
While the general trend is that more negatives are better, real-world data is rarely perfect. Chuhan Wu and Fangzhao Wu noted in Rethinking InfoNCE: How Many Negative Samples Do You Need? that noisy data can introduce "false negatives" that derail training. They proposed Adaptive Negative Sampling (ANS), which dynamically adjusts the number of negatives during training to find the sweet spot between representation quality and noise interference.
Furthermore, this "more is better" philosophy extends even to security. Wen Wen and Xinbo Gao applied similar sharp theoretical analysis to Adversarial Contrastive Learning (ACL). They proved that even when models are trained to be robust against attacks, the generalization error remains manageable (scaling logarithmically with $K$), allowing for high-cardinality negative sets in robust representation learning.
Summary of the Shift
The research direction across these 18 papers represents a fundamental shift in how we view the "negative" side of contrastive learning:
- Old View: More negatives increase complexity and class collisions, potentially hurting generalization.
- New View: More negatives shrink the surrogate gap at $O(K^{-1})$ and provide better distributional coverage, while generalization error only grows at a negligible $O(\log K)$ rate.
This theoretical maturation finally aligns the math with the empirical reality of large-scale self-supervised learning.