Reinforcement Learning Enhanced Explainer for Graph Neural Networks

Caihua Shan, Yifei Shen, Yao Zhang, Xiang Li, Dongsheng Li

Graph Neural Networks (GNNs) have become the go-to architecture for everything from drug discovery to social network analysis. However, like many deep learning models, they are notoriously "black boxes." When a GNN predicts that a molecule is mutagenic, we often do not know why.

A new paper, "Reinforcement Learning Enhanced Explainer for Graph Neural Networks" (RG-Explainer), proposes a novel way to pull back the curtain using reinforcement learning (RL). RG-Explainer is an RL framework that explains GNN predictions by iteratively building a connected, influential subgraph. Unlike previous methods that use "soft masks"—which often result in disconnected, nonsensical fragments—RG-Explainer ensures the explanation follows the model's internal message-passing logic, leading to more accurate and human-readable insights.

The Problem with Existing Explainers

To explain a GNN, we usually want to find the smallest "influential subgraph"—the specific nodes and edges that most heavily influenced the model's final decision.

Existing explainers (like GNNExplainer or PGExplainer) typically treat this as a continuous optimization problem. They apply a "soft mask" to edges, essentially asking, "If I dim this edge, does the prediction change?" The problem is that these methods often produce disconnected edges or violate the message-passing scheme of GNNs. If a GNN relies on information flowing from node A to C through B, an explanation that only highlights A and C without B is technically impossible according to the model's own logic.

Furthermore, many existing tools rely on hand-crafted search heuristics that do not generalize well to new, unseen graphs (the "inductive" setting).

The RG-Explainer Approach

The authors introduce RG-Explainer, which treats explanation as a sequential decision-making process.

Architecture of the RG-Explainer framework, showing the Seed Locator and the iterative Graph Generator.

The framework consists of three main pillars:

  1. Seed Locator (Starting Point Selection): For graph-level classification, you first need to know where to start looking. The Seed Locator is a trained module that identifies the most "influential" node in a graph to serve as the root of the explanation.
  2. Iterative Graph Generator: This is the heart of the RL agent. Starting from the seed node, the agent looks at the "boundary" (neighboring nodes) and chooses which node to add next. Because it only adds neighbors, the resulting subgraph is guaranteed to be connected, mirroring the way GNNs actually pass messages.
  3. Stopping Criteria Learning: Instead of a human deciding the explanation should be exactly five nodes long, the agent learns a "STOP" action. It balances the trade-off between a concise explanation and one that maintains the original prediction accuracy.

The agent is trained using a reward function that combines Mutual Information (how well the subgraph mimics the original prediction) with regularizations for size, radius (compactness), and feature similarity. To represent the "state" of the graph during RL training without massive overhead, the authors use APPNP (Approximate Personalized PageRank), which decouples feature transformation from message passing.

Datasets and Key Results

The researchers evaluated RG-Explainer on six diverse datasets, including synthetic node classification benchmarks (BA-shapes, BA-Community, Tree-Cycles, Tree-Grid) and graph classification datasets (BA-2motifs and Mutagenicity, a real-world dataset of 4,337 molecule graphs).

Visual comparison of explanations generated by GNN-Explainer, PG-Explainer, and RG-Explainer against ground-truth motifs.

RG-Explainer outperformed state-of-the-art baselines in 5 out of 6 datasets based on AUC scores:

  • Massive Gains: On the Tree-Grid dataset, RG-Explainer improved the explanation AUC by 29.8% over the next best method.
  • Real-World Accuracy: On the Mutagenicity dataset, it achieved an AUC of 0.873, successfully identifying chemical groups like $NO_2$ and $NH_2$ that drive toxicity.
  • Inductive Performance: Unlike search-based methods that must be re-run from scratch for every new graph, RG-Explainer learns a policy. In tests where the explainer was trained on only 10% of the data, it maintained high accuracy on the remaining 90%, whereas previous methods saw sharp performance drops.

By framing the problem as iterative growth rather than edge-masking, the authors ensure the explanation is a valid path for message passing. This makes the explanation much more faithful to the GNN’s actual computation.

Limitations and Future Work

While RG-Explainer provides high-quality explanations, the authors note a potential "double-edged sword": by making GNNs more transparent, it might also make them more vulnerable to targeted adversarial attacks.

Future research directions suggested include using these explanations to build more robust GNNs that ignore "noisy" or irrelevant parts of a graph, and exploring how these RL-based explanations can be scaled to even larger, industrial-scale graphs where the action space (the boundary of the subgraph) might become very large.

Summary updated

BibTeX
@inproceedings{shan2021reinforcement,
  author = {Caihua Shan and Yifei Shen and Yao Zhang and Xiang Li and Dongsheng Li},
  title = {{Reinforcement Learning Enhanced Explainer for Graph Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure