NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

HetGPT: Harnessing the Power of Prompt Tuning in Pre-Trained Heterogeneous Graph Neural Networks

Yihong Ma, Ning Yan, Jiayu Li, Masood Mortazavi, Nitesh V. Chawla · DOI

The "pre-train, fine-tune" paradigm has become a cornerstone of modern machine learning, allowing models to leverage vast amounts of unlabeled data before specializing in a specific task. However, in the world of Heterogeneous Graph Neural Networks (HGNNs)—which model complex web-like structures with multiple types of nodes and edges—this paradigm often hits a wall. A new paper from researchers at the University of Notre Dame, Futurewei Technologies, and Syracuse University introduces HetGPT, a framework that adapts the "pre-train, prompt" success of NLP to the complex world of heterogeneous graphs.

TL;DR

HetGPT is the first prompt-tuning framework designed specifically for heterogeneous graphs. By reformulating node classification as a contrastive task using virtual class and feature prompts, it significantly improves the performance and training efficiency of pre-trained models, especially in data-scarce "few-shot" scenarios.

What Problem Does This Paper Address?

Traditional fine-tuning for HGNNs faces several critical challenges:

  1. Objective Misalignment: Pre-training tasks (like predicting if an edge exists) often don't align well with downstream tasks (like classifying a node). This can lead to "negative transfer," where pre-training actually hurts final performance.
  2. Data Scarcity: In semi-supervised settings, labeled nodes are often sparse. Fine-tuning a large, complex model on just a few examples frequently leads to severe overfitting.
  3. Computational Cost: Fine-tuning requires updating all parameters of a large pre-trained network, which is slow and resource-intensive.
  4. Structural Complexity: Existing graph prompting techniques are built for homogeneous graphs (where all nodes/edges are the same type). They fail to capture the rich, multi-typed neighborhood structures inherent in real-world "Web graphs" like citation or social networks.

Methods

HetGPT introduces a post-training prompting framework that keeps the pre-trained HGNN parameters frozen, only training a small set of "prompts."

Overview of the HetGPT architecture, showing how prompts are injected and tuned.

The framework consists of three core components:

  • Virtual Class Prompt (VCP): Instead of using standard classification heads, HetGPT uses trainable "class tokens." These tokens act as representative symbols for each category in the embedding space, allowing the model to treat classification as a similarity-matching task that mirrors contrastive pre-training.
  • Heterogeneous Feature Prompt (HFP): To handle different node types (e.g., "Author" vs. "Paper"), the authors introduce type-specific feature tokens. These are injected into the input feature space as task-specific augmentations, tailoring the pre-trained representations for the specific downstream task without changing the model itself.
  • Multi-View Neighborhood Aggregation (MNA): To capture the complex structure of heterogeneous graphs, HetGPT uses a two-level attention mechanism. It aggregates information from both immediate neighbors (type-based) and distant neighbors connected via specific paths (metapath-based), creating a robust "node token" for classification.

Datasets

The authors evaluated HetGPT on three standard benchmark datasets for heterogeneous graph node classification:

  • ACM: A citation network (nodes: Paper, Author, Subject).
  • DBLP: A citation network (nodes: Author, Paper, Term, Conference).
  • IMDB: A movie network (nodes: Movie, Director, Actor).

They tested performance across various "shots" (1, 5, 20, 40, and 60 labeled nodes per class) to assess how well the model handles data scarcity.

Key Insights and Ideas

  • Classification as Contrastive Learning: By using class tokens and a contrastive loss (InfoNCE), HetGPT reformulates classification to look exactly like the pre-training task. This alignment is the key to overcoming negative transfer.
  • Parameter Efficiency: Because the underlying HGNN is frozen, HetGPT only trains a tiny fraction of the total parameters. This leads to significantly faster convergence compared to full fine-tuning.
  • Mitigating Overfitting: The virtual class prompt generalizes the characteristics of a class in the embedding space. This acts as a powerful regularizer, preventing the model from memorizing the few labeled examples available in semi-supervised settings.

Key Results

  • State-of-the-Art Performance: HetGPT outperformed traditional fine-tuning in 88 out of 90 experimental pairs across three datasets and three different pre-trained models (DMGI, HeCo, and HDMI).
  • Few-Shot Champion: The gains were most dramatic when labels were extremely scarce. In 1-shot settings, HetGPT improved Macro-F1 scores by up to 6.60%.
  • Faster Convergence: As shown in the training loss plots, HetGPT reaches optimal performance much faster than standard fine-tuning.
Figure 4: Comparison of training losses over epochs between HetGPT and its fine-tuning counterpart on DBLP and IMDB.
  • Interpretability: t-SNE visualizations reveal that the learned class tokens (stars) naturally migrate to the center of their respective node clusters (circles), proving that the prompts capture meaningful semantic information.
Figure 5: Visualization of the learned node tokens and class tokens in virtual class prompt on ACM and DBLP.

Limitations and Future Work

While HetGPT shows impressive results for node classification, the authors acknowledge a few areas for further exploration:

  • Class Imbalance: The current work doesn't explicitly address scenarios where some classes have vastly more nodes than others.
  • Task Diversity: The framework is currently focused on node classification. Future work could extend HetGPT to other graph tasks like link prediction or whole-graph classification.
  • Prompt Design: Exploring more complex or automated ways to design the feature and class prompts could yield further performance gains.

Summary updated

BibTeX
@inproceedings{ma2023hetgpt,
  author = {Yihong Ma and Ning Yan and Jiayu Li and Masood Mortazavi and Nitesh V. Chawla},
  title = {{HetGPT: Harnessing the Power of Prompt Tuning in Pre-Trained Heterogeneous Graph Neural Networks}},
  booktitle = {The Web Conference},
  year = {2023},
  url = {https://openreview.net/forum?id=Tt64Q2GFCs},
}
Figure