A Survey of Contrastive and Counterfactual Explanation Generation Methods for Explainable Artificial Intelligence | Stepin, Alonso, Catala Pereira-Fariña

  • Theoretical foundations of contrastive and counterfactual explanations
  • State-of-the-art computation frameworks
  • To what extent are these frameworks grounded in the theoretical approaches?
  • Provides a taxonomy both for theoretical and practical approaches.

Their description of contrastive and counterfactual explanations:

The need of generating more human-like explanations has attracted AI researchers’ attention to particular properties of explanation as well as its sub-types [11]. Thus, it appears particularly challenging to explain a given algorithm’s output in terms of reasonable yet non-occurring alternatives given a possibly infinite set of such options. Furthermore, this can be enhanced with the ability of suggesting relevant changes in the input so that the algorithm outputs a different decision. (11975)

Background

Contrastive explanations

  • Why P rather than Q?
  • Pragmatic approach: "Thus, supporters of the pragmatic approach to explanation argue that it is exactly the ability to distinguish the answer to an explanatory question from a set of contrastive hypothesized alternatives that provides the explainee with sufficiently comprehensive information on the reasoning behind the question [13]" (11975)
  • this form of explanation can be cast in terms of probabilities: probability of the observed event P should be higher than the alternatives Q1, Q2
  • contrastive reasoning important in cognition
  • this probabilistic interpretation as a basis of abductive inference: best explanation is most likely hypothesis among competing hypotheses.

Counterfactual explanation

Counterfactual thinking is thinking about past possibilities and past or present impossibilities (cf. 11975), or briefly: what could have been.

Formulation of counterfactual reasoning is a bit more specific: "the combination of imagining an alternative scenario in relation to the one that actually happened and the exploration of its consequences" (11975)

The counterfactual states "implicitly or explicitly contradict factual world knowledge" (11975); in the sense that it is other than what actually happened; it is at this moment no longer possible to happen as a past possibility that did not actualize. (I'm suddenly getting Agamben vibes)

Logical structure:

1) antecedent P with alternative event 2) had P be the case, then Q would have been the case 3) "binary counterfactual dependency relation between them" (11976) * Not sure what this means; that Q is not currently the case, because P is not the case? I.e. a causal relation?

Different interpretations (see paper for author refs):

  • Antecedent is factually false, irregardless of truth of Q
  • Antecedent is "expected" to be false
  • Both antecedent and consequent must be factually false

Counterfactual in computer science setting:

In this setting, the truth of a counterfactually inferred statement is resolved by: (1) modeling a situation where the smallest possible change in features of the actual world (as set in the antecedent) leads to a different (possibly, desired) state of things (the so-called ‘‘closest’’ or ‘‘nearest’’ possible world); and (2) estimating what is true in that setting [35] (11975)

Relation counterfactual with causality. This is also how I've encountered this as a sufficient condition for a causal relation, e.g. in Pearl-Theoretical impediments machine learning . A requirement for stating that P caused Q, is showing that if P had not been, Q would not have been as well. I find the following description slightly confusing though because here the order seems to be partially reversed: 1) you find a causal relation 2) from which you can conclude a counterfactual conditional 3) which in turns allows you to formulate a conditional for a causal relation ...

A counterfactual definition of a cause of an arbitrary event traces back to Hume [38]. According to him, a cause is an object (antecedent) that justifies the existence of another object (consequent) which it is followed by: ''If the first object had not been, then the second never had existed''. Therefore, once a causal connection between the antecedent and the consequent is established, a counterfactual conditional can be generalized to be a conditional claim about an alternate possibility and its consequences of the form ‘‘If X were to occur, then Y would (or might) occur’’ [33]

Q: Does this fit with all three interpretations from above?

Logically speaking, we have the equivalence:

  • P -> Q
  • not P -> not Q

But that's a bit too rigid for reality perhaps.

Pearl framed this in terms of probability: What's P(Y=1 | X=1), when we know that P(Y=0 | X=0)?

What's the distinction between contrastive and counterfactual explanation?

Contrastive and counterfactual explanations are related, but sometimes in the literature they are treated as exactly the same ór as very distinct.

They summarize a few interpretations. I kind of expected the authors to clearly state their definition, but they don't. Their main point is that the proces of generating an explanation can be quite different given different interpretations.

In context of AI

Ah, here they do seem to give a more definite distinction!

It is important to note that contrastive explanations point to the difference between the actual and a hypothetical decision. On the other hand, counterfactual explanations specify necessary minimal changes in the input so that a contrastive output is obtained. However, these terms are sometimes used interchangeably in the context of XAI [48], [49]. (11977)

The following section is very relevant for me, because it combines the themes of case-based reasoning and counterfactuals.

In the context of XAI, an explanation for an automatic decision or prediction, treated as an observation, can be obtained abductively by attempting the search problem over the set of the known information concerning that observation [50]. Alternatively, counterfactual explanation is widely addressed in the paradigm of case-based reasoning, i.e., a family of problem solving methods based on appeals to precedent solutions. In this setting, generating the most suitable counterfactual may be viewed as a search problem where the most similar precedent is looked for among those making part of the case database [14]. Furthermore, Keane et al. argue that applying case-based reasoning techniques for generating counterfactuals increases their explanatory competence [51].

  • 50: doesn't seem too relevant; text book
  • 14: F. Sørmo, J. Cassens, and A. Aamodt, ‘‘Explanation in case-based reasoning—Perspectives and goals,’’ Artif. Intell. Rev., vol. 24, no. 2, pp. 109–143, 2005
  • 51: Highly relevant M. T. Keane and B. Smyth, ‘‘Good counterfactuals and where to find them: A case-based technique for generating counterfactuals for explain- able AI (XAI),’’ in Case-Based Reasoning Research and Development. Cham, Switzerland: Springer, 2020, pp. 163–178.

CF in ML: (relatively) data-agnostic; model-agnostic; post-hoc:

Counterfactual explanations are normally considered contrastive by nature and therefore present a source of valuable complementary information to a given automatic prediction [52]. For instance, a counterfactual explanation of an ML-based algorithm prediction may describe ‘‘the smallest change to the feature values that changes the prediction to a predefined output’’ [53]. An important advantage of counterfactual explanations over their non-counterfactual analogs is that they are devoid of any prerequisites to the data or model. Indeed, counterfactual explanations are data-agnostic as they can be based on the features of the neighbouring data examples extracted from the same training set and/or on the data generated synthetically around the data instance in question. (11977)

  • 52: R. M. J. Byrne, ‘‘Counterfactuals in explainable artificial intelligence (XAI): Evidence from human reasoning,’’ in Proc. 28th Int. Joint Conf. Artif. Intell., Aug. 2019, pp. 6276–6282.
  • 53: Molnar, Interpretable Machine Learning

Taxonomy

 Stepin2021 - contfactual taxonomy