Table of Contents
Fetching ...

Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering

Peijie Sun, Le Wu, Kun Zhang, Xiangzhi Chen, Meng Wang

TL;DR

This paper focuses on developing two unique supervised contrastive loss functions that effectively combine supervision signals with contrastive loss, and substitutes the contrastive loss function in SGL with a novel loss function, showing marked performance improvement.

Abstract

While effective in recommendation tasks, collaborative filtering (CF) techniques face the challenge of data sparsity. Researchers have begun leveraging contrastive learning to introduce additional self-supervised signals to address this. However, this approach often unintentionally distances the target user/item from their collaborative neighbors, limiting its efficacy. In response, we propose a solution that treats the collaborative neighbors of the anchor node as positive samples within the final objective loss function. This paper focuses on developing two unique supervised contrastive loss functions that effectively combine supervision signals with contrastive loss. We analyze our proposed loss functions through the gradient lens, demonstrating that different positive samples simultaneously influence updating the anchor node's embeddings. These samples' impact depends on their similarities to the anchor node and the negative samples. Using the graph-based collaborative filtering model as our backbone and following the same data augmentation methods as the existing contrastive learning model SGL, we effectively enhance the performance of the recommendation model. Our proposed Neighborhood-Enhanced Supervised Contrastive Loss (NESCL) model substitutes the contrastive loss function in SGL with our novel loss function, showing marked performance improvement. On three real-world datasets, Yelp2018, Gowalla, and Amazon-Book, our model surpasses the original SGL by 10.09%, 7.09%, and 35.36% on NDCG@20, respectively.

Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering

TL;DR

This paper focuses on developing two unique supervised contrastive loss functions that effectively combine supervision signals with contrastive loss, and substitutes the contrastive loss function in SGL with a novel loss function, showing marked performance improvement.

Abstract

While effective in recommendation tasks, collaborative filtering (CF) techniques face the challenge of data sparsity. Researchers have begun leveraging contrastive learning to introduce additional self-supervised signals to address this. However, this approach often unintentionally distances the target user/item from their collaborative neighbors, limiting its efficacy. In response, we propose a solution that treats the collaborative neighbors of the anchor node as positive samples within the final objective loss function. This paper focuses on developing two unique supervised contrastive loss functions that effectively combine supervision signals with contrastive loss. We analyze our proposed loss functions through the gradient lens, demonstrating that different positive samples simultaneously influence updating the anchor node's embeddings. These samples' impact depends on their similarities to the anchor node and the negative samples. Using the graph-based collaborative filtering model as our backbone and following the same data augmentation methods as the existing contrastive learning model SGL, we effectively enhance the performance of the recommendation model. Our proposed Neighborhood-Enhanced Supervised Contrastive Loss (NESCL) model substitutes the contrastive loss function in SGL with our novel loss function, showing marked performance improvement. On three real-world datasets, Yelp2018, Gowalla, and Amazon-Book, our model surpasses the original SGL by 10.09%, 7.09%, and 35.36% on NDCG@20, respectively.
Paper Structure (35 sections, 39 equations, 3 figures, 10 tables)

This paper contains 35 sections, 39 equations, 3 figures, 10 tables.

Figures (3)

  • Figure 1: We random select an item $i$ as the anchor node. The node $k$ is $i$'s nearest neighbor, which is found by the ItemKNN algorithm, and node $a$ has interacted with item $i$'.
  • Figure 2: The overall framework for utilizing our proposed Neighborhood-Enhanced Supervised Contrastive Loss (NESCL). There are four parts, A) It is used to calculate the user-user similarity matrix and item-item similarity matrix based on the user-item interacted matrix $\mathbf{R}$. B) It denotes how to get the two representation matrix $\mathbf{H}'\in\mathbb{R}^{(|\mathcal{U}|+|\mathcal{V}|)\times D}$ and augmented representations $\mathbf{H}"\in\mathbb{R}^{(|\mathcal{U}|+|\mathcal{V}|)\times D}$ of all users and item. The $\mathcal{G}'$ and $\mathcal{G}"$ denote the two augmented graphs, respectively. C) For any anchor node(item $i$), it is necessary to collect its nearest neighbors $\mathcal{S}_i$ based on the item-item similarity matrix and its interacted neighbors based on the user-item interacted matrix. D) Before calculating the supervised collaborative contrastive loss functions $\mathcal{L}^{in}_{NESCL}$ or $\mathcal{L}^{out}_{NESCL}$, we should also index the representations of all users and items from the representation matrix. As the nearest neighbors and interacted neighbors are very clear in this figure, we highlight the contrastive view positive sample of the anchor node in this figure.
  • Figure 3: Recall@20 and NDCG@20 on three real-world datasets with different temperature $\tau$ values.