All models

DiffPool

Differentiable soft clustering that coarsens a graph layer by layer for hierarchical graph classification.

Graphs and geometry · 237 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
164.3K
Operations
237
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2018
Cited by
798 (as of 18 October 2026)
Authors
Rex Ying, Jiaxuan You, Christopher Morris and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m747
Graph hash
e37f1be14b73debb95b845944714cd0c662f04685d1e42d2990ed7dfc69f0f3d
Skeleton hash
f4c1372ef7b0aa667f3908960c861aa0c848f5b871b82754056857eb93c807a1
Architecture hash
1b0a10d1b572bc3547bfa47b9859422d7be3ffc816a2d673baee0bab6d566968
Diagram SHA-256
14da2f520d05a5e2d074d2d3621f1fd30a53eb68c7ce755bf4cef62a0a7dd2d5
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

DiffPool is a differentiable graph pooling module that lets a graph neural network learn hierarchical representations of graphs, and it can be combined with various GNN architectures end to end. The motivation is that standard GNNs are inherently flat and do not learn hierarchical representations, which matters most for graph classification, where the goal is to predict the label of an entire graph. At each layer DiffPool learns a differentiable soft cluster assignment for the nodes, mapping them to a set of clusters that become the coarsened input for the next GNN layer.

The idea borrows from CNNs: a graph analogue of spatial pooling that lets deep architectures operate on coarser and coarser versions of the input. The hard part is that graphs have no natural notion of spatial locality, so one cannot simply pool together all nodes in an m × m patch. Two separate GNNs consume the same input at each layer: an embedding GNN produces new node embeddings, and a pooling GNN followed by a row-wise softmax produces the probabilistic cluster assignment. The coarsened adjacency matrix is a real matrix representing a fully connected edge-weighted graph, each entry the connectivity strength between two clusters. Because training the pooling GNN from the classification signal alone is hard, the authors add an auxiliary link prediction objective, which encodes the intuition that nearby nodes should be pooled together. They also regularise the entropy of the cluster assignment so that each node's membership is close to a one-hot vector.

In the paper's experiments the GNN under DiffPool is built on top of the GraphSAGE architecture, which they found superior to the standard GCN approach. In the two-pooling-layer architecture the number of clusters is set to 25% of the number of nodes before pooling. Combined with existing GNNs, DiffPool gave an average 5-10% accuracy improvement on graph classification benchmarks over all existing pooling approaches and a new state of the art on four of five datasets. A quirk worth knowing: DiffPool could be unstable to train, with significant variation in accuracy across runs even at the same hyperparameters. Adding the link prediction objective makes training more stable and reduces the standard deviation of accuracy across runs. GraphSAGE with DiffPool also ran 12× faster than GraphSAGE with Set2Set pooling, while still achieving higher accuracy on all benchmarks.

Key idea. A differentiable, end-to-end soft cluster assignment that lets GNNs pool nodes hierarchically instead of only globally.

  • DiffPool
  • dense_diff_pool
  • Differentiable Pooling
  • differentiable graph pooling
  • hierarchical graph representation learning
  • graph classification
  • soft cluster assignment
  • graph coarsening
  • pooling-dense

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{ying2019hierarchicalgraphrepresentationlearning,
      title={Hierarchical Graph Representation Learning with Differentiable Pooling}, 
      author={Rex Ying and Jiaxuan You and Christopher Morris and Xiang Ren and William L. Hamilton and Jure Leskovec},
      year={2019},
      eprint={1806.08804},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1806.08804}, 
}