Abstract: Graph kernels based on the $1$-dimensional Weisfeiler-Leman algorithm and corresponding neural architectures recently emerged as powerful tools for (supervised) learning with graphs. However, due to the purely local nature of the algorithms, they might miss essential patterns in the given data and can only handle binary relations. The $k$-dimensional Weisfeiler-Leman algorithm addresses this by considering $k$-tuples, defined over the set of vertices, and defines a suitable notion of adjacency between these vertex tuples. Hence, it accounts for the higher-order interactions between vertices. However, it does not scale and may suffer from overfitting when used in a machine learning setting. Hence, it remains an important open problem to design WL-based graph learning methods that are simultaneously expressive, scalable, and non-overfitting. Here, we propose local variants and corresponding neural architectures, which consider a subset of the original neighborhood, making them more scalable, and less prone to overfitting. The expressive power of (one of) our algorithms is strictly higher than the original algorithm, in terms of ability to distinguish non-isomorphic graphs. Our experimental study confirms that the local algorithms, both kernel and neural architectures, lead to vastly reduced computation times, and prevent overfitting. The kernel version establishes a new state-of-the-art for graph classification on a wide range of benchmark datasets, while the neural version shows promising performance on large-scale molecular regression tasks.
Introduction
Standard Graph Neural Networks (GNNs) are fundamentally limited by the 1-dimensional Weisfeiler-Leman (1-WL) algorithm. While efficient, 1-WL fails to capture complex, higher-order structural patterns like specific cycles, rendering it "blind" to certain non-isomorphic graphs. To overcome this, researchers have explored $k$-dimensional WL ($k$-WL) algorithms that consider $k$-node tuples. However, $k$-WL suffers from two major drawbacks: extreme computational complexity ($O(n^k)$) and a tendency to overfit by memorizing complete structural signatures rather than learning generalizable features.
Methodology
This paper introduces the Local $\delta$-$k$-dimensional Weisfeiler-Leman algorithm ($\delta$-$k$-LWL) and its neural counterpart, the $\delta$-$k$-LGNN. The core innovation lies in restricting the neighborhood aggregation to "local" neighbors—nodes actually connected by edges in the graph—rather than all possible node tuples. This exploits the inherent sparsity of real-world graphs, reducing complexity from $O(n^{k+1})$ to $O(n^k \cdot d)$, where $d$ is the average degree.
The authors also introduce a "+" variant ($\delta$-$k$-LWL+) that incorporates a counting function for neighbor labels. Remarkably, they prove that for connected graphs, this local restriction actually increases expressive power compared to standard global variants.
Experimental Evaluation
The proposed methods were evaluated across a diverse spectrum of benchmarks:
- Small-scale Kernels: ENZYMES, PROTEINS, IMDB-BINARY, IMDB-MULTI, NCI1, NCI109, PTC_FM, and REDDIT-BINARY.
- Mid-scale Kernels: YEAST, YEASTH, UACC257, UACC257H, OVCAR-8, and OVCAR-8H.
- Large-scale Neural Regression: ZINC and ALCHEMY molecular datasets.
- Continuous Features: QM9 for molecular property prediction.
Results and Discussion
The local algorithms demonstrate significant improvements in both performance and efficiency. The kernel version ($\delta$-$k$-LWL) established new state-of-the-art results on several classification benchmarks, often outperforming global $k$-WL by substantial margins.
Beyond raw accuracy, the local approach offers several key advantages:
- Scalability: Computation times are reduced by orders of magnitude. On the ENZYMES dataset, the local kernel was 10x faster than its global counterpart. On larger datasets where global $k$-WL timed out (OOT) or ran out of memory (OOM), the local version finished in seconds or minutes.
- Generalization: By acting as a form of structural regularization, the local bottleneck prevents the rapid convergence to "stable coloring" seen in global $k$-WL. This allows the model to learn more nuanced features and significantly reduces the train-test error gap.
- State-of-the-Art in Regression: The $\delta$-2-LGNN outperformed previous higher-order architectures (like 1-2-3-GNN and 3-IGN) on the QM9 molecular property prediction task.
Conclusion
By embracing sparsity, the authors show that "local" higher-order WL variants are not only more scalable and robust against overfitting but also theoretically more expressive than their dense predecessors. Future work includes addressing the remaining $n^k$ bottleneck for massive graphs through sampling techniques and exploring the behavior of these architectures under stochastic gradient descent (SGD).
Summary updated