Graph Neural Network
Neural networks for data shaped like a network, such as molecules, social graphs or road maps, where each node learns from its neighbors.
Also GNN · message passing · graph convolutional network · GCN
Kipf and Welling (GCN), 2016; Gilmer et al. (message passing), 2017
Everyone in a village whispers what they know to their neighbors, a few rounds in a row. Afterwards, each person knows something about their whole neighborhood.
Where it fits
+All relationships as a list
How it works
Images are grids and text is a line, but much data is a graph: atoms joined by bonds, people joined by friendships, junctions joined by roads. A graph neural network works directly on that structure.
Each layer does message passing:
- Every node sends a message (a vector) to its neighbors.
- Every node combines the messages it receives, for example by averaging them.
- A small neural network mixes that with the node’s own vector to produce its new vector.
After one layer, a node knows about its direct neighbors; after three, about everything within three hops. The final vectors can classify nodes (is this account fraudulent?), links (will these two proteins interact?) or whole graphs (is this molecule toxic?).
A CNN is a special case where the graph is a pixel grid, and a Transformer is in a sense a GNN on a fully connected graph where attention decides how much each neighbor counts.
Everyday use cases
- Case 01
Drug and materials discovery
Molecules are graphs of atoms and bonds; GNNs predict their properties.
- Case 02
Travel time estimates
Road networks are graphs; GNNs have been used to predict arrival times.
- Case 03
Fraud rings
Spot suspicious clusters of accounts connected by transactions.
Strengths, weaknesses and when to use it
Strengths
- Works directly on irregular structures that images and sequences cannot represent.
Weaknesses
- Deep stacks tend to blur all nodes together (over-smoothing).
- Large graphs are expensive to process.
When to use itWhen relationships between items matter as much as the items themselves.
Compare with
Check yourself
- Q01
After 3 message-passing layers, what can a node know about?
Show answer
B: Nodes up to 3 hops away