Self-Supervised Heterogeneous Graph Learning: a Homophily and Heterogeneity View

Yujie Mo, Feiping Nie, Ping Hu, Heng Tao Shen, Zheng Zhang, Xinchao Wang, Xiaofeng Zhu

TL;DR

This paper introduces HERO, a novel self-supervised learning framework for heterogeneous graphs that eliminates the need for manually defined "meta-paths." By mathematically capturing both homophily (connections between similar nodes) and heterogeneity (connections between different node types) and fusing them together, HERO achieves state-of-the-art performance and linear scalability on downstream tasks such as node classification.

Introduction: The Problem with Meta-Paths

Real-world data is often best represented as a heterogeneous graph—a network containing multiple types of nodes and edges (e.g., an academic graph with "Author," "Paper," and "Subject" nodes).

To learn from these graphs without labeled data, Self-Supervised Heterogeneous Graph Learning (SHGL) methods typically rely on meta-paths. For example, a "Paper-Author-Paper" (P-A-P) path connects two papers written by the same person. This exploits homophily: the tendency of similar nodes to be connected.

Illustration of a heterogeneous graph with meta-paths, and the varying impact of different meta-paths on model performance.

However, this traditional approach has two major flaws:

  1. Meta-paths are expensive and subjective: They require domain experts to manually define them. As shown in the figure above, different meta-paths (like P-A-P vs. P-S-P) can lead to drastically different intra-class correlations and downstream performance. Furthermore, computing relationships across long meta-paths causes computational costs to explode.
  2. Ignoring Heterogeneity: By focusing only on meta-paths (which effectively turn the graph into a homogeneous one), models ignore the rich, diverse information coming from different node types (heterogeneity), leaving valuable predictive signals unutilized.

The authors tackle the challenge of capturing both homophily and heterogeneity in a graph without relying on human-defined meta-paths, while managing the inherent conflict between these two types of information.

The HERO Framework: Methods

The authors propose the HERO framework, which operates through three main steps:

  1. Capturing Homophily (Without Meta-Paths): Instead of relying on meta-paths, HERO uses a Multi-Layer Perceptron (MLP) and a self-expressive matrix. This matrix assumes that nodes belonging to the same class lie in the same subspace and are close to each other in the original feature space. The authors derive a closed-form mathematical solution for this matrix that naturally groups similar nodes together.
  2. Capturing Heterogeneity: Simultaneously, HERO uses a standard heterogeneous graph encoder to aggregate information from a node's one-hop neighbors of different types, capturing the diverse structural context.
  3. Fusing the Representations: To combine these two distinct views, HERO projects them into latent spaces and applies two clever loss functions:
  4. Consistency Loss: Maximizes the agreement (mutual information) between the homophilous and heterogeneous representations to extract shared, underlying truths.
  5. Specificity Loss: Ensures the representations do not just collapse into the exact same output, preserving the unique task-related signals inherent to both homophily and heterogeneity.

Crucially, to avoid the massive $O(N^3)$ computational bottleneck typically associated with solving self-expressive matrices, the authors use the Woodbury matrix identity to reorder operations, reducing the time complexity to scale linearly with the number of nodes.

Key Insights and Theoretical Guarantees

  • Meta-paths aren't strictly necessary: You can capture homophily purely through subspace clustering and feature distance (the self-expressive matrix). This data-driven approach saves massive computational overhead and removes the need for human bias in graph learning.
  • The "Grouping Effect": The authors mathematically prove that their self-expressive matrix naturally exhibits a "grouping effect"—meaning if two nodes have similar features, their learned representations will automatically align, effectively doing the job of a meta-path without explicitly defining one.
  • Homophily + Heterogeneity = More Information: The paper provides a formal proof that fusing homophilous and heterogeneous representations contains more task-related mutual information (and achieves a lower Bayes error rate) than using either representation alone. They are complementary, not redundant.
  • Linear Scalability is Possible: By applying matrix identity transformations to their closed-form solution, the authors bypassed the quadratic/cubic scaling issues that plague similar mechanisms, making the model highly efficient for massive graphs.

Experimental Results

The authors evaluated HERO on a mix of heterogeneous datasets (ACM, DBLP, Aminer, Yelp, Freebase) and homogeneous datasets (Amazon-Photo, Amazon-Computers, Coauthor-CS, Coauthor-Physics).

  • Superior Accuracy: On node classification tasks, HERO outperformed the best baseline SHGL methods by an average of 2.1% (Macro-F1) across four heterogeneous datasets. It also improved similarity search performance by an average of 1.8% (Sim@5).
  • Massive Efficiency Gains: On the huge Freebase dataset (180k nodes, 1.6M edges), HERO achieved the highest classification performance while requiring the minimal training time and memory cost. Several competing methods simply ran out of memory (OOM) on this dataset.
  • Generalization: Surprisingly, when adapted for homogeneous graphs (by swapping the heterogeneous encoder for a standard GCN), HERO still beat state-of-the-art self-supervised homogeneous baselines.

Limitations and Future Directions

The authors acknowledge a key limitation regarding node features. HERO relies heavily on initial node features to calculate the feature distance matrix used in the homophily step. If a graph natively lacks node features, practitioners have to use workarounds like one-hot encoding or structural embeddings, which may not be optimal.

For future work, the authors suggest developing specific methods tailored to capture homophily in heterogeneous graphs that completely lack node features, further expanding the framework's versatility.

Summary updated

BibTeX
@inproceedings{mo2024self,
  author = {Yujie Mo and Feiping Nie and Ping Hu and Heng Tao Shen and Zheng Zhang and Xinchao Wang and Xiaofeng Zhu},
  title = {{Self-Supervised Heterogeneous Graph Learning: a Homophily and Heterogeneity View}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=3FJOKjooIj},
}
Figure