Authors: Yaqi Chen, Shixun Huang, Ryan Twemlow, Lei Wang, John Le, Sheng Wang, Willy Susilo, Jun Yan, +1 more
Organizations: University of Wollongong, Northfields Avenue, Gwynneville, 2500, NSW, Australia · Wuhan University, No. 299, Luojia Hill, Wuhan, 430072, Hubei, China
GNN prompting aims to adapt models across tasks and graphs without requiring extensive retraining. However, most existing graph prompt methods still require task-specific parameter updates and face the issue of generalizing across graphs, limiting their performance and undermining the core promise of prompting. In this work, we introduce a Cross-graph Tuning-free Prompting Framework (CTP), which supports both homogeneous and heterogeneous graphs, can be directly deployed to unseen graphs without further parameter tuning, and thus enables a plug-and-play GNN inference engine. Extensive experiments on few-shot prediction tasks show that, compared to SOTAs, CTP achieves an average accuracy gain of 30.8% and a maximum gain of 54%, confirming its effectiveness and offering a new perspective on graph prompt learning.
Figures & tables
Figure 1: An analogy between GNN and NLP prompts
Figure 2: The Prompting Framework. The overall workflow includes three stages, illustrated with node classification. During example and query collection, example and query nodes are sampled for each class. Then each sampled node’s context is constructed and augmented from its neighborhood. Finally a prompt graph is built, with context nodes initialized using their contextual embeddings. A learning process refines all node embeddings and all learned parameters will be directly used on unseen test graphs without any further update.
Figure 3: Neighborhood Centroid Collection. This figure illustrates the preprocessing step for clustering node embeddings and selecting centroids. (A) Initially, node embeddings are generated by a self-supervised GNN, enabling them to capture neighborhood similarity in the graph. (B) The embeddings are then clustered, and the cluster center nodes together with some randomly sampled nodes are collected to form the neighborhood centroid candidate set. (C) Each centroid represents a class, and example and query nodes are subsequently sampled from the local neighborhood of each centroid for context construction. Unless otherwise specified, all centroids in the following sections refer to neighborhood centroids.
Figure 4: Augmentation Strategy Comparison . When sampling context near a shared centroid, subgraphs often overlap. The Overly Independent Approach augments all nodes, including overlapping ones, which disrupts structural consistency and integrity. The Overly Conservative Approach blocks augmentation in these regions, reducing structural diversity. Our Balanced Approach selectively limits augmentation in overlapping areas, preserving consistency while ensuring sufficient diversity and integrity.
Figure 5: Average Initialization and Orthogonal Loss. (A) Compared to random initialization, average embedding provides more context-related label representations. (B) Cross-entropy aligns labels with nodes but neglects inter-label relations, often leading to unclear boundaries. Orthogonal loss mitigates this by encouraging label separation.
Dataset
# Nodes
# Edges
# Classes
MAG240M
122M
1.3B
153
Wiki
4.8M
5.9M
639
arXiv
169K
1.2M
40
ConceptNet
791K
2.5M
14
FB15K-237
15K
268K
200
NELL
69K
181K
291
Table 1: Dataset statistics
Way
CTP
PG-NM
Contrastive
Graph Prompter
All In One
GPPT
GraphPrompt
3
66.09 (±0.08)
56.82 (±0.08)
56.01 (±0.09)
48.40 (±0.17)
25.16 (±0.27)
30.53 (±0.28)
42.31 (±0.24)
5
52.61 (±0.06)
42.50 (±0.06)
41.18 (±0.07)
32.61 (±0.12)
27.06 (±0.11)
22.62 (±0.13)
19.93 (±0.08)
10
36.94 (±0.04)
28.62 (±0.04)
27.35 (±0.04)
19.17 (±0.07)
9.75 (±0.05)
11.28 (±0.04)
10.92 (±0.07)
20
24.03 (±0.02)
18.34 (±0.02)
17.39 (±0.02)
11.89 (±0.04)
7.91 (±0.10)
4.97 (±0.10)
4.55 (±0.03)
40
16.37 (±0.01)
10.63 (±0.01)
10.79 (±0.01)
5.97 (±0.02)
2.22 (±0.03)
1.57 (±0.01)
3.17 (±0.03)
Table 2: Node Classification Accuracy (±std) on Arxiv. This table shows the accuracy and standard deviation in arXiv, in 5 settings of {3,5,10,20,40} ways (number of classes). All trained on the same 20M-node subgraph, and evaluated on Arxiv.
Dataset
Way
CTP
PG-NM
Contrastive
Graph Prompter
ConceptNet
4
46.3(±0.14)
46.94(±0.61)
44.01(±0.61)
44.06(±0.15)
FB15K-237
5
83.66(±0.11)
80.35(±0.57)
81.35(±0.58)
82.34(±0.07)
10
73.23(±0.10)
71.68(±0.45)
70.88(±0.48)
50.71(±0.06)
20
62.91(±0.07)
59.90(±0.35)
59.80(±0.35)
35.74(±0.04)
40
47.96(±0.05)
46.82(±0.21)
49.39(±0.23)
27.63(±0.03)
NELL
5
84.32(±0.12)
82.39(±0.53)
83.38(±0.50)
89.8(±0.06)
Table 3: Link Prediction Accuracy (±std) on ConceptNet, FB15K-237, and NELL. The table reports test accuracy(%) and standard deviation of CTP and 2 baselines, all trained on Wiki and evaluated on these 3 graphs.
Figure 6: Parameter study: λ and p . The heatmaps present the accuracy improvements of CTP over PG-NM across different combinations of λ (between [0.1,0.5] ) and p (under 3-, 5-, 10-, 20-, and 40-way). In each cell, the top value reports the accuracy of CTP for the corresponding parameter setting, while the value in parentheses shows the difference (i.e., CTP accuracy minus PG-NM accuracy). Darker red shades indicate larger accuracy gains.
Figure 7: Parameter study: Number of Downstream Examples. Figures (a) - (e) show the results of varying the number of downstream examples {0,3,5,7,10,15,20} across different way settings, with the blue line representing CTP and the orange line representing PG-NM. As the number of ways increases and the task becomes more challenging, CTP consistently achieves larger improvements over the baseline across all shot settings, demonstrating both superior and more stable performance.
Prompt tuning has become a key mechanism for adapting pre-trained Graph Neural Networks (GNNs) to new downstream tasks. However, existing approaches are predominantly supervised, relying on labeled data to optimize the prompting parameters and typically fine-tuning a task-specific prediction head -- practices that undermine the promise of parameter-efficient adaptation. We propose Unsupervised Graph Prompting Problem (UGPP), a challenging new setting where the pre-trained GNN is kept entirely frozen, labels on the target domain are unavailable, the source data is inaccessible, and the target distribution exhibits covariate shift. To address this, we propose UGPrompt, the first fully unsupervised GNN prompting framework. UGPrompt leverages consistency regularization and pseudo-labeling to train a prompting function, complemented with diversity and domain regularization to mitigate class imbalance and distribution mismatch. Our extensive experiments demonstrate that UGPrompt consistently outperforms state-of-the-art supervised prompting methods with access to labeled data, demonstrating the viability of unsupervised prompting as a practical adaptation paradigm for GNNs.
Peyman Baghershahi, Sourav Medya
Department of Computer Science University of Illinois Chicago
Graph prompt learning is an effective paradigm to adapt pre-trained graph models to downstream tasks in low-resource scenarios. However, existing multi-task graph pre-training frameworks generally use randomly initialized prompts, leading to poor alignment between the prompt space, pretext objectives and graph structural characteristics. This greatly weakens the task relevance, structural awareness and transferability of prompt representations. To address this challenge, we propose TPGC, a dual-prior prompt initialization solution that explicitly models the synergy between task prior and structural prior. Specifically, the Task-Prior Injection Module first conducts a short homologous multi-task pre-training on an auxiliary graph, enabling prompt initialization to inherit optimization preferences associated with multiple pretext tasks. Built on the task-aware representations, the Structure-Prior Injection Module further extracts transferable global structural context from the auxiliary graph, converting it into layer-wise prompt vectors by aggregating structurally informative node embeddings. Extensive experiments on 6 mainstream benchmarks covering node and graph classification show that TPGC achieves consistently better performance under few-shot settings than state-of-the-art baselines, with fewer downstream tunable parameters and lower runtime. The code is available at https://github.com/Virgilqiu/TPGC
Zhiyang Qiu, Yangtao Wang, Xiaocui Li +3
School of Computer Science and Cyber Engineering, Guangzhou University, Guang Zhou, 510006, Guangdong, China · Hunan University of Technology and Business, Changsha, 410205, Hunan, China
Graph Data Prompt (GDP), which introduces specific prompts in graph data for efficiently adapting pre-trained GNNs, has become a mainstream approach to graph fine-tuning learning problem. However, existing GDPs have been respectively designed for distinct graph component (e.g., node features, edge features, edge weights) and thus operate within limited prompt spaces for graph data. To the best of our knowledge, it still lacks a unified prompter suitable for targeting all graph components simultaneously. To address this challenge, in this paper, we first propose to reinterpret a wide range of existing GDPs from an aspect of Graph Message Prompt (GMP) paradigm. Based on GMP, we then introduce a novel graph prompt learning approach, termed Low-Rank GMP (LR-GMP), which leverages low-rank prompt representation to achieve an effective and compact graph prompt learning. Unlike traditional GDPs that target distinct graph components separately, LR-GMP concurrently performs prompting on all graph components in a unified manner, thereby achieving significantly superior generalization and robustness on diverse downstream tasks. Extensive experiments on several graph benchmark datasets demonstrate the effectiveness and advantages of our proposed LR-GMP.
Beibei Wang, Bo Jiang, Ziyan Zhang +1
School of Computer Science and Technology, Anhui University, Hefei 230601, China. · State Key Laboratory of Opto-Electronic Information Acquisition and Protection Technology, School of Computer Science and Technology, Anhui University, Hefei 230601, China.