Large Language Models for Link Stealing Attacks Against Graph Neural Networks

Faqian Guan, Tianqing Zhu, Hui Sun, Wanlei Zhou, Philip S. Yu

TL;DR

This paper introduces a novel approach to link stealing attacks against Graph Neural Networks (GNNs) by leveraging Large Language Models (LLMs). By integrating node textual features with GNN output probabilities and using carefully designed prompts, the authors significantly improve attack performance and enable a single LLM to conduct these attacks across diverse datasets, making them more realistic and potent.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) are powerful tools for analyzing graph-structured data, but they can inadvertently leak sensitive information. One such privacy threat is "link stealing," where an attacker tries to infer the existence of connections (links) between nodes in a graph. Previous link stealing attacks primarily relied on the posterior probabilities output by the GNN, often neglecting valuable node features like text. Furthermore, variations in the dimensionality of these probabilities across different datasets made it challenging to develop a single, generalized attack model. This paper addresses these limitations by proposing a method that uses LLMs to effectively incorporate textual features and overcome the challenges posed by varying data dimensions, enabling more robust and versatile link stealing attacks.

Methods

The core of this work is the application of Large Language Models (LLMs) to enhance link stealing attacks against GNNs. The authors propose a four-step process:

  1. Data Processing: Node pairs are created, and their features (including textual attributes) and posterior probabilities (obtained by querying the target GNN) are collected.
  2. Prompt Design: Two distinct prompts are designed for white-box and black-box attack scenarios. These prompts guide the LLM to combine textual information and posterior probabilities to infer link existence. A key innovation is using a related task (node same-class inference) as a "shadow task" for fine-tuning in the black-box setting, leveraging the strong correlation between same-class nodes and linked nodes.
  3. Fine-tuning: The LLM is fine-tuned using the designed prompts and data from the target GNN. This step adapts the LLM to the specific task of link stealing. Crucially, the authors fine-tune the LLM using data from multiple datasets simultaneously, enabling it to learn generalized features.
  4. Link Stealing: The fine-tuned LLM is used to predict whether a link exists between node pairs.

The novelty lies in using LLMs to integrate textual features, their ability to handle variable-length inputs (addressing the varying probability dimensions), and the strategy of multi-dataset fine-tuning for generalization.

Datasets

The authors evaluated their method on four citation datasets:

  • Cora
  • Citeseer
  • Pubmed
  • Ogbn-arxiv

These datasets are commonly used for node classification tasks and vary in size and complexity, with Ogbn-arxiv being a particularly large dataset.

Key Insights and Ideas

  • Textual Features are Crucial: The paper strongly suggests that node textual features, when combined with posterior probabilities, significantly boost the effectiveness of link stealing attacks, a factor often overlooked by prior methods.
  • LLMs Bridge the Gap: LLMs' inherent ability to process natural language and handle variable-length inputs makes them ideal for integrating diverse textual features and overcoming the challenge of varying posterior probability dimensions across datasets.
  • Generalization Through Multi-Dataset Fine-tuning: Fine-tuning a single LLM on multiple datasets simultaneously allows it to learn generalized representations, enabling it to perform link stealing attacks across different graph structures and domains without needing separate models for each.
  • Shadow Tasks for Black-Box Attacks: Using a related task like "node same-class inference" as a fine-tuning objective for LLMs in black-box scenarios is an effective strategy to improve link stealing performance, leveraging the inherent correlations in graph data.

Key Results

  • Significant Performance Boost: The proposed LLM-based method consistently achieved higher accuracy and F1 scores compared to previous state-of-the-art link stealing attack methods in both white-box and black-box settings.
  • White-Box Superiority: In white-box scenarios, the LLM method achieved over 90% accuracy and F1 score across all tested datasets, with particularly strong performance on Ogbn-arxiv (97.48% accuracy, 97.49% F1 score). This represents an improvement of up to 8% over prior methods.
  • Black-Box Effectiveness: In black-box scenarios, the LLM method achieved accuracy and F1 scores of around 84%, demonstrating its effectiveness even with limited attacker knowledge.
  • Cross-Dataset Attack Capability: A single LLM, fine-tuned on multiple datasets, could effectively perform link stealing attacks across different target datasets, a feat difficult for previous methods.
  • Universality: The method showed strong performance across different LLM architectures (Vicuna-7B, Vicuna-13B, LongChat) and target GNN models (GCN, GAT, GraphSAGE), highlighting its robustness and generalizability.

Limitations and Future Work

  • Black-Box vs. White-Box Performance: While effective, the LLM's performance in black-box scenarios is generally lower than in white-box scenarios. The authors attribute this to the LLM not being directly fine-tuned on the link stealing task itself but rather on related tasks.
  • Dataset Specifics: The performance can be influenced by dataset characteristics, such as the number of classes (e.g., PubMed's limited classes made cross-dataset tasks more challenging).
  • Future Work: The authors suggest exploring the application of LLMs to other types of GNN privacy attacks, such as model extraction, membership inference, and attribute inference.

Summary updated

BibTeX
@article{guan2025large,
  author = {Faqian Guan and Tianqing Zhu and Hui Sun and Wanlei Zhou and Philip S. Yu},
  title = {{Large Language Models for Link Stealing Attacks Against Graph Neural Networks}},
  journal = {IEEE Trans. Big Data},
  year = {2025},
  doi = {10.1109/tbdata.2024.3489427},
}
Figure