TL;DR
This paper provides the first comprehensive geometric characterization of optimal representations in Contrastive Learning (CL) when trained on imbalanced datasets. The authors prove that while data samples still collapse to their respective class means, extreme class imbalance triggers a phenomenon called "Minority Collapse," where all minority classes merge into a single vector. Crucially, they demonstrate that the exact optimal geometric structure of these representations can be precisely computed by solving a convex optimization problem.
What Problem Does This Paper Address?
In ideal settings where datasets are perfectly balanced, deep networks undergoing contrastive learning exhibit a phenomenon known as Neural Collapse (NC). When this happens, all image representations within a class collapse to their class mean, and these class means spread out as far as possible, forming a perfectly symmetrical structure called an Equiangular Tight Frame (ETF)—think of an equilateral triangle in 2D or a regular tetrahedron in 3D.
However, real-world datasets are rarely balanced. While previous research has explored how class imbalance affects standard classification networks, its impact on Contrastive Learning remained poorly understood. This paper bridges that gap by asking: What happens to the geometry of these optimal representations when some classes have significantly more samples than others? Does collapse still happen, and what happens to the symmetry?
Methods
The authors tackle this problem using the Unconstrained Features Model (UFM), an analytically tractable proxy that treats the network's final-layer representations as free optimization variables. This decouples the geometric analysis from the complex, non-linear weight dynamics of deep architectures.
Their approach introduces several key innovations:
- Generalized CL Loss Family: Instead of limiting their analysis to the standard InfoNCE loss, they define a broad family of contrastive losses based on functions that are strictly convex and argument-wise strictly increasing.
- Convex Optimization Framework: They construct a novel mathematical lower bound for the contrastive risk. They prove that this bound is a strictly convex function of the Gram matrix (the matrix of pairwise inner products between class means). This turns a traditionally non-convex problem into a convex program that can be solved uniquely and efficiently.
- Symmetry Analysis: They mathematically derive how the relative proportions of classes dictate the angular symmetry of the optimal class means.
Datasets
To validate their theoretical findings, the authors conducted controlled numerical experiments using imbalanced subsets of the standard CIFAR-10 dataset.
- They selected three classes (bird, automobile, airplane) to create a 3,000-sample dataset.
- Mild Imbalance Experiment: Configured with class proportions of 50%, 25%, and 25% ($\lambda_1 = 0.5, \lambda_2 = \lambda_3 = 0.25$).
- Extreme Imbalance Experiment: Configured with class proportions of 90%, 5%, and 5% ($\lambda_1 = 0.9, \lambda_2 = \lambda_3 = 0.05$).
A ResNet-50 architecture was used to learn the representations, which were constrained to a 2D space ($d=2$) to match the theoretical requirement ($d \ge C-1$).
Key Insights and Ideas
- Intra-Class Collapse is Robust: Class imbalance does not stop intra-class variance collapse. Even with severe imbalance, all samples from the same class still collapse tightly to their class mean.
- Goodbye ETF, Hello Asymmetry: When classes are imbalanced, the optimal geometry is no longer a perfectly symmetric ETF. For instance, in a three-class setup with two equiprobable minority classes, the class means form an isosceles triangle rather than an equilateral one.
- The Minority Collapse Threshold: Under extreme imbalance, if the majority class probability exceeds a specific non-asymptotic threshold, a phenomenon called Minority Collapse (MC) occurs. The minority classes completely lose their distinctiveness and collapse into a single shared vector positioned diametrically opposite to the majority class.
- Dimensional Efficiency: The paper proves that to globally minimize contrastive risk, the representation dimension only needs to be $d = C - 1$. This suggests that the massive embedding dimensions commonly used in practice might be highly inefficient for simple downstream classification.
Key Results
- Theoretical MC Thresholds: For the popular InfoNCE loss, the authors derived conservative, parameter-free thresholds guaranteeing minority collapse. In Unsupervised Contrastive Learning (UCL), minority collapse occurs if the majority class accounts for $\lambda_1 \ge 0.9292$ of the data. For Supervised Contrastive Learning (SCL), the threshold is $\lambda_1 \ge 0.9438$.
- Empirical Alignment: When training a ResNet-50 on the 90% imbalanced CIFAR-10 subset, the resulting empirical Gram matrix matched the theoretical matrix computed via CVX optimization up to four decimal places.
- Visual Confirmation: In the extreme imbalance experiment, 2D plots clearly showed the red and blue points (minority classes) merging into a single point on the unit circle, directly opposite the green points (majority class).
Limitations and Future Work
The primary limitation of this work is the assumption that the representation dimension $d$ is greater than or equal to $C - 1$. While this holds true for standard computer vision tasks (e.g., $d=512$ vs. $C=10$ for CIFAR-10), it is violated in Large Language Models (LLMs), where vocabulary sizes (classes) reach tens of thousands while embedding dimensions remain in the hundreds or thousands ($d < C - 1$). The authors flag this under-parameterized regime as an important open problem.
Additionally, future work includes extending this analysis to scenarios involving hard-negative sampling mechanisms and characterizing thresholds when there is more than one majority class.
Summary updated