Introduction
In many practical machine learning scenarios, obtaining negative labels is significantly more challenging than identifying positive ones. For instance, in recommendation systems, a user's interaction with an item provides a positive signal, but the absence of interaction does not necessarily imply a negative preference—it simply remains unlabeled. This scenario defines the Positive Unlabeled (PU) learning setting. While self-supervised contrastive learning methods like InfoNCE have shown great promise in learning from unlabeled data, they typically fail to leverage the specific information provided by a small set of positive labels. Conversely, supervised contrastive learning (SCL) requires labels for both classes. To bridge this gap, we introduce puNCE (positive unlabeled Noise Contrastive Estimation), a novel objective designed to learn robust representations in the PU setting.
The puNCE Framework
The core innovation of puNCE lies in its ability to treat unlabeled data as a weighted mixture of both positive and negative classes, guided by the class prior ($\pi$)—the estimated probability that a random unlabeled sample is positive.
The framework employs a "duplicate and weight" strategy:
- Labeled Positives: These samples are treated with unit weight, encouraging the model to cluster them together in the embedding space.
- Unlabeled Samples: Each unlabeled sample is conceptually duplicated in the loss function. One instance is treated as a positive sample with weight $\pi$, while the other is treated as a negative sample with weight $(1 - \pi)$.
- Implicit Supervision: This weighting scheme allows the model to utilize the entire unlabeled pool to provide weak supervision, effectively distinguishing between latent positive and negative distributions without requiring explicit negative labels.
Experimental Evaluation
The performance of puNCE was evaluated across diverse domains, including computer vision (MNIST, CIFAR-10) and natural language processing (SST2 sentiment analysis). The researchers compared puNCE against standard unsupervised baselines (InfoNCE), supervised methods (SCL), and specialized PU classification algorithms such as uPU and nnPU.
A key finding was the superiority of linear probing over full model fine-tuning in the PU setting. Fine-tuning on biased PU data often leads to "feature distortion," where the high-quality representations learned during pretraining are warped. By freezing the encoder and training only a linear head, puNCE maintains the integrity of the learned feature space.
Key Results and Insights
The empirical results demonstrate that puNCE significantly outperforms existing state-of-the-art PU learning methods, particularly in regimes with very limited supervision.
On the CIFAR-10 benchmark with only 1,000 labeled positive samples, puNCE achieved an 8.9% improvement in classification accuracy over the best existing PU baselines. Furthermore, puNCE exhibits remarkable efficiency, reaching higher accuracy with 5% labeled data than standard InfoNCE does with 20%. In NLP tasks, puNCE outperformed SCL-based approaches by nearly 3% in few-shot scenarios (e.g., 10 samples).
Beyond raw accuracy, puNCE provides a more stable training process. Classical PU algorithms are often prone to overfitting and instability; initializing these models with puNCE-trained features leads to much more robust downstream performance.
Conclusion and Future Directions
puNCE offers a powerful and elegant solution for representation learning in the Positive Unlabeled setting. By leveraging the class prior to treat unlabeled data as a mixture, it extracts maximum information from limited supervision. While currently focused on binary classification and requiring a known class prior, future work could extend this logic to multi-class settings and explore robustness to distribution shifts between labeled and unlabeled data.
Summary updated