Papers
Topics
Authors
Recent
Search
2000 character limit reached

GFMate: Test-Time Prompt Tuning for GFMs

Updated 4 July 2026
  • GFMate is a test-time prompt tuning framework that adjusts frozen Graph Foundation Models using few-shot labeled data and unlabeled target data for cross-domain adaptation.
  • It employs centroid prompts and layer prompts to refine class representations and balance multi-layer contributions for improved node and graph classification.
  • The method integrates a complementary learning objective on unlabeled data to mitigate distribution shifts, achieving significant gains over baseline approaches.

GFMate is a test-time prompt-tuning framework for Graph Foundation Models (GFMs) that is designed for cross-domain adaptation on a target graph using both few-shot labels and abundant unlabeled target-domain data. In the formulation introduced in "GFMate: Empowering Graph Foundation Models with Test-time Prompt Tuning" (Jiang et al., 14 May 2026), the underlying GFM is pre-trained in a label-free manner and then frozen; adaptation occurs only through prompts introduced after pre-training. The method combines centroid prompts, layer prompts, and a complementary learning objective, with the stated aim of avoiding prompt entanglement with specific source domains or pre-training strategies while exploiting unlabeled target nodes during test-time tuning (Jiang et al., 14 May 2026).

1. Problem setting and motivation

GFMate is defined in a setting where a Graph Foundation Model fθf_\theta has been pre-trained in a label-free manner, for example via link prediction or contrastive learning, on a set of source-domain graphs Gpre\mathcal{G}_{pre}. At downstream time, one observes a single target graph Gtar=(V,A,X)G_{tar}=(V,A,X), where VV is the node set, A{0,1}V×VA\in\{0,1\}^{|V|\times |V|} is the adjacency matrix, and XRV×dX\in\mathbb{R}^{|V|\times d} contains node features. A few-shot subset VFSVV_{FS}\subset V has labels yiy_i, while the remaining nodes form the unlabeled set VUL=VVFSV_{UL}=V\setminus V_{FS} (Jiang et al., 14 May 2026).

The paper places GFMate against earlier graph prompt tuning methods that tune prompts learned during source pre-training. In that standard few-shot setting, one tunes a prompt set BpreB_{pre} by solving

Gpre\mathcal{G}_{pre}0

Two limitations are identified. First, there is pre-training entanglement: prompts specialized to a source domain or to a particular pre-training objective may not generalize to unseen target domains or to GFMs pre-trained by different objectives. Second, there is neglect of unlabeled data: abundant unlabeled nodes in the target graph are not actively used, leaving a substantial train-test distribution shift unaddressed (Jiang et al., 14 May 2026).

GFMate addresses these issues by introducing prompts only after pre-training is fixed. The test-time objective is written as

Gpre\mathcal{G}_{pre}1

with Gpre\mathcal{G}_{pre}2 frozen. In the terminology of the paper, this makes the prompts pre-training-agnostic, because they do not participate in source pre-training and therefore are not tied to a particular source-domain set or self-supervised pre-training loss (Jiang et al., 14 May 2026).

2. Prompt parameterization: centroid prompts and layer prompts

The method assumes that the pre-trained GFM consists of Gpre\mathcal{G}_{pre}3 layers of a GNN backbone, such as GCN or GAT. Layer-wise embeddings are denoted

Gpre\mathcal{G}_{pre}4

where the row Gpre\mathcal{G}_{pre}5 is the embedding of node Gpre\mathcal{G}_{pre}6 at layer Gpre\mathcal{G}_{pre}7 (Jiang et al., 14 May 2026).

For each class Gpre\mathcal{G}_{pre}8, GFMate first computes a few-shot centroid at each layer: Gpre\mathcal{G}_{pre}9 where Gtar=(V,A,X)G_{tar}=(V,A,X)0. A learnable additive prompt Gtar=(V,A,X)G_{tar}=(V,A,X)1 is then introduced, yielding the refined centroid

Gtar=(V,A,X)G_{tar}=(V,A,X)2

The collection of centroid prompts is

Gtar=(V,A,X)G_{tar}=(V,A,X)3

These centroid prompts alter the class representatives directly in embedding space rather than modifying the pre-training process or encoding source-domain-specific prompt parameters (Jiang et al., 14 May 2026).

In parallel, GFMate introduces a layer prompt in the form of a learnable scalar weight Gtar=(V,A,X)G_{tar}=(V,A,X)4 for each layer. The vector

Gtar=(V,A,X)G_{tar}=(V,A,X)5

controls how strongly each layer contributes to final classification. The paper describes these weights as adapting automatically to the “hop-aggregation” patterns of the target graph (Jiang et al., 14 May 2026).

Prediction is performed by a multi-layer ensemble score. For any node Gtar=(V,A,X)G_{tar}=(V,A,X)6 and class Gtar=(V,A,X)G_{tar}=(V,A,X)7,

Gtar=(V,A,X)G_{tar}=(V,A,X)8

where cosine similarity is used: Gtar=(V,A,X)G_{tar}=(V,A,X)9 Class probabilities are then obtained through a temperature-scaled softmax,

VV0

with VV1 (Jiang et al., 14 May 2026).

3. Complementary learning at test time

The optimization objective combines ordinary few-shot supervision with an unlabeled-data term derived from complementary labels. On the labeled set VV2, GFMate uses the standard cross-entropy

VV3

This term anchors the prompt tuning to the observed few-shot labels (Jiang et al., 14 May 2026).

For unlabeled nodes, the method first computes a per-layer confidence statistic. For each layer VV4, the average entropy over VV5 is

VV6

where VV7 is defined using only layer VV8 in the score. The pivot layer is then selected as

VV9

that is, the layer with highest confidence on the unlabeled target nodes (Jiang et al., 14 May 2026).

Using that pivot layer, each unlabeled node A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}0 is assigned a complementary label

A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}1

namely the class least similar to the node representation at the pivot layer. The corresponding loss is

A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}2

This explicitly pushes the probability of the complementary class toward zero (Jiang et al., 14 May 2026).

The full objective is a convex combination: A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}3 Only A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}4 and A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}5 are learnable; the GFM parameters A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}6 remain fixed. Updates are performed by gradient descent,

A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}7

with learning rate A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}8, and optimization stops when the validation loss on a small held-out part of A{0,1}V×VA\in\{0,1\}^{|V|\times |V|}9 converges or after a fixed number of steps (Jiang et al., 14 May 2026).

4. Algorithmic workflow and computational profile

The test-time procedure begins by computing layer embeddings XRV×dX\in\mathbb{R}^{|V|\times d}0 on the target graph. Centroid prompts XRV×dX\in\mathbb{R}^{|V|\times d}1 and layer prompts XRV×dX\in\mathbb{R}^{|V|\times d}2 are initialized randomly, and the few-shot centroids XRV×dX\in\mathbb{R}^{|V|\times d}3 are computed for all layers and classes. Each optimization step then refines the centroids, computes per-layer probabilities and entropies on unlabeled nodes, selects the pivot layer, determines complementary labels, evaluates XRV×dX\in\mathbb{R}^{|V|\times d}4 and XRV×dX\in\mathbb{R}^{|V|\times d}5, forms the total loss, and updates XRV×dX\in\mathbb{R}^{|V|\times d}6 and XRV×dX\in\mathbb{R}^{|V|\times d}7 by SGD. Final predictions on XRV×dX\in\mathbb{R}^{|V|\times d}8 are given by

XRV×dX\in\mathbb{R}^{|V|\times d}9

This is the complete workflow described as the GFMate test-time prompt tuning algorithm (Jiang et al., 14 May 2026).

The paper gives the per-step complexity as

VFSVV_{FS}\subset V0

which is stated to be linear in graph size. It also emphasizes parameter efficiency: GFMate tunes only VFSVV_{FS}\subset V1 parameters, in contrast to VFSVV_{FS}\subset V2 parameters in instance-level prompt methods (Jiang et al., 14 May 2026).

A practical consequence is reported in downstream adaptation on Arxiv-year. SAMGPT requires VFSVV_{FS}\subset V3 s, VFSVV_{FS}\subset V4 M tunable parameters, and VFSVV_{FS}\subset V5 GB GPU memory, while GFMate requires VFSVV_{FS}\subset V6 s, VFSVV_{FS}\subset V7 k parameters, and VFSVV_{FS}\subset V8 GB GPU memory, corresponding to 98% faster adaptation and 97% less memory in that experiment (Jiang et al., 14 May 2026).

5. Experimental evaluation

GFMate is evaluated on 12 benchmarks across node and graph classification. The node-classification portion includes Cornell, Texas, Wisconsin, Chameleon, Squirrel, Cora, Citeseer, Arxiv-year, and Amazon-Photo in a one-versus-all cross-domain setting; the graph-classification portion includes BZR, COX2, and PROTEINS. The task range is from one-shot to full-shot classification with 5 random runs (Jiang et al., 14 May 2026).

The baseline suite spans several categories. Supervised GNNs include GCN, GAT, GraphSAGE, H2GCN, and GPR. Self-supervised pre-train plus fine-tune baselines include LP+FT, DGI+FT, and GCL+FT. Single-domain prompt-tuning baselines include GPPT, ProNoG, GraphPrompt, GPF, DAGPrompt, and All-In-One. Cross-domain GFM baselines include GCOPE, MDGPT, SAMGPT, MDGFM, BRIDGE, and RiemannGFM, while GraphAny and GTrans are considered in the full-shot setting (Jiang et al., 14 May 2026).

For one-shot node classification, the paper reports the following accuracies in a representative table: GFMate attains VFSVV_{FS}\subset V9 on Cora, yiy_i0 on Cite, yiy_i1 on Chameleon, and yiy_i2 on Squirrel. The stated average improvement over the best baseline is up to +30.63% (relative) on Chameleon (Jiang et al., 14 May 2026). Across varying few-shot sizes yiy_i3, GFMate is reported to consistently outperform GFMs. When plugged into different pre-training strategies—LP, DGI, and GCL—and different backbones—GCN, SAGE, GAT, and H2GCN—the method is reported to yield always +10–30% gain (Jiang et al., 14 May 2026).

Ablation studies attribute the performance to all three main components. On one- versus three-shot node classification averaged over five graphs, removing centroid prompts causes a yiy_i4 drop, removing layer prompts causes a yiy_i5 drop, and removing complementary learning so that only few-shot supervision remains causes a yiy_i6 drop (Jiang et al., 14 May 2026). In the binary classification setting, the paper reports even larger relative gains, described as being in line with the yiy_i7 risk bound in Proposition 1 (Jiang et al., 14 May 2026).

6. Scope, interpretation, and limitations

The central claim about generalization is that GFMate’s prompts are agnostic to both the source pre-training domain set and the GFM’s self-supervised loss. The method is said to plug seamlessly into any GNN-based GFM backbone and pre-training objective, and the active use of unlabeled testing data through complementary labels is presented as a mechanism for mitigating train-test distribution shifts (Jiang et al., 14 May 2026).

The term pre-training-agnostic has a precise meaning in this framework. It does not denote adaptation without optimization; rather, it denotes that prompt parameters are introduced only after the source pre-training stage and are therefore not entangled with a particular source-domain prompt design. The learnable objects are the centroid prompts yiy_i8 and layer prompts yiy_i9, while the foundation model parameters VUL=VVFSV_{UL}=V\setminus V_{FS}0 remain fixed (Jiang et al., 14 May 2026).

The paper also identifies clear limitations. GFMate is designed for GNN-based GFMs on text-free graphs and does not immediately extend to LLM-based GFMs on text-attributed graphs. Its test-time tuning protocol requires access to the full target graph, so the setting is transductive; inductive test-time tuning is explicitly left as an open direction. In addition, the complementary labeling mechanism is characterized as heuristic, and the authors suggest that more robust uncertainty-based or self-training mechanisms could be investigated in future work (Jiang et al., 14 May 2026).

Within the graph prompt-tuning literature, GFMate is therefore best understood as a target-domain adaptation mechanism that relocates prompt optimization from pre-training or source-domain transfer into inference-time adjustment on the target graph itself. This suggests a distinct design principle for GFMs: rather than encoding source-domain knowledge into prompt parameters in advance, one can leave the foundation model frozen and use structurally lightweight prompts plus unlabeled target-domain signals to specialize predictions at test time (Jiang et al., 14 May 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to GFMate.