Neo4j MPGNN Thesis/ Sida 1 av 5
Background & Problem
Exploring why graph neural networks need efficient integration with graph databases, and the computational challenges of processing large-scale graph data.
Motivation
Graph databases have become an increasingly popular storage solution for interconnected data. Social networks, citation graphs, knowledge bases, and biological networks are all naturally modeled as graphs with nodes and relationships. At the same time, graph neural networks (GNNs) have emerged as one of the leading methods for learning representations on graph-structured data, achieving state-of-the-art results on tasks like node classification, link prediction, and graph classification.
The natural question arises: can we build efficient machine learning pipelines that leverage graph databases as the backend for GNN training and inference?
The Challenge
The core challenge lies in how GNNs work. In a message-passing neural network (MPNN), each node aggregates information from its neighbors, then passes its updated representation to the next layer. After k layers, a node’s representation depends on all nodes within k hops. In dense graphs or graphs with high diameter, this neighborhood can quickly explode to encompass nearly the entire graph.
This creates two major problems:
- Memory explosion: Loading the full graph into memory may be infeasible for large graphs (e.g., ogbn-papers100M has 111 million nodes)
- Computational cost: Processing the entire graph for each training step is expensive
Graph databases offer a potential solution by providing scalable storage and query capabilities for graph-structured data. However, fetching data from a database introduces latency, and the question becomes: can we design pipelines that are both accurate and cost-efficient?
Our Approach
We set out to answer this question by:
- Building a robust integration between Neo4j (a leading graph database) and PyTorch Geometric (a popular GNN library)
- Implementing multiple sampling and inference strategies to control computational cost
- Developing a custom database plugin to move computation into the database itself
- Benchmarking everything across multiple datasets of varying size and complexity
The goal was not just to make it work, but to understand the tradeoffs between accuracy, speed, memory usage, and cost.