NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Discovering Invariant Neighborhood Patterns for Heterophilic Graphs

Jinluan Yang, Ruihao Zhang, Zhengyu Chen, Teng Xiao, Yueyang Wang, Fei Wu, Kun Kuang

TL;DR

The Invariant Neighborhood Pattern Learning (INPL) framework tackles the problem of distribution shifts in non-homophilous graphs—where "opposites attract" rather than "birds of a feather flock together." By combining adaptive neighborhood propagation with a strategy to learn invariant representations across discovered environments, INPL achieves state-of-the-art performance on diverse real-world graph benchmarks.

What Problem Does This Paper Address?

Most Graph Neural Networks (GNNs) are built on the homophily assumption: the idea that connected nodes likely share the same label (e.g., friends often have similar interests). However, many real-world networks are non-homophilous (or heterophilic). In a dating network, opposites might attract; in a transaction network, a buyer connects to a seller.

Standard GNNs struggle here because neighborhood patterns are much more diverse. A major issue is distribution shift: the specific mix of neighbor types a node sees during training might be completely different from what it encounters at test time. For example, a model might train on nodes with a "mixing" pattern but be asked to predict on a purely homophilous or heterophilic node during testing.

Figure 1: Schematic diagram of the distribution shifts problem on non-homophilous graphs. The shape denotes the label of each node. The shape circle is labeled as “deep learning", and rectangle is labeled as “system design". The neighborhood pattern of training nodes A and B are non-homophilous patterns, where parts of nodes are in the same class and the others are not, which dominate the training of GNNs. However, the neighborhood pattern of node C is homophilous and the neighborhood pattern of node D is heterophilic, leading to the distribution shifts between training and testing.

Existing "debiased" GNNs often still rely on homophily assumptions, leaving a significant gap in handling these complex, non-homophilous shifts.

Methods

The authors propose the Invariant Neighborhood Pattern Learning (INPL) framework, which consists of two primary modules:

  1. Adaptive Neighborhood Propagation (ANP): Instead of a fixed aggregation strategy, ANP dynamically learns how to combine information from both immediate and high-order neighbors. It uses an Invariant Propagation Layer to mix different neighborhood scales and an Adaptive Propagation mechanism. The latter employs a generative network and Gumbel-Softmax sampling to choose the optimal propagation steps for each node, allowing the model to "attend" to the most relevant neighborhood context.

    Figure 3: The module of Adaptive Neighborhood Propagation (ANP), the invariant propagation layer is proposed to combine both the high-order and low-order neighborhood information. And adaptive propagation is proposed to capture the adaptive neighborhood information, s is the adaptive propagation step learned by the generative network qϕ.
  2. Invariant Non-Homophilous Graph Learning (INHGL): To ensure the model generalizes to unknown test environments, this module uses Environment Clustering. It applies K-means to node representations to partition the graph into multiple "virtual environments." The model is then trained with a variance penalty (inspired by Invariant Risk Minimization), forcing it to find features that yield consistent, high-performance predictions across all these different clusters.

Datasets

The researchers evaluated INPL on eleven diverse non-homophilous datasets, ranging from small-scale subgraphs to massive social networks:

  • Large-scale: snap-patents (2.9M nodes), pokec (1.6M nodes), genius, twitch-gamers, and Penn94.
  • Small-scale: film, squirrel, chameleon, cornell, texas, and wisconsin.
  • Homophilous (for comparison): Cora, CiteSeer, and PubMed.

Key Insights and Ideas

  • Diversity is the Challenge: The core insight is that non-homophilous graphs don't just have "different" patterns; they have diverse and shifting patterns. A single node might have a neighborhood that is 30% homophilous and 70% heterophilic.
  • Latent Environments: Since real-world graphs rarely come with "environment labels" (telling you which nodes belong to which distribution), the use of unsupervised clustering to discover these environments is a clever way to apply invariance principles to node-level tasks.
  • Adaptive Hops: By allowing the model to learn the propagation step $s$ adaptively, it can effectively "skip" irrelevant immediate neighbors to find semantically similar nodes further away in the graph structure.

Key Results

INPL achieved state-of-the-art results across nearly all tested non-homophilous datasets. Notable highlights include:

  • Significant Gains on Small Datasets: Compared to the strong baseline LINKX, INPL improved accuracy by 5.40% on Cornell, 10.26% on Texas, and 10.39% on Wisconsin.
  • Robustness to Shifts: The model maintained high performance even when subjected to artificial shifts in node degree, class distribution, and neighborhood patterns, significantly outperforming previous debiasing methods that assume homophily.
  • Versatility: While designed for heterophilic graphs, INPL remained highly competitive on standard homophilous benchmarks like Cora and PubMed, suggesting it is a robust general-purpose framework.

Limitations and Future Work

The authors identify a few hurdles for future research:

  • Computational Complexity: Directly calculating higher-order adjacency matrices ($A_k$) for extremely large datasets can be memory-intensive, potentially exceeding GPU limits.
  • Domain Specificity: While highly effective for graph data, it remains to be seen if these neighborhood-invariance principles translate well to other domains like computer vision or natural language processing.
  • Hyper-parameter Sensitivity: The final performance can be sensitive to the choice of hyper-parameters, suggesting a need for more automated tuning strategies in production environments.

Summary updated

BibTeX
@misc{yang2024discovering,
  author = {Jinluan Yang and Ruihao Zhang and Zhengyu Chen and Teng Xiao and Yueyang Wang and Fei Wu and Kun Kuang},
  title = {{Discovering Invariant Neighborhood Patterns for Heterophilic Graphs}},
  year = {2024},
  eprint = {2403.10572},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.10572},
}
Figure