SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Senzhang Wang*†  
Central South University szwang@csu.edu.cn
Jun Yin†  
Central South University  
yinjun2000@csu.edu.cn
Chaozhuo Li  
Microsoft Research Asia  
cli@microsoft.com
Microsoft Research Asia xing.xie@microsoft.com
Jianxin Wang  
Central South University  
jxwang@mail.csu.edu.cn
GNN explanation method aims to identify an explanatory subgraph which contains the most informative components of the full graph. However, a major limitation of existing GNN explainers is that they are not robust to the structurally corrupted graphs, e.g., graphs with noisy or adversarial edges. On the one hand, existing GNN explainers mostly explore explanations based on either the raw graph features or the learned latent representations, both of which can be easily corrupted. On the other hand, the corruptions in graphs are irregular in terms of the structural properties, e.g., the size or connectivity of graphs, which makes the rigorous constraints used by previous GNN explainers unfeasible. To address these issues, we propose a robust GNN explainer called V-InfoR<sup>3</sup>. Specifically, a robust graph representation extractor, which takes insights of variational inference, is proposed to infer the latent distribution of graph representations. Instead of directly using the corrupted raw features or representations of each single graph, we sample the graph representations from the inferred distribution for the downstream explanation generator, which can effectively eliminate the minor corruption. We next formulate the explanation exploration as a graph information bottleneck (GIB) optimization problem. As a more general method that does not need any rigorous structural constraints, our GIB-based method can adaptively capture both the regularity and irregularity of the severely corrupted graphs for explanation. Extensive evaluations on both synthetic and real-world datasets indicate that V-InfoR significantly improves the GNN explanation performance for the structurally corrupted graphs.
Nowadays, graph data is ubiquitous in various domains, such as citation networks [1, 2, 3], social networks [4, 5], and chemical molecules [6]. GNN has manifested promising performance in many graph tasks, e.g., node classification [7, 8], link prediction [9], and graph classification [10, 11], by aggregating node features in light of the topological structures. Similar to other deep learning models, GNN models also have the defect that they are non-transparent, and the prediction results lack human-intelligible explanations [12]. Precise explanations can not only make people better understand GNN predictions but also assist GNN designers in detecting underlying flaws and purifying them.
†Equally contribute to this research.
3Code and dataset are available at https://anonymous.4open.science/r/V-InfoR-EF88
(a) Raw graph  $G$ $\phi (G) = \hat{y}$
(b) Minor corruption  $\phi (G^{\prime}) = \hat{y}$
Figure 1: An illustration of the structurally corrupted graphs, where the solid red lines represent the newly added edges and the dashed red lines represent the removed edges. (a) is the raw graph and  $\hat{y}$  is the prediction given by GNN  $\phi$ ; (b) represents the graph  $G'$  with minor corruption whose prediction remains  $\hat{y}$ ; (c) shows the graph  $G''$  is severely corrupted such that the predicted label of GNN on it is changed.
(C) Severe corruption  $\phi (G^{\prime})\neq \hat{y}$
GNN explainer aims to identify an explanatory subgraph, whose components exert vital influence on the prediction of the full graph [13]. Existing GNN explanation methods generally allocate significance scores for each component of the graph, and a subgraph with the highest score is extracted as the explanation of the whole graph [14]. They optimize the allocation of the significance scores by minimizing an explanation loss function [15, 13]. The final explanation provided by GNN explainer includes a subgraph structure along with the corresponding node features.
However, a major limitation of existing works is that they mostly focus on designing effective significance score allocation methods, but ignore such a critical problem: Whether and to what extent a structurally corrupted graph will affect the performance of the GNN explainer? In many real application scenarios, the graphs may contain various corruptions, such as noise [16, 17] and adversarial edges [18, 19, 20]. Existing methods directly adopt the raw graph features [21, 22, 15, 23] or the latent graph representations [13, 24, 25] as the input of the explainer model, and thus the output explanation may not be reliable when the input is corrupted. Previous work has shown that the explanation of deep neural networks is fragile to attacked images [26]. Thus whether the structurally corrupted graphs will remarkably affect the performance of the GNN explainer and how to address it is an interesting problem, yet has not been fully studied and remains an open research issue.
This paper for the first time investigates how to construct a robust GNN explainer for structurally corrupted graphs. As illustrated in Figure 1, based on whether the prediction of the downstream task (e.g., graph classification) is changed, the structural corruptions of a graph can be categorized into minor corruptions and severe corruptions. In Figure 1(a),  $\phi$  denotes the GNN model to be explained, and  $G$  is the raw graph. Figure 1(b) shows the case of the graph with minor corruption  $G^{\prime}$ , which is not so intense that the predicted graph label remains the same as the raw graph. Figure 1(c) shows the case of the severely corrupted graph  $G''$  where the corruption is devastating enough to the GNN and thus results in a different prediction. Based on this example, we argue that a robust GNN explainer should satisfy the following two requirements. First, the minor corruption should be considered as redundant components and filtered by the explainer as they do not affect the final prediction. Second, the severe corruption should be identified by the explainer as part of the explanation since they are the non-ignorable reason that changes the final prediction. However, it is non-trivial to meet the two requirements simultaneously due to the following two challenges.
Robust graph representation extraction to eliminate the minor corruptions. As we discussed before, existing works directly use the raw graph features or the latent graph representations of each single graph as the explanation input, which will raise the risk of the GNN explainer overfitting to corruptions [26]. This is because the raw graph features can be easily corrupted by noise or adversarial attacked edges. The latent graph representations have been proved vulnerable to structural corruption [27, 20]. How to extract a robust graph representation that can effectively filter the minor corruptions while preserving the vital information for GNN explanation exploration is challenging.
Structural irregularity of the severe corruptions. The corruptions may be of different sizes or consist of several disconnected parts in the graphs, i.e., they are irregular [28]. For example, in molecule chemistry, the corruptive functional groups differ largely in terms of size (e.g., -Cl and
$-\mathrm{C}_{10}\mathrm{H}_9$  in solubility analysis). Moreover, a molecule containing multiple functional groups which are disconnected from each other is common in the real-world. To meet the second requirement, the structural irregularity of severe corruption should be identified by the GNN explainer. Hence it is not reasonable to adopt some predefined rigorous constraints, e.g., size constraint or connectivity constraint that are commonly used in previous explainers, to the explanations of corrupted graphs. How to design a more general objective function to adaptively capture the structural irregularity of severe corruption is also challenging.
To address the two aforementioned challenges, we propose a robust GNN explainer for structurally corrupted graphs called V-InfoR (Variational Graph Representation based Information bottleneck Robust explainer). Specifically, V-InfoR contains two major modules. (1) Robust graph representations extractor. In this module, we take insights of variational inference [29, 30] to model the statistical characteristics that are shared by all the observed graphs, i.e., the mean and the standard deviation. The statistics are capable of capturing the uncertainty and variability of the observed graphs. Based on the statistics, a variational graph distribution is induced, which can effectively model the common features of all the graphs and filter the minor corruption. The variational graph representations provide a more robust graph representation for the downstream explanation generator. (2) Adaptive explanation generator. To address the irregularity issue of the severe corruptions, we propose an Adaptive Graph Information (AGI) constraint. The AGI constraint directly restricts the information carried by the explanation without any rigorous assumptions on the structural properties (e.g., size or connectivity) of the explanation. By incorporating the AGI constraint, we formulate the GNN explanation exploration as a Graph Information Bottleneck (GIB) optimization problem to adaptively capture both the regularity and irregularity of the severely corrupted graphs.
- This work for the first time studies the negative effect of both minor and severe structural corruptions on existing GNN explainers, and proposes a robust explainer V-InfoR to effectively handle the two types of corruption.
- We novelly propose to incorporate variational inference to explore GNN explanation. A variational inference based robust graph information extractor is proposed to mitigate the uncertainty and variability of minor corruptions when extracting the critical graph information.
- We generalize the GNN explanation exploration by introducing an adaptive graph information constraint, which can capture both the regularity and irregularity of the corrupted graphs. We also theoretically derive the variational bound of this objective to make it feasibly estimizable.
- Extensive experiments on one synthetic dataset and three real-world datasets demonstrate the superiority of V-InfoR over state-of-the-art GNN explanation methods.
In this section, we will first provide the quantitative evidence that existing GNNs explainers are fragile to structurally corrupted graphs. Then we provide a formal statement of the graph explanation problem. See Appendix B for the basic notations.
2.1 Are existing GNN explainers robust to corruptions?
To study whether existing GNN explainers are robust to corruptions, we evaluate the performance of six state-of-the-art GNN explainers when minor corruption and severe corruption are injected into the raw graphs, respectively. We use the synthetic BA-3Motifs dataset [15], which is a widely used benchmark dataset for GNN explanation. To investigate the minor corruption, we select the corrupted graphs whose predictions are unchanged after randomly flipping  $20\%$  edges. For the severe corruption, we use the SOTA graph adversarial attack algorithm GRABNEL, which formulates the attack task as a Bayesian optimization problem [18]. The attack budget of GRABNEL means the highest percentage of the attacked edges. We use a  $10\%$  attack budget here, which is able to change the prediction of the selected graphs and thus can be considered as the severe corruption.  $F_{NS}$  score is used as the evaluation metric and a higher  $F_{NS}$  score means a better explanation performance [25]. The formal definition will be given later in Section 4.1.
Figure 2: The overall architecture of V-InfoR, which consists of the robust graph representation extractor and the adaptive explanation generator.
The result is presented in Figure 5 of Appendix C. The histograms of the three colors represent the explainer performance on raw graphs, graphs with random noise, and attacked graphs, respectively. One can see that both the minor corruption (20% random structural noise) and the severe corruption (10% GRABNEL attack) remarkably degrade the explanation performance. Minor corruption brings about an average performance degradation of 31.15% for the six GNN explainers, and severe corruption results in an average performance degradation of 40.64%. The experimental result verifies that both the minor and the severe corruptions do significantly affect the performance of existing GNN explainers. Therefore, a robust GNN explainer is required for the structurally corrupted graphs.
Formally, given the GNN model  $\phi$  to be explained and the input graph  $G = (\mathbf{X},\mathbf{A})$ , the explanation provided by the GNN explainer is a subgraph  $G_{S} = (\mathbf{X}_{\mathbf{S}},\mathbf{A}_{\mathbf{S}})$ .  $\mathbf{A}_{\mathbf{S}}$  is a subset of the original adjacent matrix  $\mathbf{A}$  and contains the key structure that determines prediction largely and  $\mathbf{X}_{\mathbf{S}}$  is the features of nodes which associates with  $\mathbf{A}_{\mathbf{S}}$ . Existing researches show that topological information is critically important to graph classification [27, 13]. Hence, our V-InfoR focuses on the structural corruption when exploring explanation. We deem an explanation  $G_{S}$  sufficient when it can produce the same prediction as using the full graph, and deem it necessary when the prediction will change if it is removed from the full graph [25]. An ideal explanation should be both sufficient and necessary. Formally, the sufficient and necessary conditions [25] are formulated as follows, respectively,
$$
\underset {c \in \mathcal {C}} {\operatorname {a r g m a x}} P _ {\phi} (c | \mathbf {X} _ {\mathbf {S}}, \mathbf {A} _ {\mathbf {S}}) = \hat {y}. \tag {1}
$$
$$
\underset {c \in \mathcal {C}} {\operatorname {a r g m a x}} P _ {\phi} (c | \mathbf {X} - \mathbf {X} _ {\mathbf {S}}, \mathbf {A} - \mathbf {A} _ {\mathbf {S}}) \neq \hat {y}, \tag {2}
$$
where  $\hat{y} = \mathrm{argmax}_{c\in \mathcal{C}}P_{\phi}(c|\mathbf{X},\mathbf{A})$  in Formula (1) and (2).
Figure 2 illustrates the overall architecture of V-InfoR, which is composed of two key modules, the robust graph representation extractor and the adaptive explanation generator. As shown in the upper part of Figure 2, the robust graph representation extractor takes the full graph  $G$  as input, and two GCN encoders are adopted to infer the statistics of  $G$ 's latent distribution (i.e., mean and standard deviation). The variational node representations, which are sampled from the latent graph distribution, will induce the edge representations. The edge representations are then fed into the adaptive explanation generator which is shown in the lower part of the figure. A multi-layer perceptron
projects the edge representations into the probability of each edge. The explanation subgraph  $G_{S}$  is generated on the basis of this probability. Finally, the proposed novel Graph Information Bottleneck (GIB) objective is optimized, which is defined over the full graph prediction  $\hat{y}$  and the explanation subgraph prediction  $\hat{y}_{S}$ . Next, we will introduce the two modules in detail.
3.1 Robust graph representation extractor
Specifically, we introduce a variational auto-encoder (VAE) [30] to deduce the statistics in the variational distribution of the minorly corrupted graphs. For a set of observed graphs  $\mathcal{G} = \{G^k = (\mathbf{X}^k,\mathbf{A}^k)\}_{k = 1}^{|\mathcal{G}|}$ , variational inference assumes that they are generated by a latent random process, involving a latent continuous random variable  $\mathbf{z}$  [29, 30]. This random process contains two steps. First, a value  $\mathbf{z}^k$  is generated from a prior distribution  $p(\mathbf{z})$ . Then the graph  $G^k$  is generated from a conditional distribution  $p(\mathbf{G}|\mathbf{z})$  and observed by us. Variational inference aims at identifying the posterior distribution  $p(\mathbf{z}|\mathbf{G})$ , i.e., inverting the distribution of latent variable  $\mathbf{z}$  from the observed graphs<sup>4</sup>. However, the true posterior distribution  $p(\mathbf{z}|\mathbf{G})$  is unknown. A feasible method is introducing a variational distribution  $q(\mathbf{z};\mathbf{G})$  to approximate  $p(\mathbf{z}|\mathbf{G})$  [28]. This work assumes that  $q(\mathbf{z};\mathbf{G})$  is a Gaussian distribution  $\mathcal{N}(\boldsymbol{\mu},\boldsymbol{\sigma}^2)$  and increases the similarity between  $q(\mathbf{z};\mathbf{G})$  and  $p(\mathbf{z}|\mathbf{G})$ . The similarity measurement is Kullback-Leibler divergence,
$$
\operatorname {K L} [ q (\mathbf {z}; \mathbf {G}) | | p (\mathbf {z} | \mathbf {G}) ] = \sum_ {\mathbf {z} ^ {k}} q \left(\mathbf {z} ^ {k}; \mathbf {G}\right) \log \frac {q \left(\mathbf {z} ^ {k} ; \mathbf {G}\right)}{p \left(\mathbf {z} ^ {k} | \mathbf {G}\right)}. \tag {3}
$$
We substitute the unknown  $p(\mathbf{z}|\mathbf{G})$  for  $p(\mathbf{z},\mathbf{G}) / p(\mathbf{G})$ . Finally, the objective function of the robust graph representation extractor to be minimized can be formulated as
$$
L _ {\mathrm {V A E}} = - \mathbb {E} _ {q (\mathbf {z}; \mathbf {G})} [ \log p (\mathbf {G} | \mathbf {z}) ] + \mathrm {K L} [ q (\mathbf {z}; \mathbf {G}) | | p (\mathbf {z}) ], \tag {4}
$$
where  $p(\mathbf{z})$  is the standard Gaussian distribution  $\mathcal{N}(\mathbf{0},\mathbf{I})$ . See Appendix A for detailed derivation.
We refer to the latent variable  $\mathbf{z}$  as a variational representation because it contains the indicative information of the observed graphs. We also refer to the model that computes the distribution  $q(\mathbf{z};\mathbf{G})$  as an encoder, since given a graph  $G$ , it produces a distribution over the latent variable  $\mathbf{z}$ , from which  $G$  could have been generated. Similarly,  $p(\mathbf{G}|\mathbf{z})$  is referred to as a decoder, since given a code  $\mathbf{z}$  it produces the probability of the possible graph  $G$ .
In our implementation, we employ a 3-layer GCN as the encoder and a simple inner product as the decoder. The first two layers of GCN aim to aggregate and combine the information from the graph. The third layer consists of two separate graph convolution operators to calculate the mean  $\mu$  and standard deviation  $\sigma$  of  $q(\mathbf{z};\mathbf{G})$ , respectively. This procedure can be formulated as
$$
\mathbf {H} ^ {k} = \operatorname {G C N} \left(\mathbf {H} ^ {k - 1}, \mathbf {A}\right), k = 1, 2, \mathbf {H} ^ {0} = \mathbf {X}, \tag {5}
$$
$$
\boldsymbol {\mu} = \operatorname {G C N} _ {\boldsymbol {\mu}} \left(\mathbf {H} ^ {2}, \mathbf {A}\right), \tag {6}
$$
$$
\log \sigma = \operatorname {G C N} _ {\sigma} \left(\mathbf {H} ^ {2}, \mathbf {A}\right). \tag {7}
$$
The variational inference procedure endows  $q(\mathbf{z};\mathbf{G})$  vital graph information and is insensitive to minor corruptions. Hence the sampled graph representation  $\mathbf{z}$  which follows  $q(\mathbf{z};\mathbf{G})$  is more robust. Next, the robust representation  $\mathbf{z}$  will be fed into the explanation generator for explanation exploration.
3.2 Adaptive explanation generator
As the second challenge stated before, severe corruptions should be identified as part of the explanation, but they are usually irregular in terms of size, connectivity or some other structural properties. The rigorous constraints of the structural regularity adopted in previous works [15, 13, 25] are thus not feasible for the severe corruptions. Hence, a new GNN explanation exploration objective function is required to adaptively capture the irregularity of the severe corruptions. Inspired by the Graph Information Bottleneck (GIB) principle [31, 32], we propose to introduce an Adaptive Graph Information (AGI) constraint in exploring GNN explanation. On the one hand, the AGI constraint functions as a bottleneck to directly restrict the information carried by the explanation  $G_{S}$ , instead
4Without ambiguity,  $\mathbf{z}$  represents the random variable and its sampled value (i.e.,  $\mathbf{z}^k$ ), simultaneously.
of simply restricting the size or connectivity of  $G_{S}$ . Without any predefined structural regularity constraints, our method can more effectively capture the irregularity of the explanation caused by the severe corruptions. On the other hand, since the information measurement of the explanation  $G_{S}$  can be continuously optimized, the AGI constraint can adaptively cover the discrete rigorous constraints [28]. To this end, we formulate the GNN explanation problem as a GIB-guided optimization task to adaptively generate the explanations.
The insight of the GIB-guided optimization is that the explanation  $G_{S}$  of graph  $G$  should contain the minimal sufficient components of  $G$  [31]. GIB principle facilitates  $G_{S}$  to be informative enough about the prediction  $\hat{y}$  of  $G$  (sufficient). GIB principle also inhibits  $G_{S}$  from preserving redundant components which is irrelevant for predicting  $G$  (minimal). To this aim, the GIB-guided optimization task of  $G_{S}$  is formally defined as follows,
$$
\min  _ {G _ {S} \subset G} \operatorname {G I B} (G, \hat {y}; G _ {S}) = - \operatorname {M I} (\hat {y}, G _ {S}) + \beta \operatorname {M I} (G, G _ {S}), \tag {8}
$$
where  $\mathrm{MI}(\cdot ,\cdot)$  denotes the mutual information. The second term  $\mathrm{MI}(G,G_S)$  measures the vital graph information carried by the explanation  $G_{S}$ , which functions as the AGI constraint. Nevertheless, the GIB-guided explanation exploration task in Formula (8) cannot be directly extended to a continuous optimization procedure, because both  $G$  and  $G_{S}$  have discrete topological information which is difficult to optimize over. We resort to Gilbert random graph theory [33] which argues that an arbitrary graph  $G$  can be represented as a random graph variable, and each edge of  $G$  is associated with a binary random variable  $r$  to reveal its existence. Additionally, the existence of one edge is conditionally independent of the other edges.  $r_{ij} = 1$  means there is an edge  $(i,j)$  from  $v_{i}$  to  $v_{j}$ , otherwise  $r_{ij} = 0$ . To sum up, an arbitrary graph  $G$  can be represented as
$$
p (G) = \prod_ {(i, j)} p \left(r _ {i j}\right). \tag {9}
$$
For the binary variable  $r_{ij}$ , a common instantiation is the Bernoulli distribution  $r_{ij} \sim \mathrm{Bern}(\theta_{ij})$  where  $\theta_{ij} = p(r_{ij} = 1)$  is the probability of edge  $(i,j)$  existing in  $G$ . However, the Bernoulli distribution cannot be directly optimized. To address this issue, we apply categorical reparameterization [34] to the Bernoulli variable  $r_{ij}$ . The continuous relaxation of  $r_{ij}$  can be formulated as
$$
r _ {i j} = \operatorname {S i g m o i d} \left(\frac {\log \epsilon - \log (1 - \epsilon) + \alpha_ {i j}}{\tau}\right), \epsilon \sim \operatorname {U n i f o r m} (0, 1), \tag {10}
$$
where we let the latent parameter  $\alpha_{ij} = \log \frac{\theta_{ij}}{1 - \theta_{ij}}$ .  $\tau$  controls the approximation between the relaxed distribution and  $\operatorname{Bern}(\theta_{ij})$ . When  $\tau$  approaches 0, the limitation of Formula (10) is  $\operatorname{Bern}(\theta_{ij})$ .
According to Formula (10), the Bernoulli parameter  $\theta_{ij}$  is indeed associated with parameter  $\alpha_{ij}$ . In our implementation, we use a multi-layer perceptron (MLP) to compute  $\alpha$ . The MLP takes the variational node representation  $\mathbf{z}$  as input and concatenates the representations of two nodes  $v_{i}, v_{j}$  as the representation of the corresponding edge  $(i,j)$ , which can be formulated as
$$
\alpha_ {i j} = \operatorname {M L P} \left[ \left(\mathbf {z} _ {i}, \mathbf {z} _ {j}\right) \right], \tag {11}
$$
where  $[\cdot, \cdot]$  is the concatenation operator.
Based on  $\alpha$  and Formula (10), we obtain the probability matrix  $\mathbf{M}_{\mathbf{P}}$  whose elements indicate the existence of the corresponding edges. Next, we can sample the explanation  $G_{S}$  based on the probabilities in the matrix  $\mathbf{M}_{\mathbf{P}}$  as follows,
$$
G _ {S} = \left(\mathbf {X} _ {\mathbf {S}}, \mathbf {A} _ {\mathbf {S}} = \mathbf {M} _ {\mathbf {p}} \odot \mathbf {A}\right). \tag {12}
$$