HGCVAE: Integrating Generative and Contrastive Learning for Heterogeneous Graph Learning

Yulan Hu, Zhirui Yang, Sheng Ouyang, Junchen Wan, Fuzheng Zhang, Zhongyuan Wang, Yong Liu · OpenReview

Abstract

Generative self-supervised learning (SSL) has exhibited significant potential and garnered increasing interest in graph learning. In this study, we aim to explore the problem of generative SSL in the context of heterogeneous graph learning (HGL). The previous SSL approaches for heterogeneous graphs have primarily relied on contrastive learning, necessitating the design of complex views to capture heterogeneity. However, existing generative SSL methods have not fully leveraged the capabilities of generative models to address the challenges of HGL. In this paper, we present HGCVAE, a novel contrastive variational graph auto-encoder that liberates HGL from the burden of intricate heterogeneity capturing. Instead of focusing on complicated heterogeneity, HGCVAE harnesses the full potential of generative SSL. HGCVAE innovatively consolidates contrastive learning with generative SSL, introducing several key innovations. Firstly, we employ a progressive mechanism to generate high-quality hard negative samples for contrastive learning, utilizing the power of variational inference. Additionally, we present a dynamic mask strategy to ensure effective and stable learning. Moreover, we propose an enhanced scaled cosine error as the criterion for better attribute reconstruction. As an initial step in combining generative and contrastive SSL, HGCVAE achieves remarkable results compared to various state-of-the-art baselines, confirming its superiority.

Introduction

Most real-world data is structured as a Heterogeneous Information Network (HIN), containing various types of nodes and edges (e.g., a citation graph with authors, papers, and venues). Learning from these networks is challenging due to their inherent complexity and the need to capture diverse semantic relationships.

Current self-supervised learning (SSL) approaches for HINs generally fall into two categories:

  1. Contrastive Learning: These models learn by comparing "similar" views of data against "dissimilar" ones. However, creating effective views for complex graphs often requires manual, domain-specific "meta-paths."
  2. Generative Learning: Models like Graph Autoencoders (GAEs) reconstruct the input graph from a compressed latent representation. While they capture implicit knowledge well, they often fail to refine the latent space to be sufficiently discriminative for downstream tasks.

HGVAE (Heterogeneous Graph Variational Autoencoder) addresses these limitations by asking: Can we use the generative power of a model to improve the contrastive learning process?

Methods

The HGVAE architecture is built on three main pillars designed to bridge the gap between generative and contrastive learning:

Overview of the HGVAE architecture, illustrating the integration of generative and contrastive learning components.

1. The Backbone (VGAE + HAN)

HGVAE uses a Variational Graph Autoencoder (VGAE) as its base, with a Heterogeneous Graph Attention Network (HAN) acting as both the encoder and decoder. This allows the model to handle different node types and importance levels via attention mechanisms, effectively capturing the heterogeneity of the input graph.

2. Progressive Negative Sample Generation (PNSG)

A key innovation of HGVAE is using Variational Inference to "dream up" high-quality, difficult negative samples. Contrastive learning relies on "hard" negatives—samples that are semantically close to the target but belong to different categories—to learn robust features. HGVAE employs a progressive mechanism: early in training, it uses simple dropout-corrupted samples; as the model matures, it generates synthetic negatives by slightly shifting the mean of the learned latent distribution.

3. Enhanced Scaled Cosine Error (ESCE)

Standard reconstruction often uses Mean Squared Error (MSE), which can be sensitive to outliers. HGVAE introduces ESCE, inspired by Focal Loss, which forces the model to prioritize "hard-to-reconstruct" nodes during training, leading to more precise attribute reconstruction.

Experimental Setup

The model was evaluated on four widely-used citation and knowledge graph benchmarks:

  • DBLP: A computer science bibliography network (Author, Paper, Term, Venue).
  • ACM: A citation network (Paper, Author, Subject).
  • Freebase: A general knowledge graph (Book, Film, Music, etc.).
  • AMiner: A large-scale citation network (Paper, Author, Relationship).

Key Results

HGVAE was compared against 11 state-of-the-art (SOTA) baselines, including popular models like HeCo and HGMAE.

Node Classification

HGVAE achieved the best performance in 18 out of 24 experimental setups across varying labeled data splits (20, 40, and 60 per class). As shown in the results table, HGVAE consistently outperforms both traditional network embedding and recent contrastive/generative SSL methods.

Node classification performance (Mi-F1 and Ma-F1) across four benchmark datasets compared to state-of-the-art baselines.

Node Clustering

In clustering tasks, HGVAE secured the best results in 6 out of 8 experiments (using NMI and ARI metrics). This demonstrates that the learned representations are naturally grouped by semantic category even in the absence of labels. Visualization via t-SNE plots further confirms that HGVAE produces tighter, more distinct clusters compared to other generative models like GraphMAE.

Conclusion

HGVAE demonstrates that focusing on refining latent representations through generative-driven contrastive learning can yield superior results with less manual engineering than traditional meta-path-heavy strategies. While the model currently relies on pre-defined meta-paths and specific hyperparameter tuning for negative sample generation, it sets a new benchmark for self-supervised learning on heterogeneous graphs. Future work will explore automated meta-path discovery and adaptive mechanisms for synthetic sample generation to enhance scalability and robustness.

Summary updated

Abstract

Generative self-supervised learning (SSL) has exhibited significant potential and garnered increasing interest in graph learning. In this study, we aim to explore the problem of generative SSL in the context of heterogeneous graph learning (HGL). The previous SSL approaches for heterogeneous graphs have primarily relied on contrastive learning, necessitating the design of complex views to capture heterogeneity. However, existing generative SSL methods have not fully leveraged the capabilities of generative models to address the challenges of HGL. In this paper, we present HGCVAE, a novel contrastive variational graph auto-encoder that liberates HGL from the burden of intricate heterogeneity capturing. Instead of focusing on complicated heterogeneity, HGCVAE harnesses the full potential of generative SSL. HGCVAE innovatively consolidates contrastive learning with generative SSL, introducing several key innovations. Firstly, we employ a progressive mechanism to generate high-quality hard negative samples for contrastive learning, utilizing the power of variational inference. Additionally, we present a dynamic mask strategy to ensure effective and stable learning. Moreover, we propose an enhanced scaled cosine error as the criterion for better attribute reconstruction. As an initial step in combining generative and contrastive SSL, HGCVAE achieves remarkable results compared to various state-of-the-art baselines, confirming its superiority.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Freebase · node clusteringHGVAENMI22.52Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
Freebase · node clusteringHGVAEARI23.1Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
ACM · node clusteringHGVAENMI67.26Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
ACM · node clusteringHGVAEARI72.09Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
AMiner · node clusteringHGVAENMI41.38Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
AMiner · node clusteringHGVAEARI56.00Node clustering; results averaged over five experiment repeats.
Source quote
L211: HGVAE\xspace │ 75.92 │ 80.99 │ 22.52 │ 23.1 │ 67.26 │ 72.09 │ 41.38 │ 56.00
BibTeX
@misc{hu2023hgcvae,
  author = {Yulan Hu and Zhirui Yang and Sheng Ouyang and Junchen Wan and Fuzheng Zhang and Zhongyuan Wang and Yong Liu},
  title = {{HGCVAE: Integrating Generative and Contrastive Learning for Heterogeneous Graph Learning}},
  year = {2023},
  eprint = {2310.11102},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.11102},
}
Figure