LLM-CFExplainer: A Large Language Model-Guided Framework for Graph Counterfactual Explanations

Counterfactual explanations improve the interpretability of graph neural networks (GNNs) by identifying small structural or feature perturbations that alter model predictions. They are especially useful in applications sensitive to relational changes, including molecular property prediction, fraud detection, and recommendation systems. However, existing methods often rely on local importance scores or heuristic search, limiting their ability to capture global graph structure and generate prediction-relevant graph edits. We propose LLM-CFExplainer, a general framework that uses large language models (LLMs) to assist counterfactual generation for GNNs. The framework extracts neighborhood-level influence information from a trained GNN and converts it, together with the original graph information, into structured prompts. The LLM then performs relational reasoning and proposes counterfactual edits subject to prediction-flipping, domain consistency, and basic topological constraints. A lightweight verification module evaluates the validity of the proposed edits and ensures consistency with the original graph. Experiments on multiple benchmark datasets show that LLM-CFExplainer improves counterfactual validity, coverage of perturbable regions, and coherence of generated explanations. These results demonstrate the potential of LLMs as reasoning tools for enhancing the interpretability of graph learning models. Our code is available at https://github.com/tanhaochen001-ux/LLM-CFExplainer .

Authors

Publication Details

Journal
International Journal of Software Engineering and Knowledge Engineering
Published
2026-11-13
DOI
https://doi.org/10.1142/s0218194027500045
Primary Topic
Explainable Artificial Intelligence (XAI)
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

LLM-CFExplainer: A Large Language Model-Guided Framework for Graph Counterfactual Explanations

Mehdi Naseriparsa, Huiyong Wang, Xiaoming Zhang, Haochen Tan
International Journal of Software Engineering and Knowledge Engineering
Explainable Artificial Intelligence (XAI)
article

LLM-CFExplainer: A Large Language Model-Guided Framework for Graph Counterfactual Explanations

Mehdi Naseriparsa, Huiyong Wang, Xiaoming Zhang, Haochen Tan
article en

Abstract

Counterfactual explanations improve the interpretability of graph neural networks (GNNs) by identifying small structural or feature perturbations that alter model predictions. They are especially useful in applications sensitive to relational changes, including molecular property prediction, fraud detection, and recommendation systems. However, existing methods often rely on local importance scores or heuristic search, limiting their ability to capture global graph structure and generate prediction-relevant graph edits. We propose LLM-CFExplainer, a general framework that uses large language models (LLMs) to assist counterfactual generation for GNNs. The framework extracts neighborhood-level influence information from a trained GNN and converts it, together with the original graph information, into structured prompts. The LLM then performs relational reasoning and proposes counterfactual edits subject to prediction-flipping, domain consistency, and basic topological constraints. A lightweight verification module evaluates the validity of the proposed edits and ensures consistency with the original graph. Experiments on multiple benchmark datasets show that LLM-CFExplainer improves counterfactual validity, coverage of perturbable regions, and coherence of generated explanations. These results demonstrate the potential of LLMs as reasoning tools for enhancing the interpretability of graph learning models. Our code is available at https://github.com/tanhaochen001-ux/LLM-CFExplainer .

International Journal of Software Engineering and Knowledge Engineering
Explainable Artificial Intelligence (XAI)
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon