Everything is connected: Graph neural networks

Petar Veličković

Abstract

Graph Neural Networks (GNNs) have emerged as a powerful framework for processing data that does not fit into traditional grid-like or sequential structures. This paper provides a conceptual roadmap for GNNs, positioning them as a universal language for machine learning. By centering the discussion on permutation symmetries and structural constraints, we demonstrate how GNNs encompass a wide range of architectures, including Transformers and Deep Sets, and highlight their transformative impact on fields ranging from drug discovery to industrial logistics.

1. Introduction

Traditional deep learning has achieved remarkable success in domains characterized by regular structures, such as images (processed via Convolutional Neural Networks) and sequences (processed via Recurrent Neural Networks or Transformers). However, most real-world data is inherently irregular and relational. From the molecular bonds in a protein to the complex intersections of a global transportation network, the connections between entities are often as informative as the entities themselves.

Graph Neural Networks (GNNs) address the challenge of learning from these messy, non-Euclidean structures. Rather than treating data as a fixed grid, GNNs operate on graphs, providing a rigorous mathematical foundation for relational reasoning. This paper explores the unified principles that govern GNN design and explains why they have become a cornerstone of modern artificial intelligence.

2. The Mathematical Foundation: Permutation Symmetry

The core requirement for any model operating on a graph is its treatment of node ordering. Unlike a sequence where the position of a word matters, or an image where a pixel's coordinates are fixed, a graph's nodes have no inherent order. This leads to two fundamental symmetry constraints:

  • Permutation Invariance: For graph-level tasks—such as predicting the toxicity of a molecule—the output must remain identical regardless of how the nodes (atoms) are ordered in the input matrix.
  • Permutation Equivariance: For node-level tasks—such as identifying fraudulent users in a social network—if the input nodes are permuted, the resulting node features must be permuted in the exact same way.

By building these symmetries directly into the architecture, GNNs can generalize across different graph sizes and topologies, a property known as "strong inductive bias."

3. The Three Flavors of GNNs

Most GNN architectures can be classified into three "spatial flavors" of increasing expressive power, defined by how they aggregate information from a node's neighborhood:

  1. Convolutional: These models use fixed weights based on the graph structure. A classic example is the Graph Convolutional Network (GCN), which performs a weighted sum of neighbor features where the weights are determined by the adjacency matrix.
  2. Attentional: These models, such as the Graph Attention Network (GAT), use dynamic weights. The importance of a neighbor is not fixed by the graph structure but is instead learned based on the features of the nodes themselves.
  3. Message-Passing: This is the most general and expressive form. In a Message-Passing Neural Network (MPNN), nodes send arbitrary, learnable "messages" to their neighbors, which are then aggregated to update the node's state. This allows for complex interactions that go beyond simple weighted averages.

4. Transformers and the Hardware Lottery

One of the most significant insights in recent GNN research is the realization that the Transformer architecture is actually a special case of an attentional GNN. Specifically, a Transformer is an attentional GNN acting on a complete graph, where every token is connected to every other token.

This perspective helps explain the "Hardware Lottery." While sparse GNNs are often more "natural" for specific tasks, Transformers have dominated the field because their complete-graph structure allows for dense matrix products. These operations are exceptionally well-optimized for current GPU and TPU hardware, whereas the sparse operations required by many GNNs often suffer from lower computational efficiency.

5. Real-World Impact and Applications

GNNs have moved beyond theoretical interest to drive breakthroughs in several high-impact domains:

  • Drug Discovery: GNN-based virtual screening led to the discovery of Halicin, a potent antibiotic capable of killing drug-resistant bacteria. The model was able to identify molecular patterns that traditional methods missed.
  • Traffic Forecasting: Google Maps utilizes GNNs to model the road network as a graph, significantly improving the accuracy of estimated travel times (ETAs) by accounting for the relational nature of traffic flow.
  • Scientific Discovery: AlphaFold 2, the breakthrough model for protein folding, utilizes a geometric GNN at its core to reason about the 3D spatial relationships between amino acids.
  • Hardware Design: GNNs have been used to optimize the placement of components on advanced hardware, such as the TPUv5, outperforming human experts in complex chip floorplanning tasks.

6. Limitations and Future Directions

Despite their success, GNNs face several open challenges. A primary concern is the "bottleneck problem" or "over-squashing," where information from a large neighborhood is compressed into a single fixed-size vector, leading to the loss of critical long-range dependencies.

Furthermore, while GNNs excel when a graph is provided, many datasets do not have an explicit graph structure. The emerging field of Latent Graph Inference aims to learn the graph structure and the task simultaneously. However, because selecting an edge is a discrete, non-differentiable operation, this remains a difficult optimization problem requiring advanced techniques like variational approaches or reinforcement learning.

7. Conclusion

Graph Neural Networks represent a shift toward models that respect the relational structure of the real world. By unifying diverse architectures under the umbrella of permutation symmetry and message-passing, we can better understand the strengths and limitations of our current models. As we overcome challenges like over-squashing and hardware optimization, GNNs are poised to become the standard framework for any machine learning task involving interconnected data.

Summary updated

BibTeX
@inproceedings{velickovic2023everything,
  author = {Petar Veličković},
  title = {{Everything is connected: Graph neural networks}},
  booktitle = {Current},
  year = {2023},
  doi = {10.1016/j.sbi.2023.102538},
}
Figure