Contrastive Representation Learning (CRL) has become the engine behind many modern machine learning successes, operating on the intuitive principle of pulling "similar" data points (positives) together in a feature space while pushing "dissimilar" ones (negatives) apart. Despite its empirical dominance, the theoretical understanding of its sample complexity has lagged behind.
A major gap between practice and theory arises from how training data is constructed. In practice, contrastive "tuples" are built from a finite pool of labeled examples, meaning the same data point might appear in multiple tuples, inducing complex dependencies. Previous theoretical analyses attempted to handle this using U-statistics, but they encountered a significant bottleneck: their derived sample complexity depended heavily on the probability of the rarest class ($\rho_{\min}$). Specifically, excess risk bounds scaled in the order of $\rho_{\min}^{-1/2}$. In "extreme multi-class" settings—such as facial recognition or product categorization, which naturally feature thousands of classes and long-tailed distributions—this dependency is overly pessimistic. It implies that a massive amount of data is required simply because one class is rare, even if that tail class contributes minimally to the overall population risk.
Overcoming the Rare Class Bottleneck
To eliminate this parasitic dependence on rare classes, the authors introduce two distinct theoretical strategies that drastically improve the sample complexity bounds for Supervised Contrastive Representation Learning (SCRL).
1. Refining Existing Estimators for Heterogeneous Accuracy The first breakthrough comes from the realization that not every class needs to be estimated with the same level of precision. By allowing for "heterogeneous accuracy," the authors demonstrate that dominant classes can be estimated precisely while negligible tail classes can tolerate more noise without ruining the global model. This shifts the sample complexity bound from depending on the inverse of the rarest class probability ($1/\rho_{\min}$) to scaling with the total number of classes ($R$), regardless of the underlying class distribution.
2. A Novel De-biased Estimator ($U_N$) Taking a radically different approach, the authors formulate a new U-statistic estimator. Rather than estimating class-wise risks, this method decomposes the total risk into two scenarios: one where negative samples are allowed to "collide" (share a label) with the anchor, and one where at least one collision is forced. By combining these using the overall "collision probability" ($\tau$), the estimator captures how risk concentrates across the entire distribution.
In extreme multi-class settings, the high cardinality of classes means the chance of picking a negative sample that accidentally shares a label with the anchor is very low ($\tau \approx 0$). By exploiting this low-collision regime, the sample complexity simplifies dramatically to $\mathcal{O}(k)$, where $k$ is simply the number of negative samples per tuple.
Experimental Validation and Insights
The theoretical claims were rigorously validated using a mix of synthetic and real-world datasets, focusing heavily on imbalanced and long-tailed scenarios. These included a synthetic mixture of 20 Gaussian distributions, manually re-sampled long-tail versions of MNIST, FashionMNIST, and CIFAR-10, as well as standard CIFAR-100.
- Theoretical Speedup: The progression of sample complexity improvements is stark—moving from a worst-case $\mathcal{O}(1/\rho_{\min})$ to a distribution-independent $\mathcal{O}(R)$, and ultimately to $\mathcal{O}(k)$ for long-tailed distributions.
- Superior Generalization: In experiments on long-tailed MNIST and FashionMNIST, the proposed $U_N$ estimator consistently outperformed the previous state-of-the-art ($U_N^{hl}$) across key metrics like Precision, Recall, and F1-score for varying numbers of negative samples ($k=3, 5, 7$).
- Class-Rarity Awareness: The authors' sub-sampling algorithm naturally acts as a balancing mechanism. It effectively penalizes major classes for collisions while providing rare classes with a cleaner signal. PCA visualizations confirmed that this produces much tighter, more distinct clusters for rare classes, which prior methods often left scattered and poorly defined.
- Beating SupCon: On the CIFAR-100 benchmark, the new de-biased estimator outperformed the widely adopted Supervised Contrastive (SupCon) loss, proving its practical viability alongside its theoretical soundness.
Limitations and Future Directions
While this paper provides a major theoretical upgrade for SCRL, a few open challenges remain. First, the analysis focuses heavily on the concentration of the contrastive risk (how well the representation is learned). Building a tighter theoretical bridge between this contrastive risk and the final downstream classification error in extreme settings is an important next step. Second, while the sub-sampling algorithm makes the U-statistics computationally feasible, calculating these estimators still requires careful implementation to handle the massive number of possible valid tuples in large datasets. Finally, the theoretical analysis relies on the standard assumption that the contrastive loss is uniformly bounded, which may not cover every possible loss function variant used in practice.
Summary updated