Manuscript Offprint

arXiv:2610.33623

Graph-dependent pooling: adaptive granularity in hierarchical graph neural networks

Bohan Yoon, Hyejin Jang

ABSTRACT

Graph Neural Networks are widely used to learn structural representations of relational data. Hierarchical graph pooling learns multi-level representations by progressively coarsening graphs; however, prior methods rely on predefined cluster numbers or fixed pooling ratios, limiting adaptability to individual graphs. We propose Graph-Dependent Pooling (GDPool), which dynamically determines pooling granularity for each graph. We analyze optimization conflicts among layer-wise objectives through gradient alignment, showing that layer-wise objectives at different pooling levels can send conflicting gradients to shared parameters. GDPool uses self-attention to select graph-specific anchors representing structurally important nodes and constructs coarse graphs through soft node assignment. Experiments on metal-organic framework and molecular graph benchmarks show that GDPool consistently achieves the best predictive performance across all benchmarks. Evaluations using modularity and the effective number of clusters show that GDPool achieves consistently higher modularity than existing methods while the number of active clusters decreases monotonically with depth. Sensitivity analyses confirm stable behavior across hyperparameter and architectural choices.

1 INTRODUCTION

Graph Neural Networks (GNNs) have become a widely used approach for learning from relational data, including molecules, crystal structures, and social networks (Gilmer et al., 2017; Xu et al., 2019). In molecular and materials property prediction, graph-based models represent atoms and bonds as graphs and directly predict graph-level properties (Xie & Grossman, 2018; Chen et al., 2019). Effective graph-level prediction requires aggregating node-level information into a representation of the entire graph. While standard sum or mean readout aggregates all node representations in a single step, graph pooling progressively coarsens the graph to learn structural representations at multiple levels (Ying et al., 2018; Grattarola et al., 2022; Liu et al., 2022). Hierarchical graph pooling has therefore emerged as a key approach for compressing complex graph structures while preserving salient information, with recent work also theoretically analyzing how pooling operations affect the expressive power of GNNs (Bianchi & Lachi, 2023).

Hierarchical graph pooling involves two key design challenges. The first is determining how much to coarsen a graph. Clustering-based methods such as DiffPool, MinCutPool (Bianchi et al., 2020), and MemPool (Khasahmadi et al., 2020) typically require a predefined number of clusters, whereas selection-based methods such as Graph U-Nets (Gao & Ji, 2019), SAGPool (Lee et al., 2019), and ASAPool (Ranjan et al., 2020) rely on a predefined pooling ratio. To relax this fixed granularity, methods such as GMPool (Ko et al., 2023) and BN-Pool (Castellana & Bianchi, 2026) adapt the number of clusters to each input graph, but still require a hyperparameter specifying the maximum number of clusters. Moreover, learning graph-dependent coarsening consistently across multiple pooling levels remains an open challenge. The second challenge is how to learn these levels as a coherent hierarchy. Existing soft-assignment methods apply auxiliary objectives at individual levels (Ying et al., 2018; Bianchi et al., 2020); however, because each higher-level graph is constructed from the output of the preceding pooling operation, its supervision target recursively depends on earlier assignments. Consequently, supervising each level only through its own local objective does not necessarily ensure structural consistency across the hierarchy.

To address these challenges, we propose Graph-Dependent Pooling (GDPool). GDPool identifies important nodes as graph-specific anchors and dynamically determines pooling granularity without a predefined number of clusters or pooling ratio. Self-attention estimates node importance, selects anchors, and softly assigns nodes to the selected anchors to construct a coarse graph. We further propose hierarchical supervision, which applies pooling objectives to the cumulative assignments so that every level is anchored to the original graph. GDPool thus learns graph-dependent hierarchical representations. We evaluate predictive performance and hierarchy quality using modularity (Newman & Girvan, 2004) for structural cohesion, the effective number of clusters KeffK_{eff} (Zheng & Vedaldi, 2023) for cluster utilization, and gradient alignment (Sener & Koltun, 2018; Yu et al., 2020) among hierarchical objectives. The evaluation quantifies whether GDPool adapts to each graph while maintaining a consistent hierarchy. Our main contributions are as follows.

• Graph-dependent pooling. We propose GDPool, which selects important nodes as anchors via self-attention and thereby determines pooling granularity without a predefined number of clusters or pooling ratio. Each cluster is anchored at an actual node, which makes the hierarchy directly interpretable.

• Gradient conflict analysis and hierarchical supervision. Measuring the gradient alignment between the auxiliary objectives of different pooling layers, we identify two sources of conflict: layer-wise supervision and a pooling budget that does not fit the graph. We mitigate the first by supervising the cumulative assignment of every level against the original graph, and the second by graph-dependent anchor selection.

• Empirical validation across domains. GDPool achieves the best MAE on all five targets of four MOF and molecular benchmarks against nine existing pooling methods, with a monotonically decreasing number of active clusters and consistently higher modularity. GDPool thus forms coherent hierarchies rather than merely reducing the number of nodes.

References (77)

  • Maxcutpool: differentiable feature-aware maxcut for pooling in graph neural networks
  • Generalizing downsampling from regular data to graphs
  • The expressive power of pooling in graph neural networks
  • Spectral clustering with graph neural networks for graph pooling
  • Fast unfolding of communities in large networks
  • An online database of computational adsorption data for nanoporous materials
  • a diverse database of metal-organic frameworks with dft-derived partial atomic charges and descriptors for machine learning
  • Graph coarsening with neural networks (opens arXiv in a new tab)
  • Towards sparse hierarchical graph classifiers (opens arXiv in a new tab)
  • BN-pool: Bayesian nonparametric pooling for graphs
  • Graph networks as a universal machine learning framework for molecules and crystals
  • Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks
  • A chemically functionalizable nanoporous material [cu3 (tma) 2 (h2o) 3] n
  • Core mof 2019
  • Convolutional neural networks on graphs with fast localized spectral filtering
  • Frederik Diehl. Edge contraction pooling for graph neural networks. arXiv preprint arXiv:1905.10990, 2019. (opens arXiv in a new tab)
  • Adapting auxiliary losses using gradient similarity (opens arXiv in a new tab)
  • A Generalization of Transformer Networks to Graphs
  • Benchmarking graph neural networks
  • Graph u-nets
  • Neural message passing for quantum chemistry
  • Understanding pooling in graph neural networks
  • Inductive representation learning on large graphs
  • Strategies for pre-training graph neural networks
  • Scaling up graph neural networks via graph coarsening
  • Multi-task learning using uncertainty to weigh losses for scene geometry and semantics
  • Memory-based graph networks
  • Understanding attention and generalization in graph neural networks
  • Grouping matrix based graph pooling with adaptive number of clusters
  • Re-thinking graph transformers with spectral attention
  • Revisiting k-means: New algorithms via bayesian nonparametrics (opens arXiv in a new tab)
  • Deeply-supervised nets
  • Self-attention graph pooling
  • Conflict-averse gradient descent for multi-task learning
  • Graph pooling for graph neural networks: Progress, challenges, and opportunities (opens arXiv in a new tab)
  • SGDR: stochastic gradient descent with warm restarts
  • Decoupled weight decay regularization
  • Spectrally approximating large graphs with smaller graphs
  • Finding and evaluating community structure in networks
  • Quantum chemistry structures and properties of 134 kilo molecules
  • Recipe for a general, powerful, scalable graph transformer
  • Asap: Adaptive structure aware pooling for learning hierarchical graph representations
  • Multi-task learning as multi-objective optimization
  • Intraclass correlations: uses in assessing rater reliability
  • Going deeper with convolutions
  • Atomic-level interpretable multimodal graph neural network for predicting carbon dioxide adsorption in metal-organic frameworks
  • From louvain to leiden: guaranteeing well-connected communities
  • Graph attention networks
  • Large-scale screening of hypothetical metal–organic frameworks
  • Structural entropy guided graph hierarchical pooling
  • Holistically-nested edge detection
  • Crystal graph convolutional neural networks for an accurate and interpretable prediction of material properties
  • On layer normalization in the transformer architecture
  • How powerful are graph neural networks? In International Conference on Learning Representations, 2019
  • Do transformers really perform badly for graph representation? Advances in neural information processing systems, 34:28877–28888, 2021
  • Hierarchical graph representation learning with differentiable pooling
  • Gradient surgery for multi-task learning
  • Hierarchical graph pooling with structure learning (opens arXiv in a new tab)
  • Online clustered codebook
  • Unet++: A nested u-net architecture for medical image segmentation
  • Since C is determined dynamically for each graph, GDPool can construct hierarchical graph representations with different pooling granularities for different input graphs
  • All models were trained with the AdamW optimizer (Loshchilov & Hutter, 2019) with a weight decay of $10^{-4}$
  • For pooling-ratio-based methods, the default pooling ratio of each method was used on all datasets
  • $N$ and $E$ denote the number of nodes and edges
  • The corresponding RMSE and $R^2$ results are provided in Tables 5 and 6, respectively, for completeness
  • For hard assignments this reduces to the standard modularity, and near-uniform soft assignments yield $Q \approx 0$
  • For each graph, the total assignment mass received by each cluster is normalized into a distribution over clusters, and $K_{\mathrm{eff}}$ is the perplexity of this distribution, i.e., the exponential of its entropy
  • GDPool thus behaves like a ratio-based pooling method whose ratio is not set in advance but emerges from the anchor criterion $p_j > \bar{p}$, and the emergent ratio differs from both a fixed number of clusters ($K = 32$) and the default pooling ratio of 0.5
  • To quantify the consistency of the number of selected anchors, we used the one-way random-effects ICC, i.e., ICC(1,1) in the notation of Shrout & Fleiss
  • An ICC close to 1 therefore indicates that the variation arising from differences between graphs dominates the variation induced by the random seed, i.e., that the number of anchors is stable with respect to the seed
  • For each pair of seeds, we computed the Jaccard similarity per graph and averaged it over all graphs; the final score is the mean over the three seed pairs
  • Coordinated and free water molecules are removed with the CoRE MOF cleaning procedure (Chung et al., 2019), which yields the activated framework with 624 atoms ( $Cu_{48}C_{288}O_{192}H_{96}$ ); the structure is then converted into a graph with the same preprocessing as the hMOF dataset
  • Only atoms inside one unit cell are drawn in Figure 5a, so paddlewheels at the cell boundary appear without their ligands, whereas Figure 5b completes such fragments; the graph itself uses periodic neighbors, so the model
  • #Anchors, modularity, and $K_{\mathrm{eff}}$ are reported per pooling level (L1/L2/L3)
  • >$\lambda$</td><td rowspan=
  • >Method</th><th colspan=
  • >1</td><td rowspan=