Quant Memo
Advanced

Graph Pooling and Readout Functions

A graph neural network produces one vector per node, but many tasks need a single prediction for the whole graph — a readout function is the rule that compresses many node vectors into one without depending on node order.

A graph neural network modeling, say, a network of correlated stocks or a supply-chain graph, produces an updated feature vector for every node after a few rounds of message passing. That's useful if the task is node-level, like predicting each company's default risk. But if the task is graph-level — classifying an entire supply chain as fragile or robust, or scoring a whole correlation network's stability — the many node vectors have to be collapsed into one.

A readout function combines all of a graph's node vectors into a single graph-level vector, and it has to be permutation-invariant — giving the same answer no matter what order the nodes happen to be listed in — since a graph itself has no inherent node ordering.

The simplest readout functions are just element-wise sum, mean, or max over all node vectors — cheap, permutation-invariant, but they throw away structure, treating a graph of 500 loosely connected nodes the same way as 50 tightly clustered ones if their aggregated statistics happen to match. Graph pooling methods try to do better by learning a hierarchy: clustering nodes into a smaller set of "super-nodes" based on both their features and their connectivity, then repeating message passing and pooling on the smaller graph, echoing how a convolutional network downsamples an image through successive layers rather than simply averaging every pixel.

In finance, graph-level readouts are used to score systemic risk in interbank lending networks or contagion risk in supply chains, where the object being predicted is a property of the whole network rather than any single node in it.

Related concepts

Practice in interviews

Further reading

  • Ying et al., 'Hierarchical Graph Representation Learning with Differentiable Pooling'
ShareTwitterLinkedIn