Graph Neural Networks
Standard models treat data points as isolated rows, but real-world data is often connected. Graph Neural Networks learn from both a node's features and its structural neighborhood.
Traditional machine learning assumes every data point is independent. But in domains like social networks, molecular chemistry, or traffic systems, the relationships between points are just as important as the points themselves. Graph Neural Networks (GNNs) learn directly from this connected structure.
Structure and Features
A graph provides two distinct signals: the features describing a specific entity, and the edges connecting it to others. A GNN processes both simultaneously, ensuring that predictions are informed by local context rather than just isolated attributes.
Message Passing
The core mechanism of a GNN is message passing. In every layer, a node pulls in the feature vectors of its direct neighbors. It aggregates these signals—typically by summing or averaging them—and uses the result to compute a new, context-aware representation of itself.
The Receptive Field
One layer of message passing only sees immediate neighbors. However, by stacking multiple layers, a node indirectly receives information from nodes further away. A three-layer GNN allows a node to base its representation on a three-hop neighborhood, capturing broad structural patterns.
Where It Breaks
If you stack too many layers, every node eventually aggregates information from the entire graph. This causes over-smoothing: distinct node features get washed out, and all representations converge to the same generic vector, making the network useless for distinguishing individual nodes.
The Quick Version
- Standard models ignore structural connections.
- GNNs process both node features and edges.
- Message passing aggregates neighbor data.
- Stacking layers expands the receptive field.
- Too many layers cause over-smoothing.