SlowGuess/NeurIPS_2023_OCR huggingface dataset:
To better generalize to large datasets and reduce the computational complexity, we provide a simplified version of OAR called SimOAR in this section. Compared with OAR, SimOAR achieves a significant improvement in computational efficiency at the expense of a small amount of performance degradation. Concretely, SimOAR is mainly motivated by three empirical inferences after executing OAR:
- The most time-consuming part of OAR is its preparatory work, i.e., training OOD reweighting block, especially for large datasets. For example, on the dataset MNIST superpixels [38] containing 70,000 graphs, the converged process of VGAE occupies  $93.7\%$  of OAR's execution time.
- In the course of generating  $\mathcal{G}'$ , the number of perturbation operations is roughly proportional to the degree of distribution shift given by the OOD block. For example, the graph  $\mathcal{G}_1'$  created via deleting one edge typically gets a higher OOD score than the graph  $\mathcal{G}_2'$  created via deleting five edges.
- For two generated graphs generated via the same perturbation times, they generally get similar reconstruction losses and are assigned similar OOD scores.
Based on these, to expedite computations and simplify the OAR, we deactivate the OOD reweighting block (i.e., deleting all the sketches in gray dotted boxes in Figure 2) in OAR. As compensation for data distribution, we restrict the ratio of the number of perturbations to the number of edges in the original graph  $\mathcal{G}$  to a pre-defined minor value  $R$ . Since the generated graphs typically share similar reconstruction losses and OOD scores while  $R$  is fixed, we directly calculate their average prediction to approximate their excepted prediction. The pseudocode and more implementation details of SimOAR are provided in Appendix A.
It is worth noting that despite the potential existence of a few generated graphs  $\mathcal{G}'$  in SimOAR that fall outside the distribution, the performance of SimOAR still significantly surpasses that of current evaluation methods w.r.t consistency with both metrics based on ground truth and human supervision. Hence, in light of the efficiency of the SimOAR, we strongly advocate for its adoption as a predominant alternative to prevalent removal-based evaluation metrics. At the heart of SimOAR – and a central thesis of this paper – is the perspective that, during evaluation, rather than deleting all non-explanatory nodes and then gauging the resultant output variations, it is more insightful to randomly delete a portion of the non-explanatory nodes multiple times and then gauge the average output variations.
We present empirical results to demonstrate the effectiveness of our proposed methods OAR and SimOAR. The experiments aim to investigate the following research questions:
- RQ1: How is the evaluation quality of OAR and SimOAR compared to that of existing metrics?
- RQ2: How is the generalization of OAR and SimOAR compared to that of existing metrics?
- RQ3: What is the impact of the designs (e.g., the OOD reweighting block) on the evaluations?
Table 1: Overall evaluation scores and rankings of explainers under different evaluation methods. Symbol  $(\cdot)$  indicates the rank of explainers. Our methods, i.e., OAR and SimOAR are bold and the best-performing methods are denoted with the superscript asterisk.
SA	GradCAM	GNNExplainer	PGExplainer	CXPlain	ReFine	τ↑
BA3	Recall	88.12±0.00(1)	84.53±0.00(2)	76.83±4.64(3)	65.32±5.21(5)	54.77±4.42(6)	72.90±3.72(4)	-
RM	35.39±0.00(3)	37.67±0.00(4)	43.32±1.97(1)	29.25±2.26(5)	27.78±0.96(6)	41.24±1.55(2)	0.73
DSE	43.08±2.31(1)	41.38±1.75(2)	22.25±2.14(6)	37.92±2.52(3)	24.60±3.57(5)	29.31±2.96(4)	0.73
OAR	93.12±4.60(1)	86.20±3.76(2)	80.19±1.68(3)	65.48±3.75(5)	59.69±2.98(6)	71.02±4.45(4)	1.00*
SimOAR	84.39±5.70(1)	83.44±4.81(2)	62.52±2.25(3)	50.02±2.87(6)	55.49±4.22(5)	60.42±3.32(4)	0.93
TR3	Recall	82.08±0.00(1)	77.00±0.00(2)	60.09±4.97(4)	55.85±4.70(5)	44.39±5.57(6)	74.19±3.30(3)	-
RM	55.08±0.00(3)	51.15±0.00(4)	79.08±4.31(1)	50.45±2.04(5)	47.72±3.82(6)	64.60±2.27(2)	0.67
DSE	48.51±1.00(1)	37.32±2.35(4)	44.82±2.90(2)	33.71±3.72(6)	35.65±1.92(5)	39.49±3.31(3)	0.73
OAR	95.23±3.75(1)	87.51±6.65(2)	72.63±5.89(3)	59.06±4.83(5)	51.61±3.14(6)	63.82±5.43(4)	0.93*
SimOAR	88.45±6.04(1)	76.37±4.54(2)	53.54±4.46(6)	68.58±5.80(4)	62.98±4.00(5)	75.59±4.27(3)	0.86
MNIST-sp	Recall	43.98±0.00(3)	44.39±0.00(4)	54.63±0.96(1)	30.13±1.42(6)	38.96±2.62(5)	47.88±1.60(2)	-
RM	21.34±0.00(4)	19.10±0.00(5)	22.23±1.02(3)	25.04±0.35(2)	27.15±0.69(1)	17.58±0.50(6)	0.33
DSE	30.37±4.06(2)	29.19±2.19(3)	14.03±1.77(6)	28.45±2.65(1)	22.95±2.44(4)	21.32±1.29(5)	0.20
OAR	66.28±2.46(3)	64.18±5.25(4)	82.22±4.13(1)	63.88±3.45(5)	51.37±1.76(6)	75.43±4.84(2)	0.93*
SimOAR	54.72±3.84(4)	69.86±2.80(3)	79.69±3.53(1)	33.27±2.04(6)	52.93±3.26(5)	76.40±2.24(2)	0.93*
MUTAG	Recall	41.12±0.00(6)	44.44±0.00(5)	55.95±4.94(4)	71.22±2.54(2)	64.65±1.50(3)	77.73±3.67(1)	-
RM	75.60±0.00(5)	77.39±0.00(6)	82.32±4.37(2)	87.11±2.59(1)	76.49±3.51(4)	81.76±2.64(3)	0.73
DSE	38.03±3.90(4)	32.36±2.40(5)	40.28±1.32(3)	49.18±2.57(1)	29.06±1.44(6)	43.19±2.14(2)	0.67
OAR	52.10±3.58(6)	53.19±3.87(5)	63.35±2.50(4)	88.46±2.43(2)	67.19±2.08(3)	92.81±5.24(1)	1.00*
SimOAR	75.45±2.51(5)	71.07±5.40(6)	85.65±4.00(2)	81.48±2.98(3)	76.32±3.88(4)	89.40±5.06(1)	0.80
3.1 Experimental settings
To evaluate the effectiveness of our method, we utilize four benchmark datasets: BA3 [39], TR3 [17], Mutagenicity [40, 41], and MNIST-sp [38], which are publicly accessible and vary in terms of domain and size. Moreover, to generate the explanations of the graphs in the datasets mentioned above, we adopt several state-of-the-art post-hoc explanation methods, i.e., SA [10], GradCAM [42], GNNExplainer [11], PGExplainer [43], CXPlain [44] and ReFine [39]. The prevailing metrics — removal-based evaluation (RM for short) and generation-based evaluation, i.e., DSE [17] — are selected as the baselines. Detailed experimental details can be found in Appendix B.
3.2 Measurement metric
We elaborate on the measurement metric of existing evaluation methods in this part since how to fairly define the quality of an evaluation method is critical to our research.
Ground-truth explanations. We first follow the prior studies [11, 45, 43] and treat the subgraphs coherent to data generation procedure or human knowledge as ground truth. Although ground truth might not conform to the decision-making process exactly, it contains sufficient discriminative information to help justify the quality of explanations. Moreover, it's worth emphasizing again that our method does not depend on ground truth, and gathering ground truth is only for fair comparison.
Consistency with metric based on ground-truth explanations. Specifically, given a to-be-evaluated subgraph  $\mathcal{G}_s$  and its corresponding ground-truth explanation  $\mathcal{G}_s^{GT}$ , we use Recall as the gold evaluation metric defined as  $\mathrm{Recall}(\mathcal{G}_s) = |\mathcal{E}_s \cap \mathcal{E}_s^{GT}| / |\mathcal{E}_s^{GT}|$ , where  $\mathcal{E}_s$  and  $\mathcal{E}_s^{GT}$  are the edge set of  $\mathcal{G}_s$  and  $\mathcal{G}_s^{GT}$ ;  $|\cdot|$  denotes the cardinal function of set. Hence, for any evaluation method, we can calculate its consistency with Recall to quantify its performance via Kendall correlation  $\tau$  [46] defined as:
$$
\tau \left(\left\{r ^ {i} \right\} _ {i = 1} ^ {n}, \left\{s ^ {i} \right\} _ {i = 1} ^ {n}\right) = \frac {2}{n (n + 1)} \sum_ {i <   j} I \left(\operatorname {s g n} \left(r ^ {i} - r ^ {j}\right) = \operatorname {s g n} \left(s ^ {i} - s ^ {j}\right)\right), \tag {6}
$$
where  $\{r^i\}_{i=1}^n$  and  $\{s^i\}_{i=1}^n$  are a pair of Recall values and evaluation scores;  $\operatorname{sgn}(\cdot)$  is the sign function and  $I(\cdot)$  is the indicator function. The bigger  $\tau$  is, the higher the evaluation scores are consistent with Recall values, and thus the better the evaluation method is.
Consistency with human intuition. The consistency between evaluation results and human intuition is also an important reference. In view of the high subjectivity of human intuition, we organized a large-scale user study engaging 100 volunteers. Results are shown in Appendix C.
(a) Correlation between evaluation metrics and Recall
Figure 3: The performance of various evaluation metrics. (a) Correlation between metrics and Recall across various backbone explainers, where the vertical axis represents the normalized Kendall rank correlation. (b) Consistency between Recall and the scores provided by metrics. The more monotonously increasing the curve is, the better the evaluation metric is. Best viewed in color.
(b) Consistency between Recall and evaluation metrics
Limited by space, we further exhibit and discuss more detailed implementations and results in Appendix B, including but not limited to the generalization of OAR involving the evaluation of the post-hoc explanations for node classification task and the inherent explanations.
3.3 Study of explanation evaluation (RQ1)
As a preparation for the experiments, we first collect the explanatory subgraphs  $\{\mathcal{G}_s^i\}$  for a set of graphs  $\{\mathcal{G}^i\}_{i=1}^N$  and the corresponding well-trained GNN model  $f$ . We denote the evaluation score on  $\mathcal{G}_s^i$  based on RM, DSE and our OAR and SimOAR by  $s_{\mathrm{RM}}^i$ ,  $s_{\mathrm{DSE}}^i$ ,  $s_{\mathrm{OAR}}^i$  and  $s_{\mathrm{SimOAR}}^i$ , respectively. For more faithful comparison, we present both the explainer-level correlation defined as  $\tau_* = \tau \left( \left\{ \frac{1}{N} \sum_{i=1}^{N} \text{Recall}(\mathcal{G}_s^{i,h}) \right\}_{h \in \mathcal{H}}, \left\{ \frac{1}{N} \sum_{i=1}^{N} s_*^{i,h} \right\}_{h \in \mathcal{H}} \right)$  and the instance-level correlation defined as  $\tau_* = \tau \left( \left\{ \text{Recall}(\mathcal{G}_s^i) \right\}_{i=1}^N, \left\{ s_*^i \right\}_{i=1}^N \right)$ , where * can be RM, DSE, OAR, and SimOAR;  $\mathcal{G}_s^{i,h}$  means the subgraph  $\mathcal{G}_s^i$  is extracted by explainer  $h$ ,  $\mathcal{H}$  is the set of explainers. The explainer-level results, under all evaluation methods, on all datasets, are presented in Table 1. Moreover, considering the instance-level results share a similar tendency, we presented the representative results on BA3 and MNIST-sp in Figure 3 (a). According to Table 1 and Figure 3 (a) we can find that:
- Observation 1: OAR outperforms other methods in all cases. Substantially, Kendall rank correlation greatly improves after leveraging the paradigm of adversarial robustness. The most notable case is the explainers' rank on BA3 and MUTAG, where  $\tau^{*} = 1.00$  achieves a tremendous increase from the RM and the DSE. It demonstrates the effectiveness and universality of OAR/SimOAR and verifies that OAR/SimOAR can be leveraged to boost the quality of evaluations.
- Observation 2: SimOAR performs a little worse than OAR, but still significantly improves over the strongest baselines. To be more specific, the average score of SimOAR is  $7.83\%$  less than that of OAR, but still,  $42.62\%$  higher than RM and  $37.45\%$  higher than DSE. It demonstrates that SimOAR is adequate for the task of explanation evaluations in most cases.
Further analysis of the results presented in Table 1 reveals that:
- Observation 3: OAR/SimOAR presents a more fair and faithful comparison among explainers. The rankings provided by the OAR and SimOAR are highly consistent (i.e.,  $\tau^{*} = 0.928$  on average) with the references, while the removal- and generation-based rankings unsurprisingly pale by comparison. These empirical results give us the courage to leverage OAR and SimOAR to evaluate emerging explanation methods in the future.
3.4 Study of generalization (RQ2)
Although the experiment provided in 3.3 is detailed and fair, we contend that the generalization of OAR and SimOAR is still unexamined. Specifically, a specific explainer always has a preference
for certain patterns, and thus the explanatory subgraphs extracted by it often have similar structures. Therefore, the experimental results based on limited explainers may not generalize well to other existing or future explainers, especially those based on different lines of thought.
As it is impractical for us to cover all these explainers, we resort to directly generalizing the to-be-evaluated subgraphs. That is, we make use of fake explanatory subgraphs which are randomly sampled from the full graph. The detailed sampling algorithm and settings can be found in Appendix C. In these settings, the best case is that the evaluation score is monotonically increasing w.r.t. the Recall level, which indeed reaches the best consistency. Average normalized scores under all evaluation methods are shown in Figure 3 (b), which indicate that:
- Observation 4: OAR/SimOAR greatly improves the consistency between evaluation scores and Recalls, which indicates that our method has tremendous potential to perform well on other explainers. Conversely, removal- and generation-based methods are negatively correlated with the importance involving the set of to-be-evaluated subgraphs which get high Recalls.
3.5 Study of designs (RQ3)
Effectiveness of OOD block. We first focus on the effectiveness of the OOD block. The most immediate impact of OOD block on OAR can be estimated by comparing the performance of OAR and SimOAR, which can be also deemed as the ablation experiments. Hence, we turn to qualitatively analyze the OOD block via some case studies shown in Figure 4, where all the OOD scores belonging to the same datasets are normalized to the range of 0 to 1. Based on the information conveyed in Figure 4, the following observation can be made:
Figure 4: Case studies for OOD reweighting block with the graphs randomly selected from datasets MNIST-sp, MUTAG, and BA3 arranged from top to bottom. Best viewed in color.
- Observation 5: OOD block can assign the lower weights to the subgraph which violent the underlying properties of the full graph. For example, graph properties of chemical molecules, such as the valency rules, impose some constraints on syntactically valid
molecules. Hence, the invalid molecular subgraphs, which destroy the integrity of the carbon ring by simply removing some bonds (edges) or atoms (nodes) are assigned low scores by the OOD block.
Time complexity. To further explore the efficiency of our evaluation method and the designed module in it, we count the running time of the evaluation process on every single graph and average the time over the entire test set to obtain per-graph time consumption. The comparison is provided in Table 2. According to Table 2 we can find that:
Table 2: Per-graph time consumption. (ms)
BA3	TR3	MNIST-sp	MUTAG
RM	0.11±0.02	0.10±0.01	0.15±0.03	0.13±0.01
DSE	1.73±0.27	1.60±0.14	2.12±0.39	1.88±0.25
OAR	1.16±0.05	1.32±0.06	1.77±0.10	1.78±0.03
SimOAR	0.84±0.07	0.65±0.08	1.03±0.07	0.96±0.06
- Observation 6: SimOAR greatly reduces the execution time. Concretely, the execution speed has nearly doubled after leveraging the metric of SimOAR. This significant improvement in efficiency corresponds to the original intention of SimOAR and verifies the success of SimOAR's design.
4 Related Work & Further Discussion
OAR & Contemporary Evaluation Metrics. Apart from the qualitative evaluation methods based on human intuition, recent literature categorizes quantitative metrics into four primary categories: accuracy, faithfulness, stability, and fairness [47, 48, 49, 50, 51, 52]. Notably, Precision and Recall metrics align with the accuracy category, while our proposed OAR and SimOAR fall under the faithfulness category. Among these methods, the most recently proposed faithfulness metric is GEF [49], which however omits quantification of the distribution shift in subgraphs. Nevertheless, we
have exhibited the experimental comparison between GEF and our metrics w.r.t the latest dataset SHAPEGGEN [49] in Appendix B.
OOD & GNNs Explainability The OOD issue is one of the most critical challenges in the post-hoc explainability domain currently [16, 53]. To sidestep this challenge, many studies have pivoted towards the development of inherently explainable GNNs [15, 54]. Notwithstanding the complexity of the task, efforts such as FIDO [55] are making significant successes in addressing the OOD problem within post-hoc explanations. Concurrently, CGE [56] leverages the lottery ticket hypothesis [57, 58, 59, 60, 61] to craft the cooperative explanation for both GNNs and graphs, wherein the OOD challenge is potentially mitigated through the EM algorithm. GIBE [62] delves into the intersection of the OOD issue and regularization, viewing it through the lens of information theory. Furthermore, MixupExplainer [63] and CoGE [64] navigate the OOD problem from the generation and recognition stances, respectively.
Simultaneously, the evaluation of inherent explanations encounters the same hurdles as post-hoc explanations: it's challenging to quantify in the absence of the ground truth. Fortunately, by introducing an additionally well-trained GNN, OAR can be employed to evaluate inherent explanations in a similar way to evaluate post-hoc explanations. The experimental results are shown in Appendix B.
Limitations & Concerns. While we acknowledge the effectiveness of our methods, we also recognize their limitations. Concretely, despite utilizing SimOAR to expedite the evaluation process, our paradigm remains more time-intensive compared to the conventional removal-based metric. To overcome this constraint, a probable solution is summarizing the optimal number of perturbations and implementing a self-adaptive extraction module to select the perturbed features.
Furthermore, we recognize potential apprehensions regarding the migration of trust issues from the black-box GNN to the equally non-transparent VGAE. Nevertheless, we posit that the repercussions of this are substantially mitigated in our streamlined method. Specifically, SimOAR bypasses VGAE in favor of employing transparent heuristics for perturbation generation, effectively addressing the aforementioned trust concerns. It's noteworthy that, while SimOAR's performance may be marginally below or comparable to OAR's, it consistently exceeds other benchmarks. This emphasizes VGAE's restrained impact and reaffirms our recommendation of SimOAR over OAR.
In this paper, we explored the evaluation process of GNN explanations and proposed a novel evaluation metric, OOD-resistant adversarial robustness (OAR). OAR gets inspiration from the notion of adversarial robustness and evaluates the quality of explanations by calculating their robustness under attack. It addresses the inherent limitations of current removal- and generation-based evaluation metrics by taking both data distribution and GNN behavior into account. For applications involving large datasets, we introduce a simplified version of OAR (SimOAR), which achieves a significant increase in computational efficiency at the cost of a small amount of performance degradation. This work represents an initial attempt to exploit evaluation metrics for post-hoc GNN explainability from the perspective of adversarial robustness and resistance to OOD.
This work is primarily foundational in GNN explainability, focusing on the development of a more reliable evaluation algorithm. Its primary aim is to contribute to the academic community by enhancing the understanding and implementation of the evaluation process. We do not foresee any direct, immediate, or negative societal impacts stemming from the outcomes of our research.
This work was supported by the National Natural Science Foundation of China (9227010114, 62121002) and the University Synergy Innovation Program of Anhui Province (GXXT-2022-040).
[1] Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. CoRR, abs/2003.00982, 2020.
[56] Junfeng Fang, Xiang Wang, An Zhang, Zemin Liu, Xiangnan He, and Tat-Seng Chua. Cooperative explanations of graph neural networks. In WSDM, pages 616-624. ACM, 2023.
[57] Ari S. Morcos, Haonan Yu, Michela Paganini, and Yuandong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. In NeurIPS, pages 4933-4943, 2019.
[58] Kun Wang, Yuxuan Liang, Pengkun Wang, Xu Wang, Pengfei Gu, Junfeng Fang, and Yang Wang. Searching lottery tickets in graph neural networks: A dual perspective. In The Eleventh International Conference on Learning Representations, 2022.
[59] Yongduo Sui, Xiang Wang, Jiancan Wu, Min Lin, Xiangnan He, and Tat-Seng Chua. Causal attention for interpretable and generalizable graph classification. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 1696-1705, 2022.
[60] Tianlong Chen, Yongduo Sui, Xuxi Chen, Aston Zhang, and Zhangyang Wang. A unified lottery ticket hypothesis for graph neural networks. In ICML, pages 1695-1706, 2021.
[61] Yanfang Wang, Yongduo Sui, Xiang Wang, Zhenguang Liu, and Xiangnan He. Exploring lottery ticket hypothesis in media recommender systems. International Journal of Intelligent Systems, 37(5):3006-3024, 2022.
[62] Junfeng Fang, Wei Liu, An Zhang, Xiang Wang, Xiangnan He, Kun Wang, and Tat-Seng Chua. On regularization for explaining graph neural networks: An information theory perspective. 2022.
[63] Jiaxing Zhang, Dongsheng Luo, and Hua Wei. Mixupexplainer: Generalizing explanations for graph neural networks with data augmentation. In KDD, pages 3286-3296. ACM, 2023.
[64] Lukas Faber, Amin K. Moghaddam, and Roger Wattenhofer. Contrastive graph neural network explanation. CoRR, abs/2010.13663, 2020.
[65] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
[66] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. CoRR, abs/1710.10903, 2017.
[67] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR. OpenReview.net, 2019.
Algorithm 1 presents the pseudocode of the evaluation process of our proposed method OAR. The pseudocode of SimOAR can be obtained by removing the line 1, 6, and 8 and simply modifying line 9 into “ $s \gets \frac{1}{N_{adv}} \sum_{i} y^{(i)}$ .” For clarity, we put the step of feeding adversarial graph  $\mathcal{G}'^{(i)}$  into the target GNN and the VGAE under the for-loop. However, when implementing in real code, we can batch all those  $N_{adv}$  adversarial graphs and feed them at one time, after the sampling process is finished, to expedite computation. Meanwhile, Algorithm 2 presents the sampling process of fake explanatory subgraphs for general evaluation.
Algorithm 1 Evaluation Process of OAR
Input: Trained GNN  $f$ ; To-be-evaluated subgraph  $\mathcal{G}_s$  and its corresponding original graph  $\mathcal{G}$  and dataset  $\mathcal{D}$ ; Perturbation ratio  $R$ ; Number of adversarial graphs  $N_{adv}$   
Output: Evaluation score  $s$   
1: Train a standard VGAE on  $\mathcal{D}$  according to [19].  
2:  $c \gets \arg \max_i f(\mathcal{G})_i$ .  
3: for  $i = 1, 2, \ldots, N_{adv}$  do  
4:  $\mathcal{G}^{(i)} \gets$  randomly deleting  $\lfloor R \cdot |\mathcal{E}_{\mathcal{G}}|\rfloor$  edges from  $\mathcal{G}$  while fixing  $\mathcal{G}_s$ .  
5:  $y^{(i)} \gets f(\mathcal{G}^{(i)})_c$ .  
6:  $\mathcal{L}_{recon}^{(i)} \gets$  calculated according to Equation 5 using the trained VGAE.  
7: end for  
8:  $w_{OOD}^{(i)} \gets \frac{1 / \mathcal{L}_{recon}^{(i)}}{\sum_j 1 / \mathcal{L}_{recon}^{(j)}}, i = 1, 2, \ldots, N_{adv}$ .  
9:  $s \gets \sum_i w_{OOD}^{(i)} \cdot y^{(i)}$ .