Efficient Subgraph GNNs by Learning Effective Selection Policies

Beatrice Bevilacqua, Moshe Eliasof, Eli Meirom, Bruno Ribeiro, Haggai Maron

TL;DR

Subgraph Graph Neural Networks (GNNs) are highly expressive but notoriously slow because they process a massive "bag" of subgraphs for every input graph. POLICY-LEARN addresses this bottleneck by using a dedicated selection network to iteratively pick a tiny, task-relevant subset of subgraphs. This approach maintains the high expressive power of full-bag methods while drastically slashing computational costs.

The Bottleneck of Subgraph GNNs

Standard Message Passing Neural Networks (MPNNs) are limited by the 1-Weisfeiler-Lehman (1-WL) isomorphism test. This theoretical bound means they cannot distinguish between certain complex graph structures, such as different types of chemical rings. Subgraph GNNs fix this by breaking a graph into a "bag" of subgraphs—for example, by marking or deleting one node at a time—and processing them collectively.

WL-indistinguishable graphs become distinguishable through subgraphs

The catch is scalability. If a graph has $n$ nodes, a standard Subgraph GNN generates $n$ subgraphs. This turns a linear $O(n)$ problem into a quadratic $O(n^2)$ one, making Subgraph GNNs too slow and memory-intensive for large-scale real-world use. While researchers have previously tried picking subgraphs randomly to save time, this paper proves that random sampling often misses the "critical" subgraphs needed to actually distinguish complex structures. As graphs grow larger, the probability of a random policy picking the right "needle in a haystack" drops to zero.

The POLICY-LEARN Framework

To solve this, the authors introduce POLICY-LEARN, a framework consisting of two GNNs working in tandem:

  1. The Selection Network ($f$): This network evaluates the current bag of subgraphs and predicts which node in the original graph should be "marked" next to create a new, useful subgraph. It operates iteratively, meaning it can observe what it has already selected before choosing the next node, ensuring diversity and avoiding redundancy.
  2. The Prediction Network ($g$): Once a small, fixed budget of $T$ subgraphs is selected, this network processes them to make the final downstream prediction (e.g., predicting a molecule's toxicity).

Key Innovations

  • Sequential Selection: Unlike previous "one-shot" methods that pick all subgraphs at once, POLICY-LEARN picks them one by one. This allows the model to choose a diverse set of subgraphs that complement each other.
  • Differentiable Sampling: To train the discrete selection network using standard backpropagation, the authors employ the Gumbel-Softmax trick, allowing the model to smoothly "learn" the choice of picking a node.
  • Theoretical Grounding: The authors mathematically prove that POLICY-LEARN can identify specific families of graphs that both random sampling and prior learnable methods (like OSAN) cannot.

Experimental Validation

The model was evaluated across a diverse suite of benchmarks, including Molecular Chemistry (ZINC-12K, Alchemy-12K, OGB datasets), Social Networks (REDDIT-BINARY), Synthetic Expressivity (CSL and EXP datasets), and Structural Counting tasks.

Key Results

  • Performance vs. Efficiency: On the ZINC dataset, POLICY-LEARN using just $T=5$ subgraphs outperformed standard MPNNs and remained highly competitive with "Full-Bag" models that use all $n$ subgraphs (often 20-50).
  • Superiority over Baselines: It consistently outperformed OSAN (the previous state-of-the-art for learnable selection) and random sampling across almost all Open Graph Benchmark (OGB) datasets.
  • Unlocking Large Graphs: Because computational complexity scales with a small constant $T$ rather than the number of nodes $n$, the model provides a massive speedup and lower memory footprint. On the REDDIT-BINARY dataset, where full-bag Subgraph GNNs crash due to Out-Of-Memory (OOM) errors, POLICY-LEARN achieved 93% accuracy using only two carefully chosen subgraphs.

Limitations and Future Work

While highly effective, POLICY-LEARN currently relies on a fixed hyperparameter $T$ for its subgraph budget. Future iterations could feature a dynamic halting mechanism, allowing the model to decide when it has "seen enough" subgraphs to make a confident prediction. Additionally, while the final prediction is fast, the iterative selection process adds slight computational overhead during the forward pass. Finally, expanding this policy learning approach beyond "node-marking" to other subgraph generation methods, like edge removal, remains an exciting open area for research.

Summary updated

BibTeX
@inproceedings{bevilacqua2024efficient,
  author = {Beatrice Bevilacqua and Moshe Eliasof and Eli Meirom and Bruno Ribeiro and Haggai Maron},
  title = {{Efficient Subgraph GNNs by Learning Effective Selection Policies}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=gppLqZLQeY},
}
Figure