graph neural network gnn
**Graph Neural Networks (GNNs)** are the **deep learning architectures designed to operate on graph-structured data — learning node, edge, and graph-level representations through iterative message passing between connected nodes, enabling neural networks to reason about relational and topological structure in social networks, molecules, knowledge graphs, chip netlists, and any domain where entities and their relationships define the data**.
**Why Graphs Need Specialized Networks**
Images have a regular grid structure (pixels); text has sequential structure (tokens). Graphs have arbitrary, irregular topology — varying numbers of nodes and edges, no fixed ordering, permutation invariance requirements. Standard CNNs and RNNs cannot process graphs. GNNs generalize the convolution concept from grids to arbitrary topologies.
**Message Passing Framework**
All modern GNNs follow the message passing paradigm:
1. **Message**: Each node aggregates "messages" from its neighbors. Messages are functions of the neighbor's features and the edge features.
2. **Aggregate**: Messages are combined using a permutation-invariant function (sum, mean, max).
3. **Update**: The node's representation is updated using the aggregated message and its own current representation.
After K message passing layers, each node's representation encodes information from its K-hop neighborhood.
**Key Architectures**
- **GCN (Graph Convolutional Network)**: The foundational GNN. Aggregation is a normalized sum of neighbor features: h_v = σ(Σ (1/√(d_u × d_v)) × W × h_u) where d_u, d_v are node degrees. Simple, effective, but treats all neighbors equally.
- **GAT (Graph Attention Network)**: Applies attention mechanisms to weight neighbor contributions. Each neighbor's message is weighted by a learned attention coefficient α_uv. Enables the network to focus on the most relevant neighbors for each node.
- **GraphSAGE**: Samples a fixed number of neighbors (instead of using all) and applies learnable aggregation functions (mean, LSTM, pooling). Scales to large graphs with millions of nodes by avoiding full-neighborhood aggregation.
- **GIN (Graph Isomorphism Network)**: Provably as powerful as the Weisfeiler-Leman graph isomorphism test — the most expressive GNN under the message passing framework. Uses sum aggregation with an injective update function.
**Applications**
- **Molecular Property Prediction**: Atoms as nodes, bonds as edges. GNNs predict molecular properties (binding affinity, toxicity, solubility) for drug discovery. SchNet and DimeNet incorporate 3D atomic coordinates.
- **Chip Design (EDA)**: Circuit netlists are graphs. GNNs predict timing violations, routability, and power consumption from placement and routing graphs, enabling fast design space exploration.
- **Recommendation Systems**: User-item bipartite graphs. GNNs propagate preferences through the graph structure, capturing collaborative filtering signals. PinSage (Pinterest) processes graphs with billions of nodes.
- **Knowledge Graphs**: Entity-relation triples form graphs. GNNs learn entity embeddings that support link prediction and question answering over structured knowledge.
**Limitations**
- **Over-Smoothing**: After many message passing layers, all nodes converge to similar representations. Techniques: residual connections, jumping knowledge (aggregate across layers), normalization.
- **Expressiveness**: Standard message passing cannot distinguish certain non-isomorphic graphs. Higher-order GNNs and subgraph GNNs address this at higher computational cost.
Graph Neural Networks are **the neural network family that brings deep learning to relational data** — extending the representation learning revolution from images and text to the interconnected, structured data that describes most real-world systems.