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.
| Step | Question answered | Typical implementations |
|---|---|---|
| Select | Which input nodes map to which output nodes | Learned scores, clustering, edge contraction |
| Reduce | How to compute features of output nodes | Sum, mean, weighted aggregation |
| Connect | Which output nodes are linked | Induced subgraph, products of assignment matrices |
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.
| Property | Global pooling | Hierarchical pooling |
|---|---|---|
| Output | One vector per graph | Smaller graph, then a vector |
| Captures multiscale structure | Only indirectly | Yes, through successive coarsening |
| Extra parameters | None or few | Often many |
| Computational cost | Linear in node count | From linear to quadratic |
| Typical methods | Sum, mean, max, attention, Set2Set | DiffPool, TopKPool, SAGPool, MinCutPool |
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.
| Method | Selection mechanism | Main trade-off |
|---|---|---|
| DiffPool | Learned soft assignment to a fixed number of clusters | Expressive, but dense and memory-heavy |
| MinCutPool | Soft clustering regularized by a spectral min-cut loss | Balanced clusters, still dense |
| TopKPool | Keeps the k highest-scoring nodes by a learned projection | Sparse and fast, may drop information |
| SAGPool | Top-k selection with scores from a graph convolution | Uses structure in scoring, same dropping risk |
| EdgePool | Contracts high-scoring edges to merge node pairs | Preserves connectivity, halves nodes at most |
| Graclus pooling | Non-learned greedy graph clustering | Cheap, ignores task signal |
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.
| Situation | Recommended choice | Reason |
|---|---|---|
| Small molecules, graph classification | Sum or attention readout | Strong, cheap and expressive |
| Graphs with clear modular structure | MinCutPool or DiffPool | Learns meaningful clusters |
| Large graphs with thousands of nodes | TopKPool or SAGPool | Sparse operations fit in memory |
| Need for interpretability | Attention readout or clustering | Weights reveal influential nodes |
| Node-level prediction tasks | No pooling | Predictions stay at node resolution |
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.