GraphGPT: Generative Pre-trained Graph Eulerian Transformer

Qifang Zhao, Weidong Ren, Tianyu Li, Hong Liu, Xingsheng He, Xiaoxiao Xu

TL;DR

GraphGPT brings the "GPT moment" to graph learning by converting complex graph structures into sequences using Eulerian paths. This approach allows the model to scale to a massive 2 billion parameters, achieving state-of-the-art results on major benchmarks like PCQM4Mv2 and ogbl-ppa while overcoming the traditional scalability limits of Graph Neural Networks (GNNs).

What Problem Does This Paper Address?

For years, Graph Neural Networks (GNNs) have been the workhorse of graph learning. However, they hit a "glass ceiling" when scaling. Two major issues—over-smoothing (where node representations become indistinguishable) and over-squashing (where information bottlenecks occur)—prevent GNNs from benefiting from the massive parameter counts that have revolutionized NLP and Computer Vision.

While "Graph Transformers" (GTs) were proposed to solve this, most still rely on handcrafted structural features or GNN-based modules to understand graph topology. Furthermore, the field lacked a robust generative pre-training framework—the very thing that makes models like GPT-4 so powerful.

Methods

The authors introduce the Graph Eulerian Transformer (GET) and a three-stage framework called GraphGPT:

  1. Graph-to-Sequence Transformation: The "secret sauce" is using Eulerian paths (a path that visits every edge in a graph exactly once) to serialize the graph. This provides a lossless, reversible way to turn a graph into a string of tokens representing nodes, edges, and attributes. If a graph isn't naturally Eulerian, the authors "Eulerize" it by adding minimal synthetic edges.
Graph-to-Sequence Transformation via Eulerian Paths
  1. Generative Pre-training: The model is pre-trained on massive amounts of graph data using two tasks:
  2. Next Token Prediction (NTP): The standard "predict the next word" approach used by GPT.
  3. Scheduled Masked Token Prediction (SMTP): A variation of BERT-style masking where the difficulty increases over time.
  4. Multi-Token Node Encoding: To handle graphs with billions of nodes without an exploding vocabulary, they represent each node as a combination of $k$ tokens (similar to how UTF-8 encodes characters), allowing the model to identify unique nodes across massive datasets.
  5. Task-Agnostic Fine-Tuning: By appending special tokens (like [GSUM] for graph summary), the same architecture can be fine-tuned for node, edge, or graph-level predictions.

Datasets

The model was evaluated on a wide array of large-scale benchmarks from the Open Graph Benchmark (OGB):

  • Graph-level: PCQM4Mv2 (3.7M molecules) and ogbg-molpcba.
  • Edge-level: ogbl-ppa (protein-protein interactions) and ogbl-citation2.
  • Node-level: ogbn-proteins and ogbn-arxiv.
  • Pre-training Augmentation: The authors also used diverse datasets like Reddit-threads and synthetic Erdos-Renyi graphs to teach the model general structural patterns.

Key Insights and Ideas

  • The Eulerian Advantage: Unlike random walks, an Eulerian path guarantees the model "sees" every edge. This ensures the sequence contains the complete topological information of the graph.
  • Scaling Laws Exist for Graphs: The paper demonstrates that graph models can follow the same scaling laws as LLMs. As they increased the model size from "Mini" (4.2M params) to "XXL" (2B params), performance continued to improve consistently.
  • Implicit Structural Bias: By treating the graph as a sequence, the Transformer learns the "shape" of the graph through the order of tokens, reducing the need for the handcrafted "positional encodings" that plague other Graph Transformers.
  • Cyclic Re-indexing: To prevent the model from memorizing specific node IDs, they randomly shift node indices during training. This forces the model to learn the structure rather than just specific node labels.

Key Results

  • SOTA on PCQM4Mv2: GraphGPT achieved a Mean Absolute Error (MAE) of 0.0804, surpassing the previous state-of-the-art (0.0821).
Performance comparison on the PCQM4Mv2 dataset
  • Protein Interaction Breakthrough: On the ogbl-ppa dataset, the XXL model reached a Hit@100 of 76.55%, a massive jump over traditional GNN baselines.
  • Parameter Efficiency: Even without manual feature engineering, GraphGPT outperformed complex, specialized architectures by simply being larger and better pre-trained.
  • Scalability: This is the first work to successfully scale a graph-centric foundation model to the 2-billion-parameter mark with sustained performance gains.

Limitations and Future Work

  • Domain Specificity: While the model shows some cross-dataset understanding, it still performs best when pre-trained on data similar to the target task (e.g., pre-training on molecules for molecular tasks).
  • Computational Cost: Pre-training the larger variants is resource-intensive, requiring significant GPU hours (e.g., ~63 V100 hours for the 100M parameter "Base" model).
  • 2D vs 3D: For chemistry tasks, the model currently operates on 2D graph structures. The authors suggest that incorporating 3D spatial coordinates could further boost performance in molecular modeling.
  • Small Datasets: Like most large Transformers, GraphGPT is "data-hungry" and may be less practical than simple GNNs for very small, niche datasets.

Summary updated

BibTeX
@inproceedings{zhao2025graphgpt,
  author = {Qifang Zhao and Weidong Ren and Tianyu Li and Hong Liu and Xingsheng He and Xiaoxiao Xu},
  title = {{GraphGPT: Generative Pre-trained Graph Eulerian Transformer}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=4RdzeucFmW},
}
Figure