Abstract
We introduce graph normalizing flows: a new, reversible graph neural network model for prediction and generation. On supervised tasks, graph normalizing flows perform similarly to message passing neural networks, but at a significantly reduced memory footprint, allowing them to scale to larger graphs. In the unsupervised case, we combine graph normalizing flows with a novel graph auto-encoder to create a generative model of graph structures. Our model is permutation-invariant, generating entire graphs with a single feed-forward pass, and achieves competitive results with the state-of-the art auto-regressive models, while being better suited to parallel computing architectures.
Introduction
Graph Neural Networks (GNNs) have become the gold standard for modeling relational data, from social networks to molecular structures. However, they face two major hurdles:
- Memory Bottlenecks: Standard GNNs are "memory-hungry." To perform backpropagation, they must store the hidden states of every node at every single message-passing step. For large graphs or very deep networks, this $O(\text{nodes} \times \text{layers})$ requirement quickly exhausts GPU memory.
- Generative Complexity: Creating new graphs is difficult because graphs are discrete and their nodes can be ordered in many ways (permutation). Existing state-of-the-art models like GraphRNN generate nodes one by one (auto-regressive), which is slow, difficult to parallelize, and sensitive to node ordering.
Graph Normalizing Flows (GNFs) address these issues by bringing the power of reversible transformations to graph-structured data. By making message-passing steps exactly invertible, the authors create GRevNets, which significantly reduce memory costs, and a new generative model that is fully permutation-invariant and highly parallelizable.
Methods
The core innovation is the Graph Normalizing Flow (GNF), which ensures that the computation at each layer can be perfectly reversed.
GRevNets for Supervised Learning
To achieve reversibility, node features are split into two halves ($H^{(0)}$ and $H^{(1)}$). During a message-passing step, one half is used to update the other via a coupling layer. Because the layers are reversible, intermediate activations do not need to be stored for backpropagation; they can be reconstructed from the current state. This reduces memory requirements from $O(\text{nodes} \times \text{layers})$ to a constant $O(\text{nodes})$.
Generative GNFs for Unsupervised Learning
For generating graphs, the authors use a two-step pipeline involving a Graph Auto-Encoder (GAE) and a GNF:
- Graph Auto-Encoder (GAE): An encoder maps a graph into a continuous embedding space, and a decoder reconstructs the adjacency matrix.
- The Flow: A GNF models the distribution of these embeddings. To generate a new graph, one samples from a simple Gaussian distribution, runs it backward through the GNF to obtain node embeddings, and uses the GAE decoder to determine the edges.
Key Insights
- Memory Efficiency is Scalability: By decoupling memory usage from depth, GRevNets allow training much deeper GNNs on larger graphs than previously possible on standard hardware.
- Permutation Invariance: GNFs generate the entire graph in a single feed-forward pass, making the model "permutation-invariant" and highly efficient on parallel architectures like GPUs.
- Attention as a Filter: In generative settings with unknown structures, Graph Attention is crucial for allowing nodes to focus on relevant neighbors amidst noise.
Evaluation and Results
The model was evaluated on standard benchmarks including Cora, Pubmed, PPI, QM9, and various synthetic and real-world graph datasets (COMMUNITY-SMALL, EGO-SMALL).
- Massive Memory Savings: On the Pubmed dataset, a GRevNet required only 80.2 MB of memory compared to 945.9 MB for a standard GNN—a 10x+ improvement with no loss in accuracy.
- Competitive Performance: GRevNets matched or outperformed standard GNNs on classification tasks. In graph generation, GNFs achieved results competitive with GraphRNN while being better suited for parallel execution. On the EGO-SMALL dataset, GNFs outperformed GraphRNN on certain structural metrics like "Orbit" counts.
Conclusion and Future Work
GNFs represent a significant step forward in making GNNs more scalable and efficient for generation. Future work includes exploring end-to-end training for the generative model, developing flows that operate directly on discrete structures, and scaling generative GNFs to larger graphs.
Summary updated