On the Impact of Feature Heterophily on Link Prediction with Graph Neural Networks

Jiong Zhu, Gaotang Li, Yao-An Yang, Jing Zhu, Xuehao Cui, Danai Koutra

TL;DR

Graph Neural Networks (GNNs) typically assume that connected nodes share similar features (homophily), but what happens when opposites attract? This paper formally defines feature heterophily for link prediction and demonstrates that standard GNN architectures fail when edges connect highly dissimilar nodes. By separating ego- and neighbor-embeddings and utilizing learnable decoders, the authors show how GNNs can successfully predict links across the entire similarity spectrum.

What Problem Does This Paper Address?

Most GNN research on heterophily focuses on node classification, where class labels are known. However, for link prediction (e.g., predicting missing edges in a recommendation system or social network), class labels are often unavailable, and models must rely entirely on graph structure and node features.

Prior work has largely ignored how feature heterophily—where connected nodes have highly dissimilar features—affects link prediction. This paper fills that gap by providing formal definitions of non-homophilic link prediction and analyzing how different GNN encoders and decoders adapt to non-homophilic environments.

Methods

The authors introduce a theoretical framework that categorizes link prediction tasks based on the distribution of feature similarity scores between positive pairs (edges) and negative pairs (non-edges):

  • Homophilic: Edges have higher feature similarity than non-edges.
  • Heterophilic: Edges have lower feature similarity than non-edges.
  • Gated: A complex case where edge and non-edge similarities overlap and cannot be separated by a single threshold.
Figure 1: Categorizing link prediction tasks based on the distribution of feature similarity scores of positive node pairs (i.e., edges – colored in green) and negative node pairs (non-edges – colored in red): two distributions whose density is visualized in the plots are (approximately) separated by the threshold(s) M. Homophilic and heterophilic link prediction differs in whether the positive similarity scores fall into the larger or smaller side of the threshold M, while the magnitude of M indicates the variance of positive similarity. Gated link prediction is a more complex case where the distribution of positive and negative similarity scores cannot be separated by a single threshold.

They analyze the mathematical optimization of link prediction and evaluate combinations of:

  • Encoders: GraphSAGE and SIGN (which separate ego- and neighbor-embeddings during message passing) vs. GCN (which mixes them).
  • Decoders: Dot Product (DOT), Multi-Layer Perceptron (MLP), and DistMult.

Datasets

The authors evaluated their insights using both synthetic and real-world benchmarks:

  • Synthetic Graphs: 10 custom-generated graphs with controlled feature similarity levels ranging from highly negative (heterophilic) to highly positive (homophilic).
  • Real-World Benchmarks: ogbl-collab (a homophilic collaboration network), ogbl-citation2 (a citation network), and e-comm (a non-homophilic e-commerce graph from Amazon Search).
  • Additional Heterophilic Graphs: Biological molecular datasets from TUDataset (e.g., aspirin, benzene, malonaldehyde) identified as entirely heterophilic.

Key Insights and Ideas

  • The U-Shaped Performance Curve: Link prediction performance follows a distinct U-shape across the feature similarity spectrum. GNNs perform best at the extreme ends (pure homophily or pure heterophily) but tank in the middle ("gated" tasks) because edges and non-edges become indistinguishable based on feature similarity alone.
  • Dot Product is Not Enough: The ubiquitous dot product decoder is mathematically incapable of handling heterophilic or gated link prediction. It inherently assumes that higher feature similarity always equals a higher probability of a link. Learnable decoders like MLP or DistMult are required to capture negative correlations.
Figure 2: Link prediction scores ˆyu′v′ for decoders optimized respectively un- der homophilic and heterophilic setups in Thm. 1, assuming M = 0.5.
  • Ego-Neighbor Separation is Crucial: Encoders like GraphSAGE or SIGN that keep a node's own features separate from its neighbors' aggregated features during message passing are far more robust to degree shifts and feature variations than standard GCNs.

Key Results

  • Decoder Performance: On synthetic heterophilic graphs, the learnable DistMult decoder outperformed the standard dot product decoder by 55% and even beat the MLP decoder by 5.6% due to more stable optimization at the negative extreme.
  • Encoder Performance: GraphSAGE consistently outperformed GCN across all feature similarity levels by up to 44%.
  • Real-World Robustness: On the real-world non-homophilic e-comm dataset, GCN severely overfitted to high-similarity/low-degree buckets, whereas architectures with ego-neighbor separation (SAGE) maintained robust performance across all buckets.

Limitations and Future Work

The theoretical analysis relies on simplified assumptions, such as 2D unit vectors for node features and ideal separability between classes. In reality, feature distributions are far more complex and noisy.

The authors suggest that future work should explore more sophisticated non-linear decoders or adaptive message-passing mechanisms that can dynamically adjust to local heterophily levels within different neighborhoods of a single graph.

Summary updated

BibTeX
@inproceedings{zhu2024impact,
  author = {Jiong Zhu and Gaotang Li and Yao-An Yang and Jing Zhu and Xuehao Cui and Danai Koutra},
  title = {{On the Impact of Feature Heterophily on Link Prediction with Graph Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=3LZHatxUa9},
}
Figure