← AI Terminology
GNN - Graph Neural Network
A GNN (Graph Neural Network) is a neural network designed to operate on graph-structured data — learning node, edge, and graph-level representations by aggregating information from a node's neighbours through message-passing rounds.
Graphs model relationships that grids (images) and sequences (text) cannot — molecules, social networks, knowledge graphs, road networks, and citation networks.
Graphs model relationships that grids (images) and sequences (text) cannot — molecules, social networks, knowledge graphs, road networks, and citation networks.
Why It Matters in AI
Most real-world data has relational structure: atoms are bonded (molecules), users follow users (social), papers cite papers (citation networks). CNNs and Transformers can't natively handle irregular graph topology. GNNs gave AI the ability to reason about relationships — enabling AlphaFold 2's molecular understanding, drug discovery, fraud detection in payment networks, and recommendation systems at Pinterest and Uber.
Key Points
| Aspect | Description |
|---|---|
| Depth | k message-passing rounds = k-hop neighbourhood — deeper networks see larger local context |
| Aggregation | Sum, mean, max, or attention-weighted — different choices for different graph structures |
| Applications | Drug discovery, protein structure, fraud detection, recommendation, traffic prediction, NLP-KG |
| Message passing | Each node aggregates feature vectors from its neighbours; updates its own representation |
| Expressive limit | GNNs bounded by the Weisfeiler-Leman graph isomorphism test — cannot distinguish some graph structures |
| Key architectures | GCN (Graph Convolutional Network), GraphSAGE, GAT (Graph Attention Network), GIN |
Simple Analogy
Rumour spreading in a social network: each person updates their belief based on what all their friends tell them (message passing). After k rounds, each person's belief reflects information from up to k hops away in the social graph. GNNs learn what information to aggregate and how to update node representations for a given task.
Common Usage Examples
torch_geometric.nn.GCNConv(in_channels, out_channels)— Graph Convolutional Network layer- AlphaFold 2: GNN-like structure reasoning over amino-acid interaction graph
- Pinterest PinSage: GraphSAGE for item recommendation — generates embeddings for 3B items
- Fraud detection: GNN on payment network detects ring fraud by propagating suspicion across connected accounts
dgl.nn.GATConv— Graph Attention Network in Deep Graph Library
Summary
In short: GNNs learn representations from graph-structured data by aggregating information from neighbours — the essential architecture for any task where relationships between entities matter.