Task-Agnostic Graph Explanations
Abstract
Graph Neural Networks (GNNs) have emerged as powerful tools to encode graphstructured data.
Due to their broad applications, there is an increasing need to develop tools to explain how GNNs make decisions given graph-structured data.
Existing learning-based GNN explanation approaches are task-specific in training and hence suffer from crucial drawbacks.
Specifically, they are incapable of producing explanations for a multitask prediction model with a single explainer.
They are also unable to provide explanations in cases where the GNN is trained in a self-supervised manner, and the resulting representations are used in future downstream tasks.
To address these limitations, we propose a Task-Agnostic
GNN Explainer (T AGE ) that is independent of downstream models and trained under self-supervision with no knowledge of downstream tasks.
T AGE enables the explanation of GNN embedding models with unseen downstream tasks and allows efficient explanation of multitask models.
Our extensive experiments show that T AGE can significantly speed up the explanation efficiency by using the same model to explain predictions for multiple downstream tasks while achieving explanation quality as good as or even better than current state-of-the-art GNN explanation approaches.
Introduction
Graph neural networks (GNNs) [11, 25, 32] have achieved remarkable success in learning from realworld graph-structured data due to their unique ability to capture both feature-wise and topological information.
Extending their success, GNNs are widely applied in various research fields and industrial applications including quantum chemistry [3, 26], drug discovery [16, 28, 29], large-scale social networks [30, 35], and recommender systems [1, 33].
While multiple approaches have been proposed and studied to improve GNN performance, GNN explainability is an emerging area and has a smaller body of research behind it.
Recently, explainability has gained more attention due to an increasing desire for GNNs with more security, fairness, and reliability.
Being able to provide a [Figure]
good explanation to a GNN prediction increases model reliability and reduces the risk of incorrect predictions, which is crucial in fields such as molecular biology, chemistry, fraud detection, etc.
Existing methods adapting the explanation methods for convolutional neural networks (CNNs) or specifically designed for GNNs have shown promising explanations on multiple types of graph data.
A recent survey [37] categorizes existing explanation methods into gradient-based, perturbation, decomposition, and surrogate methods.
In particular, perturbation methods involve learning or optimization [12, 13, 15, 34, 36] and, while bearing higher computational costs, generally achieve state-of-the-art performance in terms of explanation quality.
These methods train post-hoc explanation models on top of the prediction model to be explained.
Earlier approaches like GNNExplainer [34] require training or optimizing an individual explainer for each data instance, i.e., a graph or a node to be explained.
In contrast, PGExplainer [15] performs inductive learning, i.e., it only requires a one-time training, and the explainer can be generalized to explain all data instances without individual optimization.
Compared to other optimization-based explanation methods, PGExplainer significantly improves efficiency in terms of time cost without performance loss by learning.
Following a similar inductive learning paradigm, more recent work ReFine [27] and GSAT [17] aim to provide multigrained explanations and jointly learned explanations with GNNs, respectively.
However, even state-of-the-art explanation methods like PGExplainer are still task-specific at training and hence suffer from two crucial drawbacks.
First, current methods are inefficient in explaining multitask prediction for graph-structured data.
For example, one may need to predict multiple chemical properties in drug discovery for a molecular graph.
In particular, ToxCast from MoleculeNet has 167 prediction tasks.
In these cases, it is common to apply a single GNN model with multiple output dimensions to make predictions for all tasks.
However, one is unable to employ a single explainer to explain the above model, since current explainers are trained specifically to explain one prediction task.
As a result, in the case of ToxCast, one must train 167 explainers to explain the GNN model.
Second, in industry settings, it is common to train GNN models in a two-stage fashion due to scaling, latency, and label sparsity issues.
The first stage trains a GNN-based embedding model with a massive amount of unlabeled data in an unsupervised manner to learn embeddings for nodes or graphs.
The second stage trains lightweight models such as multilayer perceptrons (MLPs) using the frozen embeddings as input to predict the downstream tasks.
In the first stage, the downstream tasks are usually unknown or undefined, and existing task-specific explainers cannot be applied.
Also, there can be tens to hundreds of downstream tasks trained on these GNN embeddings, and training a separate explainer for each task is undesirable and downright impossible.
To address the above limitations, we present a new task-agnostic explanation pipeline, where the learned explainer is independent from downstream tasks and can take downstream models as input conditions, as shown in Figure 1.
Specifically, we decompose a prediction model into a GNN embedding model and a downstream model, designing separate explainers for each component.
We design the downstream explainers to cooperate with the embedding explainer.
The embedding explainer is trained using a self-supervised training framework, which we dub Task-Agnostic GNN Explainer (T AGE ), with no knowledge of downstream tasks, models, or labels.
In contrast to existing explainers, the learning objective for T AGE is computed at the graph or node embeddings without involving task-related predictions.
In addition to eliminating the need for downstream tasks in T AGE , we argue that the self-supervision performed on the embeddings can bring an additional [Table] performance boost in terms of the explanation quality compared to existing task-specific baselines such as GNNExplainer and PGExplainer.
We summarize our contributions as follows: 1) We introduce the task-agnostic explanation problem and propose a two-stage explanation pipeline involving an embedding explainer and a downstream explainer.
This enables the explanation of multiple downstream tasks with a single embedding explainer.
We propose a self-supervised training framework T AGE , which is based on conditioned contrastive learning to train the embedding explainer.
The training of T AGE requires no knowledge of downstream tasks.
We perform experiments on real-world datasets and observe that T AGE outperforms existing learning-based explanation baselines in terms of explanation quality, universal explanation ability, and the time required for training and inference.
Relations with Prior Work Our work studies a novel explanation problem under the two-stage and multi-task settings.
The settings are important in both industrial and academic scenarios but have not been studied by prior work.
Whereas existing studies focus on designing optimization approaches [34, 36] and explainer architectures [15] under the typical task-specific setting, our work focuses on an orthogonal problem to enable task-agnostic explanations with the proposed framework including the universal embedding explainer and conditioned learning objectives.
Task-Agnostic Explanations 2.1 Notations and Learning-based GNN explanation
Our study considers the attributed graph G with node set V and edge set E .
We formulate the attributed graph as a tuple of matrices ( A , X ) , where A ∈ { 0 , 1 } | V |×| V | denotes the adjacency matrix and X ∈ R | V |× d f denotes the feature matrix with feature dimension of d f .
We assume that the prediction model F that is to be explained operates on graph-structured data through two components: a GNN-based embedding model and lighter downstream models.
Denoting the input space by G , a node-level embedding model E n : G → R | V |× d takes a graph as input and computes embeddings of dimension d for all nodes in the graph, whereas a graph-level embedding model
E g : G → R 1 × d computes an embedding for the input graph.
Subsequently, the downstream model
D : R d → R computes predictions for the downstream task based on the embeddings.
Typical GNN explainers consider a task-specific GNN-based model as a complete unit, i.e. , F :=
D◦E .
Given a graph G and the GNN-based model F to be explained , our goal is to identify the subgraph
G sub that contributes the most to the final prediction made by F .
In other words, we claim that a given prediction is made because F captures crucial information provided by some subgraph G sub .
The learning-based (or optimization-based) GNN explanation employs a parametric explainer T θ associated with the GNN model F to compute the subgraph G sub of the given graph data.
Concretely, the explainer T θ computes the importance score for each node or edge, denoted as w i or w ij , or masks for node attributes denoted as m .
It then selects the subgraph G sub induced by important nodes and edges, i.e. , whose scores exceed a threshold t , and by masking the unimportant attributes.
In our study, we follow [15], focusing on the importance of edges to provide explanations to GNNs.
Formally, we have G sub :=
( V, E sub ) =
T θ ( G ) , where E sub
= { ( v i , v j ) : ( v i , v j ) ∈ E, w ij ≥ t } .
2.2 Task-Agnostic Explanations
As introduced in Section 1, all existing learning-based or optimization-based explanation approaches are task-specific and hence suffer from infeasibility or inefficiency in many real-application scenarios.
In particular, they are of limited use when downstream tasks are unknown or undefined, and fail to employ a single explainer to explain a multitask prediction model.
To enable the explanation of GNNs in two-stage training and multitask scenarios, we introduce a new explanation paradigm called the task-agnostic explanation.
The task-agnostic explanation considers a whole prediction model as an embedding model followed by any number of downstream models.
It focuses on explaining the embedding model regardless of the number or the existence of downstream models.
In particular, the task-agnostic explanation trains only one explainer T ( tag ) θ to explain the embedding model E , which should satisfy the following features.
First, given an input graph G , the explainer T ( tag ) θ should be able to provide different explanations according to specific downstream tasks being studied.
Table 1 compares the properties of common GNN explanation methods and the desired task-agnostic explainers in multitask scenarios.
Second, the explainer T ( tag ) θ can be trained when only the embedding model is available, e.g. , at the first stage of a two-stage training paradigm, regardless of the presence of downstream tasks.
When downstream tasks and models are unknown,
T ( tag ) θ can still identify which components of the input graph are important for certain embedding dimensions of interest.
The T AGE Framework
Our explanation framework T AGE follows the typical scheme of GNN explanation introduced in the previous section.
It provides explanations by identifying important edges in a given graph and removing the edges that lead to significant changes in the final prediction.
Specifically, the goal of the T AGE is to predict the importance score for each edge in a given graph.
Different from existing methods, the proposed T AGE breaks down typical end-to-end GNN explainers into two components.
We now provide general descriptions and detailed formulations to the proposed framework.
3.1 Task-Agnostic Explanation Pipeline
Following the principle of the desired task-agnostic explanations, we introduce the task-agnostic explanation pipeline, where a typical explanation procedure is performed in two steps.
In particular, we decompose the typical end-to-end learning-based GNN explainer into two parts: the embedding explainer T E and the downstream explainer T down , corresponding to the two components in the two-stage training and prediction procedure.
We compare the typical explanation pipeline and the two-stage explanation pipeline in Figure 1.
The embedding explainer and downstream explainers can be trained or constructed independently from each other.
In addition, the embedding explainer can cooperate with any downstream explainers to perform end-to-end explanations on input graphs.
The downstream explainer aims to explain task-specific downstream models.
As downstream models are usually lightweight MLPs, we simply adopt gradient-based explainers for downstream explainers without training.
The downstream explainer takes a downstream model and the graph or node embedding vector as inputs and computes the importance score of each dimension on the embedding vector.
The importance scores then serve as a condition vector input to the embedding explainer.
Given the condition vector, the embedding explainer explains the GNN-based embedding model by identifying an important subgraph from the input graph data.
In other words, given different condition vectors associated with different downstream tasks or models, the embedding explainer can provide corresponding explanations for the same embedding model.
Formally, we denote the downstream explainer for models from D by T down : D × R d → R d , which maps input models and embeddings into importance scores m for all embedding dimensions.
We denote the embedding explainer associated with the embedding model E by T E : R d × G → G , which maps a given graph into a subgraph of higher importance, conditioned on the embedding dimension importance m [Equation]
The training procedures of the embedding explainer are independent of downstream tasks or downstream explainers.
In particular, the downstream explainer is obtained from the downstream model only, and the training of the embedding explainer only requires the embedding model and the input graphs.
As downstream models are usually constructed as stacked fully connected (FC) layers and the [Table] [Figure] <
[Figure]
AAACL3icbZDLSsNAFIYnXmu9VV26CRahBSmJCLosipdlhd6gCWEynbZDJ5kwcyKUkDdy46t0I6KIW9/CSVvEth4Y5uM/c5j//H7EmQLLejNWVtfWNzZzW/ntnd29/cLBYVOJWBLaIIIL2faxopyFtAEMOG1HkuLA57TlD2+yfuuJSsVEWIdRRN0A90PWYwSDlrzCneML3lWjQF9JlDoCWECVE2AYEMyT27T0y/XUc2BAAZfmZ87uy2WvULQq1qTMZbBnUESzqnmFsdMVJA5oCIRjpTq2FYGbYAmMcJrmnVjRCJMh7tOOxhBrV24y2Tc1T7XSNXtC6hOCOVH/TiQ4UJk9/TIzrxZ7mfhfrxND78pNWBjFQEMy/agXcxOEmYVndpmkBPhIAyaSaa8mGWCJCeiI8zoEe3HlZWieV2zNjxfF6vUsjhw6RieohGx0iaroAdVQAxH0jMboHX0YL8ar8Wl8TZ+uGLOZIzRXxvcPnaCrJQ==</latexit>
<latexit sha1_base64="agaFn6C551lw2UK48HW/AQbYOnA=">AAACL3icbZDLSsNAFIYnXmu9VV26CRahBSmJCLosipdlhd6gCWEynbZDJ5kwcyKUkDdy46t0I6KIW9/CSVvEth4Y5uM/c5j//H7EmQLLejNWVtfWNzZzW/ntnd29/cLBYVOJWBLaIIIL2faxopyFtAEMOG1HkuLA57TlD2+yfuuJSsVEWIdRRN0A90PWYwSDlrzCneML3lWjQF9JlDoCWECVE2AYEMyT27T0y/XUc2BAAZfmZ87uy2WvULQq1qTMZbBnUESzqnmFsdMVJA5oCIRjpTq2FYGbYAmMcJrmnVjRCJMh7tOOxhBrV24y2Tc1T7XSNXtC6hOCOVH/TiQ4UJk9/TIzrxZ7mfhfrxND78pNWBjFQEMy/agXcxOEmYVndpmkBPhIAyaSaa8mGWCJCeiI8zoEe3HlZWieV2zNjxfF6vUsjhw6RieohGx0iaroAdVQAxH0jMboHX0YL8ar8Wl8TZ+uGLOZIzRXxvcPnaCrJQ==</latexit>
[Figure]
model right) and the architecture of the parametric explainers (left).
During training, we generate random condition vectors p as an input to the embedding explainer and mask the embeddings.
The learning objective seeks to maximize the mutual information between two embeddings on certain dimensions.
explanation of FC layers has been well studied, our study mainly focuses on the non-trivial training procedure and design of the embedding explainer.
3.2 Training embedding explainer under Self-supervision
A straightforward idea of explaining an embedding model with no knowledge of downstream tasks is to employ existing explainers and perform explanation on the pretext task, such as graph reconstruction [10] or context prediction [6], used during the pre-training of GNNs.
However, such explanations cannot be generalized to future downstream tasks as there are limited dependencies between the pretext task and downstream tasks.
Therefore, training an embedding explainer without downstream models or labels is challenging, and it is desirable to develop a generalizable training approach for the embedding explainer.
To this end, we propose a self-supervised learning framework for the embedding explainer.
The learning objective of the proposed framework seeks to maximize restricted mutual information (MI) between two embeddings, i.e., one of the given graph and one of the corresponding subgraph of high importance induced by the explainer, in a conditioned subspace.
We introduce a masking vector p ∈ R d as the condition to indicate specific dimensions of embeddings on which to maximize the MI.
During the explanation, we obtain the masking vector from the importance vector computed by any downstream explainer T down .
As no downstream importance vector is available at training, we sample the masking vector p from a multivariate Laplace distribution due to the sparse gradient, i.e. , only a few dimensions are of high importance, assuming embeddings from well-trained models are informative with low dimension redundancy.
Empirically, the Laplacian assumption holds on all datasets we work with as we observe that gradients follow a Laplace distribution.
Formally, the learning objective based on the restricted MI is
[Equation]
where MI ( · , · ) computes the mutual information between two random vectors, p denotes the random masking vector sampled from a certain distribution, T θ ( p , G ) computes the subgraph of high importance, and ⊗ denotes the element-wise multiplication, which applies masking to the embeddings
E ( · ) .
Figure 2 outlines the training framework and objective.
Intuitively, given an input graph and the desired embedding dimensions to be explained, the explainer T θ predicts the subgraph whose embedding shares the maximum mutual information with the original embedding on the desired dimensions.
Practically, the mutual information is intractable and is hence hard to directly compute.
A common approach to achieving efficient computation and optimization is to adopt the upper bound estimations of mutual information [31], namely, the Jenson-Shannon Estimator (JSE) [18] and the InfoNCE [4].
These upper bound estimations are also referred to as contrastive loss and are widely applied in self-supervised representation learning [5, 23, 24] for both images and graphs.
Adopting these estimators, the objectives are efficiently computed as
[Equation]
for JSE and InfoNCE, respectively, where N denotes the number of samples in a mini-batch, σ denotes Sigmoid function, z i and z i,θ are embeddings of the original graph G i and its subgraph
T θ ( G i ) , or target nodes of the two graphs.
Our objective involves condition vectors as masks on the embeddings, which differs from typical contrastive loss used in self-supervised representation learning.
We hence call the proposed objective the conditioned contrastive loss.
To restrict the size of subgraphs given by the explainer, we follow previous studies [15] to add a size regularization term R , computed as the averaged importance score, to the above objectives. In the case where edge importance scores w ij ∈ [0 , 1] are computed, the regularization term is computed as [Equation] where λ s and λ e are hyper-parameters controlling the size and the entropy of edge importance scores, respectively.
We provide detailed descriptions of the objectives in Appendix B.
3.3 Explainer Architectures
Embedding explainers .
To be consistent with PGExplainer, we adopt the multilayer perceptron (MLP) as the base architecture to predict the importance score w ij for each edge ( u i , u j ) ∈ E , on top of learned embeddings
z i and z j of the two nodes connected by the edge.
Edges with scores higher than a threshold are considered important edges that remain in the selected subgraph.
In order for the embedding explainer to cooperate with different downstream explainers and provide diverse explanations for different tasks, it additionally requires a condition vector as input indicating the specific downstream task to be explained.
Formally, the graph-level embedding explainer takes the embeddings, z i and z j , and the condition vector p as inputs and computes the importance score by
[Equation]
where [ · ; · ] denotes the concatenation along the feature dimension, ⊗ denotes the element-wise multiplication, σ denotes the activation function, and f g : R d → R 2 d is a linear projection.
The node-level embedding explainer takes an additional node embedding as its input, as the explainers are expected to predict different scores for the same edge when explaining different target nodes.
The formulation of computing the importance score is as follows,
[Equation]
where f g : R d → R 3 d is a linear projection, and z target denotes the embedding of the target node whose prediction is to be explained.
Downstream explainers .
We use the following gradient-based explainer to compute condition vectors for different downstream models.
Formally, given an input embedding z and its prediction probabilities D ( z ) ∈ [0 , 1] C among all C classes, we compute the gradient of the maximal probability w.r.t.
the input embedding:
[Equation]
where D ( z )[ c ] denotes the probability for class c .
To convert the gradient into the condition vector, we further perform normalization and only take positive values reflecting only positive influence to the predicted class probability,
i.e. , p = ReLU ( norm ( g T )) .
Experimental Studies
We conduct two groups of quantitative studies evaluating the explanation quality and the universal explanation ability, i.e. , training a single explainer to explain all downstream tasks, of T AGE .
We then compare the efficiency of multiple learning-based GNN explainers in terms of training and explanation time costs.
We further provide visualizations to demonstrate the explanation quality as well as the ability to explain GNN models without downstream tasks.
4.1 Datasets
To demonstrate the effectiveness of the proposed T AGE on both node-level and graph-level tasks, we evaluate T AGE on three groups of real-world datasets that contain potentially multiple tasks.
The datasets are described as follows and their statistics are summarized in Appendix A.
MoleculeNet .
The MoleculeNet [29] library provides a collection of molecular graph datasets for the prediction of different molecule properties.
In a molecular graph, each atom in the molecule is considered a node, and each bond is considered an edge.
The prediction of molecule properties is a graph-level task.
We include three graph classification tasks from MoleculeNet to evaluate the explanation of graph-level tasks: HIV, SIDER, and BACE.
Protein-Protein Interaction .
The Protein-Protein Interaction (PPI) [39] dataset documents the physical interactions between proteins in 24 different human tissues.
In PPI graphs, each protein is considered as a node with its motif and immunological features, and there is an edge between two proteins if they interact with each other.
Each node in the graphs has 121 binary labels associated with different protein functions.
As different protein functions are not exclusive to each other, the prediction of each protein function is considered an individual task instead of a multi-class classification.
And hence typical approaches require individual explainers for the 121 tasks.
We utilize the first five out of 121 tasks to evaluate the explanation of node-level tasks.
E-commerce Product Network .
The E-commerce Product Network (EPN) 2 is constructed with subsampled, anonymized logs from an e-commerce store, where entities including buyers, products, merchants, and reviews are considered as nodes, and interactions between entities are considered as edges.
We subsample the data for the sake of experimental evaluations and the dataset characteristics do not mirror actual production traffic.
We study the explanation of the classification of fraudulent entities (nodes), where the predictions for different types of entities are considered individual tasks.
We evaluate our framework specifically on classifications of the buyer, merchant, and review nodes.
4.2 Experiment Settings and Evaluation Metrics
For each real-world dataset, we evaluate explainers on multiple downstream tasks that share a single embedding model.
For consistency with industrial use cases, we perform the two-stage training paradigm to obtain GNN models to be explained.
In particular, we first use unlabeled graphs to train the GNN-based embedding model in an unsupervised fashion.
We then freeze the embedding model and use the learned embeddings to train individual downstream models structured as 2-layer MLPs.
Specifically, for graph-level classification tasks in MoleculeNet, we employ the GNN pretraining strategy context prediction [6] to train a 5-layer GIN [32] as the embedding model on ZINC-2M [22] containing 2 million unlabeled molecules.
For the node-level classification on PPI, we employ the self-supervised training method GRACE [38] to train a 2-layer GCN [11] on all 21 graphs from PPI without using labels.
For the larger-scale node-level classification on EPN, we use graph autoencoder (GAE) [10] to train the embedding model on sampled subgraphs of EPN.
More implementation details are provided in Appendix B.
As the involved real-world datasets do not have ground truth for explanations, we follow previous studies [20, 37, 36] to adopt a fidelity score and a sparsity score to quantitatively evaluate the explanations.
Intuitively, the fidelity score measures the level of change in the probability of the predicted class when removing important nodes or edges, whereas the sparsity score measures the relative amount of important nodes or nodes associated with important edges.
A formulation of the scores is provided in Appendix B. Note that compared to explanation evaluation with ground truths, the fidelity score is considered more faithful to the model, especially when the model makes incorrect predictions, in which case the explanation ground truths become inconsistent with the evidence of making the wrong predictions.
In practice, one needs to trade-off between the fidelity score and the sparsity score by selecting the proper threshold for the importance. [Table]
4.3 Quantitative Studies
We conduct two groups of quantitatively experimental comparisons.
We first demonstrate the explanation quality of individual tasks in terms of the fidelity score and the sparsity score.
We do this by comparing T AGE with multiple baseline methods including non-learning-based methods
GradCAM [20] and DeepLIFT [21], as well as learning-based methods GNNExplainer [34] and
PGExplainer [15].
We do not include other optimization or search-based methods such as MonteCarlo tree search [9] due to the significant time cost on real-world datasets.
Note that to show the effectiveness of universal explanations over different downstream tasks, we only train one embedding explainer for all tasks in a dataset, on top of which a gradient-based downstream explainer is applied to explain multiple downstream tasks. In contrast, for existing learning-based methods, we need to train multiple explainers to explain downstream tasks individually. For all methods, we vary the downstream task. Underlines highlight the best explanation quality in terms of fidelity, on the same level of sparsity
[Table] [Table]
[Table]
threshold for selecting important nodes or edges and compare how fidelity scores change over sparsity scores on each task and dataset.
The results are shown in Figure 3.
In particular, T AGE outperforms other learning-based explainers on BACE, SIDER, and PPI (tasks 0 and 1).
For HIV and PPI (task 2),
T AGE is more effective at higher sparsity levels, i.e. , when fewer nodes are considered important and masked.
To justify the necessity of task-agnostic explanation and demonstrate the universal explanation ability of T AGE , we include PGExplainer as our baseline and compare the explanation quality when adopting a single explainer to explain multiple downstream tasks.
For PGExplainer, we train multiple explainers on different downstream tasks and evaluate each explainer on different downstream tasks.
For T AGE , we train one explainer without downstream tasks and evaluate it on different downstream tasks.
Results shown in Table 2 (MoleculeNet), Table 3 (PPI), and Table 4 (EPN) indicate that task-specific explainers fail to generalize to different downstream tasks and hence are unable to provide universal explanations.
On the other hand, the task-agnostic explainer, although trained without downstream tasks, can provide explanations with even higher quality for downstream tasks.
GNNExplainer and PGExplainer should generally outperform task-agnostic explainers, as they are specific to data examples or tasks.
This should especially be true when T AGE and PGExplainer have the same level of parameters.
However, we find that T AGE outperforms the learning-based baselines.
We believe that the underperformance of baselines is due to the non-injective characteristic of the downstream MLPs, where different embeddings can produce similar downstream prediction results.
In other words, a similar downstream prediction are not necessarily produced by embeddings that share high mutual information.
Due to this characteristic, the learning objective of T AGE computed between embeddings brings stronger supervision than the objective computed between final predictions, as the latter objective does not guarantee consistency between embeddings or between input graphs and subgraphs.
Multitask Explanation Efficiency A major advantage of the task-agnostic explanation is that it removes the need for training individual explainers, which consumes the majority of the total time cost to explain a model on a dataset.
We hence evaluate the efficiency of T AGE in terms of time cost for explanation and compare it to the two learning-based explainer baselines.
We record the time cost for the training and inference of different explanation methods on the same dataset and device, shown in Table 5.
All results are obtained from running the explanation on the PPI dataset withnode classification tasks with a single Nvidia Tesla V100 GPU.
Although the inference time cost of
T AGE is slightly higher than that of PGExplainer, the results show T AGE costs significantly less time than GNNExplainer and PGExplainer, especially in the multitask cases ( T > 1 ). T AGE allows the explanation of many downstream tasks within a reasonable time duration.
F
N N N
H 2 N N
O
O F F F
F
F
NH
O
N
NH O
O
OH
H 2 N +
O
N N + H
OH
NH O
O
O O -0.
PGExplainer GNNExplainer
F
F
NH
O
N
NH O
O
OH
H 2 N + 0.
O
N N + H
OH
NH O
O
O O
F
N N N
H 2 N N
O
O F F F
TAGE
F F
NH
O
N
NH O
O
OH
H 2 N + 0.
O
N N + H
OH
NH O
O
O O
F
N N N
H 2 N N
O
O F F F
TAGE-Single Dimension
F F
NH
O
N
NH O
O
OH
H 2 N +
O
N N + H
OH
NH O
O
O O
F
N N N
H 2 N N
O
O F F F (0.0193) (0.0494) (0.6287)
TAGE-Single Dimension
F F
NH
O
N
NH O
O
OH
H 2 N +
O
N N + H
OH
NH O
O
O O
F
N N N
H 2 N N
O
O F F F (0.8153) (0.6183) (0.3705)
[Figure]
BACE task but are just for reference.
4.4 Visualization of Explanations
We visualize the explanations of the three learning-based explanation methods on the BACE task, which aims to predict the inhibitor effect of molecules on human β -secretase 1 (BACE-1) [29].
Additional visualizations on HIV and SIDER are also provided in
Appendix E.
The visualization results are shown in Figure 4.
Each molecule visualization shows the top 10% important edges (bonds) predicted by an explainer marked in red, together with the fidelity score on the molecule.
The left three columns are explanation results with the BACE downstream task.
The right columns are explanations by T AGE to two specific graph embedding dimensions, without downstream models.
Embedding dimensions with greater values among all are selected in the visualizations.
To obtain explanations of certain embedding dimensions, we input the one-hot vectors to the embedding explainer as condition vectors.
The visualization results indicate that while baseline methods select scattered edges as important, T AGE tends to select edges that form a connected substructure, which is more reasonable when explaining molecule property predictions where a certain functional group is important for the property.
While there are no ground-truth explanations for the BACE, the validity of results produced by T AGE can be evidenced by multiple domain researches [7, 8].
We discuss them in Appendix E.
In addition, the right three columns indicate that dimensions in the embedding correspond to different substructures and T AGE is able to provide explanations to the dimensions without downstream tasks.
Conclusions
Existing task-specific learning-based explainers become inapplicable under real scenarios when downstream tasks or models are unavailable and suffer from inefficiency when explaining real-world graph datasets with multiple downstream tasks.
We introduced T AGE , including the task-agnostic
GNN explanation pipeline and the self-supervised training framework to train the embedding explainer without knowing downstream tasks or models.
Our experiments demonstrate that the T AGE generally achieves higher explanation quality in terms of fidelity and sparsity with a significantly reduced explanation time cost.
We discuss potential limitations and their solutions in Appendix G.
Checklist
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] (b) Did you describe the limitations of your work?
[Yes] In Appendix G. (c) Did you discuss any potential negative societal impacts of your work?
[N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[N/A] (b) Did you include complete proofs of all theoretical results?
[N/A] 3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] (b) Did you specify all the training details (e
g., data splits, hyperparameters, how they were chosen)?
[Yes] In Appendix B. (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[N/A] (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] In Section 4.3 - Multitask Explanation Efficiency. 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] (b) Did you mention the license of the assets?
[N/A] (c) Did you include any new assets either in the supplemental material or as a URL?
[N/A] (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[N/A] (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[Yes] The EPN dataset is anonymized.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A]
A Dataset Statistics
The statistics of datasets used for evaluating T AGE are shown in Table 6.
[Table]
B Implementation Details
Structure of explainer .
Our implementation is based on Pytorch [19], Pytorch Geometric [2], and Dive-into-graphs [14].
We implement the explainer with a linear projection f p that maps the condition vector p to the same dimension as concatenated embeddings, and a 2-layer MLP with
ReLU activation that maps concatenated embeddings with the mask to the important score.
Implementation of training objectives .
We adopt the Jason-Shannon Estimator as the lower bound for mutual information maximization for the two public datasets.
For graph-level tasks, given a mini-batch of N samples, we consider the embeddings of a graph G and its subgraph G s as a positive pair (with N positive pairs in total), and the embeddings of a graph G i and the subgraph G j,s of another sample as a negative pair (with N 2 − N pairs in total).
For node-level tasks, we still randomly sample N nodes from the entire graph at each iteration and compute the contrastive losses on original embeddings of the N nodes, and embedding of the N nodes when the important subgraph is selected, respectively for each node.
Similar to graph-level tasks, we consider embeddings of the same node (in the original graph or in the subgraph) as a positive pair, and embeddings of node i in the full graph and node j in the selected subgraph as a negative pair ( N 2 − N in total).
Training configurations .
We set the hyperparameters in the size regularization term to λ s = 0 .
and λ e = 0 .
002 , respectively.
For the graph-level explanation on MoleculeNet, we train the embedding explainer on ZINC-2M with a learning rate of 1 e − 4 and mini-batch size of 256 for one epoch.
The random condition vectors are generated from Laplace distribution Laplace (0 , 0 . 2) .
For the node-level explanation on PPI, we train the embedding explainer on PPI without labels with a learning rate of 5 e − 6 and a mini-batch size of 4 for one epoch.
The random condition vectors are generated from Laplace distribution Laplace (0 , 0 . 1) .
For the EPN dataset, we train the embedding explainer with InfoNCE loss, learning rate 1 e − 4 , and mini-batch size 16 .
The random condition vectors are generated from Laplace distribution Laplace (0 , 0 . 25) .
The hyperparameters in the size regularization term are set to λ s = 0 .
5 and λ e = 0 for the stable training with InfoNCE.
Evaluation .
In molecule and protein property prediction, we are usually interested in the positive samples, i.e. , the existence of what substructure leads to a certain property.
For learning-based baseline methods, we find it common that only one class of the two has a good explanation, and the class with higher explanation quality is not necessarily the positive class.
For example, PGExplainer has a near-to-zero fidelity score for the positive class of SIDER.
We hence compare only the higher fidelity score among the two classes for all explanation methods and datasets.
C Fidelity and Sparsity
Given a set of graphs { G i } and node masks m predicted by the explainer, the fidelity score and the sparsity score are computed as follows.
[Equation]
where N denotes the number of graphs or nodes to be explained, f denotes the GNN model associated with a specific downstream task, c i denotes the class of interest, which can be either the labeled class or the original predicted class, G i and G 1 − m i
i denote the original graph and graph with important nodes removed, respectively.
Explanations with both scores higher are better.
D Additional Results for Universal Explanation Ability
Comparison of explanation performance when trained on different datasets .
Specifically for the MoleculeNet dataset, as there is a larger unlabeled dataset, ZINC, available for the first stage training of the encoder, the training of our explainer is also performed on the ZINC dataset.
For a more strict comparison with the baseline explainer who is trained on individual MoleculeNet datasets, we additionally evaluate the explanation quality when the same individual MoleculeNet dataset is used to train TAGE.
The results are shown in Table 7.
When trained on the same datasets individually, TAGE still performs better than the baseline explainer in terms of fidelity scores.
In the individual dataset case, we need to train different explainers, similarly to the training of PGExplainer, as the datasets for the four tasks are different. [Table]
Comparison with the causality-based explainer GEM .
On the BACE dataset and task, we additionally compare TAGE with another recent SOTA learning-based method GEM [12] whose explainer is trained based on the Granger causality in Table 8.
Note that GEM is not originally proposed under our setting.
It assumes that there is a fixed number of important nodes when performing explanation and hence the final explanation is a boolean selection of nodes.
We adapt GEM to compute fidelity scores under different sparsity scores by varying the threshold when generating explanation ground-truth with Granger causality.
[Table]
E Discussion and additional results of visualizations
While there are no ground-truth explanations for the molecular datasets, the validity of results produced by T AGE can be evidenced by multiple domain research.
Take BACE for example, Jain and Jadhav [8] study multiple BACE-1 inhibitors that are similar to one presented in our results (Figure 4 - line 3).
Inhibitors in Table 1–3 and 8 of [1] share the common “2-imidazoline” structure as explained by TAGE, whereas structures such as =O and -OCF 3 as explained by GNNE and PGE are not necessarily in an inhibitor.
Moreover, inhibitors studied by Huang et al.
[7] share the common “-C(=O)-C-N(H)-C(OH)-” chain structure as present in the explanation results by T AGE (Figure 4lines 1 and 2), whereas structures explained by other explainers are not necessarily for a molecule to be a BACE-1 inhibitor.
Nevertheless, it’s still fidelity scores that give the most reliable evaluation.
Additional visualization results on HIV and SIDER are shown in Figure 5 and Figure 6, respectively.
[Figure]
PGExplainer
[Figure] [Figure]
276e-
[Figure]
TAGE 0.
TAGE-Single Dimension (0.0263) (0) (0.4154)
TAGE-Single Dimension (0.
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
O
OH OH
[Figure]
HO HO
OH
Cl Cl
[Figure]
O
O N Fe
3- Cl N
O HO
N + O
HO
N +
O
OH OH
O
OH OH
O
OH OH
O
OH OH
O OH OH O HO
HO
HO
OH
Cl
Cl
OH Cl Cl Cl
O
O N Fe
3- Cl N
O HO
N + O
HO
N +
O OH OH O HO
HO
HO
O OH OH O HO
HO
HO O OH OH O HO
HO
HO
OH
Cl
Cl
OH Cl Cl Cl
OH
Cl
Cl
OH Cl Cl Cl
OH
Cl
Cl
OH Cl Cl Cl
O
O N Fe
3- Cl N
O HO
N + O
HO
N +
O
O N Fe
3- Cl N
O HO
N + O
HO
N +
O O N Fe
3- Cl N
O HO
N + O
HO
N +
F Experimental studies on the synthetic datasets BA-Shapes
We perform an additional evaluation on the BA-Shapes synthetic datasets used in GNNExplainer [34] and provided by Pytorch-Geometric [2].
The synthetic dataset is less complicated compared to real-world datasets.
We train a 3-layer GCN for node classification with a training accuracy of 0.95.
The AUC score (for importance edges) of TAGE is 0.999 compared to 0.963 and 0.925 of PGExplainer and GNNExplainer, respectively. Note that the baseline scores are from the PGExplainer paper. Some re-implementations 34 of PGExplainer can also achieve an AUC score of 0.999.
Our purpose to show our score on BA-Shapes is to demonstrate that TAGE is on par with its baselines even when considering the typical single-task setting.
Figure 7 visualizes 20 examples of explanations.
TAGE is able to provide accurate explanations for all 20 examples.
G Discussion of limitations and potential solutions
Inductive learning of explanations.
Our study focus on the setting of inductive learning of the explanation, i.e. , to train the explainer on a given dataset and perform inference on new coming data.
There are many work conducted under the inductive setting, such as PGExplainer.
All methods under this setting may have a potential limitation that the explainer may suffer from some dataset bias when training data and the data to be explained are inconsistent.
This is an interesting problem that requires further investigation.
However, we believe that this is a separate problem and applies to all inductive learning methods.
In addition, the size of graph could be inconsistent for training and inference.
To tackle this issue, we obtain the substructure by selecting top k percentage of edges according to their important scores.
PGExplainer GNNExplainer -0.
[Figure]
TAGE 0.
TAGE-Single Dimension (0.0942) (0.6403) (0.2652)
TAGE-Single Dimension (0.0099) (0.1826) (0.0875) (With downstream task)
(No downstream task)
N
S
Cl
O
Cl
NH
[Figure]
N
[Figure]
N
O
NH
[Figure]
OH
HO
N C
O
O
OH
[Figure]
N
[Figure]
Cl
O
Cl
[Figure]
HO
N C
O
O
OH
N
S
Cl
N
S
Cl
N S Cl O
Cl NH O N
[Figure]
O
[Figure]
HO
[Figure]
O O OH O
Cl
NH
O Cl NH O
[Figure]
O
[Figure]
O
NH
[Figure]
HO
N C
O
O
OH
N C O O OH
Expressiveness of explainers.
The proposed method is the most suitable under the two-stage and multi-task settings.
Our experiments show that even compared on the single task setting and on common datasets, TAGE can still have the same or better performance than baseline task-specific explanation methods.
However, when the model, task, or datasets to be explained become too complicated, it is possible that the embedding explainer in TAGE may require more parameters to have enough expressiveness for the task-specific explanation.
In those cases, one may adopt a similar fine-tuning approach as described by Wang et al.
[27], or use task-specific explainers which are more efficient.
Black-box explanations.
Similarly to our baseline method PGExplainer, our explainer relies on node embeddings as inputs to the explainer.
In particular, the node embeddings serve as representations to allow explainers identify each node.
It is required by any (inductively) learning based explanations to tell neural network-based explainers which edge they are looking at.
A limitation of the inductive methods is that when the node embeddings may become unavailable when explaining a black-box model.
The study of explaining black-box models (where only output is available) is a different direction of study in scenarios like attacking.
Many current SOTA explanation approaches, such as
Grad-Cam, GNN-LRP, and PGExplainer, fail under the black-box setting.
However, if one would like to adapt our approach to the black-box setting, it is still feasible by adopting a surrogate model for the black-box model and perform explanation on the surrogate model.
In addition, as mentioned above, the node embeddings are mainly used to identify which node the explainer is looking at, we does not necessarily require the original embedding.
When node embedding are unavailable, we can still use any representation of nodes as long as it can identify the node based on its feature and topology.