Adversarial Attacks and Defenses on Graph-aware Large Language Models (LLMs)
Iyiola E. Olatunji, Franziska Boenisch, Jing Xu, Adam Dziedzic · 2025
Read Adversarial Attacks and Defenses on Graph-aware Large Language Models (LLMs) by Iyiola E. Olatunji, Franziska Boenisch, Jing Xu, Adam Dziedzic (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-04894.txt.
Introduction
Four authors make the first study of attacks on graph-aware language models in this 2025 paper. Language models now work directly on graph data for tasks like node classification, once the home of graph neural networks, but their security under attack was unexplored.
The team adapted graph attacks, both training time poisoning and test time evasion, against two leading models. They also found a fresh weakness: extra fake nodes slipped into one model's node sequence template badly degraded it. Design choices mattered, with one model's graph encoder proving sturdier, though both fell to subtle feature tweaks. The authors close with GALGUARD, an end-to-end defense framework.
Catalog record
| CREATOR | Iyiola E. Olatunji, Franziska Boenisch, Jing Xu, Adam Dziedzic |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 73 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-04894
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Adversarial Attacks and Defenses on Graph-aware Large Language Models (LLMs) Iyiola E. Olatunji, Franziska Boenisch, Jing Xu, Adam Dziedzic Abstract Large Language Models (LLMs) are increasingly integrated with graph-structured data for tasks like node classification, a domain traditionally dominated by Graph Neural Networks (GNNs). While this integration leverages rich relational information to improve task performance, their robustness against adversarial attacks remains unexplored. We take the first step to explore the vulnerabilities of graph-aware LLMs by leveraging existing adversarial attack methods tailored for graph-based models, including those for poisoning (training-time attacks) and evasion (test-time attacks), on two representative models, LLaGA ( Chen et al. 2024 ) and GraphPrompter ( Liu et al. 2024 ) . Additionally, we discover a new attack surface for LLaGA where an attacker can inject malicious nodes as placeholders into the node sequence template to severely degrade its performance. Our systematic analysis reveals that certain design choices in graph encoding can enhance attack success, with specific findings that: (1) the node sequence template in LLaGA increases its vulnerability; (2) the GNN encoder used in GraphPrompter demonstrates greater robustness; and (3) both approaches remain susceptible to imperceptible feature perturbation attacks. Finally, we propose an end-to-end defense framework GaLGuard , that combines an LLM-based feature correction module to mitigate feature-level perturbations and adapted GNN defenses to protect against structural attacks 1 1 1 Our code is available. 1 Introduction Graphs, characterized by nodes and edges that represent entities and relationships, are used to model complex structures in various real-world domains, including social networks ( Fan et al. 2019 ) , biology ( Dong, Mücke, and Khosla 2022 ) , finance ( Wang et al. 2021 ) , and healthcare ( Ahmedt-Aristizabal et al. 2021 ) . Graph Neural Networks (GNNs) ( Hamilton, Ying, and Leskovec 2017 ; Kipf and Welling 2022 ; Veličković et al. 2018 ) , designed specifically for graph-structured data, excel in tasks such as node classification and link prediction. Recently, the success of large language models (LLMs) such as GPT-4 ( Achiam et al. 2023 ) , Gemini ( Team et al. 2023 ) , LLaMA ( Touvron et al. 2023 ; Dubey et al. 2024 ) , Vicuna ( Chiang et al. 2023 ) , and PaLM-2 ( Anil et al. 2023 ) , trained on vast amounts of textual data, has sparked interest in their potential to enhance graph-related tasks. This fusion of graph data with LLMs (called graph-aware LLMs ( Xie et al. 2023 ) ) has opened a new line of research, where LLMs are increasingly being utilized to perform tasks traditionally handled by GNNs ( Ye et al. 2023 ; Fatemi, Halcrow, and Perozzi 2023 ; Kuang et al. 2023 ; Zhang et al. 2023 ; Chen et al. 2023b ; Chen et al. 2024 ) . In fact, recent research has shown that graph-aware LLMs can outperform GNNs on various graph-related tasks ( Wenkel, Wolf, and Knyazev 2023 ; Chen et al. 2023b ; Zhu et al. 2024 ; Chen et al. 2024 ) , positioning them as powerful alternatives. Despite their growing popularity, the vulnerabilities of graph-aware LLMs to attacks remain largely unexplored. Existing adversarial attacks on GNNs, including those for poisoning (training-time attacks) and evasion (test-time attacks) ( Zügner, Akbarnejad, and Günnemann 2018 ; Zügner and Günnemann 2019 ; Dai et al. 2023 ) , operate under a black-box setting where the attacker has no knowledge of the model’s internal workings. These attacks undermine model integrity by intentionally degrading model performance by subtly altering graph structure or node features. While GNN research has predominantly focused on structural attacks, the textual nature of graph-aware LLMs makes imperceptible perturbations to node features a significant concern that has been largely overlooked. Motivated by these three key observations: the shift from GNNs to LLMs for graph tasks, the black-box nature of current adversarial attacks on GNNs, and the potentially new vulnerabilities to feature perturbations, we ask the critical question of whether adversarial attacks designed for GNNs remain effective against the emerging graph-aware LLM paradigm . In addition, the success of graph-aware LLMs in handling graph tasks highly depends on the effective integration of graphs into the LLM. While processing the node features is straightforward given LLM’s proficiency in handling textual data, incorporating the graph structure is more complex and requires innovative techniques to capture relational information ( Chen et al. 2024 ; Guo et al. 2023 ; Liu and Wu 2023 ; Zhang et al. 2023 ; Sun et al. 2023 ; Bi et al. 2024 ; Pan et al. 2024 ) . Therefore, to effectively answer our research question, we first categorize existing graph-aware methods into two classes based on their approach to encoding graphs into LLMs; one that represents graph data as textual descriptions , converting graph information into natural language, and another that utilizes learned projectors to bridge the inherent differences between graph and text domains. While conventional text-based adversarial attacks on LLMs should generally suffice to compromise LLMs handling textual descriptions of graphs, we focus our investigation on learned projector methods, using two computationally efficient representative models, LLaGA ( Chen et al. 2024 ) and GraphPrompter ( Liu et al. 2024 ) , which both utilize frozen pre-trained LLM. Our analysis reveals that certain design choices in graph encoding for LLMs can unexpectedly enhance the success of attacks. Notably, we identify a new attack surface in LLaGA that could allow an attacker to severely degrade the model’s performance by injecting malicious nodes as placeholders within the node sequence template. In addition, we propose an end-to-end g raph- a ware L LM defense, GaLGuard , which integrates an LLM-based feature corrector with adapted GNN-based structural defenses to provide robust protection. We are the first to investigate the vulnerability of graph-aware LLMs to adversarial attacks. The contributions of the paper are summarized as follows: • We leverage representative adversarial attacks for GNNs, specifically Nettack ( Zügner, Akbarnejad, and Günnemann 2018 ) and MetaAttack ( Zügner and Günnemann 2019 ) , to investigate the transferability of poisoning and evasion attacks to graph-aware LLMs. • We create a taxonomy for graph-aware LLMs based on their encoding approaches to understand how different methodologies integrate graph structures into LLMs. • We discover a new attack surface in LLaGA , showing that injecting malicious nodes as placeholders into the node sequence template can degrade its performance. • We provide a holistic assessment of the vulnerabilities of graph-aware LLMs by performing imperceptible attacks on textual node features, a perspective often overlooked in GNNs. • We propose GaLGuard , a novel end-to-end defense strategy that integrates LLM-based feature correction with the adaptation of existing GNN-based structural defenses. 2 Graph Encoding-Based Taxonomy of LLM Adaptations Figure 1: Graph encoding-based adaptations of LLMs. In the textual description graph representation, graphs are explained textually (top part). In the learned projector representation, graphs are encoded either by node templates that turns the graph into sequences or by GNNs (bottom part). Note that in both cases, the LLM is frozen. Only the projector that maps the graph into tokens is trained. Graph encoding methods for LLMs can be categorized into two main approaches: textual descriptions of graphs (where graph information is