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

Towards Arbitrarily Expressive GNNs in O(n2) Space by Rethinking Folklore Weisfeiler-Lehman

Jiarui Feng, Lecheng Kong, Hao Liu, Dacheng Tao, Fuhai Li, Muhan Zhang, Yixin Chen · DOI

Introduction

Graph Neural Networks (GNNs) have traditionally faced a rigid trade-off between computational efficiency and expressive power. While standard Message Passing Neural Networks (MPNNs) are efficient, their expressivity is bounded by the 1-dimensional Weisfeiler-Lehman (1-WL) test. Higher-order methods like $k$-WL or Folklore WL (FWL) offer more power but typically require $O(n^k)$ space, making $k \ge 3$ impractical for large-scale applications. This paper introduces $N^2$-GNN, a framework that achieves higher expressivity than the 3-WL test while maintaining a practical $O(n^2)$ space complexity.

Rethinking the Folklore WL Hierarchy

The authors propose a hierarchical extension of the FWL test through two primary theoretical innovations: $(k, t)$-FWL and $k$-FWL+.

$(k, t)$-FWL and Equivariant Sets

The core insight is that the expressivity of FWL is driven by how information is aggregated into tuples. By using a $t$-tuple of nodes to update a $k$-tuple, the authors prove an expressiveness hierarchy that can solve graph isomorphism problems while keeping space complexity fixed at $O(n^k)$. To make this practical, they introduce $k$-FWL+, which restricts updates to equivariant sets—specific groups of nodes related to the tuple, such as local neighbors or nodes on a shortest path.

The $N^2$-GNN Architecture

$N^2$-GNN is the neural implementation of $(2, 2)$-FWL+. It operates on pairs of nodes (2-tuples) and updates them using their local overlapping $h$-hop neighborhoods. This approach allows the model to capture complex structural information without the memory explosion associated with $O(n^3)$ methods.

The construction process of neighborhood tuples in N²-GNN to recover high-order structures.

Experimental Evaluation

The model was tested across a wide range of benchmarks, including synthetic isomorphism tests, molecular property prediction, and the BREC dataset.

Performance on BREC and Synthetic Benchmarks

On the BREC dataset, which consists of 400 pairs of non-isomorphic graphs, $N^2$-GNN achieved a state-of-the-art (SOTA) accuracy of 71.8%. This significantly outperforms other high-expressivity models like $I^2$-GNN, particularly on complex graph categories.

Performance comparison on the BREC dataset showing N²-GNN's superior ability to distinguish non-isomorphic graphs.

Furthermore, the model achieved perfect 100% accuracy on the EXP, CSL, and SR25 synthetic datasets. Notably, its success on SR25 demonstrates expressivity beyond the 3-WL test, as 3-WL is known to fail on strongly regular graphs.

Molecular Property Prediction

In molecular tasks, $N^2$-GNN set a new benchmark on the ZINC-Subset dataset with a Mean Absolute Error (MAE) of 0.059, representing a 10.6% improvement over the previous state-of-the-art.

Conclusion

By rethinking the Folklore WL test, $N^2$-GNN provides a fine-grained design space for graph learning. It bridges the gap between efficient local message passing and expressive global WL tests, proving that high-order structural awareness is possible within $O(n^2)$ space constraints. Future work will focus on optimizing time complexity for larger $t$ parameters and exploring optimal equivariant sets for specific domain tasks.

Summary updated

BibTeX
@inproceedings{feng2023towards,
  author = {Jiarui Feng and Lecheng Kong and Hao Liu and Dacheng Tao and Fuhai Li and Muhan Zhang and Yixin Chen},
  title = {{Towards Arbitrarily Expressive GNNs in O(n2) Space by Rethinking Folklore Weisfeiler-Lehman}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=UlJcZoawgU},
}
Figure