BN-Pool: Bayesian Nonparametric Pooling for Graphs

Daniele Castellana, Filippo Maria Bianchi

TL;DR

This paper introduces BN-Pool, a novel graph pooling method for Graph Neural Networks (GNNs) that automatically learns the optimal number of "supernodes" for each graph. This adaptive approach addresses a key limitation of existing methods, leading to more compact and interpretable graph representations without sacrificing performance, and shows promising results in both node clustering and graph classification tasks.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) are powerful tools for analyzing graph-structured data, but effectively down-sampling graphs (pooling) to create hierarchical representations remains a challenge. Traditional pooling methods often require pre-defining the number of "supernodes" (pooled nodes) for all graphs in a dataset, which can be suboptimal and lead to redundant representations. This fixed number of supernodes can be too large for some graphs, resulting in inefficiency, or too small for others, leading to information loss. The authors aim to overcome this by developing a pooling method that can dynamically adapt the number of supernodes to the specific structure of each individual graph.

Methods

The core innovation is BN-Pool, a Bayesian Nonparametric (BNP) pooling operator. It frames graph pooling as a generative process where the graph's adjacency matrix is explained by a latent partition of its nodes into clusters. A Dirichlet Process (DP) prior is used to allow an unbounded number of clusters, meaning the model can learn the optimal number of supernodes for each graph.

The node-to-cluster assignments (the "soft clustering" part) are learned through a variational inference framework. A GNN acts as an encoder, learning node embeddings that are then used by a Multilayer Perceptron (MLP) to approximate the posterior distribution of these assignments. This process is trained by optimizing a combination of:

  1. Downstream task loss: The standard loss for the specific task (e.g., classification).
  2. Reconstruction loss: An unsupervised loss that encourages the model to reconstruct the original graph's adjacency matrix from the learned cluster assignments. This helps ensure the clusters reflect the graph's topology.
  3. KL divergence losses: Regularizers that ensure the learned variational distributions (approximations of the true posteriors) are close to their prior distributions.

The authors also introduce a sparse variant of the reconstruction loss to improve computational efficiency for large graphs.

Datasets

The paper evaluates BN-Pool on several datasets for two main tasks:

Node Clustering: * Community (synthetic) * Cora * CiteSeer * PubMed * DBLP

Graph Classification: * GCB-H * Collab * Colors3 * IMDB * Mutagenicity * NCI1 * RedditB * D&D * MUTAG * Proteins * Enzymes * MolHiv * Pep-struct * Multipartite

Key Insights and Ideas

  • Adaptive Pooling is Crucial: The paper strongly suggests that a fixed number of supernodes is a significant limitation. BN-Pool's ability to adapt the number of supernodes per graph is a key differentiator.
  • Bayesian Nonparametrics for Graph Structure: Applying BNP (specifically DP) to graph pooling is a novel approach that naturally handles the uncertainty and variability in graph structures.
  • Generative Model for Topology: Using a generative model (similar to Stochastic Block Models) to explain the adjacency matrix based on cluster memberships provides a principled way to learn meaningful clusters.
  • Unsupervised Auxiliary Loss for Topology Awareness: The reconstruction loss is critical for ensuring that the learned clusters are not arbitrary but reflect the actual connectivity patterns of the graph.
  • Trade-off between Compactness and Information: BN-Pool aims to find a sweet spot, creating compact representations (fewer supernodes) without losing essential information, which is a common goal in graph pooling.

Key Results

  • Node Clustering: BN-Pool achieves state-of-the-art or competitive results on node clustering tasks, outperforming other soft-clustering methods even without knowing the true number of clusters. For example, on the Community dataset, it achieved an ACC of 98.5±0.5 and COS of 83.0±1.4.
  • Graph Classification: BN-Pool performs on par with or better than existing pooling methods across various graph classification benchmarks. It sets new state-of-the-art results on the Colors-3 and Enzymes datasets.
  • Compact Representations: Qualitative results (e.g., Figure 9 and Figure 10) show that BN-Pool can produce sparser and more compact pooled graphs compared to methods like MinCut, which tend to create more redundant structures.
  • Computational Efficiency: While the dense reconstruction loss has O(N²) complexity, the proposed sparse variant reduces it to O(E), making it scalable to larger graphs.

Limitations and Future Work

  • Homophily Assumption: BN-Pool, like many graph pooling methods, is designed for homophilic graphs (where connected nodes tend to have similar features). It performs poorly on heterophilic datasets like Multipartite, indicating a bias towards homophily.
  • Future Work:
    • Heterophilic Graphs: Extend the generative process to better handle heterophilic settings.
  • Dynamic Graphs: Adapt the framework to model temporal dependencies in evolving graphs.
  • Further Exploration of BNP: Investigate other BNP techniques for graph representation learning.

Summary updated

BibTeX
@article{castellana2025bn,
  author = {Daniele Castellana and Filippo Maria Bianchi},
  title = {{BN-Pool: Bayesian Nonparametric Pooling for Graphs}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=3B3Zr2xfkf},
}
Figure