Heterogeneous Graph Contrastive Learning for Recommendation

Mengru Chen, Chao Huang, Lianghao Xia, Wei Wei, Yong Xu, Ronghua Luo

Abstract

Recommender systems often struggle with data sparsity and the uniform treatment of heterogeneous side information. We present Heterogeneous Graph Contrastive Learning (HGCL), a framework that leverages a cross-view meta-network to personalize the integration of social and item-dependency data. By combining adaptive knowledge transfer with self-supervised contrastive learning, HGCL achieves significant performance gains on sparse real-world datasets like Yelp, Ciao, and Epinions, particularly in cold-start scenarios.

Introduction

Graph Neural Networks (GNNs) have become the standard for modeling user-item relationships. However, they face two primary challenges: data sparsity and the "one-size-fits-all" problem. In real-world scenarios, users interact with only a fraction of items, making GNNs "label-hungry." Furthermore, side information—such as social ties or item categories—is often treated uniformly across all users. In reality, the influence of social circles or item attributes varies significantly between individuals. HGCL addresses these issues by incorporating diverse side information through a personalized lens.

The HGCL Framework

HGCL introduces a three-pronged architecture designed to extract and align knowledge from multiple relational views.

Architecture of the HGCL framework, illustrating the flow from heterogeneous graph relation learning to personalized knowledge transfer and contrastive optimization.

Heterogeneous Graph Relation Learning

The model constructs three distinct graph views: User-Item (interactions), User-User (social links), and Item-Item (knowledge/categories). A lightweight Graph Convolutional Network (GCN) encodes these relationships into embeddings, capturing the unique structural properties of each view.

Cross-View Meta Network

At the heart of HGCL is the meta-network, which extracts "meta-knowledge" from auxiliary views. Instead of a static fusion, it generates personalized transformation matrices for every user and item. This allows the model to adaptively transfer knowledge from social or item-dependency views to the main interaction view based on individual characteristics. To maintain efficiency, these matrices are optimized using low-rank decomposition.

Contrastive Learning Augmentation

To combat sparsity, HGCL employs self-supervised contrastive learning. It treats personalized auxiliary views as augmentations of the main interaction view. By maximizing the agreement between these views using an InfoNCE loss, the model learns robust representations even when explicit interaction labels are scarce.

Experimental Setup

The framework was evaluated on three large-scale datasets characterized by extreme sparsity (over 99.9%):

  • Ciao & Epinions: Online review systems featuring user-item ratings and explicit trust relationships.
  • Yelp: A massive dataset containing business reviews, social relations, and business attributes like categories and locations.

Performance and Sparsity Resilience

HGCL consistently outperformed state-of-the-art baselines, including NGCF, KGAT, and MHCN. On the Ciao dataset, it achieved a 7.3% improvement in NDCG@10 over the strongest baseline.

Performance comparison on the Yelp dataset (HR@10) across different interaction densities, demonstrating HGCL's resilience to data sparsity.

A key finding is the model's resilience to data sparsity. In "cold-start" scenarios—where users have very few interactions—HGCL's performance lead widened compared to other models. This confirms that the contrastive alignment of semantic views effectively compensates for missing interaction data. Ablation studies further showed that removing the meta-network led to significant performance drops, validating the importance of personalized knowledge transfer.

Conclusion and Future Work

HGCL demonstrates that side information is most effective when filtered through a personalized lens. While the architecture is more complex than standard GNNs, low-rank decomposition helps manage the computational overhead. Future research may explore disentangled representations to further separate genuine user interests from external social influences, potentially refining recommendation logic in even noisier environments.

Summary updated

Abstract

Graph Neural Networks (GNNs) have become powerful tools in modeling graph-structured data in recommender systems. However, real-life recommendation scenarios usually involve heterogeneous relationships (e.g., social-aware user influence, knowledge-aware item dependency) which contains fruitful information to enhance the user preference learning. In this paper, we study the problem of heterogeneous graph-enhanced relational learning for recommendation. Recently, contrastive self-supervised learning has become successful in recommendation. In light of this, we propose a Heterogeneous Graph Contrastive Learning (HGCL), which is able to incorporate heterogeneous relational semantics into the user-item interaction modeling with contrastive learning-enhanced knowledge transfer across different views. However, the influence of heterogeneous side information on interactions may vary by users and items. To move this idea forward, we enhance our heterogeneous graph contrastive learning with meta networks to allow the personalized knowledge transformer with adaptive contrastive augmentation. The experimental results on three real-world datasets demonstrate the superiority of HGCL over state-of-the-art recommendation methods. Through ablation study, key components in HGCL method are validated to benefit the recommendation performance improvement. The source code of the model implementation is available at the link https://github.com/HKUDS/HGCL.
BibTeX
@inproceedings{chen2023heterogeneous,
  author = {Mengru Chen and Chao Huang and Lianghao Xia and Wei Wei and Yong Xu and Ronghua Luo},
  title = {{Heterogeneous Graph Contrastive Learning for Recommendation}},
  booktitle = {WSDM},
  year = {2023},
  doi = {10.1145/3539597.3570484},
}
Figure