Beyond Model Interpretability: On the Faithfulness and Adversarial Robustness of Contrastive Textual Explanations (2022)

Abstract: Contrastive explanation methods go beyond transparency and address the contrastive aspect of explanations. Such explanations are emerging as an attractive option to provide actionable change to scenarios adversely impacted by classifiers’ decisions. However, their extension to textual data is under-explored and there is little investigation on their vulnerabilities and limitations. This work motivates textual counterfactuals by highlighting the social limitations of non-contrastive explainability. We also lay the ground for a novel evaluation scheme inspired by the faithfulness of explanations. Accordingly, we extend the computation of three metrics, proximity, connectedness and stability, to textual data and we benchmark two successful contrastive methods, POLYJUICE and MiCE, on our suggested metrics. Experiments on sentiment analysis data show that the connectedness of counterfactuals to their original counterparts is not obvious in both models. More interestingly, the generated contrastive texts are more attainable with POLYJUICE which highlights the significance of latent representations in counterfactual search. Finally, we perform the first semantic adversarial attack on textual recourse methods. The results demonstrate the robustness of POLYJUICE and the role that latent input representations play in robustness and reliability.

## introduction with the unprecedented growing deployment of machine learning (ml) models in high-stake areas such as law enforcement and medicine, many concerns are raised about their black-box decisionmaking process. recently, transparency is becoming a momentous requirement for accountable ml bringing forth the concept of explainable ai (exai). exai is witnessing endeavors in all modalities and textual data in particular @xcite @xcite . however, such explanations might not be sufficient in critical areas where stronger guarantees and more fine-grained explanations are required. data controllers and subjects pose strong requirements on the usefulness aspect of explanations which implies a selective, contrastive and social process @xcite . the latter entails an interaction between the explainers and the explainees and human-understandable explanations @xcite . to this end, contrastive foot_1 explanations have seen a surge of interest as a main tool to reach recourse @xcite @xcite . those explanations search for optimally proximate alternative inputs that would result in a different, usually desired, prediction. they offer explanations that are tailored to the recipient's beliefs and comprehension capabilities. whilst there is a plethora of literature published on recourse methods applied on tabular datasets and computer vision applications @xcite @xcite , little is available on contrastive textual explanations. specifically, hand-crafted contrastive sets have been employed before to evaluate fairness and robustness of ml models @xcite by rewriting input instances @xcite and defining perturbation functions @xcite to obtain counterfactual sets. a novel, yet interesting, vein of research is considering an automated counterfactuals generation in nlp @xcite . the focus of our work is this largely under-explored targeted recourse methods for language data and their evaluation schemes. we highlight scenarios where non-recourse methods fall short of the usefulness aspect of explanation especially due to the blend of syntax and semantics in the words. additionally, we consider the assessment schemes, and we target a novel evaluation aspect of the plausibility and attainability aspect of the generated counterfactuals. we argue that counterfactuals should (1) meet textual attainability from a grammatical and semantic perspective, (2) convey connectedness to their original counterparts, and (3) satisfy local algorithmic stability. accordingly, we extend proximity, connectedness and stability, in the context of faithfulness, to textual data and we propose tangible measures to quantify them. we benchmark our metrics on a sentiment analysis task on two famous recourse methods @xcite . our results highlight the role that latent representations in @xcite play in robustness and plausibility. finally, we present the first study on the resilience of textual recourse methods in the context of adversarial attacks. the study demonstrates a significant improvement in the adversarial robustness of polyjuice over mice. our contribution falls under the following categories: ## faithfulness metrics none of the metrics discussed so far explicitly targets explanation faithfulness that has been studied in non-textual frameworks @xcite . in this work, we redefine faithfulness @xcite , in natural language settings, via three main requirements. explanation faithfulness entails that counterfactuals should be generated from a "possible" world which is proximate to the starting point specified by the user. this is formalized in two quantitative measures: proximity and connectedness @xcite inferring an attainable generation of counterfactuals based on the input distribution. moreover, faithfulness to the explainee engenders local stability of the explainer during the counterfactual generation process. ## validation of faithfulness we consider models with open source code, polyjuice, mice, and contrxt mainly. counterfactuals generated by contrxt are global which makes faithfulness not directly applicable as it evaluates specific (local) explanations. thus, we consider polyjuice and mice for our validation. we train both models on the imdb sentiment analysis task on nvidia k80/t4 gpu with 16gb ram. we consider restaurant reviews for sentiment analysis foot_2 with 977 validation instances. ## conclusion counterfactual methods go beyond interpretability and offer practical explanations that comply with the social and algorithmic aspects of explainability. in this work we chart the path towards contrastive methods in nlp with a common evaluation scheme inspired by faithfulness. we present the limitations of traditional explainability which are leveraged with recourse methods, in nlp mainly. we further define faithfulness of textual explanations and present corresponding computation schemes. our benchmarks on two famous methods, polyjuice and mice, show that better algorithmic stability and attainability are achieved in the former, highlighting the importance of latent representation in the counterfactual search strategy. we highlight the vulnerabilities of textual recourse methods against semantic adversarial attacks. three immediate steps in this line of work are the mitigation of the "unconnected" counterfactuals by posing connectedness constraints on the search strategy, the enhancement of the stability when textual edits are employed, and the investigation of textual attacks on recourse methods.