Paper · 2025-03-05 · cs.LG, cs.CL
LLM as GNN: Graph Vocabulary Learning for Text-Attributed Graph Foundation Models
PromptGFM has an LLM replicate GNN message passing in text: node summaries are refined over rounds from sampled neighbours, and the final summaries become readable node IDs for fine-tuning Flan-T5 or Llama3-8B. Author-reported: 92.42% Cora node classification with Llama3-8B, the best score in the paper's table.
Graph neural networkInstruction tuningConstrained decodinggraph-learningtext-attributed-graphsgraph-foundation-modelsllm-fine-tuning
arXivPDFCodeMarkdown17 min read
AI-compiled by claude-haiku-5-5 on 2026-11-06, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Text-attributed graphs are networks in which every node carries a piece of text, such as a paper's title and abstract. Graph neural networks learn from such networks by letting each node take in information from its neighbours, but they work on numbers, not words, so combining them with a language model is awkward. PromptGFM keeps the whole process in words. A language model rewrites each node's summary over a few rounds, and each rewrite folds in short summaries of some sampled neighbours, which is roughly how a graph network passes messages along edges. The last summary of each node becomes that node's ID, made of ordinary words the model already knows.
Because the IDs are readable text, a language model can be fine-tuned on prompts that list a node's ID together with its neighbours' IDs and ask a question, such as which node a given node should connect to. When the model has to name a node, a decoding constraint keeps its answer to IDs that exist in the graph. The aim is one model that transfers across graphs and tasks, instead of a separate vocabulary for each graph.
TL;DR
- PromptGFM is a text-only graph foundation model for text-attributed graphs, built around a graph vocabulary made of language-based node IDs §1 §3.2.
- A language model summarises each node, then refines the summaries over L rounds using sampled one-hop neighbours; the final summaries are the IDs §3.1.
- Flan-T5 or Llama3-8B is fine-tuned on templated node-classification and link-prediction instructions, and link prediction is decoded with a prefix tree over valid IDs §3.2.
- Author-reported: Llama3-8B has the top node-classification accuracy in the paper's table on six of seven datasets, not on PubMed tab. 1. Code is partial (see Paper vs code).
Problem
Existing GNN-LLM methods either feed GNN embeddings to an LLM or let an LLM supervise a GNN in separate stages, so the two parts are only loosely coupled §1 fig. 1. Other methods treat each node as an out-of-vocabulary token; this causes graph-specific semantics, growing vocabularies, and mismatch with natural-language task prompts, which limits transfer across graphs and tasks §1. Heuristic graph-to-text prompts also omit the message passing of a real GNN, which the authors argue is needed for structure §1 fig. 2. Prior graph foundation models rely on domain-specific vocabularies such as per-dataset IDs or quantised computation trees §5.
Method
PromptGFM has two modules §3 fig. 3.
Graph understanding module §3.1 fig. 6. The authors frame a GNN layer as neighbour sampling, aggregation and update, and optimisation §2 eq. 1 eq. 2. They replicate this in text:
- Initialise each node's textual representation by summarising its own title and abstract with an LLM. The summary prompt is described in words in app. D.
- For each layer l = 1..L, sample one-hop neighbours of node i from the previous round eq. 3.
- Prompt the LLM to aggregate those neighbours' previous summaries and the node's own previous summary into a new summary eq. 4. No fixed mean or weighted operator is used §3.1.
- The optimisation signal (neighbours similar, distant nodes dissimilar) is written into the prompt as natural-language instruction, and no separate training loss is added §3.1.
- After L rounds the final representation is T_i = X_i^(L) §3.1.
The paper analyses input-order sensitivity app. E.1 and prompt length limits app. G.
Graph inference module §3.2 fig. 4. The final summaries are tokenised with the LLM's own tokenizer and used directly as IDs, with no clustering or remapping §3.2 eq. 5. Task templates insert the centre node's ID and its one-hop and two-hop neighbours' IDs into a readable prompt eq. 6 app. D. The model is trained across graphs and tasks with a standard token-level loss eq. 7. For generative link prediction, a prefix tree is built from the IDs of all candidate nodes, and only tokens that extend a valid prefix are allowed during decoding §3.2.
Auxiliary tasks §4.3. Node discrimination (choose the one of three nodes in a different class) and link discrimination (choose the one of three candidates not linked to a centre node) are added as extra instruction tasks, individually or together §4.3 tab. 8.
Other settings described in the paper. Adaptive prompting prepends a domain instruction at inference time app. H tab. 18. A dynamic variant regenerates only the affected nodes when a node, an edge or a node text changes app. I tab. 19 §5 Limitations (3).
# Round 0: each node is summarised from its own text [§3.1] [app. D]
def initial_summaries(texts):
summaries = {}
for node in texts:
# One LLM call per node [app. D]
summaries[node] = llm(summary_prompt(texts[node]))
return summaries# Rounds 1..L: the LLM replicates message passing in text [§3.1]
def message_passing_round(summaries, neighbours, ratio):
updated = {}
for node in summaries:
# Sample one-hop neighbours from the previous round [eq. 3]
sampled = sample_neighbours(neighbours[node], ratio)
# Aggregate and update; every input is last round's text [eq. 4]
updated[node] = llm(
aggregate_update_prompt(
summaries[node],
[summaries[j] for j in sampled],
)
)
return updated# Run L rounds; the last output is the node's textual representation [§3.1]
def graph_understanding(texts, neighbours, rounds, ratio):
summaries = initial_summaries(texts)
for _ in range(rounds):
summaries = message_passing_round(summaries, neighbours, ratio)
return summaries# Language-based ID: the final summary as LLM tokens [eq. 5] [§3.2]
def language_id(summary, tokenizer):
# No clustering or remapping; the token sequence is the ID [§3.2]
return tokenizer(summary)# Instruction: a task template filled with language-based IDs [eq. 6]
def build_instruction(template, centre, one_hop, two_hop):
# IDs are written inside angle brackets in the prompts [app. D]
return template.format(
centre=language_id(centre),
one_hop=[language_id(n) for n in one_hop],
two_hop=[language_id(n) for n in two_hop],
)# Multi-instruction fine-tuning: negative log-likelihood of the target [eq. 7]
def training_loss(model, instruction, target):
loss = 0
for s in range(len(target)):
# Next-token probability given instruction and earlier target tokens
# Summed over every target position s [eq. 7]
probs = model.next_token_probs(instruction, target[:s])
loss = loss - log(probs[target[s]])
return loss# Generative link prediction: prefix-tree constrained decoding [§3.2]
def build_prefix_tree(candidate_token_lists):
# Each root-to-leaf path is one valid node ID [§3.2]
tree = Trie()
for tokens in candidate_token_lists:
tree.add(tokens)
return tree
def allowed_next_tokens(tree, generated_so_far):
# Only tokens that extend a valid prefix may be emitted [§3.2]
return tree.children(generated_so_far)Key equations, as printed in the paper eq. 3–eq. 7:
\{X_j^{(l-1)}, v_j \in \mathcal{N}_i^{(l)}\} \leftarrow \text{Prompt}_{\text{sample}}(X^{(l-1)}, \mathcal{N}_i) eq. 3
X_i^{(l)} \leftarrow \text{Prompt}_{\text{agg-update}}(\{X_j^{(l-1)}, v_j \in \mathcal{N}_i^{(l)}\}, X_i^{(l-1)}) eq. 4
\mathcal{F}: V \rightarrow T, \quad T_i = (t_i^1, \ldots, t_i^{m_i}), \; t_i^k \in \mathcal{X} eq. 5
\mathcal{T} \leftarrow \text{Prompt}_{\text{template}}(T, G) eq. 6
\mathcal{L} = - \sum_{s=1}^{|Y|} \log \Pr(y_s \mid \mathcal{T}, Y_{<s}) eq. 7
Equation numbers are counted in source order from the arXiv v4 LaTeX; cross-check them against the PDF.
Hyperparameters
Settings the paper states are marked with their source. Settings only the code states are marked "code". "not stated" means neither the paper nor the code gives a value.
| Name | Value | Where | Notes |
|---|---|---|---|
| Graph-understanding LLM | GPT-4o mini | app. C §Limitations (1) | Code default is gpt-3.5-turbo generate_textual_id_V3.py |
| Inference backbones | Flan-T5 (size not stated); Llama3-8B | §3.2 app. C | Flan-T5 training code is not in the repo |
| GNN layers L | search {1, 2, 3, 4}; best 3 on Cora, 2 on Citeseer | app. C app. E.2 | Code default 2 generate_textual_id_V3.py |
| Neighbour sampling ratio | search {0.3, 0.6, 1.0}; 60% best overall | app. C tab. 17 | Code default 0.3 generate_textual_id_V3.py |
| Neighbour cap (prompt) | 20; explored {10, 20, 30, 40} | app. G.1 | Code caps one-hop at 12 and two-hop at 5 NC_preprocess.py; the LP script has no cap |
| Summary length | not stated | — | Code asks for about 8 words or less than 8 words generate_textual_id_V3.py generate_textual_id_V3.py |
| Summary temperature | not stated | — | Code uses 0 for round updates generate_textual_id_V3.py |
| Fine-tuning learning rate | 3e-4 | app. C | Code 2e-4 Train_PromptGFM.py |
| Fine-tuning batch size | 4 | app. C | Code default 2 Train_PromptGFM.py |
| Fine-tuning length | not stated; early stopping, patience per dataset not stated | app. C | Code sets max_steps 100, overriding 10 epochs Train_PromptGFM.py Train_PromptGFM.py |
| Parameter-efficient method | not stated | — | Code uses LoRA r=64, alpha 16, dropout 0.1 Train_PromptGFM.py |
| Weight decay, warmup, schedule, grad clip | not stated | — | Code: 0.001, 0.03 warmup ratio, constant LR, max grad norm 0.3 Train_PromptGFM.py Train_PromptGFM.py |
| Max sequence length | not stated | — | Code 1024 Train_PromptGFM.py |
| Optimizer | not stated | — | Code paged AdamW 32-bit Train_PromptGFM.py |
| Beam search (generative LP) | not stated | — | Code 100 beams, 50 returned, max length 150 Decoding.py |
| Evaluation protocol | 10-fold cross-validation, mean and std | app. C | Code: single 80/20 split, seed 42 NC_preprocess.py; LP uses a 70/30 node split LP_prepocess.py |
| Metrics | accuracy and Macro-F1 (NC); accuracy and HR@1 (LP) | app. C | — |
| Context window of LLM | 128k tokens (GPT-4o mini) | app. G.2 | — |
| Hardware | 4 × NVIDIA RTX A6000 | app. C | — |
| Cost of graph understanding (Ogbn-arxiv) | about $2.69; 17.91M tokens; about 176 min; 1.41 kWh | §4.3 | One-off per graph, cached §3.3 |
Results
Author-reported throughout. Setup: each model is trained from scratch on a single graph for node classification and link prediction §4.1; the evaluation is 10-fold cross-validation with standard deviations described in app. C, but the tables below show means only.
Node classification accuracy (%), higher is better tab. 1 (bold and colour highlights in the source are omitted; the authors' significance test is against an unnamed strongest baseline):
| Method | Cora | Citeseer | PubMed | Ogbn-arxiv | History | Photo | WikiCS |
|---|---|---|---|---|---|---|---|
| MLP | 62.29 | 64.42 | 62.88 | 62.07 | 64.62 | 61.21 | 68.41 |
| GCN | 82.47 | 76.11 | 77.36 | 66.15 | 81.93 | 78.58 | 76.33 |
| GAT | 82.92 | 77.30 | 74.36 | 65.29 | 82.85 | 82.38 | 78.21 |
| GraphSAGE | 83.69 | 73.17 | 83.22 | 68.78 | 82.12 | 80.06 | 79.56 |
| RevGNN | 86.90 | 77.34 | 82.16 | 70.43 | 83.04 | 83.24 | 81.22 |
| SGFormer | 82.36 | 73.76 | 78.92 | 63.44 | 78.98 | 80.12 | 76.56 |
| NodeFormer | 81.55 | 72.98 | 76.49 | 73.21 | 79.60 | 78.51 | 75.47 |
| BERT | 79.02 | 72.83 | 76.74 | 71.90 | 72.97 | 68.82 | 77.98 |
| Sentence-BERT | 78.09 | 72.12 | 75.48 | 77.24 | 74.10 | 69.02 | 77.72 |
| Llama3 (LM-only) | 78.17 | 74.68 | 77.46 | 77.65 | 76.49 | 74.42 | 79.94 |
| OFA | 75.72 | 71.58 | 75.26 | 74.68 | 81.43 | 84.46 | 78.02 |
| LLaGA | 81.25 | 68.80 | 86.54 | 76.05 | 82.55 | 85.34 | 80.74 |
| ENGINE | 91.48 | 78.46 | 90.24 | 76.02 | 82.46 | 83.75 | 81.56 |
| GraphPrompter | 80.26 | 73.61 | 94.80 | 75.61 | 79.42 | 80.04 | 80.98 |
| GFT | 79.88 | 71.45 | 80.21 | 73.11 | 75.58 | 76.24 | 81.02 |
| GraphText | 88.23 | 76.64 | 85.19 | 76.80 | 81.47 | 82.26 | 81.49 |
| PromptGFM (Flan-T5) | 91.72 | 84.49 | 92.83 | 80.58 | 82.33 | 85.41 | 81.49 |
| PromptGFM (Llama3-8B) | 92.42 | 85.32 | 94.65 | 83.78 | 86.72 | 86.61 | 84.66 |
| p-value (vs strongest baseline) | 4e-3 | 2.73e-8 | 3.21e-7 | 4.48e-10 | 2.64e-6 | 3.62e-2 | 9.93e-4 |
Discriminative link prediction, accuracy (%) tab. 2:
| Method | Cora | Citeseer | Ogbn-arxiv | PubMed |
|---|---|---|---|---|
| GCN | 77.15 | 78.72 | 80.89 | 77.36 |
| GAT | 70.44 | 77.17 | 76.25 | 74.36 |
| GraphSAGE | 85.31 | 87.15 | 80.76 | 83.22 |
| GraphPrompter | 90.10 | 91.67 | 73.21 | 80.49 |
| PromptGFM (Flan-T5) | 90.57 | 92.03 | 81.12 | 87.64 |
| PromptGFM (Llama3) | 91.68 | 93.46 | 84.27 | 88.12 |
Generative link prediction, HR@1 (%) tab. 3: backbone not stated in the table.
| Method | Cora | Citeseer | PubMed |
|---|---|---|---|
| GCN | 5.95 | 6.82 | 0.51 |
| GAT | 2.22 | 3.59 | 0.28 |
| GraphSAGE | 6.59 | 8.73 | 0.45 |
| InstructGLM | 6.65 | 7.13 | 0.58 |
| KGT5-context | 8.03 | 8.41 | 1.17 |
| PromptGFM | 8.21 | 8.90 | 1.21 |
Intra-domain transfer to Citeseer, accuracy and Macro-F1 (%) tab. 4 (source = graphs used for pre-training, or co-training):
| Cora | Arxiv | Pre-train Acc | Pre-train M-F1 | Co-train Acc | Co-train M-F1 |
|---|---|---|---|---|---|
| no | no | 27.64 | 17.10 | 84.49 | 82.31 |
| yes | no | 51.63 | 45.10 | 84.96 | 83.22 |
| no | yes | 60.34 | 54.81 | 85.45 | 83.91 |
| yes | yes | 61.25 | 55.66 | 86.77 | 84.24 |
Inter-domain transfer, e-commerce to biomedical tab. 5: the caption does not name the target; PubMed is the only biomedical dataset in the paper app. A.
| History | Photo | Pre-train Acc | Pre-train M-F1 | Co-train Acc | Co-train M-F1 |
|---|---|---|---|---|---|
| no | no | 39.12 | 39.84 | 90.67 | 91.82 |
| yes | no | 46.24 | 47.41 | 88.52 | 89.39 |
| no | yes | 44.21 | 44.93 | 85.34 | 85.57 |
| yes | yes | 45.18 | 45.65 | 86.22 | 87.03 |
Inter-domain transfer, computer science to biomedical tab. 6: target not named in the caption.
| Cora | Citeseer | Arxiv | Pre-train Acc | Pre-train M-F1 | Co-train Acc | Co-train M-F1 |
|---|---|---|---|---|---|---|
| no | no | no | 39.12 | 39.84 | 90.67 | 91.82 |
| yes | no | no | 51.76 | 52.84 | 86.34 | 87.29 |
| no | yes | no | 40.12 | 42.38 | 85.21 | 86.12 |
| no | no | yes | 60.21 | 62.02 | 82.17 | 86.01 |
| yes | yes | no | 50.17 | 51.74 | 84.39 | 81.94 |
| yes | no | yes | 57.28 | 59.71 | 81.32 | 83.14 |
| no | yes | yes | 55.34 | 57.11 | 82.13 | 83.10 |
| yes | yes | yes | 53.07 | 54.90 | 80.43 | 80.79 |
Cross-task generalisation, accuracy (%) tab. 7: the backbone is not stated. The ST rows match the Flan-T5 NC row of tab. 1 and the Llama3 LP row of tab. 2.
| Task | Setting | Cora | Citeseer | PubMed |
|---|---|---|---|---|
| NC | zero-shot | 18.54 | 27.64 | 39.12 |
| NC | LP → NC | 60.74 | 50.12 | 57.42 |
| NC | ST-NC | 91.72 | 84.49 | 92.83 |
| LP | zero-shot | 67.28 | 69.22 | 73.59 |
| LP | NC → LP | 78.16 | 79.23 | 84.11 |
| LP | ST-LP | 91.68 | 93.46 | 88.12 |
Auxiliary pre-training tasks on Citeseer and PubMed, accuracy and Macro-F1 (%) tab. 8:
| Dataset | +ND | +LD | Accuracy | Macro-F1 |
|---|---|---|---|---|
| Citeseer | no | no | 84.49 | 82.31 |
| Citeseer | yes | no | 85.67 | 83.22 |
| Citeseer | no | yes | 84.73 | 82.65 |
| Citeseer | yes | yes | 86.02 | 83.77 |
| PubMed | no | no | 90.67 | 91.82 |
| PubMed | yes | no | 92.53 | 92.84 |
| PubMed | no | yes | 91.12 | 92.03 |
| PubMed | yes | yes | 93.06 | 93.27 |
Controlled neighbour study, Cora and Citeseer, accuracy and Macro-F1 (%) tab. 9:
| Variant | Cora Acc | Cora M-F1 | Citeseer Acc | Citeseer M-F1 |
|---|---|---|---|---|
| Central text only | 78.17 | 75.44 | 74.68 | 71.19 |
| Semantic non-neighbours | 82.54 | 81.27 | 75.24 | 72.36 |
| Degree-preserving rewired | 61.13 | 58.71 | 62.48 | 60.04 |
| True neighbours (PromptGFM) | 91.72 | 90.06 | 84.49 | 80.13 |
Efficiency tab. 10: API cost in USD and tokens are for graph understanding; time and power for inference.
| Graphs used | API cost | Tokens (M) | Inference time (min) | Power (kWh) |
|---|---|---|---|---|
| Cora | 0.188 | 1.25 | 16.47 | 0.07 |
| Citeseer | 0.189 | 1.29 | 21.41 | 0.08 |
| Photo | 1.213 | 8.08 | 83.67 | 0.34 |
| Cora + Citeseer | n/a (cached) | n/a | 35.31 | 0.16 |
| Cora + Citeseer + Photo | n/a (cached) | n/a | 117.56 | 1.04 |
Other reported results, in words and in the appendix:
- Dataset statistics, Table 11 app. A: Cora 2,708 nodes, 10,858 edges, 7 classes; Citeseer 3,327, 9,464, 6; Ogbn-arxiv 169,343, 2,332,486, 40; WikiCS 11,701, 431,726, 10; Photo 48,362, 873,782, 12; History 41,551, 503,180, 12; PubMed 19,717, 88,648, 3.
- Permutation sensitivity app. E.1 tab. 12: shuffling neighbours gives 90.64 ± 1.12 on Cora and 83.79 ± 0.89 on Citeseer; shuffling position-tagged tokens gives 90.55 ± 1.03 and 84.28 ± 1.06.
- Layer-wise cosine similarity on Cora app. E.2 tab. 13: connected pairs 0.171, 0.223, 0.308 at layers 1–3; disconnected pairs about 0.03–0.04 at all depths.
- Self-retention and neighbour similarity app. E.2 tab. 14: self-retention falls from 0.837 to 0.632 on Cora over four layers; the margin over neighbours narrows from 0.673 to 0.295.
- Depth app. E.2: the best depth is 3 on Cora and 2 on Citeseer; over-smoothing is reported beyond that fig. 7.
- Vocabulary app. F tab. 15: coverage is 100% for every dataset; entropy ranges from 8.46 (PubMed) to 12.28 (merged graphs).
- Degree app. G.1 tab. 16: average degrees from 2.84 (Citeseer) to 36.90 (Ogbn-arxiv); nodes with more than 300 neighbours are 0.19–0.25% on three datasets and 0 elsewhere.
- Sampling ratio app. G.1 tab. 17: on Cora, 100% gives 81.36, 60% gives 89.35 and 30% gives 88.36; the configuration is not stated.
- Adaptive prompting app. H tab. 18: adds a domain-change sentence at inference; it improves every cell of the table, by up to about 3 points.
- Dynamic graphs app. I tab. 19: on a DBLP co-authorship graph, PromptGFM-dyn reaches 59.46 accuracy and 56.23 Macro-F1; OFA is the best baseline at 55.17 and 52.54. Graph statistics are not stated.
- Ablations on node classification §4.3 fig. 5: removing the graph understanding module gives the smallest drop, removing instruction fine-tuning a larger one, and removing both the largest; the full model is highest. The dataset is not named in the text, and the values are only in the figure, so they are not reproduced here.
Paper vs code
Code: official repository linked from the abstract, github.com/agiresearch/PromptGFM, cloned at commit f2e70fe46a5d68960094bcb77a2f7e3bd16574f3. The repo has no LICENSE file, so nothing from it is quoted; this card uses only pseudocode and citations. The README says the repo is still under maintenance.
- Training loss. Paper: the loss is the negative log-likelihood of the target tokens Y given the instruction eq. 7. Code: the JSON has an
outputkey Train_PromptGFM.py, but SFTTrainer is givendataset_text_field="instruction"Train_PromptGFM.py, so training text is the input prompt alone. The target is never placed in the training text, so the code does not train on eq. 7 as written. - Training length. Paper: early stopping with a per-dataset patience app. C. Code:
num_train_epochsis 10 by default Train_PromptGFM.py butmax_steps=100overrides it Train_PromptGFM.py; there is no early-stopping callback. - Learning rate and batch. Paper: 3e-4 and batch 4 app. C. Code: 2e-4 Train_PromptGFM.py and batch 2 Train_PromptGFM.py.
- Adaptation method. Paper: not stated. Code: LoRA with r=64 Train_PromptGFM.py. The 4-bit quantisation config is built but never passed to the trainer Train_PromptGFM.py.
- Neighbour sampling in the generator. Paper: each round samples one-hop neighbours of each node and aggregates them eq. 3 eq. 4. Code: a single
used_nodesset is created before the round loop and never reset, and a neighbour is removed from the pool once sampled by any centre node in any round generate_textual_id_V3.py generate_textual_id_V3.py. A node with no unused neighbours keeps its previous text generate_textual_id_V3.py. - Default sampling ratio. Paper: 60% is best overall tab. 17; search set {0.3, 0.6, 1.0} app. C. Code default: 0.3 generate_textual_id_V3.py.
- Default rounds. Paper: best depth 3 on Cora, 2 on Citeseer app. E.2. Code default: 2 generate_textual_id_V3.py.
- Neighbour cap. Paper: cap 20 app. G.1. Code: one-hop capped at 12 and two-hop at 5, chosen at random per prompt and not seeded NC_preprocess.py NC_preprocess.py. The LP script has no cap.
- Prompts. Paper: the node-initialisation prompt asks to "summarize the paper" app. D. Code: one of five random variants, each asking for about 8 words generate_textual_id_V3.py. Paper: the update prompt includes a note that connected nodes should be similar app. D. Code: that note is absent; the prompt asks for a summary of under 8 words generate_textual_id_V3.py.
- Language-based ID source. Paper: T_i is the final round's representation §3.1. Code: NC and LP scripts read
<dataset>_text_feature.csvby default NC_preprocess.py LP_prepocess.py, which is the round-0 file written in generate_textual_id_V3.py. Round-N files need--generator_outcomepassed explicitly generate_textual_id_V3.py. The ID is the whole summary with periods removed NC_preprocess.py. - Evaluation. Paper: 10-fold cross-validation app. C. Code: node classification uses one 80/20 split with seed 42 NC_preprocess.py; link prediction uses one 70/30 node-level split LP_prepocess.py. No random seed is set for sampling of neighbours or candidates in either script.
- Instruction templates. Paper: templates in app. D. Code: the node-classification prompt reads "has one hop connections with" and "also has two hop connection with" NC_preprocess.py. The wording differs from the paper but the structure matches.
- Decoding. Paper: prefix-tree constrained decoding §3.2. Code: 100 beams and 50 returned sequences Decoding.py, with the trie built from
candidate2.csvDecoding.py. The T5 checkpoint is loaded from a hard-coded local path Decoding.py. - Scope of the repo. Paper: seven datasets app. A. Code: only Cora and Citeseer data are in the repository [file listing under dataset/]. Missing from the repo: the five other datasets, Flan-T5 training code, and code for node and link discrimination, adaptive prompting, the dynamic variant, the cross-graph and cross-task experiments, and the controlled neighbour study.
- README. The README tells users to run
python train.pyREADME.md. No file of that name exists; the closest files areTrain/Train_PromptGFM.pyandTrain/llama3_finetune.py, which are identical. - OpenAI client. The generator uses the legacy
openai.ChatCompletioncall generate_textual_id_V3.py with an empty API key generate_textual_id_V3.py. It needs an older OpenAI SDK and a key set by the user. The environment file pins Python 3.8 environment.yaml.
No discrepancies found: not applicable; the discrepancies above were found.
Pitfalls
- Message passing degrades across rounds in the released generator. Because
used_nodesis shared across all rounds generate_textual_id_V3.py, each node can be sampled as a neighbour only once in the whole run. Later rounds have fewer neighbours to aggregate, and some nodes keep their earlier summary. An implementation that follows eq. 3 and eq. 4 must reset the pool per round and per centre node. - Retry temperature is unbounded within one node. For round-0 summaries, a duplicate reply raises the temperature by 0.1 and a new reply resets it to 0; the retry loop has no cap generate_textual_id_V3.py generate_textual_id_V3.py. A node that keeps repeating its summary is retried indefinitely at rising temperature.
- Summaries are not reproducible. The IDs come from a closed hosted model; the paper does not pin a model version or sampling settings for the summaries app. C. Cache the IDs once generated §3.3.
- Duplicate summaries are checked only in round 0. Distinct nodes can produce the same short summary; the generator retries only in the round-0 pass generate_textual_id_V3.py, and round updates are not checked. Check for duplicates before building prefix trees.
- Prompt length on dense graphs. The paper estimates about 400 tokens per neighbour in round one, so a 128k window fits over 300 neighbours app. G.2. The cap used in code (12 one-hop + 5 two-hop) differs from the cap the paper names (20) app. G.1. Measure prompt length for your graph before training.
- Generative link prediction is hard. Its HR@1 values are between 0.28 and 8.90 tab. 3, even for the best method. The candidate set size is not stated.
- Cross-task and generative-LP backbones are not stated. The ST rows of tab. 7 match the Flan-T5 NC row and the Llama3 LP row, and tab. 3 names no backbone. Compare numbers only within a table.
- Sampling-ratio table does not match the headline. On Cora, tab. 17 gives 89.35 at 60% sampling, but tab. 1 reports 91.72 for Flan-T5. The paper does not say which setup tab. 17 uses.
- A shuffle baseline differs from the headline. Shuffling neighbours on Cora gives 90.64 tab. 12, against 91.72 in tab. 1; the paper does not explain this.
- PubMed is not a win. GraphPrompter scores 94.80 against 94.65 for PromptGFM (Llama3-8B) tab. 1.
- Target of cross-domain tables is unnamed. tab. 5 and tab. 6 say "biomedical" but not which dataset; PubMed is the only biomedical dataset in the paper app. A, so it is the likely target, but check before comparing.
- Standard deviations are missing from the tables. The paper says 10-fold CV with standard deviations app. C, but only means appear; significance is against an unnamed strongest baseline tab. 1.
- The released training script does not match eq. 7. It trains on the prompt text only and stops at 100 steps (see Paper vs code). Fix both before comparing to the reported numbers.
- Compute and cost. Graph understanding on Ogbn-arxiv cost about $2.69 and 17.91M tokens §4.3. Inference time grows roughly linearly as graphs are added §4.3 tab. 10.
- Figures carry numbers that are not in the text. Ablation values are only in fig. 5; read them from the PDF.
Lineage
- Builds on: Flan-T5 as one of the two backbones; Llama3-8B is cited as backbone and is not carded here.
- Compared against: GCN, GAT, GraphSAGE, RevGNN, SGFormer, NodeFormer app. B; BERT, Sentence-BERT, Llama3-8B app. B; OFA, LLaGA, GraphPrompter, ENGINE, GraphText app. B; GFT app. B; InstructGLM, KGT5-context for generative link prediction app. B.
- Superseded by: not known from content already in this wiki.
Source and license
Adapted from “LLM as GNN: Graph Vocabulary Learning for Text-Attributed Graph Foundation Models” by Xi Zhu, Haochen Xue, Ziwei Zhao, Wujiang Xu, Jingyuan Huang, Minghao Guo, Qifan Wang, Kaixiong Zhou, Imran Razzak, Yongfeng Zhang (arXiv:2503.03313), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/agiresearch/PromptGFM at commit f2e70fe46a5d (none (no LICENSE file in repository)). Any quoted code is shown under that license.