GraphICL: Unlocking Graph Learning Potential in LLMs through Structured Prompt Design

Yuanfu Sun, Zheng Ma, Yi Fang, Jing Ma, Qiaoyu Tan

Main figure for GraphICL: Unlocking Graph Learning Potential in LLMs through Structured Prompt Design

Abstract

The growing importance of textual and relational systems has driven interest in enhancing large language models (LLMs) for graph-structured data, particularly Text-Attributed Graphs (TAGs), where samples are represented by textual descriptions interconnected by edges. While research has largely focused on developing specialized graph LLMs through task-specific instruction tuning, a comprehensive benchmark for evaluating LLMs solely through prompt design remains surprisingly absent. Without such a carefully crafted evaluation benchmark, most if not all, tailored graph LLMs are compared against general LLMs using simplistic queries (e.g., zero-shot reasoning with LLaMA), which can potentially camouflage many advantages as well as unexpected predicaments of them. To achieve more general evaluations and unveil the true potential of LLMs for graph tasks, we introduce Graph In-context Learning (GraphICL) Benchmark, a comprehensive benchmark comprising novel prompt templates designed to capture graph structure and handle limited label knowledge. Our systematic evaluation shows that general-purpose LLMs equipped with our GraphICL outperform state-of-the-art specialized graph LLMs and graph neural network models in resource-constrained settings and out-of-domain tasks. These findings highlight the significant potential of prompt engineering to enhance LLM performance on graph learning tasks without training and offer a strong baseline for advancing research in graph LLMs.

Benchmark Results

Tested on 3 datasets 5 baseline values reported too low

Tables show presented results in global context (best 3 papers + GCN + MLP).

Classic

#ModelAccuracy ↑Paper
1
GraphTARIF
0.9703 ±0.0019
2
GAT
0.9669 ±0.0014
3
GAT+T
0.9660 ±0.0007
7
SAGE
0.9643 ±0.0027
390
MLP
0.9128 ±0.0063
508
SAGE (GIA)
0.8512
This paper
515
RevGAT (GIA)
0.8438
This paper
516
GCN (GIA)
0.8427
This paper
517
MLP (GIA)
0.8413
This paper
527
GraphICL-LLaMA3-S1
0.8089
This paper
533
GraphICL-LLaMA3-S2
0.7918
This paper
#ModelAccuracy ↑Paper
1
GraphTARIF
0.9461 ±0.0017
2
GCN
actual #2 vs paper #454 452 places worse
0.9412 ±0.0008
best reported
actual #2 vs paper #454 452 places worse
paper 0.7435
3
GAT
0.9398 ±0.0022
8
SAGE
actual #8 vs paper #460 452 places worse
0.9351 ±0.0006
best reported
actual #8 vs paper #460 452 places worse
paper 0.7354
46
GraphSAGE
0.9120 ±0.0029
241
GraphICL-LLaMA3-S1
0.8737
This paper
242
GraphICL-LLaMA3-S2
0.8737
This paper
254
GraphICL-LLaMA2-S1
0.8706
This paper
255
LLAGA-ND
0.8699
This paper
309
GraphICL-LLaMA2-S2
0.8511
This paper
320
MLP
0.8463
436
LLAGA-HO
0.7878
This paper
439
GraphPrompter
0.7838
This paper
462
RevGAT
0.7316
This paper
482
MLP+LLM_features
0.6174
This paper
485
LLaMA3-70b-Instruct
0.5742
This paper
490
LLaMA2-13b-Chat
0.4748
This paper
495
GraphTranslator
0.3895
This paper

OGB

#ModelAccuracy ↑Paper
1
Jacobi
0.8968
2
GPR
0.8953
3
LEMP4HG
0.8939
4
SAGE
actual #4 vs paper #308 304 places worse
0.8933
best reported
actual #4 vs paper #308 304 places worse
paper 0.7344
6
GCN
actual #6 vs paper #256 250 places worse
0.8868
best reported
actual #6 vs paper #256 250 places worse
paper 0.7556
8
RevGAT
actual #8 vs paper #306 298 places worse
0.8859
best reported
actual #8 vs paper #306 298 places worse
paper 0.7362
27
MLP+LLM_features
actual #27 vs paper #346 319 places worse
0.8634
best reported
actual #27 vs paper #346 319 places worse
paper 0.6756
49
LLAGA-HO
actual #49 vs paper #306 257 places worse
0.8467
best reported
actual #49 vs paper #306 257 places worse
paper 0.7364
50
LLAGA-ND
actual #50 vs paper #306 256 places worse
0.8460
best reported
actual #50 vs paper #306 256 places worse
paper 0.7362
83
GraphSAGE
0.8287
109
GraphICL-LLaMA3-S1
0.8148
This paper
126
GraphICL-LLaMA3-S2
0.8104
This paper
160
GraphPrompter
actual #160 vs paper #186 26 places worse
0.7954
best reported
actual #160 vs paper #186 26 places worse
paper 0.7904
paper 0.7904 Δ at pub 0.0050
196
GraphICL-LLaMA2-S1
0.7884
This paper
217
GraphICL-LLaMA2-S2
0.7827
This paper
351
MLP
0.6605 ±0.0020
377
LLaMA3-70b-Instruct
0.5762
This paper
378
LLaMA2-13b-Chat
0.5734
This paper
388
GraphTranslator
0.4132
This paper
SOTA performance (not significantly different from the best) Proposed method (this paper) Baseline / comparison (this paper) Global context (other papers) Best at pub — reported result worse than the best known when published (best reported in green) Best today — OK at publication; today's leaderboard best is elsewhere