TL;DR
Prompt learning has emerged as a powerful way to adapt pre-trained graph models to few-shot downstream tasks, but traditional methods rely on completely random prompt initialization. This paper introduces TPGC (Task-Specific Prompt with Global Context), a novel framework that initializes graph prompts using both task and structural priors derived from a brief run on an auxiliary graph. This smart initialization leads to faster convergence, superior few-shot accuracy, and significantly lower computational overhead compared to state-of-the-art baselines.
What Problem Does This Paper Address?
Graph Neural Networks (GNNs) excel at modeling relational data but typically demand massive amounts of labeled data. To operate in low-resource or "few-shot" scenarios, researchers use graph prompt learning. This paradigm freezes a pre-trained graph encoder and uses lightweight, learnable "prompt vectors" to guide the model toward specific downstream tasks.
However, in multi-task pre-training setups, these prompts are initialized entirely at random. This creates a fundamental disconnect: randomly initialized prompts often land in low-density, noisy regions of the embedding space, isolated from actual node clusters and completely ignorant of the pretext tasks (e.g., Deep Graph Infomax or Graph Contrastive Learning). This lack of task relevance and structural awareness forces the model to spend significant optimization effort just trying to pull the prompts into meaningful regions, hindering multi-task collaboration and slowing down adaptation.
Methods
TPGC solves the initialization bottleneck by introducing a dual-prior injection process executed offline on a semantically related auxiliary graph (for example, using Citeseer as an auxiliary graph when the target domain is Cora).
The architecture consists of three successive stages:
- Task-Prior Injection Module (TPIM): The framework runs a brief, single-epoch multi-task pre-training phase on the auxiliary graph. This allows the shared encoder to absorb the optimization preferences of the multiple pretext tasks, transforming it into a task-aware auxiliary encoder.
- Structure-Prior Injection Module (SPIM): Using the task-aware encoder, SPIM extracts global structural context. It calculates the cosine similarity between node embeddings and task-specific global embeddings, selects the top-$k$ most structurally informative nodes, and aggregates them into layer-wise prompt vectors. These vectors are then projected to match the target graph's dimensions.
- Target-Domain Pre-training & Downstream Adaptation: The initialized prompts guide multi-task pre-training on the target graph. For downstream tasks, these pre-trained prompts are frozen and fused with a lightweight downstream-specific prompt branch to make final predictions.
Datasets
The authors evaluated TPGC on six mainstream benchmark datasets across node-level and graph-level classification tasks:
- Citation Networks (Node Classification): Cora and Citeseer.
- Bioinformatics/Chemical Graphs (Node & Graph Classification): PROTEINS, ENZYMES, COX2, and BZR.
No new datasets were introduced; the authors relied on these established benchmarks to ensure a rigorous and fair comparison against existing graph prompt baselines.
Key Insights and Ideas
- Initialization is a First-Class Citizen: Just as semantically informed initialization has revolutionized prompt tuning in Natural Language Processing, it plays a pivotal role in graph domains.
- The Geometry of Prompts: Random initialization scatters prompts in arbitrary, low-density spaces. TPGC explicitly forces prompt vectors to align with high-density, semantically meaningful clusters of the node embedding space before target training even begins.
- Highly Efficient Prior Extraction: Remarkably, the authors find that you do not need an expensive pre-training regime to get a good prior. Just one epoch of homologous pre-training on a related auxiliary graph is enough to inherit effective optimization preferences.
Key Results
TPGC was tested against strong baselines, including end-to-end GNNs, traditional pre-training methods (DGI, GraphCL), and advanced prompting methods (MultiGPrompt, ProNoG).
- Superior Few-Shot Accuracy: TPGC consistently achieved the best or second-best performance across both 1-shot and 5-shot settings. For instance, in 5-shot node classification on Cora, TPGC achieved 76.13% accuracy, outperforming MultiGPrompt (72.93%) and ProNoG (71.51%).
- Fewer Tunable Parameters: In downstream adaptation, TPGC required significantly fewer tunable parameters than competitive baselines like ProNoG (522 vs. 2564 parameters).
- Lower Runtime Overhead: On the ENZYMES dataset, TPGC clocked a downstream runtime of 2885.47 ms—nearly 1.86× faster than ProNoG (5358.24 ms), demonstrating an excellent efficiency-effectiveness trade-off.
Limitations and Future Work
The primary limitation acknowledged by the authors is that TPGC's structural aggregation relies on the assumption of graph homophily (the idea that connected nodes share similar labels or semantics). In heterophilous graphs—where connected nodes frequently belong to different classes or possess distinct characteristics—the current top-$k$ similarity matching and global context design might offer limited utility. The authors plan to explore more robust prompt initialization strategies tailored specifically for heterophilous graph scenarios in future work.
Summary updated