Source-linked AI summary

Improving Graph Collaborative Filtering with Neighborhood-enriched Contrastive Learning

Zihan Lin, Changxin Tian, Yupeng Hou, Wayne Xin Zhao

arXiv:2202.06200v2cs.IRcs.AI

TL;DR

Graph collaborative filtering contrastive methods often use randomly sampled pairs, overlooking neighboring relations among users and items. NCL incorporates structural and semantic neighbors into contrastive objectives, and experiments report consistent gains over competitive baselines on five public datasets.

  • Problem

    Existing contrastive learning methods for graph collaborative filtering typically construct pairs by random sampling, neglecting neighboring relations among users or items.

  • Method

    NCL is a model-agnostic framework that uses GNN-layer representations for structural neighbors and prototypes derived from clustered embeddings for semantic neighbors.

  • Results

    NCL is consistently better than competitive GNN and contrastive learning-based recommendation baselines across five public datasets.

  • Takeaways & Limitations

    Representative embeddings for structural and semantic neighbors allow contrastive learning between each node and corresponding neighbor representations, improving algorithm efficiency.

  • Takeaways & Limitations

    Future work will extend NCL to other recommendation tasks and develop a more unified formulation for different kinds of neighbors.

Abstract

from arXiv · show

Recently, graph collaborative filtering methods have been proposed as an effective recommendation approach, which can capture users' preference over items by modeling the user-item interaction graphs. In order to reduce the influence of data sparsity, contrastive learning is adopted in graph collaborative filtering for enhancing the performance. However, these methods typically construct the contrastive pairs by random sampling, which neglect the neighboring relations among users (or items) and fail to fully exploit the potential of contrastive learning for recommendation. To tackle the above issue, we propose a novel contrastive learning approach, named Neighborhood-enriched Contrastive Learning, named NCL, which explicitly incorporates the potential neighbors into contrastive pairs. Specifically, we introduce the neighbors of a user (or an item) from graph structure and semantic space respectively. For the structural neighbors on the interaction graph, we develop a novel structure-contrastive objective that regards users (or items) and their structural neighbors as positive contrastive pairs. In implementation, the representations of users (or items) and neighbors correspond to the outputs of different GNN layers. Furthermore, to excavate the potential neighbor relation in semantic space, we assume that users with similar representations are within the semantic neighborhood, and incorporate these semantic neighbors into the prototype-contrastive objective. The proposed NCL can be optimized with EM algorithm and generalized to apply to graph collaborative filtering methods. Extensive experiments on five public datasets demonstrate the effectiveness of the proposed NCL, notably with 26% and 17% performance gain over a competitive graph collaborative filtering base model on the Yelp and Amazon-book datasets respectively. Our code is available at: https://github.com/RUCAIBox/NCL.

1 INTRODUCTION

Graph collaborative filtering uses interaction graphs to learn user and item representations, but sparse data and unmodeled high-order or similarity relations limit existing methods. NCL addresses these issues by incorporating structural and semantic neighbors into efficient node-level contrastive learning.

  • Graph collaborative filtering applies GNNs to user-item interaction graphs to learn representations for recommendation.
  • Existing methods face sparse or noisy interactions and cannot explicitly exploit high-order relations or user and item similarity.
  • NCL defines enriched neighborhoods through structural neighbors connected by high-order paths and semantic neighbors that may not be directly reachable on graphs.
  • NCL is a model-agnostic framework that builds contrastive objectives from structural and semantic neighbors while using representative embeddings to reduce pairwise computation.

2 PRELIMINARY

Graph collaborative filtering represents implicit user-item feedback as a bipartite interaction graph and uses GNN propagation to encode neighborhood information. Iterative aggregation produces layer-specific node representations, which are summarized for recommendation.

  • Collaborative filtering predicts relevant items from an implicit-feedback matrix whose entries indicate whether user-item interactions exist.
  • GNN-based collaborative filtering organizes users and items as nodes in a bipartite graph, with edges representing observed interactions.
  • Each GNN propagation layer aggregates representations from a user’s graph neighbors to generate the next-layer representation.
  • After l iterative propagations, the representation z^(l)_u encodes information from l-hop neighbors.
  • A readout function summarizes representations across layers to obtain the final user representation, with item representations obtained analogously.

3 METHODOLOGY

NCL augments graph collaborative filtering with structural and semantic neighborhood-aware contrastive objectives, while using representative embeddings to improve efficiency. It jointly trains these objectives with the ranking loss and applies prototype learning to capture semantic relations.

  • Graph Collaborative Filtering Backbone: The backbone uses GNN propagation over the interaction graph and combines representations from all layers into final user and item embeddings.The final embeddings support recommendation through inner-product prediction.
  • Graph Collaborative Filtering Backbone: BPR loss trains the model to rank observed user-item interactions above sampled unobserved items.The pairwise training data contains an observed item and a sampled item the user has not interacted with.
  • Contrastive Learning with Structural Neighbors: Structural contrastive learning treats a node and its homogeneous structural-neighbor representation as a positive pair using even GNN-layer outputs.Even propagation steps on the bipartite interaction graph aggregate information from same-type users or items.
  • Contrastive Learning with Semantic Neighbors: Prototype contrastive learning represents semantic neighborhoods with cluster prototypes learned from similar user or item embeddings.The objective contrasts users or items with their corresponding prototypes to capture similar preferences or characteristics.
  • Overall Training and Discussion: The ranking loss and two contrastive losses are jointly optimized with multi-task learning, while representative neighbor embeddings reduce pairwise computation.The method is reported as more efficient than approaches requiring additional graph construction or neighborhood iteration.

4 EXPERIMENTS

The experiments evaluate NCL through extensive experiments and detailed analysis to verify its effectiveness.

  • NCL is evaluated through extensive experiments.
  • The evaluation includes detailed analysis results.
  • The experiments are conducted to verify NCL's effectiveness.

4.1 Experimental Setup

The evaluation uses five public datasets spanning different domains, scales, and densities, with standardized data splits, metrics, baselines, and implementation settings.

  • Dataset and protocol: Five public datasets cover different domains, scales, and densities for evaluation.The datasets are ML-1M, Yelp, Amazon Books, Gowalla, and Alibaba-iFashion.
  • Dataset and protocol: Yelp and Amazon Books users and items with fewer than 15 interactions are filtered out.Each dataset uses 80% training, 10% validation, and 10% testing interactions.
  • Baselines: The baselines include matrix-factorization, neural, graph collaborative filtering, and self-supervised methods.The compared methods include BPRMF, NeuMF, FISM, NGCF, Multi-GCCF, DGCF, LightGCN, and SGL-ED.
  • Evaluation metrics: Recall@N and NDCG@N are measured at N = 10, 20, and 50 using full ranking over uninteracted candidate items.
  • Implementation: All methods are implemented with RecBole and optimized with Adam under a shared embedding size of 64 and early stopping.The batch size is 4,096, parameters use Xavier initialization, and patience is 10 epochs.

4.2 Overall Performance

NCL is compared with recommendation baselines across five datasets, where the reported results show consistent gains and stronger improvements at smaller recommendation cutoffs.

  • Baseline comparison: GNN-based methods outperform traditional methods, while LightGCN performs best among graph collaborative filtering baselines on most datasets.Multi-GCCF performs worse than NGCF on ML-1M, which the authors associate with dense projection graphs.
  • Self-supervised comparison: SGL consistently outperforms other supervised methods on the five datasets.The passage attributes this observation to the effectiveness of contrastive learning for recommendation.
  • Overall comparison: NCL consistently performs better than the compared baselines.
  • NCL results: NCL's improvement is greater at top 10 ranks than at top 50 ranks.The authors interpret this pattern as NCL ranking relevant items higher.
  • NCL results: NCL yields more improvement on smaller datasets such as ML-1M and Yelp.The authors speculate that these datasets have sparser interactions and fewer neighbors for contrastive-pair construction.

4.3 Further Analysis of NCL

Further analyses show that NCL benefits from modeling both structural and semantic neighbors, improves recommendations especially for sparse users, and remains effective across structural-neighbor choices, parameters, and GNN backbones.

  • Neighbor ablation: Removing either structural or semantic neighbors decreases NCL performance, while both ablations still outperform LightGCN on Recall@10.The two neighbor types complement each other in graph collaborative filtering.
  • Impact of Data Sparsity Levels: NCL consistently outperforms LightGCN across five user sparsity groups, with larger gains as interaction counts decrease.The groups contain equal total numbers of interactions, and G1 has the lowest average interaction count.
  • Structural-neighbor hops: One-hop, two-hop, and three-hop structural-neighbor variants perform similarly or better than LightGCN, with the first even layer achieving the best results.One-hop neighbors appear sufficient, offering a trade-off between effectiveness and efficiency.
  • Hyperparameter analysis: Setting α around 1 improves NCL performance on both datasets, while performance remains consistently better than LightGCN across α values.The coefficient balances the structural-neighborhood and other losses.
  • Hyperparameter analysis: Large τ values harm performance, and sparser Yelp data favors a smaller temperature; prototype counts around 1000 achieve the best reported results.Removing prototypes significantly decreases performance, indicating that semantic neighbors are useful and prototypes mitigate structural-neighbor noise.
  • Other GNN backbones: NCL consistently improves NGCF, DGCF, and LightGCN, with smaller gains on NGCF and DGCF than on LightGCN.The authors associate LightGCN’s stronger improvement with its shared representation space across GNN layers.

5 RELATED WORK

Related work spans graph-based collaborative filtering, which learns node representations from interaction graphs, and contrastive learning, including node-level and graph-level approaches applied across data domains.

  • Graph-based collaborative filtering: Graph-based collaborative filtering organizes interaction data as graphs and learns node representations from graph structure information.GNN-based methods such as NGCF and LightGCN leverage high-order interaction-graph relations.
  • Contrastive learning: Contrastive learning has been applied to computer vision, NLP, graph data mining, and recommender systems.Graph contrastive learning studies include both node-level and graph-level contrastive learning.

6 CONCLUSION AND FUTURE WORK

NCL explicitly captures potential user and item relatedness from graph structure and semantic space in contrastive learning for graph collaborative filtering, with effectiveness demonstrated on five public datasets.

  • Conclusion: NCL combines structure-contrastive learning over graph neighbors with prototype-contrastive learning over semantic neighbors.Semantic neighbors are represented through prototypes obtained by clustering user and item embeddings.
  • Conclusion: Extensive experiments on five public datasets demonstrate the effectiveness of NCL.
  • Future work: Future work will extend NCL to recommendation tasks such as sequential recommendation and seek a more unified formulation for different neighbor types.

A PSEUDO-CODE FOR NCL

The pseudo-code initializes user and item embeddings, iterates until convergence with an E-step, loads minibatches, and outputs user and item representations.

  • Output: After optimization, the algorithm outputs user and item representations.
  • Initialization and optimization: NCL initializes learnable user and item embeddings before entering an iterative optimization loop.
  • Optimization loop: The algorithm uses an E-step within a while-not-convergence loop and processes minibatch data from a dataloader.

B CASE STUDY ON SELECTED NEIGHBORS

The case study compares structural and semantic neighbors for a randomly selected item on Alibaba-iFashion, alongside randomly sampled items. Neighbor-category counts are normalized and visualized in Fig. 7.

  • A central item is randomly selected from the Alibaba-iFashion dataset for neighbor analysis.
  • Structural neighbors and semantic neighbors are extracted separately and their item counts are tallied by category.
  • The category counts are normalized and compared with randomly sampled items in Fig. 7.
Loading 2202.06200v2…