Graph Neural Network
A type of neural network designed to operate on graph-structured data, where entities are connected by relationships, such as social networks, molecules, or knowledge graphs.
A graph neural network (GNN) is a neural network architecture designed to work with data that is naturally structured as a graph β a collection of nodes (entities) connected by edges (relationships). Unlike standard neural networks that process grids of pixels or sequences of tokens, GNNs process the topology and features of connected data.
What graphs look like in practice
Graphs are everywhere. Social networks are graphs where people are nodes and friendships are edges. Molecules are graphs where atoms are nodes and chemical bonds are edges. Road networks, recommendation systems, knowledge bases, financial transaction networks, and supply chains are all naturally graph-structured.
How GNNs work
The core operation in a GNN is "message passing." Each node collects information from its neighbours, combines it with its own features, and updates its representation. This process repeats over multiple layers β after one layer, each node knows about its immediate neighbours. After two layers, it knows about neighbours of neighbours. After several layers, each node's representation captures information about the broader graph structure around it.
Key GNN architectures
- Graph Convolutional Networks (GCN): Aggregate neighbour information using weighted averages, analogous to convolutions in image processing.
- Graph Attention Networks (GAT): Use attention mechanisms to learn which neighbours are most important, similar to attention in transformers.
- Message Passing Neural Networks (MPNN): A general framework where nodes exchange learned messages along edges.
Applications
- Drug discovery: Predicting molecular properties by modelling molecules as graphs.
- Fraud detection: Identifying suspicious patterns in financial transaction networks.
- Recommendation systems: Modelling user-item interactions as a bipartite graph.
- Traffic prediction: Forecasting congestion by modelling road networks.
- Knowledge graph reasoning: Answering questions by traversing relationships between entities.
GNNs and language models
While transformers have dominated recent AI progress, GNNs remain the best approach for inherently relational data. Some researchers are exploring combinations β using GNNs to enhance language models' ability to reason over structured knowledge bases.
Why This Matters
Graph neural networks are essential for AI applications involving relational data β from drug discovery to fraud detection. Understanding GNNs broadens your view of AI beyond language and image models to the many domains where relationships between entities are the key source of information.
Related Terms
Continue learning in Advanced
This topic is covered in our lesson: Specialised AI Architectures