One Model for One Graph: A New Perspective for Pretraining with Cross-domain Graphs

Jingzhe Liu, Haitao Mao, Zhikai Chen, Wenqi Fan, Mingxuan Ju, Tong Zhao, Neil Shah, Jiliang Tang · Submission to ICLR 2025 · Rejected

TL;DR

Standard graph foundation models attempt to force all graphs into a single architecture, but extreme structural and semantic differences across domains often trigger catastrophic forgetting and negative transfer. OMOG (One Model for One Graph) flips this paradigm by pretraining a modular bank of graph-specific experts alongside lightweight, post-hoc gating modules. At test time, OMOG adaptively selects and fuses the top-$k$ most relevant expert models for an unseen graph, achieving state-of-the-art transfer performance on both zero-shot and few-shot tasks.

What Problem Does This Paper Address?

In natural language processing and computer vision, a single massive model can generalize across thousands of diverse tasks. Cross-domain Graph Neural Networks (GNNs) struggle to replicate this success due to structural and feature heterogeneity:

  1. Feature disparity: Different datasets have distinct attribute vocabularies and dimensions.
  2. Structural disparity: Graphs from different domains exhibit fundamentally conflicting topological properties—most notably homophily (the tendency of connected nodes to share labels). A single model trained to assume high homophily will degrade on heterophilous graphs.

Recent attempts to train a unified "one model for all graphs" backbone frequently trigger negative transfer, where pretraining data from conflicting domains hurts performance on novel downstream graphs.

Methods

OMOG replaces the monolithic pretraining pipeline with a two-stage "model bank" architecture:

[Pretraining]
Graph_i ──> SGC Aggregation ──> Expert_i (Transformer + Contrastive Loss)
                              └──> Gate_i (MLP Filter/Generator)

[Inference on Unseen Graph]
G_test ──> Evaluate all Gates ──> Top-k Expert Selection ──> Weighted Fusion ──> Prediction

1. Unified Representation

To align feature spaces across distinct domains, node textual descriptions are encoded into a shared 384-dimensional semantic space using SentenceBERT. Structural context is captured by running multi-hop Simplified Graph Convolutions (SGC, $\alpha = 4$) over the unified features.

2. Graph-Specific Pretraining (The "Model Bank")

For each pretraining graph $G_i$, OMOG independently trains:

  • An Expert Model: A Transformer block taking multi-hop neighborhood features as input, trained via node-level feature masking and self-supervised contrastive learning.
  • A Post-Hoc Gating Module: An MLP that learns to mask out irrelevant features and retain domain-salient signals. It is trained so that filtered representations match the pretraining graph's domain centroid embedding while perturbed/masked versions are pushed away.

3. Inference via Adaptive Model Fusion

Given an unseen target graph:

  • Each pretrained gate scores the target graph's relevance by comparing filtered node representations to its domain centroid.
  • The top-$k$ ($k=2$) scoring experts are selected, normalized via softmax, and averaged into a custom, task-specific model.
  • Predictions use cosine similarity retrieval between target node embeddings and label/class centroid embeddings (for zero-shot and few-shot classification) or pairwise node similarities (for link prediction).

Datasets

The authors evaluate OMOG using a leave-one-out evaluation on 10 text-attributed graphs (TAGs) curated by Chen et al. (2024b), spanning diverse domains:

  • Computer Science & Bio Citation: Cora, CiteSeer, Arxiv, DBLP, PubMed
  • E-Commerce & Social Networks: History, Child, Sportsfit, Products, Amazon Ratings (notably heterophilous)
  • Knowledge Graphs: WikiCS

No new benchmark datasets were introduced.

Key Insights and Ideas

  • Modularity beats monolithic backbones: Decoupling pretraining into isolated, per-graph models inherently eliminates interference between conflicting graph structures (e.g., citation networks vs. recommendation graphs). Adding new datasets to the pretraining pool requires training only one new expert, avoiding costly global retraining.
  • Topological & semantic gating works without supervision: Gating modules effectively discover domain relationships post-hoc. For instance, when evaluating on Cora, gates trained on CiteSeer and DBLP assign the highest affinity scores without any explicit domain supervision.
  • Retrieval-based inference is essential for transfer: Projecting node and label embeddings into a common metric space and framing prediction as nearest-neighbor retrieval consistently outperforms standard classification heads across unseen label spaces.
  • Negative transfer is real when scaling experts: Ablations show that randomly selecting experts degrades performance as the pool grows, whereas top-$k$ gating keeps transfer performance stable and robust.

Key Results

  • Zero-Shot Transfer (Leave-One-Out):
  • Node Classification: OMOG achieves the best accuracy on 8 of 9 datasets (average rank 1.11), outperforming AnyGraph and ZeroG by an average margin of ~9%.
  • Link Prediction: OMOG secures the #1 rank across all 9 downstream datasets (average rank 1.00; Hits@100 reaching 56.28 on Cora and 40.95 on Products).
  • Few-Shot Node Classification (5-shot):
  • OMOG achieves an average rank of 1.1 across 10 datasets, beating strong baselines like Prodigy and GraphAlign.
  • On the heterophilous Ratings dataset, OMOG scores 39.23%, outperforming the second-best baseline Prodigy (30.88%) by over 8 percentage points.

Limitations and Future Work

  • Dependence on Text Attributes: OMOG relies on rich text descriptions encoded via language models to construct a shared semantic space; adapting it to purely structural graphs lacking natural language remains unaddressed.
  • Graph-Level Rather Than Subgraph-Level Routing: Gating relevance is computed over the entire test graph. More fine-grained, node- or cluster-level dynamic routing within heterogeneous graphs could improve performance further.
  • Cross-Task Generalization: While OMOG addresses cross-domain transfer for node classification and link prediction, unifying disparate prediction tasks into a shared cross-task prompt framework remains future work.

Summary updated

BibTeX
@misc{liu2024one,
  author = {Jingzhe Liu and Haitao Mao and Zhikai Chen and Wenqi Fan and Mingxuan Ju and Tong Zhao and Neil Shah and Jiliang Tang},
  title = {{One Model for One Graph: A New Perspective for Pretraining with Cross-domain Graphs}},
  year = {2024},
  eprint = {2412.00315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.00315},
}
Figure