Table of Contents
Fetching ...

From Nodes to Narratives: Explaining Graph Neural Networks with LLMs and Graph Context

Peyman Baghershahi, Gregoire Fournier, Pranav Nyati, Sourav Medya

Abstract

Graph Neural Networks (GNNs) have emerged as powerful tools for learning over structured data, including text-attributed graphs (TAGs), which are common in domains such as citation networks, social platforms, and knowledge graphs. GNNs are not inherently interpretable and thus, many explanation methods have been proposed. However, existing explanation methods often struggle to generate interpretable, fine-grained rationales, especially when node attributes include rich natural language. In this work, we introduce GSPELL, a lightweight, post-hoc framework that uses large language models (LLMs) to generate faithful and interpretable explanations for GNN predictions. GSPELL projects GNN node embeddings into the LLM embedding space and constructs hybrid prompts that interleave soft prompts with textual inputs from the graph structure. This enables the LLM to reason about GNN internal representations and produce natural language explanations along with concise explanation subgraphs. Our experiments across real-world TAG datasets demonstrate that GSPELL achieves a favorable trade-off between fidelity and sparsity, while improving human-centric metrics such as insightfulness. GSPELL sets a new direction for LLM-based explainability in graph learning by aligning GNN internals with human reasoning.

From Nodes to Narratives: Explaining Graph Neural Networks with LLMs and Graph Context

Abstract

Graph Neural Networks (GNNs) have emerged as powerful tools for learning over structured data, including text-attributed graphs (TAGs), which are common in domains such as citation networks, social platforms, and knowledge graphs. GNNs are not inherently interpretable and thus, many explanation methods have been proposed. However, existing explanation methods often struggle to generate interpretable, fine-grained rationales, especially when node attributes include rich natural language. In this work, we introduce GSPELL, a lightweight, post-hoc framework that uses large language models (LLMs) to generate faithful and interpretable explanations for GNN predictions. GSPELL projects GNN node embeddings into the LLM embedding space and constructs hybrid prompts that interleave soft prompts with textual inputs from the graph structure. This enables the LLM to reason about GNN internal representations and produce natural language explanations along with concise explanation subgraphs. Our experiments across real-world TAG datasets demonstrate that GSPELL achieves a favorable trade-off between fidelity and sparsity, while improving human-centric metrics such as insightfulness. GSPELL sets a new direction for LLM-based explainability in graph learning by aligning GNN internals with human reasoning.

Paper Structure

This paper contains 35 sections, 7 equations, 3 figures, 11 tables.

Figures (3)

  • Figure 1: Illustration of Gspell's framework. First, the projector is trained to align GNN node embeddings with the LLM’s embedding space. Next, hybrid prompts are constructed by interleaving projected embeddings (as soft prompts) with natural language tokens. These prompts are then fed into the LLM to produce natural language explanations, which are converted into explanation subgraphs.
  • Figure 2: Left: prompt with category and embeddings highlighted. Right: full model response with summaries in the middle and YES/NO verdicts aligned on the right.
  • Figure 3: Left: prompt with category and embeddings highlighted. Right: model response with summaries, YES/NO verdicts, and reasoning. Below: instructions shown separately.

Theorems & Definitions (2)

  • Definition 1: Text-Attributed Graph (TAG)
  • Definition 2: Local Factual Explainer