𝒩-WL: A New Hierarchy of Expressivity for Graph Neural Networks

Qing Wang, Dillon Ze Chen, Asiri Wijesinghe, Shouheng Li, Muhammad Farhan

TL;DR

This paper introduces a novel hierarchy of graph isomorphism tests, called Neighborhood Weisfeiler-Lehman (N-WL), to better measure the expressive power of Graph Neural Networks (GNNs). Unlike existing methods that struggle with computational cost and interpretability, N-WL offers a more intuitive and efficient way to design and evaluate GNNs, leading to a new GNN architecture, G3N, that demonstrates improved performance on various graph learning tasks.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have become a powerful tool for learning from graph-structured data. However, understanding their capabilities and limitations, particularly their "expressive power" (what graph properties they can learn), remains a significant challenge. Current GNN expressivity is often measured against the Weisfeiler-Lehman (WL) test, specifically its k-WL variants. While k-WL provides a theoretical framework, it suffers from practical limitations: high computational costs for k > 1, a lack of intuitive interpretation, and difficulty in pinpointing specific graph properties that distinguish graphs. This makes it hard to design GNNs that are both expressive and practical. The authors aim to bridge this gap by proposing a new hierarchy of graph isomorphism tests that is more aligned with the local, neighborhood-based nature of GNNs, offering a more suitable benchmark for their expressivity.

Methods

The core contribution is the introduction of the Neighborhood Weisfeiler-Lehman (N-WL) algorithm and its associated hierarchy. Unlike the traditional k-WL which operates on k-tuples of nodes, N-WL focuses on coloring nodes based on the properties of induced subgraphs within a node's d-hop neighborhood. This approach introduces two key parameters:

  • t: The size of induced subgraphs considered.
  • d: The radius of the neighborhood to explore.

The authors propose two variants:

  1. N(t, d)-WL (Strong Hierarchy): This variant considers both the isomorphism type and positional type of induced subgraphs. This allows for a more nuanced understanding of subgraph importance within a neighborhood.
  2. N<sup>c</sup>(t, d)-WL (Connected-Hereditary Subgraphs): This variant restricts the analysis to connected induced subgraphs. Surprisingly, they prove this variant has equivalent expressivity to N(t, d)-WL, offering potential efficiency gains for sparse graphs.

The paper also introduces Graph Neighbourhood Neural Network (G3N), a GNN architecture designed to instantiate the N-WL principles. G3N leverages subgraph pooling and aggregation within neighborhoods to learn node representations, aiming to be more expressive than standard message-passing GNNs.

Datasets

The paper evaluates G3N on a variety of datasets:

  • Synthetic Datasets:
    • EXP: Pairs of graphs designed to be indistinguishable by 1-WL.
  • SR25: Strongly regular graphs, some indistinguishable by 3-WL.
  • graph8c: All connected non-isomorphic 8-node graphs, with subsets indistinguishable by 1-WL and 3-WL.
  • CSL: 41-node, 4-regular graphs, mostly distinguishable by 3-WL.
  • RandomGraph: Used for substructure counting.
  • Real-World Datasets:
    • TU Datasets: A collection of graph classification and regression tasks on molecular datasets (MUTAG, PTC_MR, PROTEINS, NCI1, IMDB-B, IMDB-M) and social networks.
  • ZINC: Molecular dataset for regressing constrained solubility.
  • MolHIV: Molecular dataset for graph classification.
  • MolTOX21: Molecular dataset for graph classification.

No new benchmarks were introduced; existing standard datasets were used.

Key Insights and Ideas

  • N-WL as a Better Benchmark: The k-WL hierarchy, while theoretically sound, is not ideal for measuring GNN expressivity due to its computational cost and lack of intuitive interpretation. N-WL, by focusing on local neighborhoods and subgraph properties, offers a more practical and interpretable framework.
  • Dual Control of Expressivity: The N-WL hierarchy allows expressivity to be controlled by two independent parameters: the size of induced subgraphs (t) and the size of the neighborhood (d). This provides a finer-grained control over the model's capacity.
  • Connected Subgraphs Suffice: The surprising finding that considering only connected induced subgraphs (N<sup>c</sup>(t, d)-WL) offers the same expressivity as considering all induced subgraphs (N(t, d)-WL) is a significant insight. This suggests that for sparse graphs, focusing on connected structures can improve efficiency without sacrificing expressive power.
  • G3N's Neighborhood Aggregation: The G3N architecture effectively translates the N-WL principles into practice by aggregating information from induced subgraphs within a node's neighborhood, demonstrating a more powerful way to capture structural information than traditional message-passing.

Key Results

  • Theoretical Hierarchy: The paper establishes strict hierarchies for N-WL, showing that increasing t or d strictly increases expressivity in distinguishing non-isomorphic graphs.
  • Equivalence of Connected Subgraphs: Theorem 3.7 proves that N<sup>c</sup>(t, d)-WL and N(t, d)-WL have equivalent expressivity.
  • G3N Performance: G3N models, particularly with appropriate t and d configurations, demonstrate strong performance on graph isomorphism tasks and substructure counting (Table 2). For instance, G3N-(2,1) and G3N-(3,1) show significant improvements over 1-WL bounded GNNs.
  • Real-World Performance: G3N achieves competitive or superior results on molecular datasets (ZINC, MolHIV) compared to several state-of-the-art GNNs, especially those that do not rely on pre-selected subgraph patterns (Table 3, Table 4).
  • Complexity Advantage: The N-WL algorithms exhibit significantly lower computational complexity compared to k-WL, especially for sparse graphs and larger diameters (Figures 10-13). For instance, N-WL is orders of magnitude faster than k-WL on ZINC, MolHIV, and NCI1 datasets when d=1.

Limitations and Future Work

  • Computational Cost and Parameter Complexity: As with most expressive GNNs, G3N can have increased runtime and parameter complexity, especially for larger datasets. The authors suggest exploring sampling methods to mitigate this.
  • Expressivity vs. Generalisability: The paper acknowledges an unclear explanation for the trade-off between expressivity and generalisability.
  • Domain-Dependent Parameters: The parameters d and t are currently domain-dependent and require manual tuning to balance performance and computational resources.
  • Future Research Directions:
    • Investigating sampling methods for larger datasets.
  • Exploring the interaction between expressivity, generalisability, and explainability.
  • Developing methods for automatic selection of d and t.
  • Analyzing connections between N-WL and node-level, link-level, or subgraph-level properties.
  • Further formal study of N-WL properties and its connection to logic.

Summary updated

BibTeX
@inproceedings{wang2023n,
  author = {Qing Wang and Dillon Ze Chen and Asiri Wijesinghe and Shouheng Li and Muhammad Farhan},
  title = {{𝒩-WL: A New Hierarchy of Expressivity for Graph Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=BPokzSdc-d},
}
Figure