{'fraction_non_alphanumeric': 0.03932937792161093, 'fraction_numerical': 0.011529126213592233, 'mean_word_length': 4.413918968244312, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Faithful Explanations for Deep Graph Models

This paper studies faithful explanations for Graph Neural Networks (GNNs). First, we provide a new and general method for formally characterizing the faithfulness of explanations for GNNs. It applies to existing explanation methods, including feature attributions and subgraph explanations. Second, our analytical and empirical results demonstrate that feature attribution methods cannot capture the nonlinear effect of edge features, while existing subgraph explanation methods are not faithful. Third, we introduce \emph{k-hop Explanation with a Convolutional Core} (KEC), a new explanation method that provably maximizes faithfulness to the original GNN by leveraging information about the graph structure in its adjacency matrix and its \emph{k-th} power. Lastly, our empirical results over both synthetic and real-world datasets for classification and anomaly detection tasks with GNNs demonstrate the effectiveness of our approach.


Introduction
Graph Neural Networks (GNNs) have shown promise in a wide range of prediction tasks, ranging from applications in social networking [6,21,12] to cyber-physical systems security [4,35]. However, their predictions remain opaque to human users, which threatens to ultimately limit their successful adoption in many domains. A widely-used approach for explaining the predictions of neural networks computes feature attributions [28,16,31,29,26,23,19,33,22,8], which are interpreted as importance scores for the input features relative to a given quantity of interest, such as the logit of a predicted label. In the context of GNNs, recent work has proposed numerous subgraph explanation techniques [37,20,32,2], which aim to specifically leverage graph structure when identifying the node and edge features that are important for a prediction.
For any explanation method to be useful in diagnosing and improving the graph models' performance, it must be faithful to begin with. Namely, the information provided by an explanation should be consistent with the behavior of the underlying model. Metrics related to faithfulness have been widely researched for attribution methods used in vision models [34,16,31,36,3,11] but have received limited attention for graph models. Thus, the question that we aim to address in this paper is, how should one construct and evaluate faithful explanations for GNNs?
To answer this question, we begin by introducing a unified faithfulness metric for both gradient-based and subgraph-based attribution methods (Sec. 3). We then look towards applying this metric to the task of constructing explanations, by treating it as an objective function to optimize. A key challenge in this agenda stems from the fact that GNNs are locally linear w.r.t node features, but in general this is not the case w.r.t their edge features (Prop. 3.2). This finding motivates a focus on explaining GNNs via non-linear local approximations, as these can more faithfully capture the importance of edge features in GNN predictions.  Figure 1: (a) An illustration of the proposed faithful graph explanation KEC. We consider a target graph model F where messages pass as far as from a node's 2-hop neighbors, and an quantity of interest, the prediction on the black node. KEC firstly builds two functions p 1 and p 2 which directly take the information from its 1-hop and 2-hop neighbors, respectively. Secondly KEC minimizes the difference between the change ∆p = ∆p 1 + ∆p 2 and the change ∆F under the local perturbations to the input graph. Finally, the optimal parameters of p 1 and p 2 that minimizes (∆p − ∆F ) 2 are used to compute the importance of node and edge features in the given input. (b) an visualization of the proposed method KEC compared with Saliency Map(SM) and GNNExpl [37] on Cora. Visualizations of other methods are not included for the space limit in this version. Node to explain is colored in gray. Nodes and edges with positive influence are in blue and the negative ones are in red. The opacity of the nodes and the thickness of edges correspond to actual influence scores.
Our contributions are summarized as follows: 1) We introduce general faithfulness, a quantitative metric for both subgraph and gradient-based GNN explanations; 2) We introduce a novel GNN explanation technique called K-hop Explanation with a Convolutional Core (KEC) that maximizes this metric; 3) We evaluate KEC on synthetic and real-world datasets showing that KEC is up to 3 OOM more faithful than prior work (Table. 1). Notably, we find that some existing methods known for faithfulness when applied to vision models, e.g. Integrated Gradients [31], are not as faithful on GNNs. Additionally, We find that KEC is often significantly more faithful than subgraph explanations. Finally, we provide a case study on anomaly detection models in an industrial control setting, and highlight the insights that our approach can provide in understanding false positive predictions (Sec. 6).

Background
We provide background on the notation used throughout the paper, and then outline the predominant explanation techniques given by prior work both for general feed-forward networks and GNNs. Finally, we discuss notions of explanation faithfulness used in prior work on feature attribution.
Notation. Let (X ∈ R n×d , A ∈ R n×n + ) be a graph of n nodes and d features, with adjacency matrix A. Note that we do not require adjacency information to be discrete, as several GNN frameworks (e.g., Pytorch Geometric [7]), treat edges as positive scalars. In this paper, we are primarily interested in the node classification task. Given a graph (X, A), the model aims to predict a nominal-valued label for each node. Formally, we consider a Graph Convolution Network y = arg max c {e v f (X, A)} c where f is a stack of graph convolution and dense layers, separated by ReLU activations, and e v selects the prediction of the target node. For instance, when e v [i] = I[i = k], y is the prediction of the k-th node. When e v is clear from the context and the class of interest is the network's prediction, we write F (X, A) = {e v f (X, A)} y . The graph convolution that we assume is expressed as N (A)XW , where N (A) = D −1/2 (A + I)D −1/2 , D is the degree matrix, and W is the kernel [15].
We write V(H) to denote the vectorization of a matrix H by stacking its column vectors, and V −1 for the corresponding inverse. Finally, given a distribution D with support in R d , we write B(x, D) to denote the neighborhood {x |x = x − , ∼ D} around x.
Throughout the paper we consider the following explanation methods for graph networks.
Feature Attributions. The output of feature attribution is a score for each feature that indicates its importance for increasing a quantity of interest, e.g. the output of prediction score. Among the space of feature attributions we consider distributional influence [16] because they are axiomatically justified for some desired properties, e.g. linear agreement [16], and their faithfulness to the target function is provable (discussions to follow in Sec. 2.1). We adapt distributional influence for graph models in Def. 2.1. Definition 2.1 (Distributional Influence [16]). Given a graph (X, A), let B(X, D X ) and B(A, D A ) be neighborhoods around its node features and edge weights, respectively. Its feature influence χ(X, D X ) and edge influence χ(A, D A ) for a the model F (X, A) are defined as χ(X, Special cases of points defined by the distribution of interest derives leads to a set of existing methods and we are interested in the following two in the rest of the paper: 1) a set only containing the input of interest -Saliency Map (SM) [28]; and 2) a uniform distribution over a linear path from a baseline point to the input -the integral part of Integrated Gradient (IG) [31]. We discuss our choices of the baselines for IG in Sec. 5.
Subgraph Explanations. The output of a subgraph explanation is a perturbed matrix of node features or/and an adjacency matrix with more zero entries, which are considered as the most relevant part of the input graph towards the output [37,20,32,2]. One way to unify several subgraph explanations is shown in Def. 2.2. Definition 2.2 (Subgraph Explanation). Given the output of graph network F and an input (X, A), the subgraph graph explanation is an instance (X s , A s ) that minimize the following objective: where s and L are a user-defined size function and a performance penalty, respectively. K is a constant.
The size function s(·, ·) ensures that X s and A s have less features (or edges) so that the explanation highlights important features (or edges) and drop the unimportant ones. One example is to use a differential relaxation of ||A s || 0 and ||X s || 0 , e.g. a continuous mask [37] or 1 norm [20], for the size function s. On the other hand, L(X s , A s , F ) penalizes the decay of the model's performance on the subgraph to prevent it from returning trivial solutions. Solving L(X s , A s , F ) is usually done by gradient descend because this is a non-linear objective w.r.t the node and edge features. Example choices of L(X s , A s , F ) are mutual information, i.e. GNNExpl [37] and PGExpl [20], and Shapley Value, i.e. SubgraphX [2]. This paper mainly considers GNNExpl and PGExpl as the evaluation of SubgraphX using the default parameters from DIG [18] exceeds the timeout limit (10 minuteshttps://us06web.zoom.us/j/86767269620 per node) with our current computational resources (Titan RTX) on Cora. We define GNNExpl as follows in Def. 2.3. Definition 2.3 (GNNExpl). Given an input graph X, A and a graph model F, the subgraph explanations are defined as solutions to the following objective: where K 1 , K 2 are the maximum number of non-zeros features and edges, respectively, and 0 ≤ t ≤ 1.
Since PGExpl shares the same motivation with GNNExpl and only differs on techniques that 1) narrow down the searching space for the optimal A s and 2) learn a dense layer to jointly explain a set of nodes, we therefore point the readers to Luo et al. [20] for details.

Attribution Faithfulness
In this subsection, we firstly describe how faithfulness is defined in the literature for feature attribution methods that returns a vector Φ to explain the feature importance of x given a general function h(x).
We discuss how to adapt the faithfulness metric to graph models in Sec. 3.
2 and the optimal Φ * that minimizes φ exists as By by adding a tiny diagonal matrix to , one can ensure that E ∼D ( ) is invertible, which usually leads to trivial affect to the final explanations as detailed in Yeh et al. [36]. We discuss the examples of distribution D for graph data in Sec. 3.

Faithfulness of Graph Explanations
This section provides a set of characterizations on the faithfulness of graph explanations. Firstly, we generalize Def. 2.4 to subgraph explanations with general faithfulness (Def. 3.1). Secondly, we show that the limitation of using feature attributions for attributing over edge features. Lastly, we demonstrate that the existing subgraph explanations can lose faithfulness in Prop. 3.3.
To faithfully capture the local behavior of a deep model F , a common approach is to find a surrogate function p to approximate F 's output. However, given the ultimate goal of learning p is to understand how F changes in a given neighborhood, one can directly approximate the change of the target function, i.e. h(x) − h(x − ) in Def. 2.4. The following definition therefore characterizes the faithfulness of using an arbitrary function p to explain a graph model F and we discuss how the linearity of p impacts its faithfulness.  2 where X ∼ D X , A ∼ D A and we regard p as a local difference model to F . Def. 3.1 can be viewed as a measurement on the difference of difference; Namely, it is sufficient for p to be a faithful local difference model to F that their first-order differences within a local neighborhood are small. To give some concrete examples of p we will introduce the following cases where we categorize the distributional influence explanation as using a linear p w.r.t both node and edge features to explain the graph model whereas subgraph explanations are special cases when p is non-linear.
Case I: Linear p. Notice when p(X, the Saliency Map of F (Def. 2.1), p(X, A) can be viewed as a linearization for F at the given input (X, A). Besides, all distributional influences can be viewed as computing linear approximations to F because they are proved to return the weights of F if F is a linear model [16]. We now discuss a limitation of using a linear local difference model p.
We begin with Prop. 3.2. Proposition 3.2. Given a convolutional graph model F (X, A) with ReLU activations, F (X, A) is locally linear w.r.t X when A is fixed. However, only one of the following statement can hold at one time: 1) F contains one graph convolution layer; 2) when X is fixed, F is not locally linear w.r.t A.
Prop. 3.2 suggests a linear p is provably faithful to explain the feature importance of X within an input region where the model is linear, though such regions are usually infinitesimal without robust training strategies, e.g. a GloroNet [17]. On the other hand, Prop. 3.2 also suggests that a nonlinear local difference function p may be a better fit to attribute over the edge features for graph neural networks with more than two graph convolution layers. In practice, multi-layer graph convolutions are necessary for a variety of tasks because information from 1-hop neighbors are usually not sufficient to predict the node's label. In Sec. 4 we discuss the way to construct a faithful and nonlinear p.
Case II: Nonlinear p. Subgraph explanations (Def. 2.2) are among the use of nonlinear p to model the change of GNN but should be considered as a special case: it adds a special layer at the bottom of the original function F , which pre-processes the input, i.e. ablating some features and edges, before feeding them to F . Namely, p(X, A) = F (X s , A s ). Therefore, one necessary condition for p(X, A) to be faithful is that F has exactly the same local behavior within the neighborhood centered at (X s , A s ) and (X, A). Firstly, subgraph (X s , A s ) must not change the model's output, which we find is usually not guaranteed. For example, the objective given by Def. 2.3 always maximizes the output probability regardless of the original probability. Secondly, we also hypothesize that when F is less non-linear, e.g. in an early stage of training, subgraph explanations might be more faithful because the decision boundaries in the input space are less complex compared to a well-trained model. Prop. 3.3 summarizes our analysis, and empirical findings will be discussed in Sec. 5. Proposition 3.3. Given a local difference model p(X, A) = F (X s , A s ) defined by a subgraph explanation X s , A s , and a model F (X, A) = {e v f (X, A)} y where f is the output of the last layer of graph convolution and y is the target class, the general unfaithfulness ∆(p) has the following

Towards Faithful Explanations
In this section, we discuss ways to develop a non-linear faithful local difference model p to explain the target GNN. Graph networks can be written as where M is the number of graph convolution layers and Λ * is the corresponding activation matrix for ReLUs (we point readers to the proof of Prop. 3.2 in Appendix. A for details in expanding graph networks in matrix products), the non-linearity between F and A is polynomial up to A M (when all ReLUs are activated). Recall that each entry of the k-th power of the adjacency A k ij indicates the number of paths from i to j with a k-hop path, we propose to build M polynomial functions w.r.t A to explain F (X, A). Formally, we introduce Def. 4.1.
is the normalization for the adjacency matrix and w k (k = 1, ..., M ) are trainable parameters.
Each component N (A k )Xw k in the k-hop model builds a direct edge between a k-hop neighbor and the node of interest. By attributing the output of the k-hop local difference mode w.r.t the node features and the edge features, we generate the explanation to F (X, A) as the gradient of p, i.e. X p and A p, for the importance of the nodes and edges, respectively. The analytical expressions of X p, A p are functions of w k and can be analytically derived using Kronecker product; however, most auto differentiable framework, i.e. Pytorch, can utilize vector-Jacobian tricks to efficiently compute X p, A p. The following proposition ensures we can find optimal parameters w k for the k-hop model to faithfully explain the target GNN.
Complexity The complexity of solving the optimal parameters using a linear function (Def. 2.4) is to invert a symmetric matrix with n * d + e rows where n and e is the number of nodes and edges in the computational graph, and d is the number of node feature dimensions. For KEC, we only need to invert a symmetric matrix with M * d rows where M is the number of graph convolution layers which is usually, e.g. 3 or 4, far less than the number of nodes in practice.
Implementation. Similar to the linear case (Def. 2.4), to inverse E X , A [φφ ] one can add a tiny diagonal matrix or pseudo-inverse instead of actually finding the matrix inverse for approximating the inverse of that expectation. In practice, We have firstly attempted to solve W * with SVD but run into numerical instability because the smallest eigenvalues of the φ are too close to 0. We find one way to stabilize the pseudo-inverse is a truncated SVD, which discards the singular vectors if their corresponding singular values are less than a threshold [24]. Empirically we find a threshold of 0.0001 provides a numerical stability for all experiments.

Experiments
This section provides the following empirical studies. Firstly, we measure the general unfaithfulness ∆(p) of several baseline explanations and the proposed method KEC. We find that KEC is the most faithful method on one synthetic dataset and two real-world datasets when perturbing the node features or edge features in Sec. 5.2. Secondly, we demonstrate that gradient-based methods and KEC are both accurate and succinct. Besides, they are also faithful to model's parameters while subgraph explanations, i.e. GNNExpl, may be less sensitive, which serves as an empirical evidence for Prop. 3.3. Due to a space limit, the details of this part are included in Appendix. C.3. Visual comparisons of our approaches are arranged in Fig. 1 and later in Sec. 6 in our case study as this section mainly focuses on quantitative results.

Setup
Datasets and Models. We explain the graph model's prediction on the following datasets: 1) BA-Shapes: a synthetic dataset with duplicates of motifs in a house-like shape and random nodes, which has been widely used in the literature. The task is to classify the type of each node being which part of the "house" motif or just random nodes; 2) Cora [27]: a citation network where nodes represent documents and edges represent citation links and the task is to predict the category of the publication represented by each node; and 3) Citeseer [27]: a citation network similar to Cora but with more node features. All datasets are trained with graph convolution networks (GCNs). Architecture and parameter details are included in Appendix. B.1.
Baselines. We include two types of distribution influence in the evaluations: Saliency Map (SM) and Integrated Gradient with a zero vector (IG (zero)) and a random vector (IG (random)) as the baseline and we use 50 points to interpolate points between the baseline and the input, following the frequent choices in the literature. For subgraph explanations, we include: 1) GNNExpl as it is the building block for many follow-up works; 2) a continuous version of GNNExpl (GNNExpl (soft)) where we do not drop edges with small importance scores and we instead consider it as providing a constinous and weighted adjacency matrix A sij ≤ 1 and 3) PGExpl. We also include the optimal explanations from Def. 2.4 (Linear) solved by the truncated SVD. More details on the implementaion of GNNExpl and PGExpl can be found in Appendix B.2.

Explanation Faithfulness
Distributions. The first experiment evaluates the faithfulness of all explanations with Def. 3.1. Since KEC is motivated to bring non-linearity into the local difference model to faithfully attribute over the edge features, we mainly consider the following distributions: 1) U(A, σ) where the perturbation to each edge weight A ij is uniformly sampled from [−σ, σ] and we clip each edge weight so that A ij ≥ 0. We evaluate the case when σ = 0.2 and 0.5. We consider this case as we drop the edges in a soft way; 2) B(A, σ) where the probability we sample the perturbation from a Bernoulli distribution of the parameter σ (consider this case as we drop the edge in a hard way). We evaluate the case when σ = 0.2 and 0.5. Our perturbations to edge features include self-loops. Prop. 4.2 does not prevent us from considering perturbations to the node features. Therefore, we also explore U(X, σr) where the perturbation to each feature X ij is uniformly sampled from [−σ * r, σ * r] where r = max(X) − min(X) is the range of feature values. In our experiments, σ = 0.2.
Results. For BA-shapes, we use node indices [400:700:5] following the choice in the previous work [37,20,32,2]. For Cora and Citeseer, we use node indices [0:1000:5]. Due to the space limits, results on Citeseer is moved to Appendix C.1. To evaluate the general faithfulness ∆(p) we average 500 points sampled (with the same random seed for all methods) from the distribution of interests. To solve the optimal parameters in Linear and PEC we use 200 samples.
We average the results on all nodes in Table 1. We make the following observations from the table: 1) KEC is uniformly better than all baselines on real datasets, i.e. Cora and Citeseer, white it matches or is slightly worse than Linear on BA-shapes; 2) Saliency Map (SM) is much faithful than most other baselines for explaining the graph models while Integrated Gradient (IG) is really sensitive to the choice of baselines. A common choice of baseline, a zero vector, from the vision task does not appear to be a reasonable baseline in the graph case. We hypothesize this is because a baseline adjacency matrix with all zeros is too far away from any meaningful given input adjacency matrix. In the image case, moving from a zero baseline to the current image can be viewed as shedding a light on a black image; however, in the graph case, the same intuition does not exist and a random baseline adjacency matrix is much more faithful to explain the local behavior of a graph model than does a zero one.
Our results highlight that the baseline selection plays an important role if users would like to use IG to explain the graph models; and 4) lastly we find that by interpreting edges with lower importance scores and removing them from the original graph to create a subgraph, i.e. considering GNNExpl instead of GNNExpl (soft), significantly increases the unfaithfulness in the real datasets, i.e. Cora and Citeseer, but not in BA-shapes. This brings our attention to the limitation when using synthetic data to evaluate graph explanations. On the other hand, the difference between GNNExpl and GNNExpl (soft) indicates that edges with lower importance scores are not "noise"; they could be insufficient for the model to make the right decision but are necessary to keep for the purpose of faithful explanations.
In summary, as KEC is motivated to find a non-linear local difference model to faithfully attribute over edges, the current approximation method, truncated SVD, provides reasonable precision to use when evaluating over perturbations on edge features.
Larger Neighborhood, Approximation Error. We also measure the general unfaithfulness ∆p for a mixed distribution, i.e. perturbing the node and edge features together. We find that when users want to apply KEC using perturbations on node features, a much larger set of samples are necessary to ensure the faithfulness if the dimensions of node features are significantly high. More experimental details, the relevant table, and our findings are discussed in Appendix. C.2 and C.4.
Faithfulness to Model Parameters. So far we develop and evaluate the faithfulness of graph explanations on every single node but being faithful to the target model can also be considered in another context -that the explanations should be sensitive enough to the model's trainable parameters, i.e. a sanity check [1]. We compare the performance of the explanations against the model's test accuracy with checkpoints saved during training. Experimental details and relevant plots are included in Appendix C.3) Our results suggest that SoftGNNExpl and PGExpl may not be sensitive enough to reflect the model's performance. That is, these explanations appear to locate relevant edges in the graph even when the model is degenerated.

Efficiency
Following the efficiency experiments by Alsentzer et al. [2] we also report the timing of our methods and all baselines. Results are shown in Table. 2b measured on a single Tesla T4. We use the default number of epochs for GNNExpl and PGExpl in the public repository.

Case Study: Anomaly Detection
This section conducts a case study of using faithful explanations for real-world GNN applications, combined with domain-specific knowledge, to help interpret explanation results. We use the dataset collected from a real-world secure water treatment system (SWAT) [10] to build a GNN model for anomaly detection in multivariate time series data. Prior work [5] has demonstrated GNNs' efficacy in such a task, however, we want to provide more insights into how GNN models make their prediction with our explanation methods. Since many methods (e.g., GNNExpl) are originally designed only for classification tasks, we will use visual comparisons in lieu of formal quantitative analysis in this case study. The SWAT dataset [10] contains time series readings of 51 nodes (sensors and actuators) in a water treatment testbed over 11 days. To generate anomaly, researchers manually temper with individual nodes (e.g., shutdown) or spoof readings and label the corresponding data points as being under attack. The training procedure for anomaly detection with a GNN together with the quantity of interest we use to attribute over the node and edge features are included Appendix D . We compare KEC and Saliency Map, the faithful ones, with GNNExpl (soft), the less faithful one, found in Sec. 5.
Findings. Figure 2a shows the visualization of three attack instances explained by different methods. Images of the same column are from the same attack. The actual node under attack is marked by yellow starts while the model's predictions are colored in gray. Blue nodes and edges are positive influences -what makes the model believe the gray node has an anomalous reading -while red ones mean negative. Among the three attacks, we find several interesting insights: (1) The model incorrectly attributes nodes for attack #1. The attack spoof the pressure sensor (DPIT301) readings to repeatedly trigger the backwash process (controlled by pump P602). As a result, the model predicts a correlated pump (P601) should also have a low speed reading well below its normal operating range. Looking at the visualizations, KEC clearly shows the influence of DPIT301-P602-P601 with blue edges. (2) Both attack #2 and #3 directly set flow meter FIT401's value as 0 to shut down subsequent processes. Since they are the same attacks, their explanations should reflect the similarity as well. Surprisingly, SM generates inconsistent explanations for these two attacks. We find the disagreement mainly focuses on the top left group w.r.t the stared node, which provides us a direction to investigate the model's behavior. (3) Overall, GNNExpl's results might be less insightful since almost everything is important to the prediction and a lack of anti-significant edges and nodes. We believe this is because GNNExpl uses a sigmoid function at the top of the mask (Def. 2.3), which can i) easily push the significance scores towards either 0 and 1; and ii) flip the sign of negative scores.

Related Work
Faithfulness in General. We first compare terms used in the literature that are similar to general faithfulness. Yeh et al.
[36] use INFD score to quantify the faithfulness for gradient-based attributions, which is one of the building block for our metric. Another line of work is the ablation study for input features [3,34], which can be viewed as evaluating whether the explanation is faithful when compared with a baseline vector, e.g. all zeros, where general faithfulness can be used for any neighborhood of interest as long as the explanation can be written as a local difference model p.
To ensure the explanation captures the local behavior of the target function, LIME [23] instead minimizes the difference between a surrogate model and the target function for neighbors, where the difference is also weighted by the distance. We highlight that our methods are different from LIME in the following aspects: 1) LIME considers that the surrogate model takes points in a space different from the GNN's input space for the purpose of interpretability; 2) LIME requires that the surrogate model's output becomes similar to the target function, whereas general faithfulness requires the change of p to align with the change of the target GNN, i.e. the difference of difference. 3) LIME uses a linear model and enforce sparsity of the weights, where KEC uses k-hop models and considers non-linearity for the adjacency matrices. We argue that the sparsity penalty can become dominant compared to faithfulness, resulting in non-faithful but sparse explanations. The graph variation of LIME, GraphLIME [13], uses Hilbert-Schmidt Independence Criterion Lasso to encoder non-linear interactions between node features. GraphLIME can not attribute over edges and therefore are not compared in this paper.
Faithfulness in Graph Models . The most similar metric proposed for the faithfulness of grpah explanation is fidelity by [2], which measures the difference of the model's output when the input is replaced with the importance subgraph. fidelity therefor can be considered as a special case for general faithfulness when the neighborhood of interest is only the input itself. Sanchez-Lengeling et al. [25] introduces four metrics for attributions among which the term faithfulness refers to how explanations change when the training set is perturbed. i.e. introducing noises and permuting the labels. Sanchez-Lengeling et al. [25] finds IG and GradCAM [26] is more correlated with the model's performance, which agrees with our conclusions in Sec. 5 from another way of varying the model's performance. Using checkpoints may provide more continuous measurement than training multiple models because we are continuously monitoring the same network. Besides, our experiments also cover subgraph explanations that are not included by Sanchez-Lengeling et al. [25].
Explaining Graph Classifications. Another line of related in work is to explain graph classifications, where all node and edge features are used and the task is to attribute the model's output over the entire graph. One simple way to adapt KEC explanation into this case is by modifying the e v vector (Sec. 2.1) to be a vector of all ones, which should function as a global sum pooling operation and Prop. 4.2 still holds in this case. As the paper mainly focuses on explaining node classification and its related tasks, e.g. node-level anomaly detection, which already covers a large scope of research topics, we leave this as a future work to follow up with.

Conclusion
In this paper, we study the problem, how should one construct and evaluate faithful explanations for GNNs?. We build a general faithfulness metric, general faithfulness, to both subgraph explanations and feature attributions methods to understand how well these approaches capture the model's behavior in a local neighborhood. In particular, we introduce KEC as a faithful explanation to attribute a GNN's output w.r.t node and edge features. Our empirical studies over a set of existing explanations methods highlight cases when they may not be faithful. Finally, we provide a case study on anomaly detection for the use case of faithful explanations in debugging and improving the model's behavior beyond classification tasks with GNNs. A Proofs Proposition 3.2 Given a convolutional graph model F (X, A) with ReLU activations, F (X, A) is locally linear w.r.t X when A is fixed. However, only one of the following statement can hold at one time: 1) F contains only one layer of graph convolution; 2) when X is fixed, F is not a local linear function w.r.t A.
Proof. It is easy to find when F has only one layer of graph convolution, it can be written as is the normalized adjacency matrix and we omit the bias. Because ReLU is piece-wise linear, F is also piece-wise linear w.r.t X and A. We now consider a two-layer graph convolution network Consider a set of points P = {(X i , A i )} in the input space, if the activation status, OFF or ON, of all ReLUs remain the same for these points, we refer P as an activation region in the input space and write where Λ * are tensors with the diagonals of the last two dimensions being 0 or 1, indicating whether the pre-activations of ReLUs are positive or not. The convexity of P follows from observations [14,9]. We now make the following observations. Suppose A is fixed, ∀(X i , A) ∈ P , F is a linear function w.r.t X. In this case, a linear p = V(( X F )) V(X) is always able to faithfully capture the change of F within the activation region P . However, when X is fixed, F is still a non-linear function w.r.t A within most activation regions 1 . It is easy to find that F can be locally linear w.r.t. A contains only if and only if the number of graph convolutions is 1. The analysis for a network with more than two convolutional layers is similar.
Proof. By the definition of the general unfaithfulness, we have Because (·) 2 is a convex function, we exchange the order of expectation with the square function and finds a lowe-bound of ∆(p) by Jensen's Inequality as where C = F (X s , A s ) − F (X, A).
Proof. By Def. 3.1, we write ∆(p) for p(X, A) = M k=1 e v N (A k )Xw k as follows: By introducing the following matrices: where M is the number of convolutional layers and d is the number of node features, we re-denote With the definition of F (X, A) = e v f (X, A) y , we re-denote where . Therefore, the general unfaithfulness is then given by To find the optimal W * that minimizes ∆(p), we take the derivative w.r.t W and set it to zero (the integral in the expectation is over the random variables X , A instead of W , therefore we can interchange the order of the derivative and the integral), which yields the following relation The solution exists as

B.2 Implementation GNNExpl and PGExpl
We use the implementation on Pytorch Geometric for GNNExpl 2 . We use all default parameters in this implementation except using feat_mask_type='individual_feature' to get the feature masks and return_type='raw' when our models provide logit outputs. GNNExpl drops edges with importance scores lower than 0.5 as the sigmoid function predicts whether an edge should be kept and we think 0.5 is a reasonable threshold.
PGExpl was originally built in TensorFlow. We use the pytorch implementation 3 acknowledged by Luo et al. [20] on their github page. We fixed a few bugs in dealing with edge cases in this   implementation and reuse their hyper-parameters, e.g. number of epochs, temperatures. In BAshapes, we find that training PGExpl with all points provides a slightly better results on ROC-AUC score so we train all nodes together. In Cora and Citeseer, we train each node individually. To create a subgraph explanation, we only keep top K% edges. As Luo et al. [20] selects 100 for BAshapes, for nodes in which the average number of edges in its computation graph for a 3-layer GNN (our model) is around 739, we use K = 100/739 = 13.5.

C Other Experiments
This section includes the details of several experiments mentioned in Sec. 5.

C.1 Faithfulness Evaluations on Citeseer
In this section, we include the results of measuring general unfaithfulness (Def. 3.1) for baseline explanations and our proposed method, KEC, on Citeseer in addition to the results for BA-shapes and Cora shown in Table 1.

C.2 Mixed Distribution
We measure the general unfaithfulness ∆p for a mixed distribution by perturbing the node and edge features together. We denote this neighborhood as U(X, 0.5r) × U(A, 0.5) for example. This is a relatively larger neighborhood compared to all three distributions above. We do not perturb node features for BA-shapes as they are constants by construction.
Notice that we increase the test samples size from 500 to 3000 per node in this case because this is a much larger neighborhood (details on how we get this number to follow in Sec. ??). Since we are perturbing the node and edge features together, we use a baseline of zero vector for both node and edge features for IG, denoted as IG (full) in the table (we run test with a random baseline as well and it does make a big difference in this case). PGExpl is excluded because it does not attribute over node features. Results are shown in Table. 3 (BAshapes is excluded because we are not interested in perturbing constant node features).
Results. We make the following observations: 1) The unfaithfulness scores for all methods are generally higher than the numbers they can get in U(X, σr) or U(A, σ) with the difference on the order of magnitude. We hypothesize the reason for KEC to be less faithful in this distribution is because of the sample size, which we will discuss further in Appendix C.4 as well. When solving KEC with a sufficient large number of samples is not feasible, we consider Saliency Map as a better choice in a mixed distribution in terms of the faithfulness; 3) Lastly, we again blame the unfaithfulness of IG for the choice of the baseline. Our results highlight the common baseline in image domain may not be a reasonable choice for graph data.

C.3 Parameter Faithfulness
In Sec. 5, we develop and evaluate the faithfulness of graph explanations on every single node but being faithful to the target model can also be considered in a larger scope -that the explanations should be sensitive enough to the model's trainable parameters, i.e. a sanity check [1]. We compare the performance of the explanations against the model's test accuracy with checkpoints saved during training.

C.3.1 Experiments and Results
To quantitatively measure the performance of an explanation, we use ROC-AUC scores when a ground-truth label for the important edge is given, i.e. in BA-shapes, following the choice from the literature [37]. When a ground-truth is missing, i.e. Cora, we use Sparsity of important edges, i.e. |A t |/|A| where A t is an adjacency matrix with edges whose importance scores are all higher than t and A is the original adjacency matrix, as used in [2]. Instead of choosing t, we firstly normalize edge importance scores to [−1, 1] and measure the area of the curve when t : 0 → 1. We show the results for BA-shapes in Fig. 3a and for Cora in Fig. 3b for example.
Our findings are as follows: 1) the AUC scores and sparsity scores of SM, IG, KEC and Linear are better when the model is more accurate. The sparsity of PGExpl shows the highest sensitivity against the model's accuracy; 2) in both datasets all explanation methods become less faithful when the model becomes more accurate. We believe this is because when a model under-fits, it is more linear and its local behavior is easier to capture. An analogy to this is that gradient-based attributions all reduce to Saliency Map in a linear model [3]; 3) In Fig. 3a, we find that the ROC-AUC scores for SoftGNNExpl and PGExpl are pretty high even when the model is in its early stage of training while the correlations of the rest methods between explanation AUC and the test accuracy are stronger. We believe this demonstrates the necessity of refining the penalty functions L (Def. 2.3) in the existing work to encourage the faithfulness.  . In practice, we find this mapping from the gradient space to the probability space is not well-justified because the signs of gradient values contain information of whether this features has positive or negative contributions. In practice, we find that by thresholding gradients, or explanations with both positive and negative values, and varying the temperature of sigmoid function, the ROC-AUC scores can span the entire possible range [0.5, 1.0] and an example of Saliency Map is shown in Fig. 5. We locate this issue and find it is caused by the numerical instability in computing the sigmoid function. As gradients can be as small as 1e − 8, Figure 5: ROC-AUC scores change when the temperature T of sigmoid function and the threshold t vary when Saliency Map in BA-shapes when using float numbers, i.e. np.float32, and using temperature as T = 1, tiny gradient values will overflow. To provide fair evaluations for Saliency Maps and all gradient-based methods, after the absolute function we firstly use a threshold to zero-out tiny gradients. The threshold is chosen as the minimal value that provides relative stable ROC-AUC scores over all temperature values from 10 −18 to 10 5 . We pick 10 −3 following our observations. Secondly, we run ROC-AUC scores with temperature sigmoid over the same temperature interval as mentioned above and use the average ROC-AUC scores for the explanation. This only applies to Saliency Map, Integrated Gradient, KEC, Linear in Sec. 3a and does not apply to GNNExpl and PGExpl as they are already in the range of [0, 1]. We believe this mapping from the gradient space to the probability space is not robust and should be replaced in the future.

C.4 Approximation Error
This section checks how many samples are sufficient to approximate the optimal parameters in KEC using truncated SVD and we show this in Fig. 4. We use Cora as an example here. By varying the number of points we use to solve the parameter in KEC (numbers on the row axis) and the number of points we use to evaluate the faithfulness (numbers on the column axis), we get the heatmaps of unfaithfulness scores for three distributions U(X, 0.5), U(A, 0.5) and U(X, 0.5) × U(X, 0.5) where darker grids are less faithful situations. We make the following observations: 1) in general we can minimize the unfaithfulness w.r.t a set of points equal or less than the samples we use to solve the parameter of KEC. This is observed from the diagonals of three heatmaps; 2) for perturbation only on edges, even with a small amount of samples, e.g. 100 samples, the unfaithfulness of KEC is still less than 0.001 even evaluated with 3000 samples; 3) for perturbations on node features and the mixed case, KEC may only be faithful for a subset of points used to solve the truncated SVD. We believe this is mainly because the neighborhood U(X, 0.5) is an ∞ ball with much more dimensions than that of U(A, 0.5). Namely, there are 1433 dimensions in the node features for Cora, which is about 3x larger than the average number, i.e. 414.8, of edges within a node's computation graph (a 3-hop subgraph in our case). Therefore, we use 3000 samples in Table 3.

D Anomaly Detection
We follow the training strategy from Deng and Hooi [5]. Node features are one-dimensional time series data, which is the history of sensor readings over time. We use the physical structure of sensors as the adjacency information. During the training process, given the reading from t to t − 4, a GNN is trained to predict the reading at t + 1 with MSE loss. During the test time, GNN's prediction of the sensor's reading is considered as normal values and the actual observation is compared with the prediction. The maximum deviation between the model's deviation and the observation over node, when found higher than a threshold, will trigger the anomaly flag and the node with the highest deviation is considered as the node under attach. The choice of threshold value is based on the model's prediction on a separated validation set. We refer the reader to Deng and Hooi [5] for details and our code submission for the implementation.