Organizations: School of Cyberspace, Hangzhou Dianzi University, Hangzhou, China · Hangzhou Dianzi University, Hangzhou, China · Beihang University, Beijing, China · Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China
Text-attributed graphs (TAGs) enhance graph learning by integrating rich textual semantics and topological context for each node. While boosting expressiveness, they also expose new vulnerabilities in graph learning through text-based adversarial surfaces. Recent advances leverage diverse backbones, such as graph neural networks (GNNs) and pre-trained language models (PLMs), to capture both structural and textual information in TAGs. This diversity raises a key question: How can we design universal adversarial attacks that generalize across architectures to assess the security of TAG models? The challenge arises from the stark contrast in how different backbones-GNNs and PLMs-perceive and encode graph patterns, coupled with the fact that many PLMs are only accessible via APIs, limiting attacks to black-box settings. To address this, we propose BadGraph, a novel attack framework that deeply elicits large language models (LLMs) understanding of general graph knowledge to jointly perturb both node topology and textual semantics. Specifically, we design a target influencer retrieval module that leverages graph priors to construct cross-modally aligned attack shortcuts, thereby enabling efficient LLM-based perturbation reasoning. Experiments show that BadGraph achieves universal and effective attacks across GNN- and LLM-based reasoners, with up to a 76.3% performance drop, while theoretical and empirical analyses confirm its stealthy yet interpretable nature.
Figures & tables
Figure 1. An overview of the proposed BadGraph framework.
Dataset
Emb.
Models
Clean
STACK
PGD
RND
FLIP
SGAttack
WTGIA
Our-text
Our-struct
BadGraph
Cora
TF-IDF
R-GCN
86.67
82.37
78.07
73.93
73.11
85.41
86.22
84.44
79.11
70.89
GIN
85.93
72.37
78.30
72.59
72.89
81.04
85.70
84.44
76.96
63.04
GraphSAGE
84.96
72.30
77.41
74.81
74.74
73.70
83.19
73.93
76.37
54.67
TAGCN
87.33
75.33
80.22
75.04
75.85
87.33
87.56
85.48
83.41
73.93
GCN
85.48
73.78
77.70
74.89
74.44
83.63
83.85
84.15
78.67
71.33
SBERT
R-GCN
87.33
76.37
80.30
76.00
75.93
86.30
85.93
80.30
79.11
56.67
Table 1. GNN-as-Reasoner Scenarios. Attack performance on three datasets across various target GNNs. Lower scores indicate stronger attacks. "Clean" denotes unperturbed graphs; Our-text and Our-struct correspond to text-only and structure-only variants. Best results are in bold.
Dataset
Models
Clean
STACK
PGD
RND
FLIP
SGAttack
WTGIA
Our-text
Our-struct
BadGraph
Cora
DeepSeek-V3
71.85
68.14
72.96
65.92
64.07
67.03
63.70
25.55
67.03
17.03
Mistral-7B
43.70
42.96
53.33
42.59
47.03
37.40
21.48
21.11
38.51
16.29
Arxiv
DeepSeek-V3
64.60
60.80
60.60
61.20
58.70
-
60.10
44.30
55.55
22.90
Mistral-7B
9.30
7.70
8.90
9.20
9.00
-
7.60
4.90
4.70
2.90
Products
DeepSeek-V3
77.10
75.90
75.00
76.50
75.60
75.80
74.10
60.20
75.20
55.80
Mistral-7B
12.20
9.50
10.00
9.70
8.30
12.20
9.10
8.60
12.80
7.80
Table 2. LLM-as-Reasoner Scenarios. Attack performance across two LLM backbones on three TAG datasets.
Figure 2. Edge-level homophily shift on the Cora dataset.
# Nodes
Perturb. Ratio
Acc
Avg. Homo. (edge)
Avg. Homo. (node)
0
0
64.6%
0.8184
0.4257
500
0.09%
23.4%
0.8183
0.4292
1000
0.17%
22.9%
0.8182
0.4317
1500
0.26%
22.6%
0.8181
0.4316
Table 3. Accuracy and homophily changes of deepSeek-as-Reasoner on Arxiv under varying perturbation ratios.
Figure 3. T-SNE visualization illustrating embedding shifts caused by the attack on the Cora dataset.
Method
R-GCN
GCN
GIN
GraphSAGE
TAGCN
Clean
87.33
87.11
85.70
86.00
88.22
Anchor Mis.
71.63
63.93
71.04
62.59
77.11
Rephrasing
58.15
58.74
50.74
39.04
54.59
BadGraph
56.67
56.00
47.04
39.93
51.19
Table 4. Robustness of BadGraph under prompt variations on Cora. “Rephrasing” rewrites the prompt, and “Anchor Mis.” uses inconsistent influencers across modalities.
Method
GIN
GraphSAGE
SGCN
TAGCN
Qwen
DeepSeek
Clean
85.70
86.00
86.07
88.22
68.88
71.85
Ours-LLaMA
48.81
39.85
58.52
52.44
15.92
17.03
Ours-Qwen
48.70
39.56
55.78
55.19
17.03
19.25
Ours-DeepSeek
47.04
39.93
55.63
51.19
16.29
16.29
Table 5. Robustness of BadGraph under Different Attacker LLMs on the Cora Dataset. Attacker models: LLaMA-4-17B, Qwen-Plus, and DeepSeek-V3.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
#Nodes
#Edges
#Classes
Cora
2,708
5,429
7
Arxiv
169,343
1,166,243
40
Products (subset)
54,025
74,420
47
Appendix
Table 6. Overview of dataset statistics.
Clean
STACK
PGD
RND
FLIP
NETTACK
SGAttack
WTGIA
BadGraph
TF-IDF
86.81
79.56
82.00
80.89
78.00
86.07
87.56
87.26
62.44
SBERT
85.45
78.22
81.11
78.07
78.15
83.56
86.00
85.11
35.11
Appendix
Table 7. Attack Results Under RUNG Defense on the Cora Dataset.
Method
R-GCN
GCN
SGCN
TAGCN
Clean
86.30
85.19
87.78
87.04
BadGraph
72.59
75.19
75.19
75.56
Δ Acc
+1.70
+3.86
+3.93
+1.63
Appendix
Table 8. Effectiveness of BadGraph under adversarial training on the Cora. Δ Acc = Accuracyadv-trained−Accuracyvanilla .
Encoder
GIN
GraphSAGE
SGCN
TAGCN
DeepSeek
Clean
85.70
86.00
86.07
88.22
71.85
GCN
55.44
54.07
58.63
55.59
21.11
R-GCN
46.96
38.52
57.04
54.37
19.59
GAT
47.04
39.93
55.63
51.19
17.03
Appendix
Table 9. Attack performance with different encoders on the Cora dataset across various GNN encoder backbones.
Figure 4. Attack Success Rate on OGBN-Products for different target GNNs, evaluated on two settings: Medium (medium-degree nodes) and Hard (high-degree nodes).
Dataset
Emb.
Metrics
Clean
STACK
PGD
RND
FLIP
SGAttack
WTGIA
Our-text
Our-struct
BadGraph
Cora
TF-IDF
Average
86.19
73.14
78.51
74.07
74.19
82.38
84.95
82.60
78.90
67.52
3-MAX
86.91
73.93
79.28
74.91
75.01
85.46
86.49
84.79
80.47
72.17
Weighted
87.03
74.61
79.72
74.85
75.36
86.14
86.84
84.90
81.85
72.51
SBERT
Average
86.74
76.57
80.32
76.93
76.58
83.53
85.28
77.01
77.02
51.07
3-MAX
87.56
77.75
80.67
78.07
77.26
87.14
86.72
80.35
80.15
56.10
Weighted
87.79
77.71
80.70
78.49
77.32
87.55
87.17
80.06
81.42
55.68
Appendix
Table 10. GNN-as-Reasoner Scenarios. Comprehensive evaluation results (Average, 3-MAX, and Weighted) across all target backbones. Lower values indicate stronger attack effectiveness. "Clean" denotes unperturbed graphs, while Our-text and Our-struct represent text-only and structure-only variants, respectively. Best results are highlighted in bold.