Explaining Graph Neural Networks for Node Similarity on Graphs

Daniel Daza, Cuong Xuan Chu, Trung-Kien Tran, Daria Stepanova, Michael Cochez, Paul Groth

TL;DR

This paper tackles the unaddressed challenge of explaining node similarity scores in Graph Neural Networks (GNNs). By introducing a novel evaluation framework based on three intuitive criteria—actionability, consistency, and sparsity—the authors demonstrate that gradient-based explanation methods significantly outperform mutual information-based approaches like GNNExplainer in providing reliable, directional, and compact explanations.

What Problem Does This Paper Address?

Explainability in Graph Neural Networks (GNNs) has traditionally focused on supervised, discrete tasks like node classification ("Why is this node labeled as a research paper?") or link prediction. However, many real-world graph applications rely on unsupervised node similarity search, such as finding related products in an e-commerce graph or matching entities in a knowledge graph.

Explaining why a GNN considers two node embeddings to be similar is uniquely challenging. Unlike classification, similarity scores are continuous (e.g., cosine similarity) and lack ground-truth labels. Prior to this work, there were no standard evaluation protocols or clear criteria for what constitutes a "good" similarity explanation. This paper bridges that gap by formalizing the problem and introducing model-agnostic evaluation metrics.

Pipeline for explaining node similarity scores

Methods

The authors propose three core criteria that any robust node similarity explanation should satisfy:

  1. Actionability: Intervening on the graph using the explanation (e.g., keeping only the highly-rated edges) should yield a predictable, directional change in the similarity score.
  2. Consistency: The effect of keeping edges above an importance threshold must be distinct from (and ideally opposite to) the effect of keeping edges below it.
  3. Sparsity: The explanation should be compressible, meaning it can be pruned to a small subset of critical edges while retaining its overall impact.

To operationalize these criteria, the authors design an intervention-based framework. They compute an explanation matrix $M$ for a pair of nodes, split it into edges above a threshold ($M_a$) and below a threshold ($M_b$), and re-run the GNN on these perturbed graphs. They then evaluate the results using two metrics:

  • Fidelity ($Fid_a, Fid_b$): Measures the absolute change in similarity after the graph intervention.
  • Effect Overlap (EO): Uses a generalized Jaccard similarity to quantify whether the signs of the similarity changes overlap between the two interventions (lower is better).

They use this framework to compare Mutual Information (MI) methods (specifically GNNExplainer) against Gradient-Based (GB) methods (Vanilla Gradients and Integrated Gradients).

Datasets

The framework was rigorously evaluated across seven diverse graph datasets:

  • Homophilic citation networks: Cora, Citeseer, Pubmed (where connected nodes share similar features).
  • Heterophilic networks: Chameleon, Squirrel, Actor (where connected nodes are often structurally or semantically distinct).
  • Knowledge Graph: DBpedia50k (a featureless graph used to evaluate entity similarity).

These were tested across multiple unsupervised embedding techniques (GAE, VGAE, DGI, GRACE) and base GNN architectures (GCN, SGC, GraphSAGE, MixHop, R-GCN).

Key Insights and Ideas

  • GNNExplainer Struggles with Continuous Targets: While highly popular for node classification, MI-based methods like GNNExplainer fail to provide consistent explanations for node similarity. Keeping "important" edges according to GNNExplainer sometimes increased similarity and sometimes decreased it, showing high sensitivity to the underlying dataset and model.
  • Gradients Naturally Capture Directionality: Gradient-based methods inherently provide both magnitude and direction (positive vs. negative gradients). This makes them uniquely suited for continuous similarity scores, as they can explicitly denote which edges increase or decrease similarity.
  • Massive Compressibility: GB explanations are remarkably robust to pruning. The authors found that you can discard up to 90% of the edges in a gradient-based explanation, and the remaining 10% will still faithfully preserve the actionable and consistent properties of the full explanation.
  • The Efficiency Bonus: Beyond quality, GB methods require only a single backward pass through the network, making them computationally orders of magnitude cheaper than the iterative optimization loops required by MI methods.

Key Results

  • Fidelity & Actionability: For GB methods, keeping edges above the threshold consistently increased similarity ($Fid_a > 0$), while keeping edges below the threshold decreased it ($Fid_b < 0$). This predictable behavior was completely absent in GNNExplainer.
  • Effect Overlap (EO): Across almost all datasets, GB methods achieved an EO near or below 0.1, indicating highly distinct and consistent edge roles. GNNExplainer hovered between 0.4 and 0.6, meaning its "important" and "unimportant" edge sets often caused identical directional shifts.
  • Sparsity Retention: As shown in the paper's sparsity analysis, the fidelity and low effect overlap of Integrated Gradients remained virtually flat even when the explanation was pruned by 90%, proving that the explanatory signal is highly concentrated.

Limitations and Future Work

  • Focus on Post-Hoc Explainers: The study evaluates post-hoc instance-level explainers on frozen models. The authors note that designing a priori inherently interpretable similarity models is a promising next step.
  • Metric Generality vs. Evaluation Scope: While the proposed metrics are fully model-agnostic and theoretically apply to other distance functions (like Euclidean distance), the empirical evaluation in this paper was strictly centered on cosine similarity.
  • Explainer Selection: The study focused on representative MI and GB baselines; evaluating other advanced explainers like PGExplainer or SubgraphX remains open for future research.

Summary updated

BibTeX
@article{daza2026explaining,
  author = {Daniel Daza and Cuong Xuan Chu and Trung-Kien Tran and Daria Stepanova and Michael Cochez and Paul Groth},
  title = {{Explaining Graph Neural Networks for Node Similarity on Graphs}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure