Abstract
Graph Neural Networks (GNNs) are powerful tools for modeling interconnected data but often suffer from a lack of task-specific labeled data. We present GPT-GNN, a generative pre-training framework that enables GNNs to learn from massive unlabeled graphs. By factorizing the graph generation process into attribute and edge reconstruction, GPT-GNN captures the deep dependencies between node features and graph topology. Our approach introduces an efficient node-masking strategy and an adaptive queue to scale to billion-node graphs. Evaluation on the Open Academic Graph (OAG) and Amazon datasets shows that GPT-GNN significantly improves performance on downstream tasks, achieving state-of-the-art results with only a fraction of the labeled data typically required.
Introduction
While GNNs excel at capturing structural information, their training is notoriously data-hungry. In massive networks, obtaining high-quality labels for every node or edge is often prohibitively expensive. Inspired by the success of self-supervised pre-training in NLP (e.g., GPT, BERT), we propose a similar paradigm for graphs. However, graphs present unique challenges: node attributes and structural edges are deeply intertwined, and the scale of modern graphs (billions of nodes) makes standard generative models computationally infeasible. GPT-GNN addresses these by modeling the joint distribution of attributes and structure in a scalable, autoregressive manner.
Methods
The GPT-GNN framework pre-trains a GNN by tasking it with the autoregressive generation of an input graph. The generation process is factorized to capture the dependency between a node's semantic features and its connectivity.
Factorized Attributed Graph Generation
To model the graph generation, GPT-GNN factorizes the likelihood into two coupled steps for each node:
- Attribute Generation: Given the observed edges, the model predicts the node's attributes.
- Edge Generation: Given the observed edges and the newly generated attributes, the model predicts the remaining edges.
This sequence forces the model to learn how a node's characteristics influence its position in the network and vice versa.
Efficient Training and Scalability
To maintain efficiency, GPT-GNN employs Node Separation. Instead of multiple passes, nodes in a sampled subgraph are split into "Attribute Generation Nodes" (where attributes are masked) and "Edge Generation Nodes" (where attributes are visible). This allows the model to compute representations for both tasks in a single GNN pass.
Furthermore, to handle the limitations of subgraph sampling, an Adaptive Queue is used. It stores node representations from previous subgraphs, providing a global pool of negative samples for contrastive learning, which prevents the model from overfitting to local structures.
Experiments and Datasets
The framework was evaluated on several large-scale datasets:
- Open Academic Graph (OAG): A heterogeneous dataset with 179 million nodes and 2.2 billion edges. Downstream tasks included Paper-Field prediction and Author Name Disambiguation.
- Amazon Review Dataset: 113 million nodes representing users and products. The task was a 5-class rating prediction.
- Homogeneous Graphs: Performance was also verified on the Reddit dataset and OAG-based citation networks.
Key Results
GPT-GNN demonstrated substantial improvements over training from scratch and existing pre-training baselines such as Graph Auto-Encoders (GAE) and Deep Graph Infomax.
- Performance Gains: On average, GPT-GNN improved downstream task performance by 13.3% on OAG and 5.7% on Amazon compared to base models like the Heterogeneous Graph Transformer.
- Extreme Data Efficiency: One of the most significant findings is the model's ability to perform well with minimal supervision. Fine-tuning a pre-trained GPT-GNN with just 10–20% of the labeled data achieved performance comparable to a fully supervised model using 100% of the data.
- Transferability: The model showed robust performance in transfer learning scenarios, successfully moving knowledge across different time periods and academic fields.
Discussion and Limitations
The success of GPT-GNN highlights that structure and semantics are deeply coupled in attributed graphs. Masking edges is essential to prevent the model from simply memorizing connections, forcing it to learn the underlying data distribution.
However, the framework's reliance on complex subgraph sampling (e.g., LADIES or HGSampling) introduces pipeline complexity and potential sampling biases. Future work will focus on applying GPT-GNN to other complex domains, such as the Internet of Things (IoT) and massive knowledge graphs, where unlabeled data is abundant but labels are scarce.
Summary updated