Abstract
Contrastive Learning (CL) has revolutionized Collaborative Filtering (CF) by enhancing representation learning through the InfoNCE loss. However, standard CL often fails to account for the unique challenges of recommendation, such as exposure bias (false negatives) and the need for effective hard negative mining. This paper introduces AdvInfoNCE, a principled adversarial contrastive loss that adaptively modulates the hardness of negative samples. By framing the optimization as a min-max game linked to Distributionally Robust Optimization (DRO), AdvInfoNCE effectively distinguishes between informative hard negatives and noisy false negatives, achieving state-of-the-art performance in out-of-distribution scenarios.
Introduction
In recommendation systems, contrastive learning typically involves pulling positive user-item pairs together while pushing unobserved "negative" pairs apart. This approach faces three primary hurdles:
- False Negatives (Exposure Bias): Unobserved interactions are often treated as negatives, even though a user might simply be unaware of an item they would enjoy.
- Hard Negative Mining: Pushing away "easy" negatives provides minimal signal. Identifying "hard" negatives—items similar to a user's interests but not interacted with—is crucial for fine-grained ranking.
- Out-of-Distribution (OOD) Generalization: The distribution of items during training often shifts at test time, requiring models that are robust to popularity bias and dynamic environments.
While many current methods rely on heuristic data augmentations (e.g., edge dropping in graphs), this work argues that the fundamental bottleneck lies in the "coarse" nature of the standard InfoNCE loss.
Methodology: AdvInfoNCE
The core innovation is AdvInfoNCE, which replaces the binary view of negatives with a fine-grained, hardness-aware ranking criterion. It assigns a learnable "hardness" score ($\delta_j$) to each negative item $j$.
- Hard Negatives ($\delta_j > 0$): For informative negatives, the model contracts the feasible representation space, enforcing a stricter separation from the positive anchor.
- False Negatives ($\delta_j < 0$): For potential false negatives, the model relaxes the constraint, mitigating the impact of label noise.
To optimize these scores, the authors employ adversarial training. This is framed as a min-max game where a hardness evaluator identifies the "worst-case" distribution of negatives to challenge the recommender. This framework is theoretically equivalent to Distributionally Robust Optimization (DRO) constrained by KL-divergence, providing a formal guarantee for the model's robustness.
Experimental Evaluation
The performance of AdvInfoNCE was evaluated on four diverse datasets, including KuaiRec (fully-exposed), Yahoo!R3, Coat, and a synthetic Tencent dataset designed to test popularity-based distribution shifts.
Key Results
AdvInfoNCE consistently surpassed state-of-the-art baselines:
- Unbiased Performance: On KuaiRec, AdvInfoNCE achieved a 9.94% improvement in Recall@20 over standard InfoNCE.
- OOD Robustness: In high distribution shift scenarios on the Tencent dataset, it showed a 24.14% improvement in NDCG@20.
- Model Agnostic: The gains were consistent across different backbones, from simple Matrix Factorization (MF) to complex graph-based models like LightGCN.
Analysis and Insights
The success of AdvInfoNCE stems from its ability to align contrastive objectives with ranking metrics. The authors prove that minimizing AdvInfoNCE serves as a proxy for maximizing Discounted Cumulative Gain (DCG).
As shown in the analysis, adversarial learning naturally mitigates popularity bias. It assigns higher sampling probabilities to popular items that remain unclicked (true hard negatives) while de-emphasizing unpopular items that are more likely to be false negatives. Furthermore, the alignment and uniformity analysis reveals that AdvInfoNCE achieves a superior balance between pulling related items together and spreading representations uniformly across the hypersphere.
Conclusion and Future Work
AdvInfoNCE provides a principled solution to the limitations of standard contrastive learning in recommendation. By replacing heuristic augmentations with a robust, adversarial loss function, it achieves significant gains in generalization and ranking accuracy. While the framework requires careful tuning of the adversarial schedule to maintain stability, its theoretical foundations in DRO suggest broad applicability. Future work could explore extending this hardness-aware framework to other domains like Computer Vision or NLP, where label noise and hard negative mining remain critical challenges.
Summary updated