Title: Empowering Collaborative Filtering with Principled Adversarial Contrastive Loss
Venue: NeurIPS 2023
Accepted: yes
Keywords: Collaborative filtering

Contrastive loss

Recommendation

Generalization ability
Abstract: Contrastive Learning (CL) has achieved impressive performance in self-supervised learning tasks, showing superior generalization ability. Inspired by the success, adopting CL into collaborative filtering (CF) is prevailing in semi-supervised topK recommendations. The basic idea is to routinely conduct heuristic-based data augmentation and apply contrastive losses (e.g., InfoNCE) on the augmented views. Yet, some CF-tailored challenges make this adoption suboptimal, such as the issue of out-of-distribution, the risk of false negatives, and the nature of top-K evaluation. They necessitate the CL-based CF scheme to focus more on mining hard negatives and distinguishing false negatives from the vast unlabeled user-item interactions, for informative contrast signals. Worse still, there is limited understanding of contrastive loss in CF methods, especially w.r.t. its generalization ability. To bridge the gap, we delve into the reasons underpinning the success of contrastive loss in CF, and propose a principled Adversarial InfoNCE loss (AdvInfoNCE), which is a variant of InfoNCE, specially tailored for CF methods. AdvInfoNCE adaptively explores and assigns hardness to each negative instance in an adversarial fashion and further utilizes a fine-grained hardness-aware ranking criterion to empower the recommender’s generalization ability. Training CF models with AdvInfoNCE, we validate the effectiveness of AdvInfoNCE on both synthetic and real-world benchmark datasets, thus showing its generalization ability to mitigate out-of-distribution problems. Given the theoretical guarantees and empirical superiority of AdvInfoNCE over most contrastive loss functions, we advocate its adoption as a standard loss in recommender systems, particularly for the out-of-distribution tasks. Codes are available at https://github.com/LehengTHU/AdvInfoNCE.

Empowering Collaborative Filtering with Principled Adversarial Contrastive Loss

Abstract

Contrastive Learning (CL) has achieved impressive performance in self-supervised learning tasks, showing superior generalization ability. Inspired by the success, adopting CL into collaborative filtering (CF) is prevailing in semi-supervised topK recommendations. The basic idea is to routinely conduct heuristic-based data augmentation and apply contrastive losses ( e.g., InfoNCE) on the augmented views. Yet, some CF-tailored challenges make this adoption suboptimal, such as the issue of out-of-distribution, the risk of false negatives, and the nature of topK evaluation. They necessitate the CL-based CF scheme to focus more on mining hard negatives and distinguishing false negatives from the vast unlabeled user-item interactions, for informative contrast signals. Worse still, there is limited understanding of contrastive loss in CF methods, especially w.r.t. its generalization ability. To bridge the gap, we delve into the reasons underpinning the success of contrastive loss in CF, and propose a principled Adv ersarial InfoNCE loss ( AdvInfoNCE ), which is a variant of InfoNCE, specially tailored for CF methods. AdvInfoNCE adaptively explores and assigns hardness to each negative instance in an adversarial fashion and further utilizes a fine-grained hardness-aware ranking criterion to empower the recommender's generalization ability. Training CF models with AdvInfoNCE, we validate the effectiveness of AdvInfoNCE on both synthetic and real-world benchmark datasets, thus showing its generalization ability to mitigate out-ofdistribution problems. Given the theoretical guarantees and empirical superiority of AdvInfoNCE over most contrastive loss functions, we advocate its adoption as a standard loss in recommender systems, particularly for the out-of-distribution tasks. Codes are available at https://github.com/LehengTHU/AdvInfoNCE .

1 Introduction

Contrastive Learning (CL) has emerged as a potent tool in self-supervised learning tasks [1-4], given its superior generalization ability. By simultaneously pulling positive pairs close together while pushing apart negative pairs in the feature space [5], CL has demonstrated the ability to extract general features from limited signals. This promising result has propelled research interest in leveraging CL for Collaborative Filtering (CF) in topK recommendation tasks, leading to a marked enhancement in performance and generalization ability [6-12]. Specifically, the prevalent paradigm in CL-based CF methods is to routinely adopt heuristic-based data augmentation for user-item bipartite graphs

Ranking Criterion for False Negative

𝒋

𝒊

𝒋

𝟏

Ranking Criterion for InfoNCE

𝒋

𝟐

𝒖

(a)

∀

j, s

(

u, j

)

-

s

(

u, i

)

0

𝒊

𝒖

𝒋

𝟏

𝜹

𝒋

𝟏

> 𝟎

𝒊

𝜹

𝒋

𝟐

< 𝟎

𝒖

Ranking Criterion for True Negative

𝒋

𝟏

(b)

s

(

u, j

1

)

-

s

(

u, i

)

≤ -

δ

j

1

𝒊

𝒖

𝒋

𝟏

𝜹

𝒋

𝟏

> 𝟎

𝒊

𝜹

𝒋

𝟐

< 𝟎

𝒖

𝒋

𝟐

Ranking Criterion for True Negative

𝒋

𝟏

Ranking Criterion for False Negative

𝒋

𝟐

(c)

s

(

u, j

2

)

-

s

(

u, i

)

≤ -

δ

j

2

[13-15], coupled with the indiscriminate application of contrastive losses such as InfoNCE [16]. Wherein, a common assumption underlying these methods is considering all unobserved interactions as negative signals [17, 18].

Despite the empirical success of CL-based CF methods, two critical limitations have been observed that potentially impede further advancements in this research direction:

Lack of considering the tailored inductive bias for CF. As a standard approach for semisupervised topK recommendation with implicit feedback, CF methods face unique challenges. In most cases, the majority of user-item interactions remain unobserved and unlabelled, from which CF methods directly draw negative instances. However, indiscriminately treating these unobserved interactions as negative signals overlooks the risk of false negatives, thus failing to provide reliable contrastive signals [19]. This issue is known as the exposure bias [20, 21] in recommender systems. Unfortunately, this inherent inductive bias is rarely considered in current CL-based CF methods, resulting in suboptimal recommendation quality and generalization ability [22].

Limited theoretical understanding for the generalization ability of CL-based CF methods. While data augmentation, as a key factor for generalization ability, is pivotal in computer vision [23, 24], CL-based CF models exhibit insensitivity to perturbations in the user-item bipartite graph [25]. Recent studies [26-28] empirically reveal that contrastive loss plays a more crucial role in boosting performance in CF than heuristic-based graph augmentation. However, an in-depth theoretical understanding of contrastive loss in topK recommendation that could shed light on the generalization ability of CL-based CF methods remains largely under-explored.

To better understand and reshape the contrastive loss specially tailored for topK recommendation, we aim to automatically and adversarially assign hardness to each negative user-item pair, which de facto concurrently enlarges the similarity discrepancy for hard negatives and loosens the ranking constraint for false negatives. To be specific, the fundamental idea revolves around discerning a fine-grained degree of hardness for negative interactions, thereby yielding more profound insight into the underlying ranking criterion for topK recommendation, as depicted in Figure 1. Notably, for a given user u , δ j refers to the hardness of item j . When δ j 1 > 0 (as seen in Figure 1b), item j 1 is identified as a hard negative, resulting in a significant contraction of the feasible representation space. Conversely, when δ j 2 < 0 (as seen in Figure 1c), the ranking criterion is relaxed compared to the constraint of InfoNCE, allowing the recommender to mitigate the impact of false negative noise. Nevertheless, the tasks of effectively distinguishing between the hard and false negatives, and of learning a proper fine-grained ranking of interactions continue to present significant challenges [22].

To this end, we incorporate a fine-grained hardness-aware ranking criterion and devise a slightly altered version of InfoNCE loss through adversarial training. This modified contrastive loss coined AdvInfoNCE , is explicitly designed for robust topK recommendation. Specifically, we frame hardness learning as an adversarial optimization problem by designing a hardness mapping from interactions to hardness and iterating between hardness evaluation and CF recommender refinement.

𝟐

𝒋

𝟐

Benefiting from this adversarial framework, our AdvInfoNCE endows two appealing properties. On the one hand, it serves as a specialized contrastive loss for topK collaborative filtering that acknowledges the risk of false negatives while utilizing hard negative mining. Additionally, we theoretically demonstrate through adaptive gradients that AdvInfoNCE subtly employs informative negative sampling ( cf. Appendix B.3). On the other hand, we bridge the adversarial hardness learned by AdvInfoNCE with the ambiguity set in distributionally robust optimization (DRO), thereby naturally demonstrating its generalization ability and assuring its robust performance against the noise of false negatives ( cf. Theorem 3.1). This furnishes a potential theoretical rationalization for the exceptional robustness observed in contrastive learning. Extensive experiments on the outof-distribution benchmark datasets in topK recommendation tasks further highlight the capability of AdvInfoNCE in addressing the issue of biased observations. We advocate for AdvInfoNCE to be considered as a significant reference loss for future contrastive learning research in CF and recommend its adoption as a standard loss in recommender systems.

2 Preliminary of Contrastive Collaborative Filtering (CF)

Task Formulation. Personalized recommendations aim to retrieve a small subset of items from a large catalog to align with the user preference. Here we focus on a typical setting, collaborative filtering (CF) with implicit feedback ( e.g., click, purchase, view times, etc.), which can be framed as a semi-supervised topK recommendation problem [29]. Wherein, the majority of all possible user-item interactions are unobserved, thus previous studies typically assign them with negative labels [29, 30]. Let O + = { ( u, i ) | y ui = 1 } ( O -= { ( u, i ) | y ui = 0 } ) be the observed (unobserved) interactions between users U and items I , where y ui = 1 ( y ui = 0 ) indicates that user u ∈ U has (has not) interacted with item i ∈ I . For convenience, let I + u = { i | y ui = 1 } ( I -u = { j | y uj = 0 } ) denote the set of items that user u has (has not) adopted before. To overcome the distribution shifts in real-world scenarios [31, 10], the long-acting goal is to optimize a robust CF model ˆ y : U × I → R capable of distilling the true preferences of users towards items.

Modeling Strategy. Leading CF models [32-35] involve three main modules: a user behavior encoder ψ θ ( · ) : U → R d , an item encoder ϕ θ ( · ) : I → R d , and a predefined similarity function s ( · , · ) : R d × R d → R , where θ is the set of all trainable parameters. The encoders transfer the user and item into d -dimensional representations. The similarity function measures the similarity between the user and item in the representation space, whose widely-used implementations include dot product [30], cosine similarity [36], and neural networks [37]. For the sake of simplicity and better interpretation, we set the similarity function in our paper as:

in which τ is the hyper-parameter known as temperature [38].

Loss Function. Point- and pair-wise loss functions are widely used to optimize the parameters θ :

Point-wise losses ( e.g., binary cross-entropy [39, 40], mean square error [32]) typically treat observed interactions O + as positive instances and all unobserved interactions O -as negatives. CF methods equipped with point-wise loss naturally cast the problem of item recommendations into a binary classification or regression task. However, due to the large scale of indiscriminative unobserved interactions, this type of loss function fails to effectively consider the ranking criterion nor efficiently handle false negative instances [41].

Pairwise loss functions ( e.g., BPR [30], WARP [42], pairwise hinge loss [43]) aim to differentiate items in a specific relative order. For instance, BPR assumes that the user prefers the positive item over unobserved items. Although effective, these loss functions share a common limitation that lacks sensitivity to label noise and false negatives [22].

Recent CF methods, inspired by the success of contrastive learning (CL) in self-supervised learning tasks, show a surge of interest in contrastive loss:

Contrastive losses ( e.g., InfoNCE [16], InfoL1O [44], DCL [45], SupCon [46]) enforce the agreement between positive instances and the discrepancy between negative instances in the representation space. Separately treating the observed and unobserved interactions as positive and negative

instances allows us to get rid of data augmentation and directly apply these losses in CF. Here we focus mainly on InfoNCE (also well-known as softmax loss in CF [29]), and our findings could be easily extended to other contrastive losses. Specifically, given a user u with a positive item i and the set of items I -u that u has not interacted with, InfoNCE essentially encourages the CF model to satisfy the following ranking criterion:

where > u represents the personalized ranking order of user u . We equivalently reformulate this ranking criterion in the semantic similarity space, as depicted in Figure 1a:

Overall, the objective function of personalized recommendation with InfoNCE loss can be formulated as follows:

where ( u, i ) ∈ O + is an observed interaction between user u and item i . In most cases, the number of unobserved items, i.e., |I -u | , can be extremely large, thus negative sampling becomes a prevalent solution. The standard process of negative sampling involves uniformly drawing a subset of negative instances, denoted by N u , from the unobserved item set I -u .

Discussion. Scrutinizing the ranking criterion in Equation (3), we can easily find that InfoNCE cares about the positive item's relative orders with the negative items holistically, while ignoring the ranking relationships among these negatives. Moreover, it simply treats all unobserved interactions as negative items, thus easily overlooking the risk of false negatives [29, 30]. Such oversights impede the performance and generalization ability of InfoNCE-empowered CF models. To bridge the gap, we aim to devise a variant of InfoNCE by considering these factors.

3 Methodology of AdvInfoNCE

On the foundation of InfoNCE loss, we first devise AdvInfoNCE, a robust contrastive loss tailor-made for TopK recommendation scenarios. Then we present its desirable properties that underscore the efficacy of negative sampling and generalization ability across distribution shifts. Additionally, we delve into the hard negative mining mechanism of AdvInfoNCE and its alignment with TopK ranking evaluation metrics in Appendix B.3 and B.4, respectively.

3.1 Fine-grained Ranking Criterion

Instead of relying on the coarse relative ranking criterion presented in Equation (3), we learn a fine-grained ranking criterion in TopK recommendation by incorporating varying degrees of user preferences for different items into the loss function. In other words, we need to treat the positive item as an anchor, quantify the relative hardness of each item as compared with the anchor, and differentiate between false negatives and hard negatives. Here the hardness of a negative item is defined as its minimal similarity distance towards the positive anchor.

For simplicity, we consider a single observed user-item pair ( u, i ) ∈ O + from now on. Let us assume that for ( u, i ) , we have access to the oracle hardness δ j of each negative item j ∈ N u . By assigning distinct hardness scores to different negatives, we reframe a hardness-aware fine-grained ranking criterion in the semantic similarity space as follows:

Incorporating the hardness scores enables us to exhibit the ranking among negative items ( i.e., the larger hardness score δ j the item j holds, the less likely the user u would adopt it) and endow with better flexibility, compared with InfoNCE in Figure 1a. Specifically, as Figure 1b shows, if δ j 1 > 0 , j 1 is identified as a hard negative item with a contracted feasible zone, which indicates a stringent constraint prompting the model to focus more on j 1 . Meanwhile, as Figure 1c depicts, if δ j 2 < 0 , j 2 tends to be a false negative item and its feasible zone expands, which characterizes a more relaxed constraint. Clearly, the hardness degree δ j encapsulates a fine-grained ranking criterion for user u , thereby facilitating more accurate recommendation.

3.2 Derivation of AdvInfoNCE

The fine-grained ranking criterion for a single positive interaction ( u, i ) , as defined in Equation (5), can be seamlessly transformed into the main part of our AdvInfoNCE:

InfoNCE is a special case of AdvInfoNCE, when ∀ j, δ j = 0 . We briefly outline the main steps of derivation (see Appendix B.1 for the complete derivation):

Derivation Outline. Based on the LogSumExp operator, i.e., max( x 1 , ..., x n ) ≈ log( ∑ i exp( x i )) , the fine-grained ranking criterion could be approximated in a different form as log(exp(0) + ∑ |N u | j =1 exp( s ( u, j ) -s ( u, i ) + δ j )) . Consequently, the right-hand side of Equation (6) can be derived by factoring out the negative sign of the logarithm and reorganizing the term.

We would like to highlight the straightforward nature of this derivation, which is achieved without the need for assumptions, but the widely-used LogSumExp operator [47].

However, the oracle hardness δ j is not accessible or measurable in real-world scenarios. The challenge, hence, comes to how to automatically learn the appropriate hardness for each negative instance. Inspired by the adversarial training [48], we exploit a min-max game, which allows to train the model alternatively between the prediction of hardness and the refinement of CF model. Formally, taking into account all observed interactions, we cast the AdvInfoNCE learning framework as the following optimization problem:

Here, with a slight abuse of notation, let δ ( u,i ) j denote the relative hardness of negative item j in contrast with interaction ( u, i ) , and ∆ represent the collective set of all δ ( u,i ) j . The definition and enlightening explanation of C ( η ) will be presented in Section 3.3.

3.3 In-depth Analysis of AdvInfoNCE

In spite of the adversarial training framework of AdvInfoNCE, the theoretical understanding in terms of its inherent generalization ability remains untouched. In this section, we study it through the lens of distributionally robust optimization (DRO) [49] over negative sampling. From this perspective, AdvInfoNCE focuses on the worst-case distribution over high-quality hard negative sampling.

Theorem 3.1. We define δ ( u,i ) j . = log( |N u | · p ( j | ( u, i ))) , where p ( j | ( u, i )) is the probability of sampling negative item j for observed interaction ( u, i ) . Then, optimizing AdvInfoNCE loss is equivalent to solving Kullback-Leibler (KL) divergence-constrained distributionally robust optimization (DRO) problems over negative sampling:

where P 0 stands for the distribution of uniformly drawn negative samples, i.e., p 0 ( j | ( u, i )) = 1 |N u | ; P denotes the distribution of negative sampling p ( j | ( u, i )) .

For brevity, we present a proof sketch summarizing the key idea here and delegate the full proof to Appendix B.2.

Proof. By defining δ ( u,i ) j . = log( |N u | · p ( j | ( u, i ))) , we have 1 |N u | ∑ |N u | j =1 δ ( u,i ) l = -D KL ( P 0 || P ) . Therefore, by rearranging the terms, optimizing AdvInfoNCE can be restated as a standard DRO

problem:

We now turn our attention to the role of C ( η ) and its relationship with the ambiguity set P in DRO. The ambiguity set P is formulated by requiring the distribution of negative sampling to fall within a certain η distance from the uniform distribution, as defined below:

where ϵ serves as the hyperparameter to regulate the deviation of the negative sampling distribution from the uniform distribution. In terms of implementation, ϵ is controlled by the number of adversarial training epochs (see Algorithm 1). Clearly, C ( η ) is an equal counterpart to the ambiguity set P .

Discussion. Grounded by theoretical proof, we understand the generalization ability of our AdvInfoNCE through the lens of DRO over informative negative sampling. In essence, by learning the hardness in an adversarial manner, AdvInfoNCE effectively enhances the robustness of the CF recommender. Moreover, apart from the robustness of AdvInfoNCE (see Section 3.3), we also identify its hard negative mining mechanism through gradients analysis (see Appendix B.3) and its alignment with topK ranking evaluation metrics (see Appendix B.4). Specifically, the gradients concerning negative samples are proportional to the hardness term exp( δ j ) , indicating that AdvInfoNCE is a hardness-aware loss. To some extent, our AdvInfoNCE is equivalent to the widely-adopted Discounted Cumulative Grain (DCG) ranking metric.

Limitation. AdvInfoNCE employs end-to-end negative sampling in an adversarial manner, compelling the recommender to ensure robustness from the worst-case scenario. Despite its empirical success and desirable properties, AdvInfoNCE is not immune to the limitations of adversarial training, which is well-known for its potential training instability.

4 Experiments

We aim to answer the following research questions:

RQ1: How does AdvInfoNCE perform compared with other CL-based CF methods?

RQ2: Can AdvInfoNCE effectively learn the fine-grained ranking criterion? What are the impacts of the component ϵ ( i.e., the number of adversarial training epochs) on AdvInfoNCE?

Baselines. Two high-performing encoders - ID-based (MF [50]) and graph-based (LightGCN [51]), are selected as CF backbone models. We thoroughly compare AdvInfoNCE with two categories of the latest CL-based CF methods: augmentation-based baselines (SGL [13], NCL [52], XSimGCL [27]) and loss-based baselines (CCL [53], BC Loss [54], Adapτ [55]). See detailed introduction and comparison of baselines in Appendix A.

Datasets. To verify the generalization ability of AdvInfoNCE, we conduct extensive experiments on three standard unbiased datasets (KuaiRec [56], Yahoo!R3 [57], Coat [58]) and one synthetic dataset (Tencent [10]). We employ three commonly used metrics (Hit Ratio (HR@ K ), Recall@ K , Normalized Discounted Cumulative Gain (NDCG@ K )) for evaluation, with K set by default at 20. Please refer to Appendix C and D for more experimental results over additional backbones, additional baselines, and an intuitive understanding of AdvInfoNCE.

4.1 Overall Performance Comparison (RQ1)

4.1.1 Evaluations on Unbiased Datasets

Motivation. Evaluating the efficacy and generalization ability of CF models based on partially observed interactions collected from existing recommender system is rather challenging [59]. This is

primarily due to the exposure bias of the recommender system confounding the observed data. To address this issue, some researchers propose using unbiased evaluations [57, 58]. In these datasets, items in the test set are randomly exposed to users, while partially observed interactions are still used for training. The distribution shift between training and testing enables a fair evaluation of the generalization ability of CF methods in out-of-distribution tasks.

Results. Tables 1 and 4 present a comparative analysis of the performance on standard unbiased datasets over the LightGCN and MF backbones. The best-performing methods per test are bold and starred, while the second-best methods are underlined. The red and blue percentages respectively refer to the increase and decrease of CF methods relative to InfoNCE in each metric. We observe that:

CL-based CF methods have driven impressive performance breakthroughs compared with BPR in most evaluation metrics. This aligns with findings from prior research [27, 54] that contrastive loss significantly boosts the generalization ability of CF methods by providing informative contrastive signals. In contrast, BPR loss, which focuses on pairwise relative ranking, often suffers from ineffective negative sampling [30] and positive-unlabeled issues [21].

Contrastive loss, rather than graph augmentation, plays a more significant role in enhancing the generalization ability of CF models. We categorize CL-based CF baselines into two research lines: one adopts user-item bipartite graph augmentation along with augmented views as positive signals (referred to as augmentation-based), and another focuses solely on modifying contrastive loss using interacted items as positive instances (referred to as loss-based). Surprisingly, our results reveal no substantial difference between the performance of augmentation- and loss-based methods. This finding provides further evidence in support of the claim made in prior studies [27, 26] that, specifically in CF tasks, the contrastive loss itself is the predominant factor contributing to the enhancement of a CF model's generalization ability.

AdvInfoNCE consistently outperforms the state-of-the-art CL-based CF baselines in terms of all metrics on all unbiased datasets. AdvInfoNCE shows an improvement ranging from 3.53% to 9.94% on Recall@20 compared to InfoNCE. Notably, AdvInfoNCE gains the most on the fully-exposed dataset, KuaiRec, which is considered as an ideal offline A/B testing. In contrast, most of the CL-based CF methods underperform relative to InfoNCE and behave in an unstable manner when the testing distribution shifts. This clearly indicates that AdvInfoNCE greatly enhances the robustness of the CF model in real-world scenarios. We attribute this improvement to the fine-grained ranking criterion of AdvInfoNCE that automatically differentiates hard and false negative samples. Additionally, as shown in Table 9, AdvInfoNCE only adds negligible time complexity compared to InfoNCE.

4.1.2 Evaluations on Various Out-of-distribution Settings

Motivation. In real-world scenarios, recommender systems may confront diverse, unpredictable, and unknown distribution shifts. We believe that a good recommender with powerful generalization ability should be able to handle various degrees of distribution shift. Following previous work [10], we partition the Tencent dataset into three test sets with different out-of-distribution degrees. Here, a higher γ value signifies a greater divergence in distribution shift (for more details on the experimental settings, see Appendix C.1). We evaluate all CF methods with identical model parameters across all test sets, without knowing any prior knowledge of the test distribution beforehand.

(a) Distribution of hardness

(b) Varying hardness strategies

(c) Alignment & uniformity analysis

0.025

0.044

AdvInfoNCE

1.30

AdvInfoNCE

InfoNCE+Rand

InfoNCE+Rand

0.020

Recall@20

0.042

AdvInfoNCE+Reverse

End adversarial training

Loss

1.25

AdvInfoNCE+Reverse

0.040

1.20

Average

0.038

0.010

0.036

A

1.15

0.005

0.034

1.10

0.032

1.05

0.000

0

20

40

60

80

100

120

0

50

100

150

200

7.2

7.0

6.8

6.6

6.4

Itempopularitydegree

Epochs

UniformLoss

Figure 2: Study of hardness. (2a) Illustration of hardness i.e., the probability of negative sampling ( p ( j | ( u, i )) ) learned by AdvInfoNCE w.r.t. item popularity on Tencent. The dashed line represents the uniform distribution. (2b) Performance comparisons with varying hardness learning strategies on Tencent ( γ = 10 ). (2c) The trajectories of align loss and uniform loss during training progress. Lower values indicate better performance. Arrows denote the losses' changing directions.

Results. As illustrated in Tables 2 and 5, AdvInfoNCE yields a consistent boost compared to all SOTA baselines across all levels of out-of-distribution test sets. In particular, AdvInfoNCE substantially improves Recall@20 by 10.00% to 21.90% compared to InfoNCE and by 5.75% to 10.90% compared to the second-best baseline. It's worth noting that AdvInfoNCE gains greater improvement on test sets with higher distribution shifts, while all CL-based CF baselines suffer significant performance drops due to these severe distribution shifts. We attribute this drop to the coarse relative ranking criterion which injects erroneously recognized negative instances into contrastive signals. In contrast, benefiting from the effective adversarial learning of the fine-grained ranking criterion, AdvInfoNCE can achieve a 24.14% improvement over InfoNCE w.r.t. NDCG@20when γ = 2 , fully stimulating the potential of contrastive loss. These results validate the strong generalization ability of AdvInfoNCE as demonstrated in Theorem 3.1, proving that optimizing AdvInfoNCE is equivalent to solving DRO problems constrained by KL divergence over high-quality negative sampling.

4.2 Study on AdvInfoNCE (RQ2)

4.2.1 Effect of Hardness

Motivation. To evaluate the effectiveness of the fine-grained hardness-aware ranking criterion learned by AdvInfoNCE, and further investigate whether it truly enhances the generalization ability of CF models, we conduct a comprehensive analysis on the Tencent dataset. This analysis contains three-fold: it studies the distribution of hardness ( i.e., examining the negative sampling strategy of AdvInfoNCE); the performance trend over varying hardness learning strategies; and conducting an analysis of the alignment and uniformity properties of representations over varying hardness learning strategies. Additional experiments on the KuaiRec dataset, exhibiting similar trends and findings, can be found in Appendix D.2.

Distribution of hardness, aka. negative sampling strategy. As elucidated in Theorem 3.1, learning the hardness δ ( u,i ) j in an adversarial manner essentially conducts negative sampling. Inspired by item popularity-based negative sampling strategies [60-62], we probe into the relationship between adversarial negative sampling of AdvInfoNCE and the popularity of negative items. Figure 2a

(a) End at early-stage

(b) End at mid-stage

(c) End at late-stage

Recall@20

0.15

0.15

0.14

Validation Set

End adversarial training

y= 200 Test Set

y= 10 Test Set

y=2

Test Set

0.08

0.07

0.09

Recall@20

Recall@20

0.14

0.14

Validation Set

End adversarial training

= 200 Test Set

y= 10 Test Set

y=2

Test Set

0.09

0.08

0.07

Recall@20

Recall@20

0.15

0.14

Validation Set

End adversarial training

= 200 Test Set

y=10 Test Set

y=2 Test Set

0.09

0.08

0.07

Recall@20

Validation

0.14

0.14

0.14

0.06

0.05

aoo

Validation

0.14

0.13

0.06

0.05

OOD

Validation

0.13

0.12

0.06

0.05

OD

0.04

0.13

0.04

0.04

0

0.13

0.13

0.03

0.13

0.03

0.11

0.03

0

50

100

150

200

0

50

100

150

200

0

50

100

150

200

Epochs

Epochs

Epochs

depicts a skewed negative sampling distribution that focuses more on popular negative items and de-emphasizes the hardness of unpopular negative items, which are likely to be false negatives. These results highlight two findings. Firstly, in line with [61], only a minor portion of negative instances are potentially important for model learning, while a vast number of negatives are false negatives. Secondly, more frequent items constitute better hard negatives, which is consistent with the findings in previous work [60]. This popularity-correlated negative sampling validates that AdvInfoNCE automatically mitigates the influence of popularity bias during training, alleviates the overlook of false negatives in CF, and utilizes high-quality hard negative mining.

Performance over varying hardness learning strategies. Figure 2b clearly demonstrates that distilling the fine-grained hardness of negative items (AdvInfoNCE) is excelling over the uniformly random hardness (InfoNCE+Rand), equal hardness (InfoNCE), and reversed fine-grained hardness (AdvInfoNCE+Reverse) throughout the training process. This validates AdvInfoNCE's ability to simultaneously filter and up-weight more informative hard negatives while identifying and downweighting the potential false negatives. These desired properties further enable AdvInfoNCE to extract high-quality negative signals from a large amount of unobserved data.

Alignment and uniformity analysis. It is widely accepted that both alignment and uniformity are necessary for a good representation [5]. We, therefore, study the behavior of AdvInfoNCE through the lens of align loss and uniform loss, as shown in Figure 2c. AdvInfoNCE improves uniformity while maintaining a similar level of alignment as InfoNCE, whereas reversed fine-grained hardness significantly reduces representation uniformity. These findings underscore the importance of fine-grained hardness, suggesting that AdvInfoNCE learns more generalized representations.

4.2.2 Effect of the Adversarial Training Epochs

The critical hyperparameter, the number of adversarial training epochs, controls the degree of deviation from uniform negative sampling. As illustrated in Figure 3a through 3b, improved out-ofdistribution performance correlates with an increased adversarial learning period. On the other hand, Figures 3b through 3c show that overly prolonged adversarial training can also degrade performance on in-distribution validation sets. Therefore, it is crucial to devise a proper adversarial training period tailored to specific datasets, which aligns with the limitation of AdvInfoNCE. Consistent observations can be found on KuaiRec in Appendix D.3.

5 Conclusion

Despite the empirical successes, the profound understanding of contrastive loss in collaborative filtering (CF) remains limited. In this work, we devised a principled AdvInfoNCE loss specially tailored for CF methods, utilizing a fine-grained hardness-aware ranking criterion to enhance the recommender's generalization ability. Grounded by theoretical proof, AdvInfoNCE empowers topK recommendations via informative negative sampling in an adversarial manner. We believe that our AdvInfoNCE, as a variant of InfoNCE, provides a valuable baseline for future contrastive learning-based CF studies and is an important stepping stone toward generalized recommenders.

Acknowledgments and Disclosure of Funding

This research is supported by the NExT Research Center, the National Natural Science Foundation of China (9227010114), the University Synergy Innovation Program of Anhui Province (GXXT2022-040), and the MOE Project of Key Research Institute of Humanities and Social Sciences (22JJD110001).

References

Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML , 2020.

Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR , 2020.

Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Selfsupervised learning via redundancy reduction. In ICML , 2021.

Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR , 2021.

Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML , 2020.

Xin Xia, Hongzhi Yin, Junliang Yu, Qinyong Wang, Lizhen Cui, and Xiangliang Zhang. Selfsupervised hypergraph convolutional networks for session-based recommendation. In AAAI , 2021.

Hongrui Xuan, Yi Liu, Bohan Li, and Hongzhi Yin. Knowledge enhancement for contrastive multi-behavior recommendation. In WSDM , 2023.

Junliang Yu, Hongzhi Yin, Jundong Li, Qinyong Wang, Nguyen Quoc Viet Hung, and Xiangliang Zhang. Self-supervised multi-channel hypergraph convolutional network for social recommendation. In WWW , 2021.

Kun Zhou, Hui Wang, Wayne Xin Zhao, Yutao Zhu, Sirui Wang, Fuzheng Zhang, Zhongyuan Wang, and Ji-Rong Wen. Sˆ3-rec: Self-supervised learning for sequential recommendation with mutual information maximization. CoRR , abs/2008.07873, 2020.

An Zhang, Jingnan Zheng, Xiang Wang, Yancheng Yuan, and Tat seng Chua. Invariant collaborative filtering to popularity distribution shift. In WWW , 2023.

An Zhang, Wenchang Ma, Jingnan Zheng, Xiang Wang, and Tat-Seng Chua. Robust collaborative filtering to popularity distribution shift. ACM Transactions on Information Systems , 2023.

Jin Chen, Defu Lian, Binbin Jin, Xu Huang, Kai Zheng, and Enhong Chen. Fast variational autoencoder with inverted multi-index for collaborative filtering. In WWW , 2022.

Jiancan Wu, Xiang Wang, Fuli Feng, Xiangnan He, Liang Chen, Jianxun Lian, and Xing Xie. Self-supervised graph learning for recommendation. In SIGIR , 2021.

Chang Zhou, Jianxin Ma, Jianwei Zhang, Jingren Zhou, and Hongxia Yang. Contrastive learning for debiased candidate generation in large-scale recommender systems. In KDD , 2021.

Lianghao Xia, Chao Huang, Chunzhen Huang, Kangyi Lin, Tao Yu, and Ben Kao. Automated self-supervised learning for recommendation. In WWW , 2023.

Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. CoRR , abs/1807.03748, 2018.

Wentao Shi, Jiawei Chen, Fuli Feng, Jizhi Zhang, Junkang Wu, Chongming Gao, and Xiangnan He. On the theories behind hard negative sampling for recommendation. In WWW , 2023.

Defu Lian, Qi Liu, and Enhong Chen. Personalized ranking with importance sampling. In WWW , 2020.

David T. Hoffmann, Nadine Behrmann, Juergen Gall, Thomas Brox, and Mehdi Noroozi. Ranking info noise contrastive estimation: Boosting contrastive learning via ranked positives. In AAAI , 2022.

Jiawei Chen, Hande Dong, Xiang Wang, Fuli Feng, Meng Wang, and Xiangnan He. Bias and debias in recommender system: A survey and future directions. CoRR , abs/2010.03240, 2020.

Xiaojie Wang, Rui Zhang, Yu Sun, and Jianzhong Qi. Doubly robust joint learning for recommendation on data missing not at random. In ICML , 2019.

Chenxiao Yang, Qitian Wu, Jipeng Jin, Xiaofeng Gao, Junwei Pan, and Guihai Chen. Trading hard negatives and true negatives: A debiased contrastive collaborative filtering approach. In IJCAI , 2022.

Weiran Huang, Mingyang Yi, and Xuyang Zhao. Towards the generalization of contrastive self-supervised learning. In ICLR , 2023.

Kendrick Shen, Robbie M. Jones, Ananya Kumar, Sang Michael Xie, Jeff Z. HaoChen, Tengyu Ma, and Percy Liang. Connect, not collapse: Explaining contrastive learning for unsupervised domain adaptation. In ICML , 2022.

Dongha Lee, SeongKu Kang, Hyunjun Ju, Chanyoung Park, and Hwanjo Yu. Bootstrapping user and item representations for one-class collaborative filtering. In SIGIR , 2021.

Junliang Yu, Hongzhi Yin, Xin Xia, Tong Chen, Lizhen Cui, and Quoc Viet Hung Nguyen. Are graph augmentations necessary?: Simple graph contrastive learning for recommendation. In SIGIR , 2022.

Junliang Yu, Xin Xia, Tong Chen, Lizhen Cui, Nguyen Quoc Viet Hung, and Hongzhi Yin. Xsimgcl: Towards extremely simple graph contrastive learning for recommendation. CoRR , abs/2209.02544, 2022.

Junkang Wu, Jiawei Chen, Jiancan Wu, Wentao Shi, Xiang Wang, and Xiangnan He. Understanding contrastive learning via distributionally robust optimization. In NeurIPS , 2023.

Yehuda Koren, Steffen Rendle, and Robert M. Bell. Advances in collaborative filtering. In Recommender Systems Handbook , pages 91-142. Springer US, 2022.

Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. BPR: bayesian personalized ranking from implicit feedback. CoRR , abs/1205.2618, 2012.

Yue He, Zimu Wang, Peng Cui, Hao Zou, Yafeng Zhang, Qiang Cui, and Yong Jiang. Causpref: Causal preference learning for out-of-distribution recommendation. In WWW , 2022.

Yehuda Koren. Factorization meets the neighborhood: a multifaceted collaborative filtering model. In KDD , 2008.

Dawen Liang, Rahul G. Krishnan, Matthew D. Hoffman, and Tony Jebara. Variational autoencoders for collaborative filtering. In WWW , 2018.

Xiang Wang, Xiangnan He, Meng Wang, Fuli Feng, and Tat-Seng Chua. Neural graph collaborative filtering. In SIGIR , 2019.

Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L. Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In KDD , 2018.

Steffen Rendle, Walid Krichene, Li Zhang, and John R. Anderson. Neural collaborative filtering vs. matrix factorization revisited. In RecSys , 2020.

Xiangnan He, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu, and Tat-Seng Chua. Neural collaborative filtering. In WWW , 2017.

Feng Wang and Huaping Liu. Understanding the behaviour of contrastive loss. In CVPR , 2021.

Ying Shan, T. Ryan Hoens, Jian Jiao, Haijing Wang, Dong Yu, and J. C. Mao. Deep crossing: Web-scale modeling without manually crafted combinatorial features. In KDD , 2016.

Immanuel Bayer, Xiangnan He, Bhargav Kanagal, and Steffen Rendle. A generic coordinate descent framework for learning from implicit feedback. In WWW , 2017.

Steffen Rendle. Item recommendation from implicit feedback. In Recommender Systems Handbook , pages 143-171. Springer US, 2022.

Jason Weston, Samy Bengio, and Nicolas Usunier. WSABIE: scaling up to large vocabulary image annotation. In IJCAI , 2011.

Cheng-Kang Hsieh, Longqi Yang, Yin Cui, Tsung-Yi Lin, Serge J. Belongie, and Deborah Estrin. Collaborative metric learning. In WWW , 2017.

Ben Poole, Sherjil Ozair, Aäron van den Oord, Alexander A. Alemi, and George Tucker. On variational bounds of mutual information. In ICML , 2019.

Chun-Hsiao Yeh, Cheng-Yao Hong, Yen-Chi Hsu, Tyng-Luh Liu, Yubei Chen, and Yann LeCun. Decoupled contrastive learning. In ECCV , 2022.

Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In NeurIPS , 2020.

Carlo Alberto Barbano, Benoit Dufumier, Enzo Tartaglione, Marco Grangetto, and Pietro Gori. Unbiased supervised contrastive learning. In ICLR , 2023.

Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR , 2018.

Zhaolin Hu and L Jeff Hong. Kullback-leibler divergence constrained distributionally robust optimization. Available at Optimization Online , 1(2):9, 2013.

Yehuda Koren, Robert M. Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer , 42(8):30-37, 2009.

Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yong-Dong Zhang, and Meng Wang. Lightgcn: Simplifying and powering graph convolution network for recommendation. In SIGIR , 2020.

Zihan Lin, Changxin Tian, Yupeng Hou, and Wayne Xin Zhao. Improving graph collaborative filtering with neighborhood-enriched contrastive learning. In WWW , 2022.

Kelong Mao, Jieming Zhu, Jinpeng Wang, Quanyu Dai, Zhenhua Dong, Xi Xiao, and Xiuqiang He. Simplex: A simple and strong baseline for collaborative filtering. In CIKM , 2021.

An Zhang, Wenchang Ma, Xiang Wang, and Tat-Seng Chua. Incorporating bias-aware margins into contrastive loss for collaborative filtering. In NeurIPS , 2022.

Jiawei Chen, Junkang Wu, Jiancan Wu, Xuezhi Cao, Sheng Zhou, and Xiangnan He. Adapτ : Adaptively modulating embedding magnitude for recommendation. In WWW , 2023.

Chongming Gao, Shijun Li, Wenqiang Lei, Jiawei Chen, Biao Li, Peng Jiang, Xiangnan He, Jiaxin Mao, and Tat-Seng Chua. Kuairec: A fully-observed dataset and insights for evaluating recommender systems. In CIKM , 2022.

Benjamin M. Marlin and Richard S. Zemel. Collaborative prediction and ranking with nonrandom missing data. In RecSys , 2009.

Tobias Schnabel, Adith Swaminathan, Ashudeep Singh, Navin Chandak, and Thorsten Joachims. Recommendations as treatments: Debiasing learning and evaluation. In ICML , 2016.

Yuta Saito, Suguru Yaginuma, Yuta Nishino, Hayato Sakata, and Kazuhide Nakata. Unbiased recommender learning from missing-not-at-random implicit feedback. In WSDM , 2020.

Hugo Caselles-Dupré, Florian Lesaint, and Jimena Royo-Letelier. Word2vec applied to recommendation: hyperparameters matter. In RecSys , 2018.

Ting Chen, Yizhou Sun, Yue Shi, and Liangjie Hong. On sampling strategies for neural network-based collaborative filtering. In KDD , 2017.

Steffen Rendle and Christoph Freudenthaler. Improving pairwise learning for item recommendation from implicit feedback. In WSDM , 2014.

Hao Tang, Guoshuai Zhao, Yuxia Wu, and Xueming Qian. Multi-sample based contrastive loss for top-k recommendation. IEEE Transactions on Multimedia , 2021.

Zhuang Liu, Yunpu Ma, Yuanxin Ouyang, and Zhang Xiong. Contrastive learning for recommender system. CoRR , abs/2101.01317, 2021.

Tiansheng Yao, Xinyang Yi, Derek Zhiyuan Cheng, Felix X. Yu, Ting Chen, Aditya Krishna Menon, Lichan Hong, Ed H. Chi, Steve Tjoa, Jieqi (Jay) Kang, and Evan Ettinger. Selfsupervised learning for large-scale item recommendations. In CIKM , 2021.

Lianghao Xia, Chao Huang, Yong Xu, Jiashu Zhao, Dawei Yin, and Jimmy X. Huang. Hypergraph contrastive collaborative filtering. In SIGIR , 2022.

Haoxuan Li, Yi Bin, Junrong Liao, Yang Yang, and Heng Tao Shen. Your negative may not be true negative: Boosting image-text matching with false negative elimination. In ACM MM , 2023.

Jiancan Wu, Xiang Wang, Xingyu Gao, Jiawei Chen, Hongcheng Fu, Tianyu Qiu, and Xiangnan He. On the effectiveness of sampled softmax loss for item recommendation. CoRR , abs/2201.02327, 2022.

Kelong Mao, Jieming Zhu, Xi Xiao, Biao Lu, Zhaowei Wang, and Xiuqiang He. Ultragcn: Ultra simplification of graph convolutional networks for recommendation. In CIKM , pages 1253-1262. ACM, 2021.

Thomas N. Kipf and Max Welling. Variational graph auto-encoders. CoRR , abs/1611.07308, 2016.

Hongyi Wen, Xinyang Yi, Tiansheng Yao, Jiaxi Tang, Lichan Hong, and Ed H Chi. Distributionally-robust recommendations for improving worst-case user experience. In WWW , 2022.

Jin Chen, Defu Lian, Yucheng Li, Baoyun Wang, Kai Zheng, and Enhong Chen. Cacheaugmented inbatch importance resampling for training recommender retriever. In NeurIPS , 2022.

A Related Work

We remind important related works to understand how our AdvInfoNCE stands and its role in rich literature. Our work is related to the literature on contrastive learning-based collaborative filtering (CL-based CF) methods, and theoretical understanding of contrastive loss in collaborative filtering.

A.1 Contrastive Learning-based Collaborative Filtering

The latest CL-based CF methods can roughly fall into two research lines. The first one, which we term the 'augmentation-based' approach, leverages user-item bipartite graph augmentations along with augmented views as positive signals. The second category, referred to as 'loss-based' approaches, mainly focuses on the modification of contrastive loss. In loss-based CF models, interacted items serve as positive instances.

Augmentation-based [13-15, 52, 26, 27, 63-66]. The prevailing augmentation-based paradigm in CL-based CF methods is to employ user-item bipartite graph augmentations to generate contrasting views. These contrasting views are then treated as positive instances in the application of contrastive loss, such as InfoNCE loss, to further enhance collaborative filtering signals. Recent studies have extensively explored methods for generating contrastive views. Several studies like SGL [13] and DCL [64] elaborate on data-heuristic augmentation operators such as a random node or edge dropout and random walk. NCL [52] takes a different approach and incorporates potential neighbors from both the graph structure and semantic space into contrastive views. XSimGCL [27] takes it a step further and discards ineffective graph augmentations, choosing instead to employ a simple noise-based embedding augmentation. In pursuit of high-quality augmented supervision signals instead of handcrafted strategies, AutoCF [15] designs a learnable masking function to automatically identify important centric nodes for data augmentation.

Loss-based [53-55, 22, 67]. Recent research, such as the experiments presented in SimGCL [26] and XSimGCL [27], has empirically shown that contrastive loss can be instrumental in enhancing the performance of CF methods, often playing a more significant role than heuristic-based graph augmentation. Despite these findings, there remains a gap in the exploration of loss-based CF methods, an area ripe for further investigation. BC loss [54] incorporates bias-aware margins into the contrastive loss, enabling the learning of high-quality head and tail representations with robust discrimination and generalization abilities. Adapτ [55] proposes an adaptive fine-grained strategy for selecting the personalized temperature τ for each user within the contrastive loss. HDCCF [22] devises a new contrastive loss function extending the advantage of negative mining from user-item to neighbored users and items.

A.2 Theoretical Understanding of Contrastive Loss in CF

Despite the remarkable success of CL-based CF methods, there remains a lack of theoretical understanding, particularly regarding the superior generalization ability of contrastive loss. In a study conducted by [68], three model-agnostic advantages of contrastive loss are theoretically revealed, including mitigating popularity bias, mining hard negative samples, and maximizing the ranking metric. CLRec [14] sheds light on contrastive loss from a bias-reduction perspective by revealing its connection with inverse propensity weighting techniques. XSimGCL [27] suggests that contrastive learning enables the recommender to learn more evenly distributed user and item representations, thereby mitigating the prevalent popularity bias in CF.

B In-depth Analysis of AdvInfoNCE

B.1 Complete Derivation of AdvInfoNCE

Full Derivation. We first introduce the widely-used LogSumExp operator in machine learning algorithms.

The fine-grained ranking criterion for a single positive interaction ( u, i ) is defined as:

Then we probe into the Eq (11) and transform it into an optimization problem as follows:

We can seamlessly transform this optimization objective into the core component of our AdvInfoNCE:

Drawing inspiration from adversarial training [48], we utilize a min-max game that allows for alternating training of the model between predicting hardness and refining the CF model. Formally, we formulate the AdvInfoNCE learning framework as the following optimization problem:

where exp( δ ( u,i ) j ) |N u | ∈ C ( η, ( u, i )) = ( 1 |N u | -ϵ, 1 |N u | + ϵ ) , and ϵ is a hyperparameter that regulates the upper-bound deviation of hardness. In practice, ϵ is regulated by the number of adversarial training epochs under a fixed learning rate (refer to Algorithm 1).

If we further define exp( δ ( u,i ) j ) |N u | as p ( j | ( u, i )) , which signifies the likelihood of selecting item j as a negative sample for the user-item pair ( u, i ) , we can rewrite the AdvInfoNCE loss as:

B.2 Proof of Theorem

Theorem 3.1. We define δ ( u,i ) j . = log( |N u | · p ( j | ( u, i ))) , where p ( j | ( u, i )) is the probability of sampling negative item j for observed interaction ( u, i ) . Then, optimizing AdvInfoNCE loss is equivalent to solving Kullback-Leibler (KL) divergence-constrained distributionally robust optimization (DRO) problems over negative sampling:

where P 0 stands for the distribution of uniformly drawn negative samples, i.e., p 0 ( j | ( u, i )) = 1 |N u | ; P denotes the distribution of negative sampling p ( j | ( u, i )) .

Proof. We denote the relative hardness of negative item j with respect to observed interaction ( u, i ) as δ ( u,i ) j and redefine it as log( |N u | · p ( j | ( u, i ))) . In this definition, |N u | is the number of negative

samples for each user u , and p ( j | ( u, i )) is the probability of selecting item j as a negative sample for a given user-item pair ( u, i ) .

With the constraint that ∑ |N u | j =1 p ( j | ( u, i )) = 1 , we can recalculate the average hardness as follows:

In this formulation, P 0 represents the distribution of uniformly drawn negative samples, where p 0 ( j | ( u, i )) = 1 |N u | . Meanwhile, P denotes the distribution of negative sampling, represented as p ( j | ( u, i )) .

Since p ( j | ( u, i )) ∈ C ( η, ( u, i )) = ( 1 |N u | -ϵ, 1 |N u | + ϵ ) , we further define η = -log (1 -ϵ 2 |N u | ) . Thus, the feasible zone presented above is equivalent to a relaxed constraint D KL ( P 0 || P ) ≤ η .

The AdvInfoNCE loss for all observations can be rewritten in a different form by reorganizing and simplifying the Eq (15):

The equation presented above exemplifies a widely encountered formulation of the Distributionally Robust Optimization (DRO) problem [49] where the ambiguity set of the probability distribution is defined by the Kullback-Leibler (KL) divergence D KL ( P 0 || P ) ≤ η .

B.3 Gradients Analysis

In this section, we delve into the crucial role of hardness δ j in controlling the penalty strength on hard negative samples. The analysis begins with the main part of AdvInfoNCE for a single positive interaction ( u, i ) , as defined in Eq (13), primarily due to its simplicity. For the sake of notation simplicity, let us denote it as:

Then the gradient with respect to the positive representations ϕ θ ( i ) of item i is formulated as:

The gradients with respect to the negative representations ϕ θ ( j ) of item j is given by:

Clearly, for a given user u , the gradient with respect to the positive item i equals the sum of gradients of all negative items, in accordance with the findings in [38]. The hardness exp( δ j ) dictates the importance of negative gradients. Specifically, the gradients relating to the negative item j in Eq (20) correlate proportionally to the hardness term exp( δ j ) , which shows that the AdvInfoNCE loss function is hardness-aware.

B.4 Align Top-K evaluation metric

Discounted Cumulative Gain (DCG) is a commonly used ranking metric in topK recommendation tasks. In DCG, the relevance of an item's contribution to the utility decreases logarithmically in relation to its position in the ranked list. This mimics the behavior of a user who is less likely to scrutinize items that are positioned lower in the ranking. Formally, DCG over rank π s ( u, i ) is defined as follows:

Where π s ( u, I ) is a ranked list over I , as determined by the similarity function s for user u , and y is a label vector that indicates whether an interaction has occurred previously or not. Then π s ( u, i ) is the rank of item i . Building on the research presented in [68], we explore how well AdvInfoNCE aligns with DCG for our purposes.

Under our proposed fine-grained hardness ranking criteria defined in Eq (11), the π s ( u, i ) can be obtained as follows:

Suppose that there are K items in I that are interacted with u , let them to be { 1 , 2 , · · · , K } ithout loss of generality. Then

the equality holds if and only if the interactions { ( u, i ) : i = 1 , 2 , · · · , K } are ranked top-K. For a given u ,

The inequality in Eq (25) holds under the common usage of s ( u, i ) ∈ [0 , 1] , the first inequality in Eq (26) holds when |I| ≥ 6 , while the second inequality in Eq (26) holds by Eq (24).

Therefore, by Eq (23) and Eq (26),

Consequently, minimizing L AdvInfoNCE is equivalent to minimizing DCG ( π s ( u, I ) , y ) .

C Experiments

C.1 Experimental Settings

Datasets

KuaiRec [56] is a real-world dataset sourced from the recommendation logs of KuaiShou, a platform for sharing short videos. The unbiased testing data consist of dense ratings from 1411 users for 3327 items, with the training data being relatively sparse. We categorize items that have a viewing duration exceeding twice the length of the short video as positive interactions.

Yahoo!R3 [57] is a dataset that encompasses ratings for songs. The training set is comprised of 311,704 user-selected ratings ranging from 1 to 5. The test set includes ratings for ten songs randomly exposed to each user. Interactions with items receiving a rating of 4 or higher are considered positive in our experiments.

Coat [58] records online shopping interactions of customers purchasing coats. The training set, characterized as a biased dataset, comprises ratings provided by users for 24 items they have chosen. The test set, on the other hand, contains ratings for 16 coats that were randomly exposed to each user. Ratings in Coat follow a 5-point scale, and interactions involving items with a rating of 4 or above are classified as positive instances in our experiments.

Tencent [10] is collected from the Tencent's short-video platform. We sort the items according to their popularity in descending order and divide them into 50 groups. Each group, defined by its popularity rank, is assigned a certain number of interactions, denoted by N i , for inclusion in the test set. The quantity N i is calculated based on N 0 · γ -i -1 49 , where N 0 is the maximum number of interactions across all test groups and γ denotes the extent of the long-tail distribution. A lower value of gamma indicates a stronger deviation from the original distribution, thus yielding a more evenly distributed test set. To ensure that the validation set mirrored the long-tail distribution of

the training set and no side information of the test set is leaked, the remaining interactions are randomly divided into training and validation sets at a ratio of 60:10.

Baselines. In this study, we conduct a comprehensive evaluation of AdvInfoNCE using two widely adopted collaborative filtering backbones, MF [50] and LightGCN [51]. We thoroughly compare AdvInfoNCE with two categories of the latest CL-based CF methods: augmentation-based baselines (SGL [13], NCL [52], XSimGCL [27]) and loss-based baselines (CCL [53], BC Loss [54], Adapτ [55]).

SGL [13] leverages data-heuristic graph augmentation techniques to generate augmented views. It then employs contrastive learning on the augmented views and the original embeddings.

NCL [52] implements contrastive learning on two types of neighbors: structural neighbors and semantic neighbors. Structural neighbors are represented by the embeddings derived from evennumbered layers in a Graph Neural Network (GNN). Semantic neighbors comprise nodes with similar features or preferences, clustered through the Expectation-Maximization (EM) algorithm.

XSimGCL [27] directly infuses noise into graph embeddings from the mid-layer of LightGCN to generate augmented views. This method arises from experimental observations indicating that CF models are relatively insensitive to graph augmentation. Instead, the key determinant of their performance lies in the application of contrastive loss.

CCL [53] proposes a variant of contrastive loss based on cosine similarity. Specifically, it implements a strategy for filtering out negative samples lacking substantial information by employing a margin, denoted as m .

BC Loss [54] integrates a bias-aware margin into the contrastive loss to alleviate popularity bias. Specifically, the bias-aware margin is learned via a specialized popularity branch, which only utilizes the statistical popularity of users and items to train an additional CF model.

Adapτ [55] proposes to automatically search the temperature of InfoNCE. Moreover, a finegrained temperature is assigned for each user according to their previous loss.

Evaluation Metrics. We apply the all-ranking strategy, in which all items, with the exception of the positive ones present in the training set, are ranked by the collaborative filtering model for each user. An exception is KuaiRec, where the unbiased test set clusters in a small matrix [56]. This unique structure leads to a failure of the all-ranking strategy as the test set is not randomly selected from the whole user-item matrix. Consequently, for KuaiRec, we rank only the 3327 fully exposed items during the testing phase.

C.2 Performance over the MF Backbone

Given that the implementation of augmentation-based methods is tied to the LightGCN architecture, we compare AdvInfoNCE using the Matrix Factorization (MF) backbone against only loss-based methods. As shown in Table 4 and 5, AdvInfoNCE consistently surpasses all collaborative filtering baselines with modified contrastive losses. Moreover, similar to the trend observed with the LightGCN backbone, AdvInfoNCE excels on test sets exhibiting higher distribution shifts, while still preserving remarkable performance on the in-distribution validation set. The superior performance of AdvInfoNCE across both the LightGCN and MF backbones emphasizes its model-agnostic characteristic. We advocate for considering AdvInfoNCE as a standard loss in recommender systems.

C.3 Performance over Extensive Backbones

To validate the generalization ability of AdvInfoNCE, we conducted experiments on additional backbones, including UltraGCN [69] and an adapted version of VGAE [70]. The results in Table 6 indicate that AdvInfoNCE performs excellently across various backbones, which showcases the generalization ability of AdvInfoNCE.

C.4 Performance Comparison with Extensive Baselines

We compare AdvInfoNCE on the LightGCN backbone with extensive baselines on Tencent. The results in Table 7 show that AdvInfoNCE also outperforms almost all the latest debiasing [10, 71] and hard negative mining algorithms [72].

C.5 Training Cost

Let n be the number of items, d be the embedding size, N be the number of negative sampling, M = |O + | be the number of observed interactions, B be the batch size and N b be the number of mini-batches within one batch. In AdvInfoNCE, the similarity calculation for one positive item with N negative items costs O (( N +1) d ) , and the hardness calculation costs O ( Nd ) . The total training costs of one epoch without backward propagation are summarized in Table 8. The training cost of

AdvInfoNCE is a little higher than BPR loss, sharing the same complexity with InfoNCE. In Table 9, we present both the per-epoch and total time costs for each baseline model on the Tencent dataset. As evidenced, augmentation-based contrastive learning (CL) baselines significantly cut down the overall training time, while loss-based CL baselines exhibit a complexity similar to that of InfoNCE. Surprisingly, compared to InfoNCE, AdvInfoNCE introduces only a marginal increase in computational complexity during the training phase.

D Discussion about AdvInfoNCE

D.1 Algorithm

Algorithm 1 depicts the detailed procedure of AdvInfoNCE. Here we uniformly sample N negative items for each observed interaction and multiply a large weighting parameter K in front of each negative item, as a surrogate of the whole negative set N u . Specifically, we adversarially train the hardness δ ( u,i ) j at a fixed interval before reaching the maximum adversarial training epochs E adv . The precise methods for computing the hardness δ ( u,i ) are further discussed in Section D.4.

j

D.2 Effect of the Fine-grained Hardness on KuaiRec

We conduct the same experiments as Section 4.2.1 on KuaiRec, to investigate how the fine-grained hardness affects the out-of-distribution performance.

We plot the average value of p ( j | ( u, i )) across one batch, as depicted in Figure 4a. The figure reveals that AdvInfoNCE learns a skewed negative sampling distribution, mirroring the trend observed in the Tencent dataset. Such a distribution places more emphasis on popular negative items and reduces the difficulty of unpopular negative items, which have a higher probability of being false negatives.

To examine the effect of fine-grained hardness, we conduct experiments with four different hardness learning strategies, including AdvInfoNCE, InfoNCE, InfoNCE-Rand, and AdvInfoNCE-Reverse. AdvInfoNCE-Reverse refers to a strategy where hardness is learned by minimizing, rather than maximizing, the loss function. This inversion results in what we term 'reversed hardness', in contrast to the approach of our AdvInfoNCE method. InfoNCE-Rand denotes the assignment of uniformly random hardness for each negative item. We conduct 5-fold experiments with different random seeds for each strategy and report the mean value with standard error in Figure 4c. As the result shows, AdvInfoNCE yields consistent improvements over the other three different hardness strategies during the training phase. In contrast, the performance of AdvInfoNCE-Reverse drops rapidly as continuously training the reversed hardness. The sustained superior performance of AdvInfoNCE indicates that it effectively promotes the generalization ability of the CF model by automatically distinguishing false negatives and hard negatives.

Figure 4b illustrates the uniform and align loss during the training phase following the initial warm-up epochs. As demonstrated, after the warm-up phase, both InfoNCE and InfoNCE-Rand exhibit a slight increase in align loss, while their uniform loss maintains a stable level. In contrast, AdvInfoNCE significantly improves uniformity at an acceptable cost of increasing align loss. On the other hand, employing reversed hardness (as in AdvInfoNCE-Reverse) appears to have a negative impact on representation uniformity. These findings underscore the importance of fine-grained hardness in AdvInfoNCE, suggesting that AdvInfoNCE learns more generalized representations.

D.3 Effect of the Adversarial Training Epochs on KuaiRec

In this section, we conduct experiments on KuaiRec, where AdvInfoNCE is trained for varying numbers of adversarial epochs. We plot performance metrics (Recall@20 in Figure 5a and NDCG@20 in Figure 5b) on the test set, which represents out-of-distribution data, throughout the training phase. The green stars mark the corresponding endpoint of adversarial training. As illustrated in Figure 5a and 5b, both Recall@20 and NDCG@20 show a proportional trend with the number of adversarial training epochs, up to a certain threshold. However, it is worth noting that in the extreme condition when the number of adversarial training epochs exceeds the threshold, performance on out-of-distribution sharply declines. This indicates a need to strike a balance when determining the appropriate number of adversarial training epochs for AdvInfoNCE.

Algorithm 1 AdvInfoNCE

Input: observed interactions O + , unobserved interactions O -, learning rate of adversarial training lr adv , maximum adversarial training epochs E adv , adversarial training intervals T adv , parameters of the CF model θ , parameters of the hardness evaluation models θ adv , weighting parameter K

Output: θ

Initialize: Initialize θ and θ adv , e ← 1 , e adv ← 1

repeat

Freeze parameters of the hardness evaluation model θ

Randomly sample N negative items from I u for each interaction within a batch

Compute

s

(

u, i

)

,

δ

(

j

with

θ

and

θ

adv adv -

, respectively

Update if

e

θ

L

Adv

(

u, i

)

T

adv

== 0

&

e

adv

E

Freeze parameters of the CF model

Update adv

θ

by maximizing

e

adv

θ

end if

e

e

until

+1

CF model converges

D.4 Hardness Learning Strategy

To accurately evaluate the hardness of each negative instance, we need to establish a mapping from unobserved user-item pairs to their corresponding hardness values, and this mapping mechanism can be diversified. Generally, the hardness learning strategy can be formulated as:

where g θ adv ( u, j ) is a raw hardness score function for the unobserved user-item pair ( u, j ) , and p ( j | ( u, i )) is the probability of sampling the negative instance j , which is calculated by normalizing g θ adv ( u, j ) . In this paper, we proposed two specific mapping methods: embedding-based ( i.e., AdvInfoNCE-embed) mapping and multilayer perceptron-based ( i.e., AdvInfoNCE-mlp) mapping. It should be noted that all the results reported in the main text of this paper are based on the implementation of the AdvInfoNCE-embed version.

AdvInfoNCE-embed. The hardness computation process in AdvInfoNCE-embed follows a similar protocol as CF models. We directly map the index of users and items into its corresponding hardness embedding and calculate the hardness of each user-item pair through a score function. Specifically, this process involves a user hardness encoder ψ θ adv ( · ) : U → R d and an item hardness encoder ϕ θ adv ( · ) : I → R d , where θ adv denotes all the trainable parameters of the hardness learning model. In our experiments, we adopt the same embedding dimension as the CF models for hardness learning. For the score function, we define g θ adv ( u, j ) = ψ θ adv ( u ) ⊤ · ϕ θ adv ( j ) .

AdvInfoNCE-mlp. Unlike AdvInfoNCE-embed, AdvInfoNCE-mlp maps the embeddings of items and users from the CF model into another latent space with two multilayer perceptrons (MLPs) and calculates the hardness on this latent space. By respectively defining the MLPs for users and items as MLP u and MLP v , the score function for hardness calculation is defined as g θ adv ( u, j ) = MLP u ( ψ θ ( u )) ⊤ · MLP v ( ϕ θ ( j )) . In our experiment, we simply employ one-layer MLPs and set the dimension of latent space as four. It's worth noting that this MLP-based implementation of adv

e

adv

+1

u, i

)

L

Adv

(

u,i

)

then

(a) Distribution of hardness

(b) Varying hardness strategies

(c) Alignment & uniformity analysis

0.20

1.2

AdvInfoNCE

Average pGjl(u, i)

0.08

InfoNCE+Rand

1.0

AdvInfoNCE+Reverse

Recall@20

0.15

Loss

0.06

AdvInfoNCE

InfoNCE+Rand

Align

0.8

0.04

0.10

AdvInfoNCE+Reverse

End adversarial training

0.6

0.02

0.05

0.4

0.00

0

20

40

60

80

100

120

0.00

0

20

40

09

80

100

0.2

-4

-3

2

-1

0

Itempopularitydegree

Epochs

UniformLoss

(a) Recall@20

(b) NDCG@20

Recall@20

0.25

Adversarial TrainingEnd at

NDCG@20

0.60

Adversarial TrainingEnd at

AdversarialTrainingEnd at

0.50

0.20

0.40

0.15

Test

Test

0.30

0.10

OD

aOO

0.20

0.05

0.10

0

20

40

60

80

100

0

20

40

60

80

100

Epochs

Epochs

AdvInfoNCE may also be adaptable for handling out-of-distribution tasks in other fields, such as computer vision (CV) and natural language processing (NLP).

As reported in Table 10, both AdvInfoNCE-embed and AdvInfoNCE-mlp yield significant improvements over InfoNCE. Moreover, AdvInfoNCE-embed generally outperforms AdvInfoNCE-mlp.

D.5 The Intuitive Understanding of AdvInfoNCE

In this section, we aim to understand the mechanism of AdvInfoNCE intuitively, from the perspective of false negative identification.

Figure 6 illustrates the changes of the out-of-distribution performance and FN identification rate during the training process on Tencent. Here, the FN identification rate indicates the proportion of false negatives with negative δ j . It can be observed that the out-of-distribution performance exhibits a rising trend along with the FN identification rate. Meanwhile, the out-of-distribution performance of InfoNCE remains relatively low. This indicates that AdvInfoNCE enhances the generalization ability of the CF model by identifying false negatives.

Figure 7 illustrates how AdvInfoNCE adjusts the scores and rankings of sampled negative items, by identifying the false negatives and true negatives. We retrieve the negative items sampled during training. If a sampled negative item appears in the test set, it is labeled as a false negative (FN); otherwise. In Figure 7a and 7b, the leftmost item represents a false negative, while the other two items on the right are negatives. The bar charts in blue and red depict the cosine similarity scores of sampled negative items measured by InfoNCE and AdvInfoNCE respectively. The rankings of sampled negative items are annotated above the bars. The line graph illustrates the hardness δ j computed by AdvInfoNCE, measured on the right axis. It can be observed that when the hardness δ j

0.0200

0.75

FN IdentificationRate

06100

AdvInfoNCE

0.70

0.65

0.0180

R

0.60

20

ion

0.0170

0.55

a

3

ND

C

0.0160

0.50

lent

0.45

0.0150

FN

0.40

0.0140

0.35

0.0130

0.30

2

3

4

5

6

7

8

Adversarial Training Epochs

is negative ( i.e., indicating that the item is identified as a false negative), the cosine similarity score improves. Conversely, if the hardness δ j is positive, the score decreases.

E Hyperparameter Settings

For a fair comparison, we conduct all the experiments in PyTorch with a single Tesla V100-SXM332GB GPU and an Intel(R) Xeon(R) Gold 6248R CPU. We optimize all methods with the Adam optimizer and set the layer numbers of LigntGCN by default at 2, with the embedding size as 64 and the weighting parameter K as 64. We search for hyperparameters within the range provided by the corresponding references. For AdvInfoNCE, we search lr adv in [1e-1, 1e-4], E adv in [1, 30] and T adv in {5, 10, 15, 20}. We adopt the early stop strategy that stops training if Recall@20 on the validation set does not increase for 20 successive evaluations. It's worth noting that AdvInfoNCE inherits the hyperparameter sensitivity property of adversarial learning, therefore it's necessary to choose proper hyperparameters for different datasets. We suggest selecting a suitable adversarial learning rate lr adv first and then increasing the number of adversarial training epochs E adv gradually until AdvInfoNCE reaches a relatively stable performance. We report the effect of changing the number of negative sampling in Table 13, where N is the number of negative sampling.

(a) User 46767

(b) User 54944

0.8

0.6

AdvInfoNCE

1.1921

1.1793

1.5

AdvInfoNCE

1.4195

1.3257

1.5

90

R:10

Cosine Similarity

R:5

1.0

Similarity

1.0

0.4

R:55

0.4

R: 124

R:267

0.5

CosineS

0.2

0.5

0.2

R:5436

R: 4587

R:3807

0.0

R:12970

R:11570

0°0

0.0

R:26007

0.0

-0.7887

0.5

0.2

-0.5607

R: 39641

0.5

0.2

j6543

j29448

-1.0

0.4

J39318 (FN)

j702

j8605

ItemID

ItemID

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn this work, the authors focus on improving the generalization ability of the top-K recommendation model by a proposed principled Adversarial InfoNCE loss (AdvInfoNCE). Existing contrastive learning based methods usually lack considering the tailored inductive bias (such as hard negatives and false negatives) and sufficient theoretical understanding for the generalization ability. The proposed AdvInfoNCE loss could adaptively explore and assign hardness (weight) for each negative instance in an adversarial fashion. The theoretical guarantees and experiments demonstrate the effectiveness of the proposed AdvInfoNCE loss.\n\nSTRENGTHS:\n1.\tThe motivation that adaptively assigns hardness for each negative instance in an adversarial fashion to improve the generalization ability is justified.\n2.\tThe theoretical proof demonstrates the generalization ability of the proposed AdvInfoNCE loss.\n3.\tThe experiments on unbiased datasets and out-of-distribution settings demonstrate the effectiveness of the proposed AdvInfoNCE loss in terms of generalization ability.\n\nWEAKNESSES:\n1.\tIt would be better to add an intuitive example to show the adaptive learning process for hard negatives and false negatives in the min and max stages.\n2.\tIn terms of adaptively learning hardness for each negative instance, it would be better to add some baselines focusing on mining hard negatives or false negatives. \n3.\tIn terms of the generalization ability, it would be better to add some baselines focusing on out-of-distribution. Besides, OOD experiments are also performed on popularity-based distribution shift scenarios, what’s the difference compared with debiasing experiments?\n\nQUESTIONS:\n1.\tCould you please give an intuitive description to show the adaptive learning process for hard negatives and false negatives in the min and max stage ? Especially for hard negatives and false negatives?\n2.\tWhy the corresponding item is identified as a hard negative rather than a general negative when sigma > 0 ?\n3.\tIn terms of adaptively learning hardness for each negative instance, could you please add some baselines focusing on mining hard negatives or false negatives [1,2] ?\n4.\tIn terms of the generalization ability, could you please add some baselines focusing on out-of-distribution [3,4] ?\n\n[1] Chen, Jin, et al. \"Cache-Augmented Inbatch Importance Resampling for Training Recommender Retriever.\" In NIPS, 2022.\n[2] Chen, Jin, et al. \"Learning Recommenders for Implicit Feedback with Importance Resampling.\" In WWW, 2022.\n[3] Hongyi Wen, et al. \"Distributionally-robust Recommendations for Improving Worst-case User Experience\". In WWW, 2022.\n[4] An Zhang, et al. \"Invariant Collaborative Filtering to Popularity Distribution Shift\". In WWW, 2023.\n\nLIMITATIONS:\nThe authors adequately point out the limitations and there is no negative societal impact of their work.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-29"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper is on collaborative filtering (CF) enhanced by contrastive learning (CL). The authors point out that the adoption of CL into CF is suboptimal due to challenges such as the issue of out-of-distribution, the risk of false negatives, and the nature of top-K evaluation. They also note that current CL-based CF methods lack consideration of the tailored inductive bias for CF and have limited theoretical understanding of their generalization ability.\n\nTo address these limitations, the authors propose a principled Adversarial InfoNCE loss for CF that focuses on mining hard negatives and distinguishing false negatives from the vast unlabeled user-item interactions. The proposed method is compared with several state-of-the-art contrastive learning-based CF methods on both unbiased and synthetic datasets. The experiments show that the proposed method outperforms the baselines in terms of accuracy and robustness, demonstrating its potential for improving the performance of recommender systems.\n\nSTRENGTHS:\ni) The paper proposes a novel approach to adaptive contrastive learning in collaborative filtering by adopting an adversarial approach. The proposed Adversarial InfoNCE loss addresses the limitations of existing methods and allows for the fine-grained assignment of hardness to each negative user-item pair, which enhances the recommender's generalization ability and empowers top-K recommendations via informative negative sampling.\n\nii) The paper provides innovative theoretical insights into the benefits of adversarial hardness learning. It shows that the proposed hardness scores are correlated with the out-of-distribution problem of recommendation, and can thereby enhance the generalization ability of recommenders.\n\niii) The study of hardness gives an in-depth analysis on the learned hardness scores, which uncovers the importance of learning correct hardness for the massive negative samples without observations.\n\nWEAKNESSES:\ni) The proposed method can be viewed as an adaptive SSL method for recommendation [1-2]. Also, it can be a learnable negative sampling approach [3-4]. Literature review (baseline comparison would do better) should be done for these two very relevant research line.\n\nii) Though a brief training cost experiment is given in the appendix. I would expect more detailed efficiency experiments or analysis to support the claim that the proposed AdvInfoNCE can serve as a foundation loss for future CF researches, as the proposed approach utilizes the adversarial training method.\n\n[1] Graph contrastive learning with adaptive augmentation\n\n[2] Automated Self-Supervised Learning for Recommendation\n\n[3] Personalized Ranking with Importance Sampling\n\n[4] AHP: Learning to Negative Sample for Hyperedge Prediction\n\nQUESTIONS:\nIt would be better for the authors to clarify the relations between the proposed method and the related research lines I mentioned above. And I would expect the authors to give a more detailed efficiency analysis or experiments.\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-03"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies contrastive learning (CL) in collaborative filtering (CF) for top-k recommendation. In particular, it focuses on the CF-tailored challenges for CL, and then presents adversarial infoNCE (AdvInfoNCE) loss. This loss dynamically assigns hardness to negative instances and incorporates a fine-grained ranking criterion to improve the CF recommender’s generalization ability. Furthermore, this paper highlights theoretical properties of AdvInfoNCE. Experiments on both synthetic and real-world datasets are done to show the effectiveness of this loss, especially in out-of-distribution scenarios.\n\nSTRENGTHS:\n1.\tThe motivation of considering fine-grained hardness-aware ranking criteria is clear and reasonable. Technically, it is insightful and novel to transfer the distinguish between false and hard negatives into a margin learning problem.\n2.\tAs proved in Sec 3.3, the adversarial training framework of AdvInfoNCE is natural and somehow equivalent to solve a distributionally robust optimization (DRO) problem. I appreciate this theoretical guarantee that can endow a AdvInfoNCE-trained CF models with better generalization ability.\n3.\tThe experiments are done on four datasets with two CF base models, which are sufficient to demonstrate the effectiveness of the proposed loss. Moreover, the selected baselines are quite new, including some recent and strong works.\n4.\tThis proposed loss seems to be a general loss that can be applied in general recommendation models.\n\nWEAKNESSES:\n1.\tThe hardness is denoted as $\\delta$ in Sec 3.2, while related to $p(j|(u,i))$. This is not explained clearly. More clarifications are needed here.\n2.\tIn Line 214, the limitation is stated as the ‘training instability’, which is not empirically shown in the experiments, such as indicated by ‘training loss variance’. It would be better to discuss more about this instability.\n3.\tAlthough the proof of Theorem 3.1 seems correct, the DL-divergence In Line 195 misses a minus sign. Please double check and fix it.\n\nQUESTIONS:\n1.\tThe hardness is denoted as $\\delta_{j}^{(u)}$ first and then $\\delta_{j}^{(u,i)}$, which seems confusing. Is it related to a specific user $u$ or a user-item pair $(u,i)$?\n\nLIMITATIONS:\nPlease refer to the weaknesses and questions.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-05"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nCurrent losses for collaborative filtering struggle to handle the issue of unobserved user-item pairs.  Typically, the approach is to treat unseen pairs as negatives while seen pairs as positives, but this is somewhat problematic because unseen pairs could just be unobserved positives.  The authors propose an adversarial InfoNCE-based loss that claims to address this problem in collaborative filtering.  This loss works by minimizing the InfoNCE loss given that we have adversarially learned weights for the negative samples.  They give a theorem that shows this proposed loss can be interpreted as a distributionally robust optimization problem.  Finally, they give some empirical results showing the efficacy of their method over other CF baselines.\n\nSTRENGTHS:\n1.  This paper provides a method that appears to give solid gains across various collaborative filtering tasks.\n\n2.  They do make an attempt to try to interpret what the \\delta (adversarially learned parameters) in their method are doing.\n\n3.  The graphs for the results and the pictures explaining the methods are good and helped me with understanding. \n\n4.  The authors try to tackle a hard problem: it is hard to think about how to best utilize unseen pairs in collaborative filtering due to their unseen nature.\n\n5.  The method is fairly novel as a nontrivial extension to InfoNCE to the collaborative filtering setting via adversarial training.\n\nWEAKNESSES:\n1.  I don't understand the role of the adversarial variables in the algorithm.  In figure 2a there was some attempt at interpreting the values of the deltas, but it still does not make sense.  I hope the authors can explain the role of the variables better.\n\n2.  I think the terminology of \"hard negative\" is confusing, because typically in the self-supervised learning literature people call negatives that are near the decision boundary \"hard negatives\".  However, in this paper hard negatives are the opposite: negatives that are far away from the positives pair.  I suggest rewriting the paper to make the message more clear.\n\n3.  In general, the paper is hard to understand and has many grammatical errors.  The authors should fix this to make the paper easier to read.\n\n4.  From what I can understand, the loss should simply make the deltas as large as possible (positive) to increase the loss value given that there are no constraints (aside from the number of epochs trained, I guess).  I have concerns about the usefulness and stability of this algorithm.\n\n5.  In theorem 3.1, we assume that the deltas imply a probability distribution.  Is this true?  As we train do the deltas for a user i add up to |N_i|?  I'm not sure there is a constraint there enforcing this.  In that case I'm not sure the theory applies to the algorithm as-is.\n\nQUESTIONS:\nMy questions are in the weaknesses.\n\nLIMITATIONS:\nSeems to be sufficient.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-05"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a principled AdvInfoNCE loss for CF methods to improve generalization ability. It utilizes a fine-grained hardness-aware ranking criterion to assign weights for unobserved user-item interactions. In this way, it can enable better distinction between different negative, thus mitigating the inductive bias in CF-based methods. It provides theoretical proof of the effectiveness of AdvInfoNCE loss and the experimental results compared with other popular loss used in recommenders look promising.\n\nSTRENGTHS:\nIt is well-written and easy to follow.  \nGood motivation of improving the generalizability of CF-based methods.  \nIt provides thereotical guarantees for the loss design and conducts comprehensive analysis on the effectiveness of its method.  \nExperimental results compared with other popular functions adopted in CF models look promising.  \nCode is open.\n\nWEAKNESSES:\nExperiments can be more extensive. The results on MF and LightGCN look promising. But I think it would be more convincing if the authors can consider more CF-based backbones like MultVAE [1] and DGCF [2].  \n\n[1] Liang et al. Variational Autoencoders for Collaborative Filtering. 2018 WWW.  \n[2] Wang et al. Disentangled Graph Collaborative Filtering. 2020 SIGIR.\n\nQUESTIONS:\nThis paper proposes a novel constrastive loss for fine-grained ranking of negative samples to improve the generalizability of CF-based models, which is a significant contribution. It provides comprehensive theoretical analysis and experiments look promising. I just have minor concerns about the technical details.  \n- Do you attempt other similarty measurements for calculating the hardness and whether the choice of similarity calculation matters?  \n- What is the rate of negative samples over all the unobserved interactions used in your method and is there any  result of using different negative sampling rate?\n\nLIMITATIONS:\nMore CF-based backbones can be considered.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-08"}