Abstract
Graph contrastive learning has been developed to learn discriminative node representations on homogeneous graphs. However, it is not clear how to augment the heterogeneous graphs without substantially altering the underlying semantics or how to design appropriate pretext tasks to fully capture the rich semantics preserved in heterogeneous information networks (HINs). Moreover, early investigations demonstrate that contrastive learning suffer from sampling bias, whereas conventional debiasing techniques (e.g., hard negative mining) are empirically shown to be inadequate for graph contrastive learning. How to mitigate the sampling bias on heterogeneous graphs is another important yet neglected problem. To address the aforementioned challenges, we propose a novel multi-view heterogeneous graph contrastive learning framework in this paper. We use metapaths, each of which depicts a complementary element of HINs, as the augmentation to generate multiple subgraphs (i.e., multi-views), and propose a novel pretext task to maximize the coherence between each pair of metapath-induced views. Furthermore, we employ a positive sampling strategy to explicitly select hard positives by jointly considering semantics and structures preserved on each metapath view to alleviate the sampling bias. Extensive experiments demonstrate MCL consistently outperforms state-of-the-art baselines on five real-world benchmark datasets and even its supervised counterparts in some settings.
Introduction
Graph Contrastive Learning (GCL) has emerged as a powerful paradigm for learning node representations in an unsupervised manner. While highly effective on homogeneous graphs, extending GCL to Heterogeneous Information Networks (HINs)—which contain multiple types of nodes and edges—presents unique challenges. Standard augmentations like random edge dropping often lead to semantic distortion, where the fundamental meaning of a relationship is lost. Furthermore, existing pretext tasks often fail to capture the complementary semantics inherent in different paths through the network. Finally, sampling bias remains a significant issue; randomly selected "negative" samples in HINs are frequently false negatives (nodes that are semantically similar to the anchor), leading to suboptimal embeddings.
Methodology: The MCL Framework
To address these limitations, we propose MCL (Multi-view Heterogeneous Graph Contrastive Learning). The framework leverages the inherent structure of HINs to create semantically meaningful views and introduces a robust sampling strategy to mitigate bias.
Metapaths as Multi-Views
Instead of stochastic graph corruption, MCL utilizes metapaths—predefined sequences of node and edge types—to generate multiple subgraphs. These metapaths (e.g., Author-Paper-Author or Author-Paper-Subject) act as natural "views" of the network, preserving high-order semantics while providing diverse perspectives on node relationships.
Dual Contrastive Objectives
MCL employs a two-tiered contrastive approach:
- Intra-metapath Contrast: Compares two differently augmented versions of the same metapath-induced view.
- Inter-metapath Contrast: Aligns representations across different metapath views. This ensures the model captures both specific local relationships and universal global features shared across the network.
Positive Sampling Strategy (MCL-P)
To combat sampling bias, we introduce a "hard positive" sampling strategy. Rather than contrasting an anchor node solely against itself, MCL-P identifies additional positive samples based on two criteria:
- Topology: Nodes with high structural similarity are identified using Personalized PageRank (PPR).
- Semantics: Nodes with similar raw attributes are identified via L2 distance.
By treating these similar nodes as positives, the model avoids the "false negative" trap where semantically related nodes are pushed apart in the embedding space.
Experimental Evaluation
The MCL framework was evaluated on five benchmark HIN datasets: ACM, DBLP, IMDB, AMiner, and FreeBase.
Key Results
- Performance: MCL and its variant MCL-P consistently outperformed state-of-the-art self-supervised baselines such as DMGI and HeCo.
- Comparison with Supervised Models: Remarkably, MCL achieved performance comparable to, and in some cases exceeding, fully supervised Graph Neural Networks (e.g., GCN, GAT) in node classification tasks.
- Clustering Quality: Visualization using t-SNE on the DBLP dataset revealed that MCL produces significantly more distinct and compact clusters compared to previous methods, which often exhibited overlapping class boundaries.
Conclusion
MCL provides a principled way to apply contrastive learning to heterogeneous networks by using metapaths as semantic-preserving augmentations. By integrating inter-metapath contrast and a dual-pronged positive sampling strategy, the framework effectively captures complex network semantics while mitigating the impact of sampling bias. Future work may explore automated metapath discovery to reduce reliance on domain expertise and investigate the application of multi-view contrastive learning to dynamic, evolving graphs.
Summary updated