[Paper Review] Can Graph Neural Networks Count Substructures?
This paper investigates the expressive power of Graph Neural Networks (GNNs) in counting attributed substructures, distinguishing between induced-subgraph-count and subgraph-count. It proves that Message Passing Neural Networks (MPNNs) and 2-Weisfeiler-Lehman (2-WL) networks cannot count induced subgraphs of connected patterns with three or more nodes, but can count star-shaped subgraphs. The authors introduce Local Relational Pooling (LRP), a novel architecture that effectively counts substructures and achieves competitive performance on molecular prediction benchmarks.
The ability to detect and count certain substructures in graphs is important for solving many tasks on graph-structured data, especially in the contexts of computational chemistry and biology as well as social network analysis. Inspired by this, we propose to study the expressive power of graph neural networks (GNNs) via their ability to count attributed graph substructures, extending recent works that examine their power in graph isomorphism testing and function approximation. We distinguish between two types of substructure counting: induced-subgraph-count and subgraph-count, and establish both positive and negative answers for popular GNN architectures. Specifically, we prove that Message Passing Neural Networks (MPNNs), 2-Weisfeiler-Lehman (2-WL) and 2-Invariant Graph Networks (2-IGNs) cannot perform induced-subgraph-count of substructures consisting of 3 or more nodes, while they can perform subgraph-count of star-shaped substructures. As an intermediary step, we prove that 2-WL and 2-IGNs are equivalent in distinguishing non-isomorphic graphs, partly answering an open problem raised in Maron et al. (2019). We also prove positive results for k-WL and k-IGNs as well as negative results for k-WL with a finite number of iterations. We then conduct experiments that support the theoretical results for MPNNs and 2-IGNs. Moreover, motivated by substructure counting and inspired by Murphy et al. (2019), we propose the Local Relational Pooling model and demonstrate that it is not only effective for substructure counting but also able to achieve competitive performance on molecular prediction tasks.
Motivation & Objective
- To understand the expressive power of GNNs through their ability to count attributed substructures, a task relevant to real-world applications in chemistry and biology.
- To formally distinguish between induced-subgraph-count and subgraph-count capabilities of GNN architectures.
- To identify fundamental limitations of popular GNNs like MPNNs and 2-IGNs in counting complex substructures.
- To propose a new architecture, Local Relational Pooling (LRP), inspired by substructure counting, to overcome these limitations.
- To validate theoretical findings with empirical experiments on molecular graph benchmarks.
Proposed method
- Theoretical analysis is conducted using graph construction techniques to create pairs of non-isomorphic graphs that are indistinguishable by MPNNs and 2-WL but differ in induced-subgraph-count.
- The paper formalizes two types of substructure counting: induced-subgraph-count and subgraph-count, with node and edge features considered.
- It proves equivalence between 2-WL and 2-IGN in distinguishing non-isomorphic graphs, resolving an open problem.
- A new GNN architecture, Local Relational Pooling (LRP), is proposed, which performs message passing over local subgraph patterns and aggregates relational features.
- LRP uses operations N2P (node-to-pattern), E2P (edge-to-pattern), and Ppl (pooling over patterns) to encode substructure counts.
- Experiments are conducted on ogbg-molhiv, QM9, and ZINC datasets using standard splits and metrics, with LRP models trained with early stopping and learning rate scheduling.
Experimental results
Research questions
- RQ1Can MPNNs and 2-WL GNNs count induced subgraphs of connected patterns with three or more nodes?
- RQ2Can MPNNs and 2-IGNs count subgraphs of star-shaped patterns?
- RQ3Are k-WL and k-IGN architectures capable of substructure counting for larger patterns?
- RQ4Can a GNN architecture be designed to effectively count substructures and generalize to molecular prediction tasks?
- RQ5What is the empirical performance of the proposed Local Relational Pooling model compared to existing GNNs?
Key findings
- MPNNs and 2-IGNs cannot count induced subgraphs of any connected pattern with three or more nodes, as proven by constructing indistinguishable graph pairs with different induced-subgraph-counts.
- MPNNs and 2-IGNs can successfully count subgraphs of star-shaped patterns, generalizing prior results to include node and edge features.
- 2-WL and 2-IGN are equivalent in distinguishing non-isomorphic graphs, providing a partial answer to an open problem in the literature.
- k-WL and k-IGN architectures can count substructures for larger patterns, but k-WL with a finite number of iterations cannot achieve universal subgraph counting.
- The proposed Local Relational Pooling (LRP) model achieves competitive performance on ogbg-molhiv and ZINC benchmarks, with Deep LRP-7-1 achieving 0.223 MAE on ZINC, outperforming baselines with similar parameter counts.
- LRP-1-3 (ES) trained for 20 epochs achieves better generalization than the 100-epoch version, indicating that early stopping mitigates overfitting on scaffold-split data.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.