GraphCLIP: Enhancing Transferability in Graph Foundation Models for Text-Attributed Graphs

Yun Zhu, Haizhou Shi, Xiaotang Wang, Yongchao Liu, Yaoke Wang, Boci Peng, Chuntao Hong, Siliang Tang

TL;DR

GraphCLIP introduces a self-supervised contrastive pretraining framework that aligns subgraphs with LLM-generated textual summaries to build highly transferable Graph Foundation Models (GFMs). By combining language-graph contrastive learning with invariant learning and a novel prompt-tuning strategy, GraphCLIP achieves state-of-the-art zero-shot and few-shot performance across diverse, unseen text-attributed graph domains without relying on manual labels.

What Problem Does This Paper Address?

Text-Attributed Graphs (TAGs)—graphs where nodes contain free-text information, such as citation networks, e-commerce product catalogs, and social networks—are ubiquitous. Recently, researchers have tried to build Graph Foundation Models (GFMs) by combining TAGs with Large Language Models (LLMs). However, current approaches face two major bottlenecks:

  1. Heavy reliance on label information: Most existing methods require explicit downstream or source labels during pretraining, which severely limits their ability to scale using vast, unlabeled web data.
  2. Limited cross-domain transferability: Models trained on one domain (e.g., academic citations) often perform poorly when deployed directly onto another domain (e.g., e-commerce) due to mismatched label spaces and a failure to capture robust, causal structural features.

Existing paradigms typically treat LLMs as feature enhancers, predictors, or basic aligners, but they struggle to generalize across distinct graph distributions without extensive fine-tuning.

Figure 1: Three main categories of TAG methods.

Methods

To overcome these challenges, the authors propose GraphCLIP, a framework consisting of three main components:

  • Graph-Summary Pair Generation: Instead of aligning raw, noisy node text directly with graph structures, the authors leverage an LLM (Qwen2-72B) to generate comprehensive textual summaries of sampled subgraphs. By transcribing subgraphs into a structured GraphML markup format, the LLM can easily comprehend both the text and the local topology, producing summaries that naturally blend structure and semantics.
  • Contrastive Pretraining with Invariant Learning: GraphCLIP processes subgraphs using a Graph Transformer (GraphGPS) and encodes the LLM-generated summaries using a text encoder (SBERT). It then uses a contrastive loss to map both modalities into a shared embedding space. To ensure the model captures transferable, causal features rather than domain-specific spurious correlations, the authors integrate invariant learning via adversarial training, perturbing the graph encodings during pretraining to simulate worst-case distribution shifts.
  • Graph Prompt Tuning for Few-Shot Learning: To adapt the model to low-resource target datasets without causing catastrophic forgetting, GraphCLIP freezes both the pretrained graph and text models. It introduces a small, learnable prompt feature ($\sigma$) optimized via a supervised contrastive loss, ensuring perfect alignment with the pretraining objective.

Datasets

The authors curated a massive pretraining corpus and evaluated it across 12 open TAG datasets spanning multiple domains:

  • Source Datasets (Pretraining): 5 large-scale datasets containing over 0.2 billion tokens: ogbn-ArXiv, ArXiv_2023, PubMed (Academic), ogbn-Products (E-commerce), and Reddit (Social).
  • Target Datasets (Evaluation): 7 small-scale datasets used to test zero-shot and few-shot transferability: Cora, CiteSeer (Academic), Ele-Photo, Ele-Computers, Books-History (E-commerce), WikiCS (Wikipedia), and Instagram (Social).

Key Insights and Ideas

  • Bridging the Modality Gap via Summarization: Raw node text lacks structural context. Asking an LLM to summarize a target node alongside its neighbors creates a textual representation that inherently encodes graph structure, making it a far superior target for language-graph alignment.
  • The Flaw of Vanilla Contrastive Loss: The authors mathematically demonstrate that standard contrastive alignment can fail under distribution shifts because it optimizes for average alignment across augmented views. This allows the model to ignore less frequent domains. Incorporating adversarial invariant learning forces uniform alignment, significantly boosting out-of-distribution (OOD) generalization.
  • Prompt Tuning via Perturbation Alignment: By designing the few-shot learnable prompt to mimic the adversarial perturbations applied during pretraining, the model adapts to new labels smoothly without distorting its underlying structural knowledge.

Key Results

Zero-Shot Node Classification

GraphCLIP consistently outperformed state-of-the-art GFMs and LLM-only baselines across both in-domain and cross-domain tasks:

  • On the cross-domain WikiCS (Wikipedia) dataset, GraphCLIP achieved 70.19% accuracy, outperforming the previous best graph model (ZeroG) by over 15% in absolute improvement.
  • On the Books-History dataset, GraphCLIP achieved 53.88% accuracy, beating ZeroG (40.74%) by more than 13%.

GraphCLIP proved highly versatile, achieving top-tier performance on link prediction without any task-specific fine-tuning (e.g., 92.67% AUC on WikiCS and 96.04% on Books-History).

Few-Shot Performance

In 1-, 3-, 5-, and 10-shot settings, GraphCLIP’s prompt tuning consistently bypassed the "negative transfer" issues plaguing classical graph prompt methods (like GPF and All-in-One), which often performed worse than pure zero-shot baselines in ultra-low-resource settings.

Limitations and Future Work

The primary limitation acknowledged by the authors is that GraphCLIP currently does not incorporate complex edge attributes (such as specific interaction types in social networks or bond types in molecular graphs). Edge attributes are critical for domains like molecular property prediction.

Future work will focus on extending Graph Transformers to encode diverse edge attributes within the unified text-graph space and exploring optimal domain-balancing ratios during large-scale pretraining.

Summary updated

BibTeX
@inproceedings{zhu2024graphclip,
  author = {Yun Zhu and Haizhou Shi and Xiaotang Wang and Yongchao Liu and Yaoke Wang and Boci Peng and Chuntao Hong and Siliang Tang},
  title = {{GraphCLIP: Enhancing Transferability in Graph Foundation Models for Text-Attributed Graphs}},
  booktitle = {The Web Conference},
  year = {2024},
  url = {https://openreview.net/forum?id=mjzss9Xg76},
}
Figure