What are contrastive explanation and how has it been applied to solve NLP tasks?
Contrastive explanations clarify why an event occurred in contrast to another, which are inherently intuitive to humans to both produce and comprehend (Jacovi et al., 2021). Compared to other explanations, Miller (2019) first suggests contrastive explanations are more effective in human learning. While Liang et al. (2020) first leverage expert annotated contrastive explanations for active learning to improve data efficiency, Jacovi et al. (2021)
propose a method to produce contrastive explanations automatically in the latent space via input token/span for 3-label classification. Meanwhile, Chen et al. (2021) generate contrastive explanation with counterfactual examples for natural language inference. Different from Paranjape et al. (2021) uses human templates to prompt PLMs to generate contrastive explanations, we focus on generating contrastive explanation with retrieved symbolic knowledge to distinguish the candidates before prediction, which is ignored in previous works.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Many commonsense reasoning NLP tasks involve choosing between one or more possible answers to a question or prompt based on knowledge that is often implicit. Large pretrained language models (PLMs) can achieve near-human performance on such tasks, while providing little human-interpretable evidence of the underlying reasoning they use. In this work, we show how to use these same models to generate such evidence: inspired by the contrastive nature of human explanations, we use PLMs to complete explanation prompts which contrast alternatives according to the key attribute(s) required to justify the correct answer (for example, peanuts are usually salty while raisins are sweet). Conditioning model decisions on these explanations improves performance on two commonsense reasoning benchmarks, as compared to previous non-contrastive alternatives. These explanations are also judged by humans to be more relevant for solving the task, and facilitate a novel method to evaluate explanation faithfulfness.
[{"first":"Bhargavi","last":"Paranjape","middle":[]},{"first":"Julian","last":"Michael","middle":[]},{"first":"Marjan","last":"Ghazvininejad","middle":[]},{"first":"Luke","last":"Zettlemoyer","middle":[]},{"first":"Hannaneh","last":"Hajishirzi","middle":[]}]
ALICE: Active Learning with Contrastive Natural Language Explanations
Training a supervised neural network classifier typically requires many annotated training samples. Collecting and annotating a large number of data points are costly and sometimes even infeasible. Traditional annotation process uses a low-bandwidth human-machine communication interface: classification labels, each of which only provides several bits of information. We propose Active Learning with Contrastive Explanations (ALICE), an expert-in-the-loop training framework that utilizes contrastive natural language explanations to improve data efficiency in learning. ALICE learns to first use active learning to select the most informative pairs of label classes to elicit contrastive natural language explanations from experts. Then it extracts knowledge from these explanations using a semantic parser. Finally, it incorporates the extracted knowledge through dynamically changing the learning model's structure. We applied ALICE in two visual recognition tasks, bird species classification and social relationship classification. We found by incorporating contrastive explanations, our models outperform baseline models that are trained with 40-100% more training data. We found that adding 1 explanation leads to similar performance gain as adding 13-30 labeled training data points.
[{"first":"Weixin","last":"Liang","middle":[]},{"first":"James","last":"Zou","middle":[]},{"first":"Zhou","last":"Yu","middle":[]}]
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Existing knowledge-enhanced methods have achieved remarkable results in certain QA tasks via obtaining diverse knowledge from different knowledge bases. However, limited by the properties of retrieved knowledge, they still have trouble benefiting from both the knowledge relevance and distinguishment simultaneously. To address the challenge, we propose CPACE, a Concept-centric Prompt-bAsed Contrastive Explanation Generation model, which aims to convert obtained symbolic knowledge into a contrastive explanation for better distinguishing the differences among given candidates. Firstly, following previous works, we retrieve different types of symbolic knowledge with a concept-centric knowledge extraction module. After that, we generate corresponding contrastive explanations using acquired symbolic knowledge and explanation prompts as guidance for better modeling the knowledge distinguishment and interpretability. Finally, we regard the generated contrastive explanation as external knowledge for downstream task enhancement. We conduct a series of experiments on three widely-used question-answering datasets: CSQA, QASC, and OBQA. Experimental results demonstrate that with the help of generated contrastive explanation, our CPACE model achieves new SOTA on CSQA (89.8% on the testing set, 0.9% higher than human performance), and gains impressive improvement on QASC and OBQA (4.2% and 3.5%, respectively).
[{"first":"Qianglong","last":"Chen","middle":[]},{"first":"Guohai","last":"Xu","middle":[]},{"first":"Ming","last":"Yan","middle":[]},{"first":"Ji","last":"Zhang","middle":[]},{"first":"Fei","last":"Huang","middle":[]},{"first":"Luo","last":"Si","middle":[]},{"first":"Yin","last":"Zhang","middle":[]}]
Contrastive Explanations for Model Interpretability
Contrastive explanations clarify why an event occurred in contrast to another. They are inherently intuitive to humans to both produce and comprehend. We propose a method to produce contrastive explanations in the latent space, via a projection of the input representation, such that only the features that differentiate two potential decisions are captured. Our modification allows model behavior to consider only contrastive reasoning, and uncover which aspects of the input are useful for and against particular decisions. Our contrastive explanations can additionally answer for which label, and against which alternative label, is a given input feature useful. We produce contrastive explanations via both high-level abstract concept attribution and low-level input token/span attribution for two NLP classification benchmarks. Our findings demonstrate the ability of label-contrastive explanations to provide fine-grained interpretability of model decisions.
[{"first":"Alon","last":"Jacovi","middle":[]},{"first":"Swabha","last":"Swayamdipta","middle":[]},{"first":"Shauli","last":"Ravfogel","middle":[]},{"first":"Yanai","last":"Elazar","middle":[]},{"first":"Yejin","last":"Choi","middle":[]},{"first":"Yoav","last":"Goldberg","middle":[]}]
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In order to better understand the reason behind model behaviors (i.e., making predictions), most recent works have exploited generative models to provide complementary explanations. However, existing approaches in NLP mainly focus on “WHY A” rather than contrastive “WHY A NOT B”, which is shown to be able to better distinguish confusing candidates and improve data efficiency in other research fields.In this paper, we focus on generating contrastive explanations with counterfactual examples in NLI and propose a novel Knowledge-Aware Contrastive Explanation generation framework (KACE).Specifically, we first identify rationales (i.e., key phrases) from input sentences, and use them as key perturbations for generating counterfactual examples. After obtaining qualified counterfactual examples, we take them along with original examples and external knowledge as input, and employ a knowledge-aware generative pre-trained language model to generate contrastive explanations. Experimental results show that contrastive explanations are beneficial to fit the scenarios by clarifying the difference between the predicted answer and other possible wrong ones. Moreover, we train an NLI model enhanced with contrastive explanations and achieves an accuracy of 91.9% on SNLI, gaining improvements of 5.7% against ETPA (“Explain-Then-Predict-Attention”) and 0.6% against NILE (“WHY A”).
[{"first":"Qianglong","last":"Chen","middle":[]},{"first":"Feng","last":"Ji","middle":[]},{"first":"Xiangji","last":"Zeng","middle":[]},{"first":"Feng-Lin","last":"Li","middle":[]},{"first":"Ji","last":"Zhang","middle":[]},{"first":"Haiqing","last":"Chen","middle":[]},{"first":"Yin","last":"Zhang","middle":[]}]
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Pretrained Language Models (PLMs) (Raffel et al., 2020;Lewis et al., 2020;Radford et al., 2019;Brown et al., 2020) have been shown to encode substantial amounts of knowledge in their parameters (Petroni et al., 2019;Talmor et al., 2020;Roberts et al., 2020) and have achieved impressive performance on commonsense reasoning (CSR) tasks without the use of external knowledge (Trinh and Le, 2018;Yang et al., 2020). However, these models provide little human-interpretable evidence of the intermediate commonsense knowledge or reasoning they use, and have been observed to overly rely on superficial dataset artifacts (Poliak et al., 2018;Geva et al., 2019). To overcome this limitation, recent work has shown that PLMs can i) I picked up a bag of peanuts and raisins for a snack. I wanted a sweeter snack out so I ate the for now. Contrastive Expl. -Peanuts are salty while raisins tend to be sweet.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
ii) The geese prefer to nest in the fields rather than the forests because in the predators are more hidden. Contrastive Expl. -Forests are denser than fields Table 1: Examples of Winograd Schema Instances where the correct and incorrect answer choices are highlighted in blue and red respectively. Choices are contrasted along attributes like taste (for i) and density of vegetation (for ii) by humans to explain why they prefer some answer choice. explain themselves by generating free-form natural language explanations of their reasoning patterns (Rajani et al., 2019a;Camburu et al., 2018;Narang et al., 2020). However, the space of possible free-form explanations is incredibly large, inherently ambiguous, and difficult to annotate or evaluate (Wiegreffe et al., 2020;Latcinnik and Berant, 2020). Furthermore, quantifying the model's dependence on free-form explanations is also challenging (Camburu et al., 2020). We address these challenges by proposing an unsupervised method that uses contrastive prompts, which require the model to explicitly contrast different possible answers in its explanation (Table 1).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Our approach is based on a key observation: Many commonsense reasoning tasks require the comparison or contrast of plausible alternatives along a distinguishing attribute. For instance, in Table 1, the differentiating attributes for the two answer choices maybe taste (for i) and vegetation density (for ii). People commonly use contrastive explanations to explain their reasoning (Miller, 2018). Rather than asking "Why P?", they ask "Why P rather than Q?", where Q may be implicit from the context. For example, instead of justifying why raisins are the appropriate choice, people tend to ex-plain why they are more likely than peanuts. Miller (2018) also argues that such contrastive explanations are computationally efficient, as they only require focusing on the limited set of reasons that might make one answer more likely than the other instead of exhaustively enumerating all possible reasons for an answer. For instance, the raisin's taste (not its size, temperature, etc.) in Table 1 is adequate to explain why it is the best answer.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Our goal is to enable PLMs that explain their predictions to similarly benefit from such constraints. We develop a small set of contrastive generation prompts that can be in-filled by a PLM such as T5 (Raffel et al., 2020) or BART (Lewis et al., 2020) (see Table 3). These templates are designed to cover a multitude of language patterns used by humans to compare and contrast entities. Another PLM then conditions on both the original input and the generated contrastive explanation, to predict the final answer. This approach is inspired by Shwartz et al. (2020), who also use textual prompts to query the PLM with clarification questions. However, their prompts are generic while we prompt for instance-specific information.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Our approach shows quantitative improvements in task performance over two existing methods for model explainability (Shwartz et al., 2020;Latcinnik and Berant, 2020), for two commonsense reasoning tasks: the Winograd Schema Challenge (Levesque et al., 2012) and multiple-choice question answering about physical commonsense (Bisk et al., 2020). Our gains in the zero-shot setting are especially notable, outperforming the best reported results on publicly available PLMs and improving over Shwartz et al. (2020) by up to 11%. We also show, through human evaluations, that contrastive explanations are deemed more useful for solving the original task compared to generic clarification questions. Finally, contrastive explanations can be semantically perturbed to quantify the model's dependence on them by flipping the contrast in the explanation to support the foil, facilitating quantification of model faithfulness. 1
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Human-Authored Contrastive Explanation Winograd Schema 1. The party was more interesting and uplifing than the • Parties are for celebrating while funerals are for mourning funeral because the was rigid.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
• People wear colorful clothes at parties and black at funerals 2. The geese prefer to nest in the fields rather than the • Forests are dense while fields are sparse forests because in the predators are more hidden.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
• Forests have more predators than fields.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
PIQA 1. How do you get strong hamstrings?
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
• Hamstrings are located in the legs while biceps are located in (a) work out your upper body (b) work out your legs the upper body 2. How do you flood a room?
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
• Filling it with objects can clutter a room while filling it (a) fill it with objects (b) fill it with water with water floods the room. Table 2: Examples of commonsense tasks that can be explained using contrastive language and some contrastive explanations authored by in-house annotators. The Fact and Foil are marked in the input.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We present the theory of contrastive explanations adopted in this work (Section 3.1) and the intuition behind using them for commonsense reasoning tasks (Section 3.2).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
A contrastive explanation is generally defined as an answer to a counterfactual question of the form "Why P rather than Q?" for two potential hypotheses P and Q that can follow from some event E. It explains why some fact P occurred instead of some foil Q, where Q can be implicit (Hesslow, 1988;Lipton, 1990;Miller, 2019). A good contrastive explanation points to differences between the fact and foil with regard to certain attributes, not just conveying that the fact has a certain attribute. Table  1 shows examples of contrastive explanations that differentiate between peanuts and raisins (on the basis of taste) or forests and fields (on the basis of vegetation densities) to explain the more probable answers to Winograd Schema instances. Previous studies (Miller, 2019) in philosophy, psychology, and cognitive science show that humans use such contrastive explanations when explaining their decisions to each other. Importantly, Miller (2018) also argues that contrastive explanations are computationally efficient -exhaustively describing all causes for the occurrence of an event P is harder than only enlisting causes for why another event Q did not occur instead of P .
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Many recently proposed commonsense reasoning tasks are framed in a multiple-choice format that facilitates contrastive explanation (see Table 2). In this study, we focus on the following two tasks.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
The Winograd Schema Challenge (Levesque et al., 2012, WSC) is a pronoun coreference resolution task designed as a hard benchmark for evaluating everyday knowledge and commonsense reasoning (Zhang et al., 2020). For instance, in the sentence "The city councilmen refused the demonstrators a permit because they feared violence," the pronoun they must be disambiguated between fact (the city councilmen) and foil (the demonstrators). Both fact and foil are explicit in such sentences.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
The Physical Interaction Question Answering (Bisk et al., 2020, PIQA) challenge is designed to test knowledge of physical commonsense. PIQA requires choosing between which one of two solutions is a better way of achieving a goal posed as a question (see Table 2). PIQA questions relate to physical properties of entities, their affordances, and how they can be manipulated. The fact and foil are explicit in the two solutions, which typically differ from one another by a short noun phrase.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
To validate our intuition that contrastive reasoning is instrumental in these tasks, we performed a pilot study with 10 annotators over 100 commonsense questions from Winogrande and PIQA. We instructed them to answer the questions and explain their reasoning, but gave no specific instructions about what the explanations should look like. Examples are shown in Table 2. In 76% of Winogrande and 64% of PIQA examples, annotators explicitly contrasted the fact and foil. The frequent use of certain phrase structures, like P are while Q are , strongly informed our method for generating them (Section 4).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We assume the input to a commonsense reasoning problem consists of a textual context c which contains a placeholder , and two marked answer Prompt Pattern
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Personal Characteristics =⇒ P likes/likes to while Q likes/likes to Megan said it would be liberating to go out without makeup like P likes/likes to while Q does not like/like to Elena does since never wore makeup P prefers/prefers to while Q prefers Explanation: Elena likes to be natural while Q prefers while P does not prefer/prefer to Megan likes to wear lipstick Q thinks while P thinks/does not think Object Characteristics P is taller/shorter/smaller/larger/slower/faster than Q How to tie pieces of paper together? =⇒ P is/are while/but/however Q is/are (a) Thread ruler through the holes Q has/have while/but/however P has/have (b) Thread ribbon through the holes P has/have more/less than Q Explanation: Ruler is hard while a ribbon is P is/are than Q flexible Spatial/Temporal Contrast =⇒ P is inside/outside/above/below Q Emily looked up and saw Patricia racing by overhead. was on the is closer to P and farther away from Q ramp. P is to the right/left of Q Explanation: Emily is below Patricia Q takes longer to than P Use cases and causes P is used for Q To prepare the puff pastry for your pie, line a baking sheet with P is used to do Q parchment. Then =⇒ P is used for/to/in while Q is used for/to/in (a) Unroll the pastry, lay it over baking twine. Q is used while P is used (b) Unroll the pastry, lay it over fishing line. Q because while P because Explanation: Baking twine is used in Q can cause while P results in baking while fishing line is used in fishing choices a 1 and a 2 corresponding to the fact and foil ( Table 2, left column). Let c x denote substitution of x for the placeholder in c. The task is to predict whether c a 1 or c a 2 is more likely to be true, i.e., whether a 1 or a 2 best completes the context. Our approach has two stages: First, an Explainer PLM P expln generates contrastive explanations (Section 4.2) by infilling preset contrastive templates (Sec. 4.1) on the basis of c, a 1 , and a 2 . Then, a Task Model P LM selects the correct answer conditioned on both the context and the generated explanations (Sec. 4.3).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We develop a list of contrastive templates on the basis of an annotation study. For 250 instances from Winogrande and PIQA, we asked three annotators to explain why one answer is more likely than the other. We manually examined these explanations and abstracted them into templates containing at least two placeholders: two for the fact and foil being contrasted, and possibly more corresponding to the properties they are being contrasted on. For instance, peanuts are salty while raisins are sweet becomes Q are while P are . We retained templates used by annotators at least 10 times. Table 3 shows several examples. A template is converted into an explanation by replacing placeholders for the fact and foil with answers a 1 and a 2 and the remaining placeholders with the appropriate contrastive information.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We evaluate the quality and coverage of our templates with another round of human evaluation. For 100 WSC and PIQA examples, we ask three annotators to either write contrastive explanations using one or more of the templates, or indicate that none of the them were appropriate. Annotators used the templates in over 82% of cases, indicating high coverage for the tasks we study.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Let t denote a contrastive template. We write t a 1 ,a 2 to denote the customization of t to an input by filling its marked placeholders for fact and foil with the answer choices. For instance, in Figure 1, the template P are while Q are is customized to Fields are while forests are . 2 A full explanation may be produced by filling the remaining gaps in t a 1 ,a 2 by leveraging an infilling language model, the explainer P expln .
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We first construct a neutral context c a 0 by filling c's placeholder with a task-specific neutral answer  Figure 1: (1) A commonsense reasoning instance (c, a 1 , a 2 ) is converted into a custom prompt c a0 ⊕ t a1,a2 as input for the explainer PLM (2) The combination of input and explanation (c ai ⊕ e j ) is used by task model to score a i ∀i∀j. For a 1 and a 2 , scores are aggregated over templates.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
that does not indicate if a 1 or a 2 is correct. For Winogrande Schemas, c a 0 is constructed using the ambiguous pronoun in c (them in Figure 1). For PIQA, c a 0 is constructed as "c ⊕ a 1 or a 2 ", where ⊕ is string concatenation, e.g., upper body or legs in Figure 1 (More dataset-specific details are in Section 5.2). We then prepend c a 0 to the customized template t a 1 ,a 2 and use it as input to the infilling language model to fill in the remaining gaps in the template. We use the maximum likelihood candidate phrases from top-K decoding to transform the template into a full explanation e.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We use a list of templates t 1 , . . . , t n to generate a list of candidate explanations e 1 , . . . , e n for each input, which are all fed into the task model. We also use some task-specific heuristics to reduce the number of prompts for each example, detailed in Appendix A.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Given the context and answer choices (c, a 1 , a 2 ) and a list of explanations e 1 , . . . , e n , the second stage of our pipeline is a binary classifier between a 1 and a 2 which marginalizes over the explanations. We first assign a score to each answer a ∈ {a 1 , a 2 } and explanation e ∈ {e 1 , ..., e n }:
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
where c a denotes the substitution of a into c, P LM is string probability under the task language model, and k is the string length of c a ⊕ e. We use φ as input to a logistic regression classifier which marginalizes over explanations:
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
where Z is a normalizer over a 1 and a 2 . At initialization, φ uses a pretrained language model, and we fine-tune it to minimize the cross-entropy loss of P(a * | c, a 1 , a 2 ), where a * is the correct answer. We do not fine-tune the explainer PLM since the top-K beam decoding is a discrete operation that is hard to backpropagate through. In the zero-shot setting (where the task PLM is not fine-tuned) and during inference, the answer is predicted by aggregating scores assigned to an answer by all n explanations: argmax a i j φ(c, a i , e j ).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Context-Only We experiment with a baseline that does not condition on explanations at all. Here,
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
and gold answer is argmax a i φ(a i , c)
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Unconstrained Generation Latcinnik and Berant (2020) generate explanations from a PLM by beam-decoding a free-form sequence termed a hypothesis which is then used by a classifier to solve the task. The model is trained end-to-end and loss terms are added to encourage the hypothesis to sound natural. Explanation generation is otherwise unconstrained. For fair comparison with our approach, we do not fine-tune the explainer PLM (more details are in Appendix C). Shwartz et al. (2020) propose an unsupervised model that uses a PLM as the answer scorer and a (possibly different) PLM as a knowledge source, similar to our framework. They formulate the process of obtaining relevant knowledge as self-talk with the following steps: 1) completing clarification question prefixes such as "what is the definition of ..." conditioned on input context, 2) generating their corresponding answers (clarifications), and 3) conditioning on the clarification questions and answers to make predictions. The key difference between their approach and ours is in the choice of prompts for the PLM, and the kinds of knowledge the prompts seek. While Shwartz et al.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
(2020) draw inspiration from inquiry-based discovery learning (Bruner, 1961), we target contrastive reasoning.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We Each instance provides two answer choices, which we use directly as a 1 and a 2 . For the neutral answer c a 0 , we use the sentence with the original ambiguous pronoun. Since Winogrande has a blank space for the answer, we replace it with the most likely pronoun under a masked language model (BERT), following Shwartz et al. (2020). c a 1 , c a 2 are obtained by replacing the blank space or pronoun with the answer choice.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Physical Interaction Question Answering (PIQA) (Bisk et al., 2020) PIQA provides two answer choices which mostly vary from each other on a substring (e.g., "work out your [upper body]/[legs]"). We use these differing substrings as a 1 =legs and a 2 =upper body. For the neutral answer a 0 , we combine the answers into "a 1 or a 2 " (upper body or legs). In the cases where a 1 or a 2 is longer than 2 words, we include an or between the full answers. More details and examples are presented in Appendix A. We use question-answer pairs for c a 1 and c a 2 .
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
In this section, we present an extensive evaluation of our approach, demonstrating performance gains which are independently verified by human judges.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We report task accuracy as a proxy for explanation quality. Table 4 compares the task performance of our model with the baselines defined in Section 5.1. We observe that generating and conditioning on additional information from PLMs improves performance over just using the original input (Row 1 vs. 2-6). Using templates to prompt the PLM for specific knowledge is better than unconstrained generation of text (Row 2 vs. 3-6). Contrastive explanations outperform previous work that use clarification questions in self-talk (Shwartz et al., 2020). The T5-Large explainer already surpasses the results of self-talk despite being smaller than GPT2-XL, demonstrating the impact of using contrastive explanations over clarification questions.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We also observe that larger explainer PLMs (going from T5-Large to T5-11B) yield higher performance. Our zero-shot results with T5-11B are the highest reported on Winogrande, PIQA and WSC for an open-sourced model. 3 Finally, our approach gets smaller improvements when finetuning the task model. This suggests that some of the reasoning is still learned implicitly by the task model. Figure 2 shows task performance with various training data sizes of Winogrande, indicating a larger gap between the Context-Only baseline and our approach when training data is scarce.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Setup Following the human evaluation setup of Shwartz et al. (2020), we sample up to 50 highest-    Crowd workers are presented with a commonsense instance, the correct answer, and an explanation, and are asked to judge for: 1) Grammaticality, whether the explanation is grammatical; 2) Relevance, whether it's relevant to the topic of the text; 3) Factual Correctness, whether it's factually correct or likely true; and 4) Helpfulness, whether it adds helpful evidence for the correct answer. These metrics and definitions follow from Shwartz et al.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
(2020) with more details in Appendix B. The annotators are also shown the same explanation with fact and foil flipped (details in Section 6.3) and are asked to judge if the other answer is more likely than before if they assume the flipped explanation to be hypothetically true.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Results Table 5 shows the results of human evaluation of contrastive and self-talk explanations. The contrastive explanations are overwhelmingly preferred over self-talk explanations for relevance, factual correctness and helpfulness. They may be con-sidered less grammatical because of in-filling noise (such as incomplete phrases). Table 6 presents some qualitative examples of instances where contrastive explanations improve over all baselines.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We also analyze how much the task model relies on contrastive explanations for its decisions.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Flipping Explanations Our choice of contrastive language templates facilitates a novel way to evaluate explanation usefulness in prediction. The contrast in the explanation can be reversed by flipping the position of the fact and the foil in the explanation. If the choice between fact and foil actually depends on the contrastive explanation, then the flipped explanation should provide a hypothetical situation where the foil is more likely than the fact. For instance, "peanuts are salty while raisins are sweet," when switched to "raisins are sweet while peanuts are salty," may provide evidence that peanuts is a more likely label for the example in Table 1 (i). This may cause a model that uses the explanation to flip its prediction and lead to a drop in accuracy. The magnitude of drop can quantify the extent to which the model relies on the contrast    provided in the explanation. In fact, humans also deem the flipped explanation to imply the opposite label in a majority of cases (Table 5), indicating that our contrastive explanations frequently capture contrastive properties that the labels truly rely on. Table 7 shows the flipped evaluation results. We observe declines in accuracy of up to 8%, indicating that the model does use some contrastive knowledge to reason about the task. Finetuned models show a smaller decline in accuracy compared to the zero-shot setting. In this case, the task model may be directly fitting the data in lieu of relying on the knowledge conveyed by the explanation.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Abstracting Fact and Foil Given input context c (consisting of the fact and foil a 1 , a 2 ) and an explanation e, the explainer PLM P expl infills its explanation e on c while the task model P LM conditions on both c and e. We can test the quality of the generated explanations and the task model's reliance on them by forcing the task model to rely on e when information in input c is restricted. One potential way to do so is to scrub the identities of the fact and foil, a 1 and a 2 , from c.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We replace the fact and foil with placeholder tokens to create an abstract context c . For instance, the example in Table 6 (ii) becomes "The <mask1> and <mask2> helped me navigate ... down.", where the model must now choose between <mask1> and <mask2>. 4 Running the task model on c lower-bounds the performance possible without knowing answer identities. We can now test the relevant answer-based knowledge contrastive contained in the explanations by allowing the explanation model to see the original answers in c, but then abstracting them out when passing the input context and explanations to the task model. More formally, the task model conditions its decision on c and e . For Table 6 (ii) c and e are "The <mask1> and <mask2> helped me navigate ... down." and "The <mask1> is right-side-up while the <mask2> is upside down." Since only the explainer PLM is shown answer identities, the task model's decision is conditionally independent of the answer identities given the explanation.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Experiments on Winogrande and PIQA in the Banerjee and Baral (2020a) 38.8 Table 9: Zero-shot test performance on Common-senseQA for baselines as well as contrastive models which ensemble fact/foil pairs by voting (V) and maximum margin (MM). The best reported unsupervised performance (Banerjee and Baral, 2020b) uses Con-ceptNet, which was used to construct the dataset.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
fine-tuned setting (Table 8) show that performance improves significantly when the task model conditions on both c and e compared to a fully abstracted contrastive baseline that only conditions on c (from 63.2 to 70.4 for Winogrande), covering almost half of the gap between the fully abstracted setting and the non-abstracted original model (79.1). This indicates that our contrastive explanations encode a significant amount of information required for commonsense tasks. Even if the full model does not always use the explanations, these evaluations show that our contrastive explanations contain rich task-relevant knowledge, and suggest that future work might focus on how to better make use of this signal.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
The set of contrastive prompts used in our framework are curated from an in-house analysis of training instances from Winogrande and PIQA datasets.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
To determine the generalizability of these prompts for other commonsense reasoning tasks, we also experiment with the CommonsenseQA dataset (Talmor et al., 2019), which consists of multiple-choice questions created over ConceptNet -"Where on a river can you hold a cup upright to catch water on a sunny day? a) waterfall, b) bridge, c) valley, d) pebble, e) mountain". Since there are more than two answer choices to contrast, we convert each instance into 10 pairwise (binary) classification instances. Contrastive explanations are generated for each pairwise decision in the zero-shot setting, similar to Winograd and PIQA datasets. To choose the final answer, we consider two inference procedures: (a) Vote: The answer that receives the maximum number of votes across all binary clas-sification instances is selected, and (b) Maximum Margin: The choice with the maximum difference (margin) between answer likelihoods for any binary classification instance is selected. In Table  9, we observe that self-talk significantly hurts performance for this dataset. On the other hand, contrastive explanations are found to be useful and approach the zero-shot performance of the stateof-the-art, which uses ConceptNet (Banerjee and Baral, 2020b). These results demonstrate that the set of contrastive prompts are generalizable to other commonsense reasoning datasets, and that while our contrastive prompts are limited to contrasting two answer choices at a time, the framework can be easily extended to tasks with multiple foils.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
We show it is possible to prompt pretrained language models (PLMs) to generate contrastive explanations of their reasoning patterns, inspired by explanations that humans naturally provide for their reasoning. Conditioning model decisions on these explanations improves performance on two commonsense reasoning benchmarks, and humans judge the explanations to be highly relevant and helpful in comparison to prior work. We also showed how contrastive explanations can facilitate in-depth evaluations of faithfulness by flipping or abstracting the fact and foil, finding that our explanations encode a significant amount of information relevant to the classification decision, and in many cases models rely on the contrast in the expected way. While we have shown that our method is flexible enough to apply to multiple-choice commonsense tasks with many foils, leveraging contrastive reasoning in a wider variety of open-ended tasks remains an exciting challenge for future work. A Generating Contrastive Templates Table 12 shows the complete list of contrastive patterns used in our work, categorized under different types of attributes/properties. For templates with no place holders for the explainer to fill out, we only replace placeholders for answers (fact and foil). Table 10 lists a 0 , a 1 , a 2 , c a 0 , c a 1 , c a 2 for different examples in Winogrande and PIQA to explain dataset specific transformations made by our approach. Detection of P , Q: For WSC, the fact and foil are typically 1-word nouns. However, they may by qualified in the context and these qualifiers are important for contrasting. For instance, in the WSC example "She remembered how annoying it is to dust her wood chair so she bought a plastic 
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
The annotation task was carried out in Amazon Mechanical Turk, following (Shwartz et al., 2020).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
To ensure the quality of annotations, workers were required to be located in the US, UK, or Canada, and have a 99% approval rate for at least 5000 prior tasks. Annotators were paid .30$ per HIT to ensure participants get approximately $15/hr if they are doing the task. Annotation were aggregated from 3 workers using majority vote. The annotations yielded moderate levels of agreement, with Fleiss Kappa κ = 0.43 (Landis and Koch, 1977).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Explainer PLM For T5 we use special symbols <extra id 0> and <extra id 1> in place of the blanks ( ) in our templates. We observe that T5 is able to replace these tokens with multi-word phrases. For BART, we substitute blanks with a sequence with four [MASK] tokens to encourage generating multiple words. BART can choose to delete a [MASK] token during generation. Top-K decoding was done with a beam size of 200 and a maximum output sequence length of 20 for T5 models and 100 for BART. This is because both T5 is pre-trained to in-fill by only generating missing phrases while BART is pre-trained to decode the entire input with missing phrases filled in. We used early stopping for BART.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Task PLM Task PLM was finetuned for 20 epochs, using BertAdam optimizer with a learning rate of 2e − 5, batch size of 8, and dropout of 0.1, following (Latcinnik and Berant, 2020).
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Self-Talk (Shwartz et al., 2020) generate multiple clarification questions conditioned on the context, by 1) concatenating one of several question prefixes to the input prompt or question; and 2) generating 5 questions for each prefix using Nucleus sampling with p = 0.2, i.e., sampling from the top 20% tokens (Holtzman et al., 2019) limiting the question length to up to 6 tokens excluding the prefix. For each well-formed question, they generate multiple answers using a similar method. They Winogrande Ian volunteered to eat Dennis's menudo after already having a bowl because despised eating a1 : Ian a2 : Dennis a0 : he ca 0 : Ian volunteered to eat Dennis's menudo after already having a bowl because he despised eating ca 1 : Ian volunteered to eat Dennis's menudo after already having a bowl because Ian despised eating ca 2 : Ian volunteered to eat Dennis's menudo after already having a bowl because Dennis despised eating PIQA (difference between answers is 1-2 words)
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
To prepare carrots before cooking with them, you can a1 : Run them in the sink under boiling water a2 : Run them in the sink under cold water a0 : boiling water or cold water ca 0 : To prepare carrots before cooking with them, you can run them in the sink under boiling water or cold water ca 1 : To prepare carrots before cooking with them, you can run them in the sink under boiling water ca 2 : To prepare carrots before cooking with them, you can run them in the sink under cold water PIQA (difference between answers is larger)
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
To prevent gunk buildup in cup holders of a car, a1 : place coffee filters inside of the cup holders. a2 : pour a thin layer of oil into the cup holders. a0 : place coffee filters inside of the cup holders or pour a thin layer of oil into the cup holders. ca 0 : To prevent gunk buildup in cup holders of a car, place coffee filters inside of the cup holders or pour a thin layer of oil into the cup holders ca 1 : To prevent gunk buildup in cup holders of a car, place coffee filters inside of the cup holders ca 2 : To prevent gunk buildup in cup holders of a car, pour a thin layer of oil into the cup holders Table 10: Examples of Winogrande and PIQA, with fact, foil , neutral answer and respective substituted contexts used in our approach for prompting the explainer PLM or computing answer likelihood.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Original Input: The geese prefer to nest in the fields rather than the forests because in the predators are more hidden.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
(i) Context-Only Input to task model: The geese prefer to nest in the <mask1> rather than the <mask2> because in the predators are more hidden.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
(ii) Fully Abstracted Input to explainer: The geese prefer to nest in the <mask1> rather than the <mask2> because in the predators are more hidden. Generated Explanation: <mask1> is smaller than <mask2> Input to task model: The geese prefer to nest in the <mask1> rather than the <mask2> because in the predators are more hidden. <mask1> is smaller than <mask2> (iii) Abstraction after Explanation Input to explainer: The geese prefer to nest in the fields rather than the forests because in the predators are more hidden. Generated Explanation: Forests have more predators than fields Input to task model: The geese prefer to nest in the <mask1> rather than the <mask2> because in the predators are more hidden. <mask2> have more predators than <mask1> Table 11: Input to Explainer and Task model for Abstractive Evaluation limit the answer length to 10 generated tokens, and use Nucleus sampling with p = 0.5. Shwartz et al.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
(2020) only condition task prediction on a single clarification question and answer pair that increases the model's belief of a certain answer choice. Thus, the score of each answer choice is selected as the score of the text containing the clarification that most supports it, i.e., whose combination with it yields maximum language model likelihood.
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
Unconstrained Generation For unconstrained explanation baseline, maximum output sequence length was set to 20 and beam size for beam decoding was set to 200. Again we use early stopping. WSC and PIQA OPT1 is/are smaller than OPT2 OPT1 is/are larger than OPT2 OPT1 is/are slower than OPT2 OPT1 is/are faster than OPT2 OPT1 is than OPT2 OPT1 are than OPT2 OPT1 is while OPT2 is OPT1 is but OPT2 is OPT1 is however OPT2 is OPT1 are while OPT2 are OPT1 are but OPT2 are OPT1 are however OPT2 are OPT1 has while/but/however OPT2 has/does not have OPT1 have while/but/however OPT2 have/do not have OPT1 is made of/to however OPT2 is made of/to OPT1 is made of/to while OPT2 is made of/to Spatial:
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
WSC and PIQA OPT1 is above OPT2 OPT1 is below OPT2 OPT1 is to the right of OPT2 OPT1 is to the left of OPT2 OPT1 is inside OPT2 OPT1 is outside OPT2 is closer to OPT1 and father away from OPT2 OPT1 is closer to while OPT2 is father away from Usecase:
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
WSC(No PERSON entity) and PIQA OPT1 can while OPT2 can/cannot OPT1 is/can be used for OPT2 OPT1 is/can be used to do OPT2 OPT1 is/can be used for but OPT2 cannot OPT1 is/can be used for while OPT2 is used for OPT1 is/can be s used for but OPT2 is used for OPT1 is/can be used to while OPT2 is used to OPT1 is/can be used to but OPT2 is used to Causes:
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
WSC (No PERSON entity) and PIQA OPT1 has because while OPT2 is because OPT1 can cause while OPT2 causes/results in Since it can OPT1 but not OPT2 Since it can OPT1 but because it is not it can't OPT2
Prompting Contrastive Explanations for Commonsense Reasoning Tasks
WSC (No PERSON entity) and PIQA can be OPT1 but cannot be OPT2 OPT1 means to while OPT2 means to OPT1 is defined as while OPT2 is defined as OPT1 OPT2 OPT1 but not OPT2 OPT1 exists while an OPT2 doesn't Table 12: Complete list of contrastive patterns used in this work.
ALICE: Active Learning with Contrastive Natural Language Explanations
The de-facto supervised neural network training paradigm requires a large dataset with annotations. It is time-consuming, difficult and sometimes even infeasible to collect a large number of data-points due to task nature. A typical example task is medical diagnosis. In addition, annotating datasets also is costly, especially in domains where experts are difficult to recruit. In a traditional an-1 Co-supervised project.
ALICE: Active Learning with Contrastive Natural Language Explanations
Which image is not a Ring-Billed Gull? Figure 1: An example task that would benefit from learning with natural language explanation. The top-left corner shows an example image of a ring-billed gull. In the other three images (A), (B), (C), which one is not a ring-billed gull but a California gull? Given the natural language explanation "Ring-billed gull has a bill with a black ring near the tip while California gull has a red spot near the tip of lower mandible", it would be easier to find that (A) is the correct choice.
ALICE: Active Learning with Contrastive Natural Language Explanations
notation process, the human-machine communication bandwidth is narrow. Each label provides log C bits per sample for a C-class classification problem. However, humans don't solely rely on such low bandwidth communication to learn. They instead learn through natural language communication, which grounds on abstract concepts and knowledge. Psychologists and philosophers have long posited natural language explanations as central, organizing elements to human learning and reasoning (Chin-Parker and Cantelon, 2017;Lombrozo, 2006;Smith, 2003). Following this intuition, we explore methods to incorporate natural language explanations in learning paradigms to improve learning algorithm's data efficiency.
ALICE: Active Learning with Contrastive Natural Language Explanations
Let's take a bird species classification task as an example to illustrate the advantage of learning with natural language explanation. Figure 1 shows several bird images. Based on visual dissimilarity, many people mistakenly thought Image C is not a ring-billed gull as it has a different colored coat compared to the example. However, ring-billed gulls change their coat color from light yellow to grey after the first winter. So color is not the deciding factor to distinguish California gull and ringbilled gull. If we receive abstract knowledge from human experts through a natural language format, such as "Ring-billed gull has a bill with a black ring near the tip while California gull has a red spot near the tip of lower mandible" and incorporate it in the model, then the model will discover that Image A is a California gull instead of a ringbilled gull based on its bill.
ALICE: Active Learning with Contrastive Natural Language Explanations
Previous work has shown that incorporating natural language explanation into the classification training loop is effective in various settings (Andreas et al., 2018;Mu et al., 2020). However, previous work neglects the fact that there is usually a limited time budget to interact with domain experts (e.g., medical experts, biologists)  and high-quality natural language explanations are expensive, by nature. Therefore, we focus on eliciting fewer but more informative explanations to reduce expert involvement.
ALICE: Active Learning with Contrastive Natural Language Explanations
We propose Active Learning with Contrastive Explanations (ALICE), an expert-in-the-loop training framework that utilizes contrastive natural language explanations to improve data efficiency in learning. Although we focus on image classification in this paper, our expert-in-the-loop training framework could be generalized to other classification tasks. ALICE learns to first use active learning to select the most informative query pair to elicit contrastive natural language explanations from experts. Then it extracts knowledge from these explanations using a semantic parser. Finally, it incorporates the extracted knowledge through dynamically updating the learning model's structure. Our experiments on bird species classification and social relationship classification show that our method that incorporates natural language explanations has better data efficiency compared to methods that increase training sample volume.
ALICE: Active Learning with Contrastive Natural Language Explanations
The key hypothesis of active learning is that, if the learning algorithm is allowed to choose the data from which it learns, it will perform better than randomly selecting training samples (Settles, 2009). Existing work in active learning focuses primarily on exploring sampling methods to select additional data-points to label from a pool of unlabeled data (Sener and Savarese, 2018;Settles, 2011Settles, , 2009). Luo and Hauskrecht (2017) propose group-based active learning where the annotator could label a group of data points each time rather than one data point. However, they still rely on classification labels as the interface for human-machine communication. Instead, we focus on incorporating natural language explanations into the classification training framework. Contrastive learning has previously been shown to substantially improve unsupervised learning (Abid et al., 2018), feature learning (Zou et al., 2015), and learning probabilistic models (Zou et al., 2013). However, it has not been applied to the setting of active learning with explanations as we explore here.
ALICE: Active Learning with Contrastive Natural Language Explanations
Hierarchical Visual Recognition Categorical hierarchy is inherent in visual recognition (Biederman, 1987;. Xiao et al. (2014) propose to expand the model based on category hierarchy for incremental learning. Yan et al. (2015) decompose classification task into a coarse category classification and a fine category classifica- tion. Different from previous work, we focus on incorporating contrastive natural language explanations into the model hierarchy to achieve better data efficiency.
ALICE: Active Learning with Contrastive Natural Language Explanations
Contrastive Natural Language Explanations Existing research in social science and cognitive science (Miller, 2019;Mittelstadt et al., 2019) suggests contrastive explanations are more effective in human learning than descriptive explanations. Therefore, we choose contrastive natural language explanations to benefit our learners. An example contrastive explanation is like "Why P rather than Q?", in which P is the target event and Q is a counterfactual contrast case that did not occur (Lipton, 1990). In the example in Figure 1, if we ask the expert to differentiate between Ring-billed gull against California gull, the expert would output the following natural language explanation: "Ringbilled gull has a bill with a black ring near the tip while California gull has a red spot near tip of lower mandible". Our explanations are classbased and are not specifically associated with any particular images.
ALICE: Active Learning with Contrastive Natural Language Explanations
We are interested in a C class classification problem defined over an input space X and a label space Y = {1, ..., C}. Initially, the training set D train = {(x i , y i )} N train 1 is small, since our setting is restricted to be low resource. We also assume that there is a limited budget to ask domain experts to provide explanations during training. Specifically, we consider k rounds of interactions with domain experts and each round has a query budget b. For each query, we need to specify two classes y p , y q for domain experts to compare. Domain experts would return a contrastive natural language explanation e. Each explanation e would guide us to focus on the most discriminating semantic segments to differentiate between y p and y q . In this paper, a semantic segment refers to a semantic segment of an object (e.g., "bill" in bird species classification) or a semantic object (e.g., "soccer" in social relationship classification).
ALICE: Active Learning with Contrastive Natural Language Explanations
To make our framework more general, we start from a standard image classification neural architecture. We formulate our initial model as M (φ, g pool , f ) = f (g pool (φ(x))): Here φ is an image encoder that maps each input image x to an activation map φ(x) ∈ R H×W ×d . g pool is a global pooling layer g pool (φ(x)) ∈ R d pool . f is a fully connected layer that performs flat C way classification. This formulation covers most of the off-the-shelf pre-trained image classifiers.
ALICE: Active Learning with Contrastive Natural Language Explanations
Contrastive Explanations
ALICE: Active Learning with Contrastive Natural Language Explanations
ALICE is an expert-in-the-loop training framework that utilizes contrastive natural language explanations to improve data efficiency in learning. AL-ICE performs multiple rounds of interaction with domain experts and dynamically updates the learning model's structure during each round. Figure 2 describes ALICE's three-step workflow for each round: (A) Class-based Active Learning: ALICE first projects each class's training data into a shared feature space. Then ALICE selects b most confusing class pairs to query domain experts for explanations. (B) Semantic Explanation Grounding:
ALICE: Active Learning with Contrastive Natural Language Explanations
ALICE then extracts knowledge from b contrastive natural language explanations by semantic parsing. ALICE grounds the extracted knowledge on the training data of b class pairs by cropping the corresponding semantic segments. (C) Neural Architecture Morphing: ALICE finally allocates b new local classifiers and merges b class pairs in the global classifier. The cropped image patches are used as additional training data for a newly added local classifier to emphasize these patches' importance. The model is re-trained after each round.
ALICE: Active Learning with Contrastive Natural Language Explanations
ALICE optimizes towards requesting the most informative explanations to reduce expert involvement. Since each explanation provides knowledge to distinguish a class pair, we aim to identify the class pairs that confuse the model most and the explanations on these class pairs would intuitively help the model a lot. ALICE identifies confusing class pairs by first projecting each class's training data into a shared feature space g pool (φ(x)). As shown in Figure 2 (A), if the training data of two classes are close in the feature space, it is usually hard for the model to distinguish them and thus it would be helpful to solicit an explanation on this class pair. Based on this intuition, we first define the distance between two classes and then select the class pairs with the lowest distance. We first profile each class j by fitting a multivariate Gaussian distribution N j (µ j , Σ j ) on class j's training sample features. We define the distance between class j and class k as the JensenShannon Divergence (JSD) between N j and N k .
ALICE: Active Learning with Contrastive Natural Language Explanations
After calculating the distance between all possible class pairs, we select the b class pairs with the lowest JSD distance to query domain experts.
ALICE: Active Learning with Contrastive Natural Language Explanations
After identifying b class pairs that the model is most confused about, we send b query to domain experts. We ask the expert the following question for each query, "How would you differentiate class P and class Q?". Since we want the expert to provide general class-level knowledge, each query only contains text information, and no visual examples are provided to the experts. We obtain b contrastive natural language explanations after the query. Next, we parse the natural language explanations into machine-understandable form.  We choose a simple rule-based semantic parser for simplicity, following Hancock et al. (2018). The simple rule-based semantic parser can be used without any additional training and requires minimum effort to develop. Formally, the parser uses a set of rules in the form α → β, which means that α can be replaced by the token(s) in β. Our rules focus primarily on identifying the discriminating semantic segments ( § 3) mentioned in the explanations (e.g., "bill" for differentiating between ring-billed gull and California gull). We also allow the parser to skip unexpected tokens so that the parser could always succeed in generating a valid output.
ALICE: Active Learning with Contrastive Natural Language Explanations
Since each explanation e provides class-level knowledge to distinguish class y p , y q , we need to propagate the knowledge to all the training datapoints in class y p , y q so that the learning model could incorporate the knowledge later during training. We denote the semantic segments mentioned in an explanation e as S = {s 1 , s 2 , ..., }. For each training data-point of class y p , y q , we apply off-theshelf semantic segment localization models to crop out the image patch(es) of the semantic segment(s) mentioned S = {s 1 , s 2 , ..., } (Figure 2 (B)). The number of patches cropped from each image equals the number of mentioned semantic segments (i.e., |S|). We then resize the image patches to full resolution. The intuition behind our crop-andresize approach comes from the popular image crop data augmentation: it augments the training data with "sampling of various sized patches of the image whose size is distributed evenly between 8% and 100% of the image area" (Szegedy et al., 2015). This data augmentation technique is widelyadopted and is supported by common deep learning frameworks like PyTorch 1 .
ALICE: Active Learning with Contrastive Natural Language Explanations
ALICE does not need the localization model during testing (More details in § 4.4). The off-theshelf semantic segment localization models could be the pre-trained localization models on various large-scale datasets like Visual Genome (Krishna et al., 2017) and PASCAL-Part (Chen et al., 2014). If there is no available off-the-shelf localization model, we could recruit non-expert annotators to annotate the location of the semantic segments given that our training set D train is small.
ALICE: Active Learning with Contrastive Natural Language Explanations
Overview ALICE incorporates contrastive natural language explanations through dynamically updating the learning model's structure. The highlevel idea is to allocate a number of local classifiers to help the origin model guided by the explanations. Specifically, for each explanation e that provides knowledge to distinguish two classes y p , y q , we allocate a local classifier that is dedicated to the binary classification between y p , y q . We incorporate the extracted knowledge from explanation e to the local classifier so that the local classifier learns to focus on the discriminating semantic segments pointed out by the domain experts. We first discuss the case where all local classifiers perform binary classification and then discuss how to extend them to support general m-ary classification.
ALICE: Active Learning with Contrastive Natural Language Explanations
Progressive Architecture Update The initial flat C-way classification architecture could be viewed as a composition of an image encoder φ and a global classifier f • g pool . We discuss how the local classifiers are progressively added to assist the global classifier. As shown in Figure 2 (C), we first merge b class pairs into b super-classes in the global classifier. For example, in the first round, the global classifier would change from C-way to (C −2b+b)-way. We then allocate b new local classifiers, each for performing binary classification for one class pair. Each local classifier is only called when the global classifier predicts its super-class as the most confident. We delay more complex conditional execution schemes as future work. We also note that the conditional execution schemes have 1 torchvision.transforms.RandomResizedCrop Figure 3: Local classifiers with shared attention mechanism potential for reducing computation runtime (Chen et al., 2020;Mailthody et al., 2019). During training, we fine-tune the image encoder φ and reset the global classifier after each round since it is only a linear layer.
ALICE: Active Learning with Contrastive Natural Language Explanations
The global classifier is trained on D train , with labels adjusted according to the class pair merging. For a local classifier corresponding to the class pair y p , y q , its training data consists of two parts. One part of the training data is the training data-points of classes y p , y q in D train . The other part is the resized image patches of class y p , y q obtained in semantic explanation grounding ( § 4.3). We use the resized image patches as additional training data to to emphasize these patches' importance. Take the local classifier distinguishing ring-billed gull and California gull as an example (Figure 2 (B, C)). This local classifier is trained on the training images of ring-billed gull and California gull, as well as the bills' patches of each training image of ring-billed gull and California gull. During testing, we only feed the whole image into the model.
ALICE: Active Learning with Contrastive Natural Language Explanations
Supporting m-ary local classifier So far we have assumed that the local classifier is always a binary classifier. An implicit assumption is that the b class pairs have no overlap. We could support overlapping class pairs as follows. If some class pairs have overlap (e.g., class pair (P, Q), class pair (P, T ), class pair (T, U )), we only allocate one local classifier for them (e.g., a 4-ary local classifier for class (P, Q, T, U )). We also merge all the relevant classes in the global classifier into only one super-class (e.g., super-class {P, Q, T, U }). The local classifier is trained on the union of the overlapping class pairs' training data including patches.
ALICE: Active Learning with Contrastive Natural Language Explanations
Local Classifier Design Our framework is agnostic to the design choice of the local classifiers. Any design could be plugged into ALICE. We provide a default design as follows. Ideally, each local classifier should learn which semantic segments to focus and how to detect them. Since different local classifier might need to detect the same semantic segments (e.g., bill), the knowledge of detecting semantic segments could be shared among all local classifiers. Therefore, we introduce a shared attention mechanism, which is parameterized using M learnable latent attention queries q 1 , q 2 , ..., q M ∈ R d that represent M different latent semantic segments. To keep our design general, we do not bind each latent attention queries to any concrete semantic segments (e.g., we do not assign binding like q 1 to "bill") and these queries are trained in a weakly-supervised manner. Following Lin et al. (2015); Hu and Qi (2019), we view the activation map φ(x) ∈ R H×W ×d of each image x as H ×W attention keys k 1 , ..., k H×W ∈ R d . We compute the attention by:
ALICE: Active Learning with Contrastive Natural Language Explanations
Each row in the attention output matrix A ∈ R M ×d is the attention output for each attention query q i , which is a descriptor of the i th latent semantic segments. After the shared attention mechanism, each local classifier applies a private fully-connected layer on flattened(A) to make predictions. Each local classifier could ignore irrelevant semantic segments by simply setting the corresponding weights in its fully-connected layer to zero.
ALICE: Active Learning with Contrastive Natural Language Explanations
Implementation Our image encoder φ could be any off-the-shelf visual backbone model and we use Inception v3 (Szegedy et al., 2016). We implement our semantic parser on top of the Pythonbased SippyCup (Liang and Potts, 2015) following previous work Hancock et al. (2018). Our framework could support applications in other languages by changing a semantic parser for corresponding languages. We provide more details in Appendix.
ALICE: Active Learning with Contrastive Natural Language Explanations
Dataset We use the CUB-200-2011 dataset (Wah et al., 2011), which contains 11, 788 images for 200 species of North American birds. We randomly sample 25 bird species due to limited access to expert query budget. Following Vedantam et al. (2017), We make sure that each sampled species has one or more confusing species from the same subfamilia so that they are challenging to classify.  In addition, each image in the CUB data-set is also annotated with the locations of 15 semantic segments (e.g., "bill", "eye"). We use these location annotations to crop training image patches based on the explanations. We do not use any location annotation during testing. More details are provided in the Appendix, including the list of 25 sampled species. We experiment with a low-resource setting with only 15 images per bird species. We employ an amateur bird watcher as the domain expert since we do not expect general MTurk workers to have enough domain expertise. To further ensure the annotation quality, our domain expert checks the professional birding field guide 2 before writing each explanation. We ask the expert, "How would you differentiate bird species P and bird species Q?". In total, we collect 67 contrastive natural language explanations (avg. length 18.45 words). We collect the explanations in an on-demand manner because our class-based active Figure 5: Comparing the performance gain of adding contrastive natural language explanations and adding training data points on bird species' prediction accuracy. Empirically, adding 1 explanation leads to similar performance gain as adding 30 labeled training data points.
ALICE: Active Learning with Contrastive Natural Language Explanations
learning is empirically insensitive to the change of random seeds and hyper-parameters. Our semantic parser identifies 2.36 semantic segments per explanation on average. In each experiment, we conduct k = 4 rounds of expert queries, with a query budget b = 3 for each round.
ALICE: Active Learning with Contrastive Natural Language Explanations
The CUB description dataset collects descriptions of visual appearance for each image rather than explanations of why the bird in the image belongs to a certain class (Reed et al., 2016;Hendricks et al., 2016). For example, an image with a Ringbilled gull has the description: "This is a white bird with a grey wing and orange eyes and beak." However, this description also fits perfectly with a California gull (Figure 1). So the crowd-sourced descriptions in the CUB description dataset is not ideal to support classification. We collected expert explanations: "Ring-billed gull has a bill with a black ring near the tip while California gull has a red spot near the tip of lower mandible." to improve classification data efficiency. In addition, we also conducted experiments to incorporate CUB descriptions (5 sentences per image), but we did not find improved performance in our setting.
ALICE: Active Learning with Contrastive Natural Language Explanations
We compare AL-ICE to its several ablations (Table 2) and evaluate the performance on the test set. We report classification accuracy on species as well as subfamilia. For subfamilia accuracy, a prediction is counted as correct as long as the predicted species' subfamilia is the same as the labeled species' subfamilia. (1) Base(Inception v3) fine-tunes the pre-trained Inception v3 to perform a flat-25 way classification. (2) ALICE w/o Grounding copies the final neural archi-
ALICE: Active Learning with Contrastive Natural Language Explanations
Model Accuracy (%)  (3) AL-ICE w/o Hierarchy has the same neural architecture as (1) but has access to the discriminating semantic segments. (4) ALICE w/ Random Grounding has the semantic segments that are randomly sampled.
ALICE: Active Learning with Contrastive Natural Language Explanations
(5) ALICE w/ Random Pairs replaces class-based active learning with randomly selected class pairs. The randomly selected class pairs are used to query experts and change the learning model's neural architecture. (9-12) ALICE i th round shows ALICE's performance after the i th round of expert queries.
ALICE: Active Learning with Contrastive Natural Language Explanations
(6-8) RandomSampling + x% extra data augments (1) with x% extra training data points.
ALICE: Active Learning with Contrastive Natural Language Explanations
Our first takeaway is that incorporating contrastive natural language explanations is more data-efficient than adding extra training data points. Figure 5 visualizes the performance gain of adding explanations and adding data points. ((6-12) in Table 2). As shown in Figure 5, adding 1 explanation leads to the same amount of performance gain of adding 30 labeled data points. For example, adding 12 explanations (ALICE (4 th round), 76.05%) achieves comparable performance gain of adding 375 training images (RandomSampling + 100% extra data, 75.91%). We note that writing one explanation for an expert is typically faster than labeling 15-30 examples. As an estimate, ; Hancock et al. (2018); Zaidan and Eisner (2008) perform user study and find that collecting natural language explanations is only twice as costly as collecting labels for their tasks. Our experiment shows that adding 1 explanation leads to similar performance gain as adding 30 labeled training data points, yielding a 6× speedup. Our second takeaway is that both the ground-    Table 2).
ALICE: Active Learning with Contrastive Natural Language Explanations
Visualization We show how the explanations help the learning model as shown in Figure 4. We visualize the saliency maps (Simonyan et al., 2014) corresponding to the correct class on four example images. As shown in Figure 4, the base model does not know which semantic segments to focus and makes wrong predictions. In contrast, ALICE's local classifiers obtain knowledge from the expert explanations and successfully learns to focus on the discriminating semantic segments to make the correct predictions.
ALICE: Active Learning with Contrastive Natural Language Explanations
6 Social Relationship Classification Task Dataset We also evaluate ALICE on the People in Photo Album Relation dataset . An example is shown in Figure 6. The dataset was originally collected from Flickr photo albums and involves 5 social domains and 16 social relations. We focus on the images that have only two people since handling more than two people requires task-specific neural architecture. The details of dataset pre-processing are included in Appendix. After pre-processing, we obtain 1, 679 training images and 802 testing images. We experiment with a low-resource setting with 15% of the remaining training images (i.e., 264 images). We obtain explanations by converting the knowledge graph collected by  into a parsed format. The semantic segments here are contextual objects like soccer. The knowledge graph contains heuristics to distinguish social relations by the occurrence of contextual objects (e.g., "soccer" for sports v.s. colleagues).
ALICE: Active Learning with Contrastive Natural Language Explanations
We use a faster-RCNN-based object detector (Ren  (Lin et al., 2014) to localize the semantic segments (contextual objects) during training. The object detector is not used during testing. We set rounds of expert queries k = 2 and the query budget b = 4.
ALICE: Active Learning with Contrastive Natural Language Explanations
We compare ALICE to its several ablations (Table 4) and evaluate the performance on the testing set. We report classification accuracy on social relationships as well as social domains. We observe similar benefits of incorporating explanations to ALICE as in the bird species classification task. As shown in Table 4, the base model with 40% extra training data (i.e., 105 images) still slightly underperforms ALICE with 8 explanations (Ran-domSampling + 40% extra data, 36.28% v.s. AL-ICE (2 nd round), 36.41%). As shown in Figure 7, adding 1 explanation leads to similar performance gain as adding 13 labeled training data points. Our ablation experiment also confirms the importance of class-based active learning. If we replace classbased active learning with a random selection of class pairs, ALICE learns a bad model structure that leads to reduced performance (ALICE w/ Random Pairs, 22.94%). The performance drop in domain accuracy is also significant. We suspect it is because the bad model structure confuses the global classifier a lot. If the global classifier calls a wrong local classifier, the local classifier is forced to make a prediction on such a out-of-distribution data. In addition, our ablation experiment also verify the importance of having knowledge beyond having the localization model. Substituting the discriminating semantic segments' image patches with other semantic segments' patches leads to worse performance (ALICE w/ Random Grounding, 27.20%).
ALICE: Active Learning with Contrastive Natural Language Explanations
One reason is that there are many objects in each image. Under our low resource setting, learning on the image patches of random semantic segments may make the model to latch on to sample-specific artifacts in the training images, which leads to poor generalization.
ALICE: Active Learning with Contrastive Natural Language Explanations
We propose an expert-in-the-loop training framework ALICE to utilize contrastive natural language explanations to improve a learning algorithm's data efficiency. We extend the concept of active learning to class-based active learning for choosing the most informative query pair. We incorporate the extracted knowledge from expert natural language explanation by changing our algorithm's neural network structure. Our experiments on two visual recognition tasks show that incorporating natural language explanations is far more data-efficient than adding extra training data. In the future, we plan to examine the hierarchical classification architecture's potential for reducing computational runtime.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
In recent years, a large number of knowledge enhanced pre-trained language models (KE-PLMs) (Zhang et al., 2019;Liu et al., 2020;Wang et al., 2021b,c) have been proposed to improve performance on a wide variety of NLP tasks (Wei et al., Figure 1: A motivating example for our CPACE model. To provide more distinguishing information, we can convert the acquired symbolic knowledge into contrastive explanation and use them for inference enhancement. 2020; Wang et al., 2020;Chen et al., 2020;Xu et al., 2021;Wang et al., 2021a) explicitly retrieve knowledge from different knowledge sources, including WordNet (Miller, 1995), Wikidata (Vrandečić and Krötzsch, 2014) and ConceptNet (Speer et al., 2017), then integrate them into downstream models for Q&A. These methods enjoy the ability to utilize diverse knowledge, but inevitably intro-duce irrelevant or even noisy knowledge which will hurt the performance of model. Other works consider PLMs as knowledge bases (Petroni et al., 2019;Heinzerling and Inui, 2021;Wang et al., 2021a), which elicit potential knowledge via prompt from PLMs (Paranjape et al., 2021;Liu et al., 2022). These approaches can obtain relevant knowledge from PLMs, however the generated knowledge from PLMs is generally common and lacks specific and distinguishing information for enhancement. It is an important direction to explore "how to provide discriminative information to models to help them distinguish candidates before answering ?".
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Inspired by previous studies (Chen et al., 2021;Paranjape et al., 2021;Jacovi et al., 2021), contrastive explanation can provide the information to explain "WHY A NOT B" for given input and prediction, which naturally has distinguishing property. As shown in Figure 1, given question, candidates and retrieved symbolic knowledge, we generate contrastive explanation for each candidate to provide discriminative information among them for inference enhancement. Therefore, in this paper, we propose a Conceptcentric Prompt-bAsed Contrastive Explanation generation (CPACE) model, a distinguish before answer architecture, to obtain high-quality incorporated knowledge and distinguish the differences among candidates. Specifically, our model consists of three parts, namely symbolic knowledge acquisition module, contrastive explanation generation module and explanation enhanced inference module. Firstly, given the question and candidates, we use a trained concept recognizer to detect concepts appearing in input. Then, with identified concepts, we extract diverse symbolic concept-centric knowledge from different types of knowledge bases. After that, we take the retrieved knowledge and a pre-defined explanation prompt as guidance for a fine-tuned generative pre-trained language model to generate contrastive explanation. The process of generation can filter irrelevant knowledge and convert selected symbolic knowledge into more specific and distinguishing information according to question and candidates. Finally, we use the generated contrastive explanation as external knowledge for enhancement. It is worth noting that contrastive explanation, as the final form of incorporated knowledge, not only meet distinguishing property, but also makes it easier for human to understand and is better interpretable.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
The contributions are summarized as follows:
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
• Based on previous exploration of contrastive explanation, we first propose a CPACE model to unify the retrieved knowledge into contrastive explanation, which can distinguish the difference among answers before prediction.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
• To better adapt contrastive explanation to question answering tasks, we develop a concept-centric prompt-based generator, which can leverage concept-centric knowledge and explanation prompt as guidance.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
• Our CPACE model achieves new SOTA on CSQA leaderboard 1 , which surprisingly surpasses human performance. Experimental results demonstrate the generalization of our methods on QASC and OBQA datasets and the effectiveness of contrastive explanation as another type of unified knowledge form for knowledge enhancement.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Here, we introduce the commonsense question answering task and the workflow of our CPACE model. Given a question stem Q, the task is to find the correct answer a from a finite set of choices A = {a 1 , a 2 , ..., a n }. As shown in Figure 2, our approach can be divided into three steps. The first step is symbolic knowledge acquisition, we build a concept recognizer to identify a concept set C from the given question Q and candidates A, then we take them as queries to extract diverse symbolic knowledge K symbolic from several knowledge bases KBs, as shown in Section 3.1:
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
The second step is contrastive explanation generation, where we generate contrastive explanation K ce with CPACE generator, given Q, A, K symbolic , C and explanation prompt P , as shown in Section 3.2:
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Step2. Contrastive Explanation Generation  Figure 2: Architecture of our CPACE model, which consists of 1) a symbolic knowledge acquisition module, 2) a contrastive explanation generation module and 3) an explanation enhanced inference module.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
The final step is explanation enhanced inference, we obtain the predicted answers a from a standard inference model enhanced with K ce , as presented in Section 3.3:
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
3 Approach 3.1 Symbolic Knowledge Acquisition
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Considering the concepts represent the key information of examples in semantic level, some works (Chen et al., 2021;Antognini and Faltings, 2021;Stowe et al., 2021) build a connection with external knowledge through concepts. Inspired by these studies, we employ a concept recognizer to detect the concepts from given question and candidates, which can ensure the retrieved symbolic knowledge is more concept-centric and relevant to the input in external knowledge extraction. We first formulate concept recognition as a token-level sequence labeling task (Thorne et al., 2019), where 1 indicates a concept token and 0 indicates a background token. For the concept recognizer, we adopt RoBERTa-large as the encoder with a CRF layer. We construct the input sentence
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
is special token to separate question and candidates. Given a sentence S = {t 1 , t 2 , ..., t n }, the task is to find a set of concepts C = {c 1 , ..., c m }. Limited by the scale of training corpus, we collect several similar datasets for concept recognizer training, including CommonGen (Lin et al., 2020), e-SNLI (Camburu et al., 2018) and CSQA (Talmor et al., 2019), all of which contained the annotated concepts or tokens in examples. The statistics of these datasets are shown in Table 1. While the CommonGen dataset is annotated to generate sentence with given concepts, we invert the target sentence into an input and use the given concepts as target. If there are more than 3 identified concepts in question stem, the top 3 concepts will be selected based on the score ranking mechanism for subsequent use. Otherwise, we select all identified concepts.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
After obtaining a group of concepts, we use them as anchors to retrieve relevant external symbolic knowledge. Following previous works (Chen et al., 2020;Xu et al., 2021), we choose ConceptNet and Cambridge Dictionary as knowledge bases for triples and definitions extraction.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Triples Extraction To extract relationships between concepts, being similar to Jession (2020), we find the path from the question concept to the candidate concept in ConceptNet. If there are more than one path, we choose the shortest. If there is no straightforward path between question concept and candidate concept, but we can find other triples in the ConceptNet with candidate concept. We define  a score function and use it to compute the final score of each triples and chose the highest,
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
where w j denotes the weight of j th triple in Con-ceptNet, N is the total number of triples related to candidate concepts, all N triples related to candidate concepts are divided into multiple relation groups by clustering, and N k is the number of triples contained in k th relation group. 
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
In this part, we present how to generate contrastive explanations, given the question, candidates, and the retrieved knowledge, from data collection and generator training aspects.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Data Collection Firstly, for contrastive explanation generator training, the most important thing is to collect a certain number of annotated contrastive explanation datasets. We firstly collect  Table 1.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Generator Training With the collected datasets, we train a contrastive explanation generator by finetuning a generative language model (GLM). In this work, we use BART-base as the backbone. In the fine-tuning stage, different from concatenating question stem and candidates in ECQA and eQASC, the hypothesis and premise sentence in e-SNLI are used as original input of GLM. The target is the explanation text. Moreover, different from previous works only consider original questions and candidates as input for fine-tuning, we also take the concepts and external symbolic knowledge to enhance the input for the prompt-based generation. As shown in Figure 3, the input is organized as follows: Task Table 9. Different from previous work (Paranjape et al., 2021) constructs Cloze prompt patterns for comparing the differences between two candidates, we consider whole contrastive explanation among all candidates and construct different discrete explanation prompts for guidance, for example, "Given concept sets, the difference among them is ". We use a list of templates t 1 , ..., t p to generate a list of candidate explanations e 1 , ..., e p for each input during fine-tuning and select the best prompt for generation, p denotes the number of the templates. It is worth noting that we firstly leverage the extracted symbolic knowledge and concepts to improve the quality of generated contrastive explanation, which is ignored in Paranjape et al. (2021).
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
As shown in step 3 of Figure 2, given original question, we use the generated contrastive explanation as external knowledge to enhance the inference model, such as ALBERT and DeBERTaV3. Other types of knowledge can also be incorporated, which is optional. The objective function is defined as follows:
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
where i represents the i th example, h i represents the hidden state after task-specific layer ( QASC & OBQA To further validate the generalization of our CPACE model, we evaluate the effectiveness of generated contrastive explanation on QASC (Khot et al., 2020) and OpenbookQA (OBQA) (Mihaylov et al., 2018). The statistics of above datasets are shown in Table 2.  
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
We choose BART-base (Lewis et al., 2020) as the pre-trained generative language model, which is the backbone of our contrastive explanation generator. For the framework, we use Pytorch 1.11. We use the AdamW (Loshchilov and Hutter, 2019) for optimization and set the warmup fraction to 0.1, and weight decay to 0.01. Meanwhile, we set the epoch to 10. For the learning rate, we search from 1e-5, 5e-5, 1e-4 and the best batch size we choose is 32. We set the max-length of output in the generator to 256. For the automatic evaluation, we use the ROUGE (Lin, 2004) and BLEU (Papineni et al., 2002) as the metric to measure the quality of generated explanation. For the inference models, we use ALBERT-xxlarge-v2 (Lan et al., 2020) and DeBERTaV3 (He et al., 2021) as backbone respectively, which are enhanced with contrastive explanation. For each experiment, we run 5 times and report the average and we use RTX6000 with 40G memory for training and inference.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Pre  As shown in Table 3, we divide existing methods on CSQA into four parts: 1) Pre-trained Lan-guage Model Only, 2) PLM + Symbolic Knowledge Retrieval, 3) PLM + Generated Knowledge, and 4) Beyond Human Level. Compared with all of baselines, our CPACE model achieve the best performance on CSQA.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Specifically, in part 1 of Table 3, experimental results demonstrate the selection of pre-trained language models (PLM) is important for commonsense question answering. PLM with optimal pretraining tasks and large parameters achieves better results. While RoBERTa-large only achieves 72.5%, DeBERTa obtains 79.6% on CSQA, which adopts disentangled attention for decoding enhancement and has 1.5B parameters. In part 2 of Table 3, incorporating triples and concept definitions helps a lot to improve the performance of PLMs on CSQA. Compared with ALBERT, ALBERT+DESC-KCR achieves 83.3% on CSQA, which gains 7.8% improvement. Meanwhile, other works attempt to generate triples or relationships with PLMs, as shown in part 3 of Table 3. While ALBERT + Path-Generator only achieves 75.6% via dynamically generating structured evidence, our CPACE model achieves 87.4% in single model setting via generating contrastive explanations. Furthermore, while KEAR leverages external knowledge and retrieved training example for knowledge enhancement, our CPACE model outperforms KEAR and achieves first place on CSQA leaderboard.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Overall, while ALBERT achieves 73.5% on CSQA test set, existing knowledge-enhanced methods achieve 3.8%-7.2% improvement and our CPACE model improves over 13.9%. It indicates the generated contrastive explanation can be another efficient way for knowledge enhancement instead of retrieving triples, definitions, and training examples. It is noted that while KEAR joints human party via extra training examples retrieval and using over 39 models for ensemble, we only use 5 models for ensemble and propose a contrastive explanation generator, which is easier to follow.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
To further measure the generality of CPACE, we evaluate our model on QASC and OBQA datasets. As shown in Table 4, we select some representative baselines for comparison, including UnifiedQA, RoBERTa+AIR and GenMC. Although ALBERT only gets 71.8% and 72.5% on QASC and OBQA, ALBERT + KD achieves 80.3% and 83.2% respectively, which only retrieves symbolic knowledge  
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Analysis of Contrastive Explanation Generator As shown in Table 5, we use BART-base as the backbone to evaluate the effectiveness of concepts, prefix prompt, and retrieved concept-centric knowledge (triples and definitions of concepts) in the generator. Only with the fine-tuned BART-base as the generator, the generated explanation enhanced inference model can achieve 78.3% on CSQA development set. Since concepts represent the key information of a given sentence, with identified concepts, the generator can get some benefits. When taking concepts as enhanced input, we can obtain 0.8% improvement. When taking explanation prompt as a formal constraint, we get an improvement of 4.1% , which fully shows the necessity of contrastive explanation prompt as constraint. Meanwhile, enhanced with the external concept-centric knowledge, we can gain 5.2% improvement, which indicates concept-centric knowledge is equally important in contrastive explanation generation. Finally, with the incorporated of above three kinds of knowledge, the inference model can be improved by 6.9%.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
In this part, we use ALBERT-xxlarge-v2 and DeBERTaV3 as the inference encoder. As shown in Table 6, ALBERT achieves 73.8% on CSQA, the DeBERTa achieves 84.6%, which indicates a better inference backbone is of importance in the downstream task. Then, we take the concept, retrieved concept-centric knowledge and generated contrastive explanation as different types of extra knowledge to enhance the inference model, respectively. While concept can only bring about 1.5% and 0.2% improvement for ALBERT and DeBERTa, we can get 10.4% and 0.5% improvement through triples and concept definitions, respectively. With the generated contrastive explanation, we can get a great improvement, which is 11.4% and 3.3% respectively. It demonstrates that generated contrastive explanation is much more effective than retrieved symbolic knowledge. Compared with adding ground-truth contrastive explanation, which achieves 11.7% and 9.2% improvement respectively, there is still some room for improvement.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
As shown in Table 7, following Shwartz et al.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
(2020), we present the human evaluation of generated contrastive explanation in four aspects, including 1) Relevant, whether the generated explanation is relevant to current example, 2) Factual, if the explanation contains factual evidence, 3) Distinguishing, if the explanation can provide distinguishing information to improve inference, and 4) Grammatical, whether the generated explanation is grammatical. We sample 100 explanations from generated con- trastive explanation on CSQA and evaluate the score of the generated explanation from above aspects. We use five students as annotators and report the average. As we can see, taking the given example as input of BART-base, we only get high grammatical score but with low distinguishing score. When we take concept and explanation prompt for enhancement, it can slightly improve the the relevance and distinguishment. Enhanced with concept-centric knowledge, it can improve the distinguishing score over 20%, which is much more helpful. Furthermore, we can use all the above knowledge to get the best performance. Besides, we demonstrate automatic evaluation of contrastive explanation, which is shown in Appendix B.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
To alleviate the knowledge insufficiency problem, many knowledge-enhanced works have been proposed (Chen et al., 2022a;Liu et al., 2020;Wang et al., 2021c,b;Chen et al., 2020;Chen et al., 2022b;Sun et al., 2021), which can be roughly categorized into explicit symbolic knowledge retrieval based and implicit knowledge generation based. In the former works, researchers (Lv et al., 2020;Chen et al., 2020;Xu et al., 2021) mainly focus on acquiring relevant knowledge from different knowledge bases, including ConceptNet (Speer et al., 2017), Wikipedia, and dictionaries. These methods enjoy the benefits of diverse knowledge but inevitably introduce irrelevant or even noisy knowledge. In the latter works, attempts (Petroni et al., 2019;Gao et al., 2021;Schick and Schütze, 2021;Zhong et al., 2021;Chen et al., 2022a)  However, limited by the pre-training corpus, the generated knowledge from PLMs lacks specific information. To takes both advantages of symbolic knowledge retrieval and knowledge generation, we propose the distinguish before answer framework to generate contrastive explanation.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Contrastive explanations clarify why an event occurred in contrast to another, which are inherently intuitive to humans to both produce and comprehend (Jacovi et al., 2021). Compared to other explanations, Miller (2019) Paranjape et al. (2021) uses human templates to prompt PLMs to generate contrastive explanations, we focus on generating contrastive explanation with retrieved symbolic knowledge to distinguish the candidates before prediction, which is ignored in previous works. Liu et al. (2022) and  are the concurrent works, focusing on improving question answering with generated knowledge and clues.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
In this paper, we propose a CPACE model, which unify the retrieved knowledge into contrastive explanation, to provide more discriminative information for model enhancement. We firstly consider concept-centric knowledge and explanation prompt as guidance for contrastive explanation generation. Our CPACE model achieves a new SOTA on CSQA leaderboard, which surprisingly surpasses human performance. In addition, we verify the effectiveness and generalization of CPACE on other datasets. In the future, we will explore a unified contrastive explanation generation framework for NLP tasks.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Limited by the scale of annotated contrastive explanation corpus, our CPACE model is only fine-tuned on approximate datasets selected with some designed principles. The performance of our method can be further improved with sufficient high-quality contrastive explanation annotated datasets over more NLP tasks. Moreover, in this paper, we mainly explore the effectiveness of the CPACE model for multiple-choice commonsense questionanswering tasks, which is our goal, while previous retrieved-augmented methods cannot provide highly relevant knowledge or context for reasoning. Due to the fact that the contrastive explanation is designed to provide distinguishing information among given options [a 1 , a 2 , . . . , a n ] or labels, there are no given candidates or labels in generative commonsense question-answering tasks, therefore, our CPACE model cannot directly fit to other generative QA benchmark datasets. However, in our work, we provide some insights for future exploration, that is, generating question-specific distinguishing knowledge with a contrastive explanation generator can improve the performance and interpretation of current reasoning models. Meanwhile, although we validate the generalization of CPACE on other QA tasks, including QASC and OBQA, the effectiveness of our model in other NLP tasks requiring contrastive knowledge enhancement, such as open domain dialogue, needs to be further explored. In the future, following the CPACE model, we will explore a unified contrastive explanation generation framework for the generative commonsense question answering tasks via generating the chain-of-thoughts with a large generative language model-based generator, such as InstructGPT (Ouyang et al., 2022), BLOOM (Scao et al., 2022) etc., or generating top-N possible candidates and ranking them with distinguishing knowledge, which is beyond the scope of this paper to explore and is also our future work.  
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
As shown in Table 8, we also present the BLEU and ROUGE results of contrastive explanation generated with different types of knowledge. While the BLEU metric focuses on the precision of text, the ROUGE metric mainly evaluates the recall performance of generated text, which denotes the text can provide more relevant contextual information for given questions. Since we use the generated text as external knowledge for inference enhancement, the recall performance in the generation is much more important. With concepts and prompt constrained, we obtain better generated explanation text in the BLEU metric, while we can acquire better generated explanation text in the ROUGE metric with the external concept-centric symbolic knowledge (triples and definitions).
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
As shown in Table 10, we present a case study of our model. Given a question Where can you find a magazine and a set of candidates {A: doctor, B: bookstore, C: market, D: train, E: mortuary}, the true answer is B:bookstore. We first identify the concepts from the input example, including concepts in question stem and answer candidates. Then, we can extract the triples from ConceptNet. As shown in Table 10, both four candidates have same relation with magazine, which can not further filter the true answer. With adding the concepts descriptions, we can further distinguish the candidates with same relations. However, the description of concepts is not clear enough for explanation, compared with the annotated contrastive explanation. With our CPACE generator, we can obtain the generated contrastive explanation with concepts, symbolic knowledge and prompt enhanced, as Table 10 shown. Compared with the extracted triples and concept descriptions, the generated contrastive explanation is much easier to understand for user, while only with BART-base, we can only obtain candidates related explanation without considering question concepts. As shown in Table 10, the concepts and symbolic knowledge can help the generative language model concentrated on the key difference of candidates according to question concepts. Meanwhile, with the generated contrastive explanation for enhancement, we can infer the predicted answer is bookstore.  Step2: Generated Contrastive A store is a place where people can find magazines along with many other printed works.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Doctor is a physician. You can buy something at market. At train station, you can take a train. Mortuary can be found in funeral.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Many other printed works can be found at a bookstore. You would find magazines along side.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Doctor is not a place where you can find various printed works. At market, magazines are not found. At train station, there are no printed works so no magazines are found. Mortuary do not have magazines.
Distinguish Before Answer: Generating Contrastive Explanation as Knowledge for Commonsense Question Answering
Bookstores have a variety of reading material including books, magazines, novels, etc. The doctor is not a place. Market sells various items one of which is printed works. Train stations do not have various printed works. Mortuary has dead bodies.
Contrastive Explanations for Model Interpretability
Explanations in machine learning attempt to uncover the causal factors leading to a model's decisions. Methods for producing model explanations often seek all causal factors at once-making them difficult to comprehend-or organize the factors via heuristics, such as gradient saliency (Simonyan et al., 2013;Li et al., 2016). However, it remains unclear what makes a particular collection of causal factors a good explanation.
Contrastive Explanations for Model Interpretability
Studies in social science establish that human explanations, conversely, are typically "contrastive" (Miller, 2019): they rely on the causal factors that explain why an event occurred instead of an alternative event (Lipton, 1990). Such explanations pro- Our work seeks to design explanations that are explicitly contrastive, thereby revealing finegrained aspects of model decisions, while being more representative of human comprehension ( §2). We introduce a novel framework for deriving contrastive explanations applicable to any neural classifier ( §3). Our method operates on the input representation space, and produces a latent, contrastive representation. We accomplish this by project-  ing the latent representations of the input to the space that minimally separates two decisions in the model. We additionally propose a measure of contrastiveness ( §3.4) by computing changes to model behavior before and after the projection.
Contrastive Explanations for Model Interpretability
Our experiments consider two well-studied NLP classification benchmarks: MultiNLI (Williams et al., 2018;§4) and BIOS (De-Arteaga et al., 2019;§5). In each, we study explanations in the form of high-level concept features or low-level textual highlights in the input. Our contrastive explanations uncover input features useful for and against particular decisions, and can answer which alternative label was a decision made against; this has potential implications for model debugging. Overall, we find that a contrastive perspective aids finegrained understanding of model behavior.
Contrastive Explanations for Model Interpretability
Explanations can be considered as answers to the question: "why P ?" where P , the fact, is the event to be explained. Consider the question (Q1; Fig. 2): Why was it decided to hire [Person X]? The explanation behind decision P (the hiring decision) comprises the causal chain of events that led to P ; a 'reasonable' answer to the question may cite that Person X has relevant degrees or professional experience. However, explaining the complete causal chain (A1; Fig. 2) is both burdensome to the explainer and cognitively demanding to the explainee (Hilton and Slugoski, 1986;Hesslow, 1988). For instance, the hiring event above is caused by Person X's application for the role-yet a reasonable explainer will likely omit this factor from the explanation for simplicity, thus reducing the cognitive load. But which factors should be omitted, and which should not?
Contrastive Explanations for Model Interpretability
The theory of contrastive explanations provides a solution common in human explanations, which inherently answer the question: "why P , rather than Q?" (Hilton, 1988), where Q (the foil) is some alternative event. 2 Therefore, the explanation to the hiring decision might answer (Q2; Fig. 2):
Contrastive Explanations for Model Interpretability
Why was it decided to hire [Person X], rather than not hiring them? Since the decision not to hire the candidate can also be traced back to the fact that they applied to the role, the explanation can be simplified by omitting this factor (A2; Fig. 2); this illustrates contrastive causal attribution ( §3.3) in the explanation process. Similarly, given a different foil (Q3; Fig. 2):
Contrastive Explanations for Model Interpretability
Why was it decided to hire [Person X], rather than hiring [Person Y]? the explainer might find it unnecessary to include attributes (such as a "relevant college degree") common to both Person X and Person Y (A3; Fig. 2). For the rest of the paper, we will refer to explanations which are not explicitly contrastive, such as A1 in Fig. 2, as non-contrastive explanations.
Contrastive Explanations for Model Interpretability
Implications for model explanations: Model explanations can benefit from explicit contrastiveness in two ways. Model decisions are complex and noisy statistical processes-'complete' explanations are difficult (Jacovi and Goldberg, 2020b). Contrastive explanations make model decisions easier to explain by omitting many factors, given the relevant foils. This reduces the burden of the explaining algorithm to interpret and communicate the 'complete' reasoning. Additionally, humans tend to inherently, and often implicitly, comprehend (model) explanations contrastively. However, the foil perceived by the explainee may not match the one truly entailed by the explanation (e.g., Kumar et al., 2020); contrastive explanations make the foil explicit, and are therefore easier to understand.
Contrastive Explanations for Model Interpretability
We present our framework for producing contrastive explanations. We describe the preliminaries for our framework ( §3.1), and outline an interventionist approach for causal attribution ( §3.2). Next, we introduce our projection-based method to produce latent contrastive representations ( §3.3) and a measure of the resulting behavioral change ( §3.4).
Contrastive Explanations for Model Interpretability
Candidate Factor Space: All causal factors that could possibly lead to the model's decision. These could include discrete features in the input (textual highlights; Lei et al., 2016; see Fig. 1), abstract input features (concepts; Kim et al., 2017;see Table 4 for an example of gender as a concept), or influential examples in the training set for a prediction (Koh and Liang, 2017;Han et al., 2020). 3 Once defined, a subset of factors from the candidate factor space can then be causally attributed to the model decision. Our framework is agnostic to the type of factor in the candidate factor space, so long as it is possible to intervene on their presence ( §3.2). Our work focuses on textual highlights and concepts.
Contrastive Explanations for Model Interpretability
Event Space: The union (as a discrete set) of all possible model decision classes. 4 This includes the event we attempt to explain (the fact), i.e. a trained model's decision 5 , as well all other classes (the foils), considered independently.
Contrastive Explanations for Model Interpretability
Given a candidate factor space, we seek to attribute factors with causality over the decision process, i.e. select factors which caused the model's decision. We adopt an interventionist approach (Woodward, 2003)-this involves determining causality of a factor by intervening on it, thereby producing a counterfactual. The importance of the intervened factor is determined by change in model behavior under this counterfactual.
Contrastive Explanations for Model Interpretability
Most interventions we consider are amnesic, i.e. use counterfactuals which omit the candidate factors under consideration. 6 Factors in the form 3 Such spaces can also be a hybrid or partial combination of the above homogeneous spaces we consider in this work. 4 We do not consider explanations for other aspects of model behavior: such as why a particular class was assigned a particular probability, or why a particular neuron received a particular activation. Additionally, for the foil we only consider a single other class (aside from the fact), rather than some subset of classes. 5 The fact is not strictly required to be the model prediction; it could alternatively be the model probability, for instance. 6 An alternative is to replace the candidate factor with other causal factors. We leave extensive comparisons of amnesic and non-amnesic interventions to future work. of highlights and concepts involve different kinds of interventions. For the former, we simply replace each highlighted token with a 'mask' token ( §4.2,5.2), and train models where such masked data is in distribution (Zintgraf et al., 2017;Kim et al., 2020), i.e. pre-trained masked language models, such as RoBERTa (Liu et al., 2019). For conceptual interventions, we employ an amnesic operation to remove a concept from the input representation ( §4.1,5.1). Following Elazar et al. (2021), this amnesic operation uses a null-space projection to iteratively remove all linear directions correlated with the concept, until it is not possible to linearly discover the concept information from the latent vector (Ravfogel et al., 2020). 7 Training an amnesic probe requires labels indicating presence of the concept for each example ( App. A.1). Where possible, we also employ a conceptual intervention via manually-annotated counterfactuals (Kaushik et al., 2020;Gardner et al., 2020) which involve textual modifications to existing data instances ( §4.1; Hyp-Negation).
Contrastive Explanations for Model Interpretability
While the aforementioned interventions select the causal factors from the candidate factor space for model explanations, we are specifically interested in selecting factors that yield contrastive explanations. Given a space of discovered causal factors, we therefore need an additional intervention to attribute contrastive behavior to a subset of these factors. We propose a method below to produce contrastive explanations in the form of a dense representation of the input in the latent space. This representation is given by a projection operation, such that only the components that distinguish the fact from the foil are preserved.
Contrastive Explanations for Model Interpretability
Formally, let x be the text input to be classified as one of K output classes Y = {y 1 , ..., y K }. Consider the model class f , which commonly uses an arbitrarily deep neural encoder enc(·) that transforms the input x into a vector h x ∈ R d . Once encoded, a final linear layer, W ∈ R K×d can then be applied to the input to yield the logits of the model over the K classes, such that f (x) = Wenc(x) = Wh x . Let y * = arg max y∈Y f (x) be the model prediction (the fact), y be an alternative prediction of interest (the foil), and p := softmax(Wh x ) the normalized model probabilities.
Contrastive Explanations for Model Interpretability
Recall that output of the model, f (x) = Wh x is linear in the latent input representation, h x . Let w i be the row in W corresponding to class i. The logits for classes y , y * , given by the dot products w y T h x and w y * T h x respectively, are thus unrelated to any other row in the prediction matrix. These dot products are un-normalized projections of the representation h x on the directions w y * , w y ∈ R d . While the representation h x can be high-dimensional, only two directions (components) in this high-dimensional space are relevant for each contrastive decision. 8 Furthermore, we are interested in the prediction of one class over the other, as opposed to the logits. Hence, we can replace these two directions with a single contrastive direction u ∈ R d , by defining u = w y * − w y . Given that the model favors y * over y , i.e., p y * > p y , if and only if u T h x > 0, the projection of h x onto u precisely yields the linear direction in R d which the model uses to differentiate between classes y * and y . We refer to the span of the uthat is, the collection of all vectors αu for a scalar α-as the contrastive space for y * and y . We define the contrastive transformation C(h x ) y ,y * to be the orthogonal projection onto this subspace:
Contrastive Explanations for Model Interpretability
where P u := uu T u T u is a projection matrix onto u. 9 The resulting representation C(h x ) y ,y * is a latent vector of the same dimensions as h x ; computing this can be understood as a contrastive intervention. Intuitively, it captures (precisely) the latent features in h x which are used by the model to differentiate the fact from the foil, where h x is the hidden representation of x before the final classifying layer.
Contrastive Explanations for Model Interpretability
We consider a measure of contrastive behavior, based on our interventionist approach. Let q := softmax(Wh x ) be the model probabilities following an intervention (contrastive or otherwise) which produces counterfactual x . Our measure of contrastive model behavior is simply the difference between normalized probabilities of the fact before and after the intervention, given by:
Contrastive Explanations for Model Interpretability
Here, the normalization ensures we consider only the fact (y * ) and foil (y ), other classes being irrelevant. This measure can be applied to both contrastive interventions, involving C(h x ) y ,y * or just causal ones, involving h x . Given −1 ≤ δ contr p,q ≤ 1, our metric is constrained; the magnitude indicates the degree of contrastive behavior. Our metric is reminiscent of statistical parity metrics used in algorithmic fairness (Zemel et al., 2013). 10 We use the contrastive measure in two settings: 1. Ranking factors (controlled foil): given a fixed foil, and the candidate factor space, we rank each factor by how contrastively useful it is to the model for choosing the fact, against the given foil. 2. Ranking foils (controlled factor): given a causal factor, we rank the set of available foils in the event space by how much the said factor is contrastively used by the decision process between the fact and the foils. The above is a relative and continuous perspective on contrastive selection, compared to a discrete and binary one discussed in §2. We leave a possible discretization of this process to future work.
Contrastive Explanations for Model Interpretability
We apply our contrastive framework to the natural language inference (NLI) task (Dagan et al., 2005), on two datasets: MultiNLI (Williams et al., 2018) and SNLI (Bowman et al., 2015). Given a premise sentence, the NLI task classifies if a hypothesis sentence entails, contradicts or is neutral to the premise. Our experiments are based on a RoBERTa-large model (Liu et al., 2019) fine-tuned on MultiNLI (obtaining 90.1% accuracy on devmismatched), unless otherwise specified; see more details in Appendix A.2.
Contrastive Explanations for Model Interpretability
Sanity Checks. Our first set of experiments use a controlled setup to verify that our method works as expected. We train a MultiNLI model on modified instances with label-specific "stains" (input  tokens inserted to contrastively distinguish classes; Sippy et al., 2020). We intervene on the stains (as highlights; §3.2) before our contrastive projection ( §3.3), and then rank highlights and foils by δ contr p,q ( §3.4). The most contrastive foils and highlights indeed correspond to the stains, verifying our methodology; see results and details in App. B.
Contrastive Explanations for Model Interpretability
Extensive prior work supports the presence of spurious correlations or artifacts in popular NLI datasets (Poliak et al., 2018;Gururangan et al., 2018). For e.g., instances with high lexical overlap between premise and hypothesis tend to correlate with the entailment class, and those containing negations in the hypothesis with the contradiction class. As a result, models trained on these datasets tend to rely on these features to make accurate predictions, regardless of other semantic signals. Moreover, Gururangan et al. (2018) show that a model can ignore the premise altogether and still make an accurate prediction based only on the hypothesis. Table 1 shows the distribution of the above three concepts in MultiNLI. While prior work provides considerable evidence that NLI model decisions rely heavily on these concepts, we investigate whether this reliance is contrastive by nature. We consider each concept independently:
Contrastive Explanations for Model Interpretability
Overlap. Instances with the overlap concept are those where all of the content words 11 in the hypothesis also exist in the premise (in any order). Prior work has shown that the overlap concept is highly relevant in the model's reasoning process for predicting entailment (Naik et al., 2018;McCoy et al., 2019). We intervene on the overlap concept via amnesic probing ( §3.2), followed by our contrastive intervention ( §3.3) to measure behavioral changes ( §3.4). Foil ranking results in Table 2 show that when predicting entailment, the overlap concept is overwhelmingly contrastive against neutral. This aligns with Table 1 statistics, which show that the concept is highly correlated with entailment (64.4%) and against neutral (6.3%) predictions. The overlap concept is thus contrastively important.
Contrastive Explanations for Model Interpretability
Hypothesis. Motivated by the finding that hypothesis-only models have been shown to achieve high accuracy in the NLI task (Gururangan et al., 2018;Poliak et al., 2018), we consider the 'hypothesis' concept-a collection of all concepts existing only in the hypothesis. This concept is realized in instances accurately predicted by a hypothesis-only baseline. We use binary concept labels based on accurate / inaccurate predictions of a hypothesis-only RoBERTa-baseline to train an amnesic probe for causal intervention ( §3.2). The amnesic probe and our contrastive intervention ( §3.3) are then applied on the full-input model. Results in Table 2 show that when predicting entailment in MultiNLI, this concept is not strongly contrastive to either foil (-0.005 v. -0.031). This aligns with Table 1 statistics, since the concept is similarly distributed with contradiction and neutral (24.7% v. 26.2%). However, when applied to the SNLI dataset, we see stronger contrastive behavior with respect to contradiction (0.505) than neutral (0.463). Perhaps this could be explained by the higher hypothesis-only bias in SNLI, compared to MultiNLI (Gururangan et al., 2018).
Contrastive Explanations for Model Interpretability
Hyp-Negation. This concept is realized in instances containing negation words (e.g., 'no') in the hypothesis. The presence of this concept is highly indicative of an NLI model's prediction to be the contradiction class regardless of other NLI semantics (Gururangan et al., 2018).
Contrastive Explanations for Model Interpretability
Here, we use manually annotated counterfactu-als to intervene on the concept 12 . Given an example without negations in the hypothesis, and predicted by the model as entailment or neutral, two of the authors manually paraphrased the hypothesis to include a negation without altering the semantics; see Appendix C for examples. 13 We then proceed to probe the model for behavioral changes (δ contr p,q ) between the instances before-and-after the intervention, treating the negated example as a counterfactual to compute q. Foil ranking results in Table 2 show that, on average, the model utilizes the negation concept as evidence for contradiction in contrast to entailment (0.195), as opposed to neutral (0.051).
Contrastive Explanations for Model Interpretability
In summary, while it is known that the above three concepts in NLI are useful, we investigated whether they are useful against a particular foil. Two concepts (overlap and hyp-negation) do have a prominent contrastive role, while the hypothesis concept is contrastive in only one setting, indicating that there might be concepts which are not explicitly contrastive.
Contrastive Explanations for Model Interpretability
Contrastive explanations can help humans understand model errors. Our goal is to answer: what factor led to the model's incorrect prediction in contrast to the gold label? We achieve this by treating an erroneous model prediction as the fact, and the gold label as the foil. For this fact-foil pair, we rank different factors based on their contrastive behavior ( §3.4). 14 We consider all unigrams and bigrams in the hypothesis as highlight factors in the NLI task. As before, we intervene on each factor, apply our contrastive intervention, and measure the change in behavior ( §3.4). Table 3 presents some SNLI examples where we report the most contrastive highlight factor (by δ contr p,q ) for each foil. We also report a noncontrastive explanation ( §2) resulting from only the causal (highlight) intervention (i.e. no contrastive projection). We see that one of the contrastive explanations (usually with the gold foil) agrees with the non-contrastive explanation, indicating that the latter might simply be reflecting an implicit contrastive explanation. The last row 12 Initial experiments with amnesic probing for this concept were inconclusive. We suspect that although useful for the model, the concept is perhaps not detectable in the last layerthe only conclusion the amnesic probing method can draw. 13 Our collection of 90 such instances for each of entailment and neutral will be released upon publication. 14 We report a BIOS factor ranking experiment in App. D.  shows a case where the non-contrastive explanation does not agree with the contrastive explanation for the gold foil. However, the model's reasoning appears to be correct since the hypothesis may or may not entail the premise; additionally 'bar' seems the correct reasoning for choosing neutral over entailment. Thus, contrastive explanations can provide insight on why the model specifically preferred its prediction over the gold label. Future work might explore using contrastive explanations to detect labeling errors in NLI (Swayamdipta et al., 2020).
Contrastive Explanations for Model Interpretability
We apply our framework on the BIOS dataset (De-Arteaga et al., 2019) containing individuals biographies, labeled with their professions and binary gender 15 (see Table 4). The task involves classifying a biography as one of 27 professions 16 , without explicitly considering the gender attribute. We analyze RoBERTa-large (Liu et al., 2019) fine-tuned on BIOS, with test performance of 87.52%.
Contrastive Explanations for Model Interpretability
She also works as a Restitution Specialist while being the liaison to the Victim Compensation Board. Ms. Azevedo was named an OVSRS Outstanding Partner due to her dedication to providing critical information to staff so victims can obtain their court-ordered restitution while offenders can be held accountable. / paralegal / F Peter also has substantial experience representing clients in government investigations, including criminal and regulatory investigations, and internal investigations conducted on behalf of clients. / attorney / M  
Contrastive Explanations for Model Interpretability
Ravfogel et al. (2020) showed that a (binary) gender concept is valuable for BIOS model predictions.
Contrastive Explanations for Model Interpretability
We use amnesic probing ( §3.2) to intervene on the presence of the gender concept, trained using the binary gender labels in BIOS, followed by our contrastive projection ( §3.3). Table 5 reports the top-5 fact/foil pairs based on the contrastive measure δ contr p,q , among all pairs of professions, along with the respective binary gender % in BIOS. The top-scoring pairs tend to be semantically similar while dissimilar in their gender proportions (e.g. paralegal and attorney). This confirms that the model is indeed leveraging the gender concept to differentiate between otherwise semantically-similar classes.
Contrastive Explanations for Model Interpretability
Amnesic probing for a concept results in a representation that cannot distinguish whether it was present or not in an instance. But it results in a final "concept vector", r, which only maintains the information relevant towards the concept. In Table 5, we additionally report the sign of the cosine similarity between u and r, where u = w y * − w y (see §3.3).  This indicates whether the concept (in this case, "male") is present in the fact (+) or not (−). The results align with intuition: the "male" concept is supportive of attorney over paralegal, and accountant over psychologist, which are male-majority professions in the BIOS dataset.
Contrastive Explanations for Model Interpretability
The demographic attributes of individuals, as encoded by their pronouns and personal names, can be spuriously correlated with their professions, as is often manifest in the BIOS dataset (De-Arteaga et al., 2019;Romanov et al., 2019). For instance, paralegals in BIOS are overwhelmingly women (roughly 90%); female names and pronouns might be very predictive of this profession, albeit for incorrect reasons. Further, names might reveal other demographics (e.g., Azevedo is a common Portuguese surname) potentially predictive of certain professions. Table 4 shows pronouns and person name highlights which are candidate causal factors of interest. We investigate the contrastive importance of these factors, by asking: which classes does the model use the pronouns and names contrastively against when making its decision?
Contrastive Explanations for Model Interpretability
We intervene on pronoun and name highlights by masking ( §3.2), followed by computing the contrastive measure (Eq. 2) for every possible profession (foil) in contrast to the model prediction (fact). Table 6 shows the most and least contrastive foils for five professions (facts), where the foils are ranked by δ contr p,q , and aggregated across BIOS dev. For example, on paralegal predictions, attorney is the most relevant foil, indicating that the model uses demographic information for that distinction. This indicates that the model leverages demographic attributes as evidence for decisions between classes, which are semantically similar but demographically different. Unlike δ contr p,q values obtained from amnesic probes, the sign of δ contr p,q obtained after highlight interventions can be meaningful. When δ contr p,q > 0, the model uses highlights as evidence for the fact and against the foil; negative values indicate evidence for the foil against the fact. For attorney predictions, paralegal is an important foil as expected, even though δ contr p,q < 0.
Contrastive Explanations for Model Interpretability
We are additionally interested in measuring the degree of contrastive behavior change without considering causal features such as highlights / concepts. We can treat the contrastive projection C(h x ) y ,y * (Eq. 1) as an intervention 17 , and measure the change in behavior following just this intervention. Since the contrastive intervention, by construction, precisely maintains contrastive behavior, δ contr p,q is no longer appropriate. We thus use a symmetrized Kullback-Leibler divergence, D KL (p q) + D KL (q p), which gives us the global behavior change across the dataset after the contrastive intervention. Table 7 reports results on the D KL metric for BIOS, applying a similar methodology as Table 6, but without the highlights intervention. When predicting the fact, the contrast between the fact and a highly impactful foil does not significantly impact the decision (since removing the non-contrastive information greatly affects the decision), and viceversa. For e.g., the contrast between the related professions of attorney and paralegal does not substantially affect the decision to predict attorney (2.195). As expected, the trend is reversed for attorney and dj (0.528), two distant professions.  physician from surgeon when making physician predictions. The measurement is inverse to the degree that the differentiation is dominating the decision process.
Contrastive Explanations for Model Interpretability
Analogous to the MultiNLI highlight ranking procedure and results presented in Section 4.2, we present highlight ranking for the BIOS task. Here, our candidate factor space considers all word unigram and bigram highlights, for simplicity. We derive the model decision after intervening on each candidate, and measure the change in behavior. We apply this technique towards understanding model errors, by selecting examples of model mistakes and assigning the foil to be the gold label. Qualitative examples in Table 13 (Appendix D) show the top-ranking highlight for answering the question: which unigram or bigram was most relevant for the model in making its prediction rather than the gold label?; see Table caption for a detailed discussion.
Contrastive Explanations for Model Interpretability
We introduce a novel framework for producing contrastive explanations for model decisions, via a projection of the input representation to a contrastive space for the prediction and an alternate label. We also propose a measure of the degree of contrastive behavior, following a contrastive intervention. Our experiments with English text classification benchmarks on BIOS and NLI demonstrate our framework's ability to rank model decisions, as well as features responsible for the decision, contrastively. Our quantitative and qualitative evaluations show the fine granularity of contrastive explanations, which could be useful for debugging model behavior. Our framework is general enough to extend other (interventionist) explanation methods to produce contrastive explanations.
Contrastive Explanations for Model Interpretability
Contrastive explanations in NLP and ML are relatively novel; future research could explore variations of interventions and evaluation metrics for the same. This paper presented a formulation designed for contrastive relationships between two specific classes; future work that contrasts the fact with a combination of foils could explore a formulation involving a projection into the subspace containing features from all other classes. A Implementation Details
Contrastive Explanations for Model Interpretability
We utilized three interventions in this work: masking of highlights, amnesic probing of concepts, and erasure of non-contrastive information.
Contrastive Explanations for Model Interpretability
Masking. The masking intervention involved replacing each token in the highlight with a predefined mask token. As we used a pre-trained masked language model for our initialization, we have used that model's mask token, which is <mask> in the case of RoBERTa-Large.
Contrastive Explanations for Model Interpretability
Amnesic probing. We have used the publicly available implementation provided by Elazar et al. (2021), which originally proposed the algorithm. Specifically, we train an iterative nullspace projection probe until convergence which captures the linear directions which correlate with the given concept, and then project the model's latent representation on the null-space of this probe. Please refer to Elazar et al. (2021) for more details. 18
Contrastive Explanations for Model Interpretability
Contrastive projection. In Section 5.3 we propose to use contrastive projection as a standalone intervention to probe for the magnitude of contrastive reasoning process in the model. As mentioned in the main text, this is simply softmax(WC(h x ) y ,y * ) where the original model output is softmax(Wh x ).
Contrastive Explanations for Model Interpretability
Our experiments were implemented in AllenNLP (Gardner et al., 2018) version 1.2.0rc1. The models used were fine-tuned RoBERTa-Large on the BIOS and MultiNLI training sets, and the models with the best dev-set performance among twenty epochs were chosen for analysis. The models otherwise used default training configurations of AllenNLP, and we provide these configurations in the repository to be included with this work. In all of our training and analysis experiments, we did not use any instances labeled with the 'model' class in BIOS, in all of the training, dev and test sets, due to an observation on noisy labeling made by Ravfogel et al. (2020) which we verified. 
Contrastive Explanations for Model Interpretability
We present a strss-test evaluation to verify the validity of our contrastive framework via data staining (Sippy et al., 2020). It involves "staining" a training instance with a feature (e.g. an inserted token) guaranteed to be useful for the task, and then attempting to recover this feature via the analysis. 19 We modify data staining to evaluate contrastive explanations via introducing stains which are only contrastively useful to the model; the "stain" is some feature useful to differentiate between a specific fact and a foil. The model is thus encouraged to exploit this feature in its decision making. Our stain is added to NLI hypothesis during training as shown in Table 10. The stain can be used by a model to perfectly distinguish a class from the others, i.e. the stain is contrastively useful for or against only the stained class. See Appendix B for illustrative examples with the stains.
Contrastive Explanations for Model Interpretability
We analyze a RoBERTa-Large model finetuned on the stained MultiNLI train set. The entire MultiNLI dataset (train, dev-matched, devmismatched) was stained during the experiment, and we masked the stain for 10% of our training data to ensure such examples are in distribution for the model, enabling us to use masked-stain examples in the analysis step. We repeat our experiment thrice, considering one of the three NLI classes as a stain each time. In all three cases, the stained models achieve high predictive mismatched dev-set performance on the stained MultiNLI (above 97% accuracy). This high performance is expected, and indicates that the models indeed exploit the stain features.
Contrastive Explanations for Model Interpretability
To recover the stains on the MultiNLI dev-set using our methodology, we apply highlight masking interventions. We define our candidate factor space to be all tokens in the hypothesis, and we expect the first token (the stain) to be the most contrastively important evidence when either the fact or the foil is the stained class. We report the accuracy of recovering the stain as the salient factor (ranking factors, c.f. §3.4) when the fact or foil is the stained class, or recovering a non-stain word when the stained class is neither the fact nor the foil. We perform the experiment for a random sample of 1000 test-set MultiNLI instances. The re- "Allison Smith is a model of tenacity and perseverance. She has battled several serious illnesses, undergone multiple surgeries, and endured life-changing procedures, yet embraces her life with joyful exuberance and optimism. Allison inspires all those who have the pleasure of meeting her and hear her incredible story. Her book has the capability of changing the lives of her readers -both those who endure chronic illnesses, as well as the caretakers (families and friends) who walk the journeys with them." -Karen'
Contrastive Explanations for Model Interpretability
Justin Bieber is a role model to the people who enjoy his music. The vast majority of these people are children, 8-16 year old girls, therefore, for him to smoke marijuana is a horrible example for the children that look up to him. It's the same as when a child sees their big sibling smoking a cigarette and feels the compulsive need to be like them.    Table 9 shows a demonstration of the data staining experiment.
Contrastive Explanations for Model Interpretability
Additionally, if the stain were to be treated as a highlight which we intervened on, followed by 20 Since the model is not guaranteed to make optimal use of the stain in every case, a high but sub-optimal accuracy performance is within expectations.  a contrastive intervention, and behavioral change, we would expect the stained class to be the most affected (ranking foils, c.f. §3.4). This is indeed the case, as shown in results in Table 11.
Contrastive Explanations for Model Interpretability
In the Hyp-Negation experiments, as mentioned, we opted to produce counterfactuals of the hypothesis negation concept, instead of doing so via amnesic probing. Table 12 contains examples of the 180 instances that we will make available online.  
Contrastive Explanations for Model Interpretability
Here, to adjust for space, we show some qualitative examples for the BIOS highlight ranking described in Section 5.4 presented in Table 13.
Contrastive Explanations for Model Interpretability
Fact Foil Input with Highlights (prediction) (gold) attorney no explicit foil Harris said the abuse had been inflicted by both "hands and items," and, according to evidence, since near the time of Kairissa's arrival in Mt. Juliet.
Contrastive Explanations for Model Interpretability
Harris said the abuse had been inflicted by both "hands and items," and, according to evidence, since near the time of Kairissa's arrival in Mt. Juliet. attorney no explicit foil
Contrastive Explanations for Model Interpretability
He has been involved in land transport for the past 13 years and has worked on various transport projects in Malta. He was appointed as chief officer for land transport within the Authority for Transport in Malta in 2010 where he was responsible for the regulation of driver training, testing and licensing, vehicle registration, goods transport, and passenger transport. In 2015 he moved back to the private sector and took on the role of General Manager of the local bus company, Malta Public Transport with his main responsibility being to oversee the transformation of the public transport service.
Contrastive Explanations for Model Interpretability
He has been involved in land transport for the past 13 years and has worked on various transport projects in Malta. He was appointed as chief officer for land transport within the Authority for Transport in Malta in 2010 where he was responsible for the regulation of driver training, testing and licensing, vehicle registration, goods transport, and passenger transport.
Contrastive Explanations for Model Interpretability
In 2015 he moved back to the private sector and took on the role of General Manager of the local bus company, Malta Public Transport with his main responsibility being to oversee the transformation of the public transport service.
Contrastive Explanations for Model Interpretability
physician no explicit foil She is a top medicine student whose academic achievements are sweet fruit of her labor. All seemed well until she reached her junior internship year, when one of her patients died under her watch. She was publicly humiliated in the aftermath. Her closest friends and family tried to lift her spirits up, but to no avail. She thought she was a failure. All she felt was the immense pressure boiling inside of her, and she can no longer contain it. Thus, on one fateful night, on the rooftop of her apartment, she decides to end her misery by taking her own life.
Contrastive Explanations for Model Interpretability
surgeon She is a top medicine student whose academic achievements are sweet fruit of her labor. All seemed well until she reached her junior internship year, when one of her patients died under her watch. She was publicly humiliated in the aftermath. Her closest friends and family tried to lift her spirits up, but to no avail. She thought she was a failure. All she felt was the immense pressure boiling inside of her, and she can no longer contain it. Thus, on one fateful night, on the rooftop of her apartment, she decides to end her misery by taking her own life. Table 13: Qualitative examples for the BIOS highlight ranking described in Section 5.4. The top-1 results of ranking highlights contrastively given a particular foil, compared to doing so generally (i.e., where the foil is all other classes together) for examples where the model made a mistake. We consider the space of highlights to be all unigrams and bigrams, and rank the space by the change in behavior (via difference of normalized logits) following a masking intervention on the highlight. In the example in the second row (for which the model mistakenly predicted physician), the model is generally most affected by the bigram "top medicine". However, this is not a particularly useful feature to favor physician rather than surgeon, since surgeons also entail medicine studies; when we repeat the experiment in contrast to surgeon, the top highlight changes to "patients died", indicating that this bigram is a better differentiator for those classes in the trained BIOS model.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In recent years, pre-trained language models (Devlin et al., 2019;Liu et al., 2019;Yang et al., 2019) have been widely adopted in many tasks of natural language processing (Talmor et al., 2019;Choi et al., 2018;Bowman et al., 2015). However, due to the lack of textual explanations, most downstream models become more complicated and difficult to understand. End users, especially those working in critical domains such as healthcare or online education, become more skeptical and reluctant to adopt or trust them, although these models have been proved to improve the decision-making performance. Therefore, providing faithful textual explanations has become a promising way to overcome the black-box property of neural networks, which has attracted the attention of academia and industrial communities.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Recently, the majority of existing methods (Xu et al., 2020;Cheng et al., 2020;Karimi et al., 2020;Ramamurthy et al., 2020;Atanasova et al., 2020;Kumar and Talukdar, 2020) in natural language processing try to explain the predictions of neural models in a model-intrinsic or model-agnostic (also known as post-hoc) way. While post-hoc models (Chen et al., 2020b;Karimi et al., 2020;Kumar and Talukdar, 2020) provide explanations after making predictions without affecting the overall accuracy, most of them neglect the rationales in inputs and provide textual explanations just in the form of "WHY A". However, we argue that contrastive explanations in the form of "WHY A NOT B" could provide more informative and important clues that are easier to understand and persuade end-users. Moreover, we believe that contrastive explanations could benefit downstream tasks (e.g., NLI), since such kind of explanations contain more helpful information (e.g. relations between rationales) that can be used to improve model performance.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
To further enhance the explainability and performance of NLI, we propose a novel textual contrastive explanation generation framework in this paper, which is post-hoc and considers rationales, counterfactual examples, and external knowledge. Specifically, we first identify rationales (i.e., key phrases) from a premise-hypothesis (P-H) pair with Figure 1: The overall workflow of contrastive explanation generation, which contains rationale identification, counterfactual example generation (as described in Figure 2) and selection, and knowledge-aware contrastive explanation generation. In our "WHY A NOT B" paradigm, we will generate explanations for A and each other class B (i.e., we will generate "WHY NOT neutral" and "WHY NOT entailment" in this example). The counterfactual example selection aims to select one most qualified for any other class B.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
label A, and then use them as the key perturbations for transforming and generating candidate counterfactual examples. Then we further select one most qualified counterfactual example for any other label B. Note that the acquisition of a qualified counterfactual example of class B is essential to generate a meaningful explanation for "WHY NOT B", otherwise the resultant contrastive explanation will be groundless or useless. After that, we take the selected examples along with the original P-H pair and related external knowledge as input, and finally employ a knowledge-aware pre-trained language model to generate contrastive explanation, which will specify why the prediction label is A rather than B, and clarify the confusions for end-users. Moreover, we train an NLI model enhanced with contrastive explanations and achieve the new stateof-art performance on SNLI.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
The contributions of this paper are as follows:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
• We introduce a novel knowledge-aware contrastive explanation generation framework (KACE) for natural language inference tasks.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
• We consider the rationales in inputs and regard them as important perturbations for generating counterfactual examples rather than just discarding them like previous post-hoc work (Hendricks et al., 2018;Cheng et al., 2020).
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
• We integrate external knowledge with generative pre-trained language model rather than only taking original inputs (Kumar and Taluk-dar, 2020;Rajani et al., 2019) for contrastive explanation generation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
• Experimental results show that knowledgeaware contrastive explanations are able to clarify the difference between predicted class and the others, which help to clarify the confusion of end-users and further improve model performance than "WHY A" explanations 1 .
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Here, we define the task of contrastive explanation generation for NLI. Given a trained neural network model f with input x and predicted class A, the problem of generating contrastive explanations (CE) to an input x is to specify why x belongs to category/class A rather than B, defined as:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In Equation 1, we first identify a set of rationales in given inputs, as described in Section 3.1, and in Equation 2 we generate counterfactual examples with reversal mechanism as presented in Section 3.2. In Equation 3, we take the selected counterfactual example along with original example and external knowledge as input, and employ a knowledge-aware generator to produce contrastive explanation as detailed in Section 3.3.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Long, fascinating, soulful. Never have I been so sad to see ending credits roll.  3 Approach
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Considering that rationales are important features of an instance, it is essential to regard rationales as key perturbations for counterfactual example generation. In this paper, we formulate rationale identification as a token-level sequence labelling task where 1 indicates a rationale token and 0 indicates a background token. Being similar with (Thorne et al., 2019), we first construct the input sequence for a premise p and a hypothesis h as S p = s Label s P remise s and S h = s Hypothesis s , where s is a special token that separates the components. Let y represent the relation between S p and S h where y ∈ {entailment, contradiction, neutral}. For each instance, we need to identify a subset r of zero or more tokens as rationales from both premise and hypothesis sentences. Both premise and hypothesis are encoded with RoBERTa (Liu et al., 2019), yielding hidden representation H p =[· · · , h p j , · · · ] and H h =[· · · , h h i , · · · ] respectively. As rationalizer is proposed by (Zhao and Vydiswaran, 2021), we follow this work for rationale identification using cross attention to embed the hypothesis (premise) into premise (hypothesis), which is defined as:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
where a ij denotes the attention score of j th token in premise to the i th token in the hypothesis, L p denotes the length of the premise sentence and W 1 is a trainable parameter matrix. The representation of i th token in the hypothesis, denoted asĥ h i , is created by concatenating its original state representation, max-pooling representation over h p , and the corresponding sum of attention representation from h p . At last, we use a softmax layer with a linear transformation to model the probability of the i th token in S h being a rationale token.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
As we have introduced above, counterfactual examples of other classes are of key importance to generate contrastive explanations. In this part, we describe how to generate counterfactual examples.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Given a trained neural network model f , the problem of generating counterfactual example for an instance x is to find a set of examples c 1 , c 2 , ..., c k that lead to a desired prediction y .
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
The counterfactual examples are explainable and contrastive when they appropriately consider proximity, diversity and validity.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Here, we define a three-part loss function to select qualified counterfactual example:  where λ 1 and λ 2 are hyperparameters for balancing L dist and L div . For generating counterfactual example, the validity term, which ensures the generated counterfactual examples have desired prediction target, is defined as:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Meanwhile, the generated examples should be proximal to the original instance as described in (Cheng et al., 2020), which means only a small change needs to be made. We do not expect a big change that transforms a large portion of the original, in which way there will be no difference with merely presenting an example of counter classes and the corresponding explanation will be uninformative or useless. That is, we expect that resultant examples are able to preserve the main content of input while changing domain-related parts.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In this paper, we choose a weighted Heterogeneous Manhattan-Overlay Metric (Wilson and Martinez, 1997) to calculate the distance as follows:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
where t indicates a rationale. To achieve diversity, we want generated examples to be different from each other. Specifically, we calculate the pairwise distance of a set of counterfactual examples and minimize:
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
After defining the loss function, we use a reversal mechanism to produce counterfactual examples. In the reversal mechanism, we use hypernym and hyponym of tokens in WordNet 2 for perturbation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For example, as shown in Figure 2, the original premise and hypothesis are "a woman and a young child are making sculptures out of clay" and "a man and a woman painting on canvas", and the label is "contradiction". We find from Word-Net the hypernyms of "making sculptures out of clay" and "painting on canvas" as "doing art" and "making something" respectively. We replace them with their hypernyms to obtain counterfactual examples, and use the model f trained on the original P-H training dataset to predict the resultant examples (Equation 7), and keep those belong to neutral or entailment. After the validity justification, we perform further selection by following Equation 8 and Equation 10, and choose the samples with the smallest loss for neutral and entailment for latter contrastive explanation generation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
After obtaining qualified counterfactual examples, some work (Cheng et al., 2020;Wachter et al., 2017;Verma et al., 2020) provides them as counterfactual explanation directly. However, since counterfactual examples do not provide explanations explicitly, it could be difficult for users to understand. Hence, in this part, we focus on generating contrastive explanation via knowledge-aware generative language model, which explain "WHY A NOT B" rather than merely "WHY A".
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
While traditional approach generate explanation with SHAP 3 or LIME 4 , recent work has exploited to use pre-trained generative language models (Radford et al., 2019;Lewis et al., 2020;Raffel et al., 2020). In this paper, we use knowledgeaware pre-trained language model to generate contrastive explanation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Knowledge Extraction Given selected counterfactual examples and identified rationales, we extract relevant knowledge to enhance the generative language model. We acquire structured knowledge and rationale definitions from ConceptNet 5 and dictionary source 6 separately. For ConceptNet, we extract knowledge with Breadth-First-Search (BFS) algorithm as described in (Ji et al., 2020). For dictionary, we extract the definition of rationales by following (Chen et al., 2020a). After extraction, we concatenate these knowledge for training knowledge-aware explanation generator.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For contrastive explanation generation, we divide the "WHY A NOT B" problem into two simple question: 1) why the label of the input belong to A, 2) why the label of the input not belong to B.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In previous study, (Kumar and Talukdar, 2020) proposed a label-specific explanation generator, which fine-tuned GPT2 independently for each label. However, the generator can only produce explanations for "WHY A". For the other part of contrastive explanation, we collect some contrastive explanations annotated by human and use them to fine-tune a "WHY NOT B" generator.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Taking a premise-hypothesis pair x along with the qualified counterfactual example x and extracted knowledge K E as input, which is in the form of s Label s x s x s K E s , our finetuned language model generates explanations that support the corresponding label in a "WHY A NOT B" way. With these explanations, end-users can observe and understand the difference between original input and counterfactual example explicitly.  (Camburu et al., 2018) extend the SNLI dataset to e-SNLI 8 with natural language explanations of the ground truth labels. Annotators were asked to highlight words in the premise and hypothesis pairs which could explain the labels and write a natural language explanation using the highlighted words. In this paper, we use the highlighted words for rationale identification and use the natural language explanation to fine-tune the language model based "WHY A" generator.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
IMDB The IMDB dataset (Maas et al., 2011) is a movie reviews dataset for sentiment classification. It contains 25,000 training data and 25,000 test data with movie reviews labeled as positive or negative. In this paper, we use IMDB as a out-of-domain dataset to evaluate if counterfactual examples can improve the robustness of our model.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
We are committed to generate contrastive explanations which can distinguish the predicted label and others at semantic level, hence, BLEU (Papineni et al., 2002) score is not a proper way to measure the quality of explanations. That is, it can be better confirmed by manual evaluation. In this work, we use manual evaluation and case study for contrastive explanations quality evaluation. Meanwhile, we use accuracy to measure the effectiveness of generated contrastive explanations on improving model performance in terms of data augmentation (organized in the form of s CE s P remise s Hypothesis s ). Table 1: Different types of explanations, including token-level explanation, e-SNLI explanation and contrastive explanation. The explanation of e-SNLI explains why the label of a given pair is contradiction, while the contrastive explanation specifies why the label is contradiction and not neutral or entailment. 
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
ETPA (Camburu et al., 2018) propose Explain-Then-Predict-Attention (ETPA) that generates an explanation and then predicts the label with only the generated explanation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
NILE:post-hoc (Kumar and Talukdar, 2020) propose natural language inference over labelspecific explanations (NILE). A premise and hypothesis pair is input to label-specific a candidate explanation generator that generates natural language explanations supporting the corresponding label. The generated explanations are then fed into an explanation processor, which predicts labels using evidence presented in these explanations.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
LIREx-base (Zhao and Vydiswaran, 2021) propose LIREx-base that incorporates both a rationale enabled explanation generator and an instance selector to select only relevant, plausible natural language explanations (NLEs) to augment NLI models and evaluate on the standardized SNLI.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For rationale identification, we use RoBERTa-base to extract hidden representations and set the learning rate to 2e-5, dropout to 0.02, batch size to 8 and number of epochs to 10. Meanwhile, we use AdamW (Loshchilov and Hutter, 2018) as the optimizer and adopt cross-entropy loss as the loss function. In the counterfactual example generation part, we build a hypernym and hyponym table, and use hypernym and hyponym of tokens in Word-Net for perturbation. In the contrastive explanation generation part, we use GPT-2 as the generative language model for training "WHY A" generator and "WHY NOT B" Generator. For generator, we set the learning rate to 5e-5, adam epsilon to 1e-8, length for generation to 100. Explanation Generation for SNLI In Table 1, we present the inputs of our model, the results of our approach that include token-level explanation (rationales), counterfactual example and generated contrastive explanation, compared with manually annotated explanation and generated "WHY A" explanations by NILE:post-hoc and LIREx-base.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Compared with "WHY A" explanations that are simple and lack essential information, the contrastive explanation contains more information such as "making sculptures out of clay is a type of art" and "making sculptures is different from painting on canvas". As shown in Table 1, we provide not only the contrastive explanation but also the identified rationales and reversed counterfactual example for reference.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
To quantitatively assess contrastive explanations, we compared our method with LIREx-base and NILE:post-hoc in terms of explanation quality through human evaluation on 100 SNLI test samples. The explanation quality refers to whether an explanation provides enough essential information for a predicted label. As shown in Table 2, contrastive explanations produced by our method have a better quality by obtaining over 2.0% and 9.0% than LIREx-base and NILE:post-hoc . Explanation Enhanced NLI In Table 3, we report the experimental results of our method and other baselines include BERT, SemBERT , CA-MTL (Pilault et al., 2021), NILE:post-hoc (Kumar and Talukdar, 2020) and LIREx-base (Zhao and Vydiswaran, 2021) on SNLI. With contrastive explanations, we are able to improve the performance of both BERT-large and RoBERTa-large. Compared with NILE:posthoc (Kumar and Talukdar, 2020), the same scale BERT-large model with contrastive explanations brings a gain of 0.4% on test, which indicates the knowledge-aware contrastive generator are better than the generator of NILE. Compared with LIREx-base that uses RoBERTa-large (Zhao and Vydiswaran, 2021), the BERT-large model and RoBERTa-large with contrastive explanations bring a gain of 0.3% and 1.0% separately, which suggests contrastive explanations are better than rationale enabled explanation. In general, contrastive explanations can achieve new state-of-art performance and get it closer to human annotation (a gain of 1.1% on BERT-Large). We believe that contrastive explanations contain more helpful information (e.g., relations between rationales, differences between original and counterfactual examples) that can be used to improve model performance.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
We perform ablation studies with BERT-large on the SNLI dataset to evaluate the impacts of different components employed in our method, and report the results in Table 4 
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In this part, we use the generated counterfactual ex-  Counterfactual example aims to find a minimal change in data that "flips" the model's prediction and is used for explanation. (Wachter et al., 2017) first propose the concept of unconditional counterfactual explanations and a framework to generate counterfactual explanations. (Hendricks et al., 2018) first consider the evidence that is discriminative for one class but not present in another class, and learn a model to generate counterfactual explanations for why a model predicts class A instead of B. In this paper, we focus on counterfactual example generation providing contrastive example for natural language inference.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For post-hoc explainable NLP system, we can divide explanations into three types: feature-based, example-based and concept-based. For feature-based explanation, (Ribeiro et al., 2016) propose LIME and (Guidotti et al., 2018) extend LIME by fitting a decision tree classifier to approximate the non-linear model. However, there is no guarantee that they are faithful to the original model. For example-based explanation, (Kim et al., 2016) select both prototypes and criticisms from the original data points. (Wachter et al., 2017) propose counterfactual explanations providing alternative perturbations. For concept-based explanation, (Ghorbani et al., 2019) explains model decisions through concepts that are more understandable to human than individual features or characters. In this paper, we integrate counterfactual example and concepts for contrastive explanation generation.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For natural language inference, (Bowman et al., 2015) propose SNLI which contains samples of premise and hypothesis pairs with human annotations. In order to provide interpretable and robust explanations for model decisions, (Camburu et al., 2018) extend the SNLI dataset with natural language explanations of the ground truth labels, named e-SNLI. For explanation generation in NLI, (Kumar and Talukdar, 2020) propose NILE, which utilizes label-specific generators to produce labels along with explanation. However, (Zhao and Vydiswaran, 2021) find NILE do not take into account the variability inherent in human explanation, and propose LIREx which incorporates a rationale enabled explanation generator. In this paper, we consider generating contrastive explanations in NLI.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
In this paper, we focus on knowledge-aware contrastive explanation generation for NLI. We generate counterfactual examples by changing identified rationales of given instances. Afterwards, we extract concepts knowledge from ConceptNet and dictionary to train knowledge-aware explanation generators. We show that contrastive explanations that specify why a model makes prediction A rather than B can provide more faithful information than other "WHY A" explanations. Moreover, contrastive explanations can be used for data augmentation to improve the performance and robustness of existing model. The exploration of contrastive explanation in other NLP tasks (i.e. question answering) and better evaluation metrics for explanation will be performed in the future.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Reported Experimental Results Here, we report some other experimental results for reproduction. We use 2 RTX-6000 GPUs for generator training. For each epoch, it takes 3 hours to fine-tune the contrastive generator. As we set 4 epochs for each "WHY A" generator and "WHY NOT B" generator, it takes 12 hours for each approach. There are 355M parameters in RoBERTa-large, 340M parameters in BERT-large and 345M parameters in GPT2-medium. And our code is based on Pytorch.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
The Difference between Counterfactual Example and Contrastive Explanation In this paper, we generate contrastive explanations with qualified counterfactual examples. As counterfactual examples provide example-based explanations, the contrastive explanations provide concept-based explanations and explain "WHY A NOT B". Meanwhile, for end-user, contrastive explanations are easier to understand than counterfactual example, which can integrate external knowledge from knowledge bases.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
Common Replaced Words Here, we show some common replaced words in reversal mechanism.
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For entailment to neutral, the top 10 removed words are "man, wearing, white, blue,black, shirt, one, young, people, woman", the top 10 inserted words are "people, there, playing, man, person, wearing, outside, two, old, near". For entailment to contradiction, the top 10 removed words are "man, wearing, white, blue,black, two, shirt, one, young,people", the top 10 inserted words are "people, man, woman, playing,no, inside, person, two, wearing, women".
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For contradiction to neutral, the top 10 removed words are "wearing, blue, black, man,white, two, red, sitting, young, standing", the top 10 inserted words are "people, playing, man, woman, two, wearing, near, tall, men, old". For contradiction to entailment, the top 10 removed words are "wearing, blue, black, man,white, two, red, shirt, young, one", the top 10 inserted words are "people, there, man, two, wearing,playing, people, men, woman, outside".
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
For neutral to entailment, the top 10 removed words are "white, wearing, shirt, black,blue, man, two, standing,young, red", the top 10 inserted words are "playing, wearing, man, two, there, woman, people, men, near, person". For neutral to contradiction, the top 10 removed words are "white, man, wearing, shirt,black, blue, two, standing,woman, red", the top 10 inserted words are "woman, man, there, playing,two, wearing, one, men, girl,no".
KACE: Generating Knowledge Aware Contrastive Explanations for Natural Language Inference
The Demand For Contrastive Explanation A "contrastive explanation" explains not only why some event A occurred, but why A occurred as opposed to some alternative event B. Some philosophers argue that agents could only be morally responsible for their choices if those choices have contrastive explanations, since they would otherwise be "luck infested". Moreover, if the answer predicted by a well-trained model is A but confusing with B, it is natural for end-users to ask "why the answer is A rather than B". A similar scenario is possible to occur when a child is going to recognize characters or learn other language skills. Therefore, contrastive explanation generation is essential in critical domains.