TL;DR: This paper introduces Weisfeiler–Leman Similarity (WLS), challenging the standard "aggregate-then-transform" pattern in Graph Neural Networks (GNNs). By shifting to a "transform-sum-cat" scheme, WLS better preserves node neighborhood information—especially for continuous attributes—yielding higher accuracy, lower regression error, and improved stability in generative tasks.
The Problem: Blind Spots in Standard Aggregation
Most popular GNNs (like GCN, GraphSAGE, and GIN) rely on an aggregate-transform pattern. They first aggregate the attributes of a node's neighbors (e.g., via averaging or summing) and then apply a learnable transformation.
However, this "aggregation-first" approach can be blind to the actual distribution of neighbor attributes. If node attributes represent 2D coordinates, different sets of neighbors might average out to the exact same position, making distinct neighborhoods indistinguishable to the model.
While the classic Weisfeiler-Leman (WL) isomorphism test works exceptionally well for discrete labels by iteratively hashing neighborhood multisets, it does not naturally extend to the continuous attributes (like physical measurements or chemical properties) that are ubiquitous in real-world data.
Methods: The "Transform-Sum-Cat" Paradigm
To address this limitation, the authors propose a fundamental shift in the order of operations, moving to a transform-sum-cat architecture:
- Transform: Apply a transformation (such as an MLP or a kernel feature map) to each neighbor's attributes individually before any combination occurs.
- Sum: Add these transformed vectors together. Grounded in kernel theory, this sum effectively represents the entire set of neighbors in a high-dimensional space without losing distributional information.
- Cat (Concatenate): Instead of blending the central node's information with its neighbors, the central node’s transformed attribute is concatenated with the neighborhood sum. This ensures the model maintains a clear distinction between the "self" and the "environment."
To maintain computational efficiency, the authors employ a WLS Kernel utilizing a second-order Taylor approximation of a Gaussian kernel. They also apply Random Projections (leveraging the Johnson-Lindenstrauss lemma) to keep the dimensionality of the iterated vectors manageable (e.g., size 200).
Key Insights
- Preserving Neighborhood "Shape": By transforming before summing, the model acts as a "set sensor." It can easily distinguish between a neighborhood of three identical points and a neighborhood of three distinct points that merely share the same average.
- The Power of Concatenation: Many GNNs sum the central node and its neighbors together, leading to information loss. The "cat" operation in WLS prevents this, a feature shown to be crucial for node classification tasks.
- Continuous WL Test: Unlike the traditional WL test's discrete hashing, WLS provides a continuous measure of similarity (exhibiting properties like orientation-invariance and monotonicity). This makes it differentiable and highly compatible with deep learning.
- Stability in GANs: In adversarial training (e.g., the MolGAN framework for generating small molecules), standard GNN discriminators often collapse, causing the generator to produce invalid molecules. The WLS-based discriminator remained remarkably stable, consistently guiding the generator toward chemically valid structures.
Benchmarks and Results
The authors evaluated WLS across a variety of standard benchmarks, demonstrating significant improvements:
- Node Classification: On the Stochastic Block Model (SBM_PATTERN) dataset, WLS achieved 99.08% accuracy, outperforming GIN, GAT, and GatedGCN.
- Graph Classification: On the synthetic "Synthie" dataset, WLS reached 86.79% accuracy, a massive gain over most baseline models which hovered around 46%. It also performed competitively on TU Datasets (BZR, COX2, DHFR, ENZYMES, PROTEINS).
- Graph Regression: For predicting molecular solubility on the ZINC dataset, the WLS-E variant (incorporating edge attributes) achieved a State-of-the-Art Mean Absolute Error (MAE) of 0.315, significantly besting GatedGCN's 0.362.
- Efficiency: Despite its high expressivity, the WLS neural network was frequently the second-fastest model tested, proving that the "transform-sum-cat" approach is both powerful and computationally viable.
Limitations and Future Work
While highly effective, WLS is primarily a local operator. It excels at understanding immediate neighborhoods but may struggle to capture "global" graph properties—such as whether a graph is Hamiltonian or determining its specific chromatic number—where overall topology outweighs local attribute distributions. Future work will likely explore combining this high-fidelity local similarity with global graph-level descriptors to build even more robust architectures.
Summary updated