Graph pooling

On this page 7

Graph pooling is an operation in graph neural networks that reduces the number of nodes in a graph, or compresses the whole graph into a single vector, while preserving the information needed for a downstream task. In graph learning, it plays the role that pooling layers play in convolutional networks: it summarizes local features into coarser representations.

Pooling is essential for graph-level tasks such as graph classification and graph regression, where one prediction is made per molecule, protein or program rather than per node. Because graphs have no fixed grid or node order, pooling must be permutation invariant, which makes its design considerably harder than pooling on images.

How graph pooling works inside a graph neural network

A typical graph neural network first applies several message passing layers that update each node embedding from its neighbors. Graph pooling then either collapses all node embeddings into one graph embedding or builds a smaller, coarsened graph on which further message passing layers operate.

Every pooling operator answers three design questions, often described as select, reduce and connect. Selection decides which nodes belong to each output node, reduction computes the features of the new nodes, and connection defines the edges of the coarsened graph.

StepQuestion answeredTypical implementations
SelectWhich input nodes map to which output nodesLearned scores, clustering, edge contraction
ReduceHow to compute features of output nodesSum, mean, weighted aggregation
ConnectWhich output nodes are linkedInduced subgraph, products of assignment matrices
The three steps of a pooling operator

The key requirement is permutation invariance for graph-level outputs: relabeling the nodes of an input graph must not change the prediction. Simple aggregators such as sum and mean satisfy this property by construction, and learned methods must preserve it through their design.

Global pooling and hierarchical pooling

Graph pooling methods fall into two broad families. Global pooling, also called a readout function, collapses all nodes in one step, while hierarchical pooling coarsens the graph gradually across several layers, similar to the downsampling stages of a convolutional network.

PropertyGlobal poolingHierarchical pooling
OutputOne vector per graphSmaller graph, then a vector
Captures multiscale structureOnly indirectlyYes, through successive coarsening
Extra parametersNone or fewOften many
Computational costLinear in node countFrom linear to quadratic
Typical methodsSum, mean, max, attention, Set2SetDiffPool, TopKPool, SAGPool, MinCutPool
Global and hierarchical pooling compared

Among global methods, sum pooling is the most expressive simple choice, because it preserves information about graph size and node multiplicities. This insight underlies the graph isomorphism network, whose theory shows that mean and max aggregation cannot distinguish certain graphs that sum can.

Main hierarchical pooling methods

Hierarchical methods differ mainly in how they select nodes for the coarsened graph. Dense methods learn soft cluster assignments, while sparse methods keep a subset of nodes and drop the rest. The table below summarizes widely used operators.

MethodSelection mechanismMain trade-off
DiffPoolLearned soft assignment to a fixed number of clustersExpressive, but dense and memory-heavy
MinCutPoolSoft clustering regularized by a spectral min-cut lossBalanced clusters, still dense
TopKPoolKeeps the k highest-scoring nodes by a learned projectionSparse and fast, may drop information
SAGPoolTop-k selection with scores from a graph convolutionUses structure in scoring, same dropping risk
EdgePoolContracts high-scoring edges to merge node pairsPreserves connectivity, halves nodes at most
Graclus poolingNon-learned greedy graph clusteringCheap, ignores task signal
Widely used hierarchical graph pooling operators

Dense methods build an assignment matrix of size nodes by clusters, so memory grows quadratically and limits them to graphs of a few hundred or a few thousand nodes. Sparse top-k methods scale to larger graphs but can disconnect the remaining nodes, which weakens message passing in later layers.

Choosing a pooling strategy

The right pooling operator depends on graph size, task type and the importance of substructure. In practice, a strong global readout is the recommended starting point, because several benchmark studies found that elaborate hierarchical methods often give small or inconsistent gains over well-tuned global pooling.

SituationRecommended choiceReason
Small molecules, graph classificationSum or attention readoutStrong, cheap and expressive
Graphs with clear modular structureMinCutPool or DiffPoolLearns meaningful clusters
Large graphs with thousands of nodesTopKPool or SAGPoolSparse operations fit in memory
Need for interpretabilityAttention readout or clusteringWeights reveal influential nodes
Node-level prediction tasksNo poolingPredictions stay at node resolution
Decision guide for graph pooling

Combining several readouts, for example concatenating sum, mean and max vectors, is a common low-cost improvement. Another option is a virtual node connected to all nodes, which acts as a learned global summary during message passing.

Limitations and open questions

Graph pooling remains an active research area because no single operator works best across tasks. Practitioners should keep the following limitations in mind when designing an architecture.

  • Information loss: sparse methods discard nodes entirely, which can remove rare but decisive substructures.
  • Weak benchmark gains: improvements reported on small datasets are often within the variance of random seeds.
  • Training instability: dense assignment methods may collapse many nodes into one cluster without auxiliary losses.
  • Expressiveness limits: pooling cannot recover structural information that the preceding message passing layers failed to capture.
  • Scalability: dense pooling with quadratic memory is impractical for social or citation networks.

Graph transformers and graph foundation models also rely on pooling, often through a dedicated summary token, so the same trade-offs between compression and fidelity reappear in newer architectures.

The short version

Many things can be drawn as dots and lines. A molecule has atoms linked by bonds. A network model learns something about every dot. Graph pooling squeezes all those dots into one summary.

Think of a class report. Each student has a grade. The principal wants one number for the whole class. Pooling is that step from many grades to one useful overview. Some methods add everything up. Others first group students into teams and summarize each team.

Where it makes a difference

A pharmaceutical research team screens two million candidate molecules for toxicity before laboratory testing. Each molecule is a graph with 20 to 60 atoms as nodes and chemical bonds as edges. The model must give one toxicity score per molecule, so graph pooling is required.

The team trains a graph isomorphism network with five message passing layers. It compares mean pooling, sum pooling and an attention-based readout on a held-out scaffold split. Sum pooling clearly outperforms mean pooling, because molecule size and repeated functional groups matter for toxicity. The attention readout reaches similar accuracy and also highlights atoms that drive each score.

Chemists use the attention weights to review flagged molecules. The screening step cuts the laboratory workload to a few thousand high-risk candidates, and the interpretable readout helps the team trust and audit the model before using it in decisions.