Informative Semi-Factuals for XAI: The Elaborated Explanations that People Prefer
Recently, in eXplainable AI (XAI), $\textit{even if}$ explanations -- so-called semi-factuals -- have emerged as a popular strategy that explains how a predicted outcome $\textit{can remain the same}$ even when certain input-features are altered. For…
Authors: Saugat Aryal, Mark T. Keane
Informativ e Semi-F actuals for XAI: The Elab orated Explanations that P eople Prefer Saugat Ary al 1 , 2 ( ) and Mark T. Keane 1 , 2 1 Sc ho ol of Computer Science, Univ ersity College Dublin, Dublin, Ireland 2 Insigh t Researc h Ireland Centre for Data Analytics, Dublin, Ireland saugat.aryal@ucdconnect.ie mark.keane@ucd.ie Abstract. Recen tly , in eXplainable AI (XAI), even if explanations – so-called semi-factuals – ha ve emerged as a popular strategy that ex- plains how a predicted outcome c an r emain the same even when certain input-features are altered. F or example, in the commonly-used banking app scenario, a semi-factual explanation could inform customers ab out b etter options, other alternativ es for their successful application, b y sa y- ing “ Even if you asked for double the loan amount, you would still be accepted". Most semi-factuals XAI algorithms focus on finding maximal v alue-changes to a single key-feature that do not alter the outcome (un- lik e counterfactual explanations that often find minimal v alue-changes to several features that alter the outcome). How ev er, no cu rren t semi- factual metho d explains why these extreme v alue-changes do not alter outcomes; for example, a more informative semi-factual could tell the customer that it is their goo d credit score that allows them to b orro w double their requested loan. In this w ork, we adv ance a new algorithm – the informative semi-factuals (ISF) metho d – that generates more elab- orated explanations supplemen ting semi-factuals with information ab out additional hidden fe atur es that influence an automated decision. Exper- imen tal results on b enchmark datasets show that this ISF metho d com- putes semi-factuals that are b oth informativ e and of high-qualit y on key metrics. F urthermore, a user study shows that people prefer these elab o- rated explanations o ver the simpler semi-factual explanations generated b y curren t methods. Keyw ords: XAI · Explanation · Informative Semi-factuals · User Study . 1 In tro duction In recent years, as Machine Learning mo dels hav e b ecome more complex and opaque, eXplainable Artificial In telligence (XAI) has adv anced methods to im- pro ve the transparency of these mo dels, making their decisions more inter- pretable to humans. Indeed, in some jurisdictions explainability is a legal re- quiremen t (see e.g. the EU’s GDPR [26] and AI Act [9]). “If only" explanations using counterfactuals hav e been extensiv ely explored in XAI, as they naturally sho w human end-users ho w a model’s predictions can change when input-features are altered (often minimally). F or example, if I am turned do wn for a $70k loan 2 Saugat Aryal ( ) and Mark T. Keane and query the decision, I could be given a counterfactual (e.g., “If only y ou had ask ed for a slightly lo wer loan of $68k, y ou would ha ve been approv ed”) giving me some recourse on the outcome. Even if or semi-factual explanations are related but differ as they show users how a mo del’s predictions can r emain the same when input-features are altered. F or example, on b eing refused a $70k loan, a semi-factual explanation could say “Even if you asked for a $10k loan, you would still b e refused”; here, ev en though this explanation seems less helpful, it still tells me something ab out m y negativ e outcome (namely , that the bank considers me to b e a credit risk even for a muc h smaller loan). As w e shall see, semi-factuals are not alwa ys unhelpful as they can often inform users ab out gainful alterna- tiv es to outcomes (e.g., telling a farmer that even if they halv ed their fertilizer use, they would still get the same high crop yield). Here, we present a no vel algorithm for computing semi-factual explanations, one that aims to mak e them m uch more informativ e for p eople using AI decision-making systems. 1.1 Ho w Counterfactuals & Semi-F actuals Differ Although semi-factuals are a sp ecial case of the counterfactual – as they tell us ab out counters to the facts, albeit ones that do not change outcomes – they ha ve differen t computational constraints and psyc hological impacts than coun terfac- tuals; semi-factuals app ear to serv e very different explanatory purposes. T ypically , go o d counterfactuals are computed by finding minimal changes to features that alter negativ e outcomes; they inform us ab out alternative an- teceden ts that can change a bad outcome (e.g., asking for a lo wer amoun t to get a loan). People sp on taneously use counterfactuals to dra w atten tion to enabling conditions leading to a negative ev ent, that they may hav e o verlooked ([4]; e.g.,“If only it hadn’t been raining, the accident wouldn’t hav e happened”). F urthermore, coun terfactuals implicitly assume c eteris p aribus (i.e.,“other things being equal”); that the altered outcome is solely due to the sp ecified feature changes and is not due to any other hidden/unmentioned feature changes. This assumption has to hold for the coun terfactual to b e meaningful and informative. In contrast, go od semi-factuals often hinge on finding maximal changes to a feature that lead to the same outc ome (e.g., asking for a m uch low er loan and still being refused); they are often designed to rhetorically con vince people that a particular feature is not as important as it first seemed. F or example, if after asking for a $70k loan, I am told that I w ould still b e unsuccessful in a $10k-loan application, the semi-factual is indicating that loan-amount may not b e the main factor in the refusal (e.g., maybe credit score is more imp ortan t?). A ccordingly , semi-factuals can w eaken p eople’s causal understanding of even ts ([19]; e.g., changing a farmer’s b elief that more fertilizer equals higher yields). F urthermore, unlike coun terfactuals, semi-factuals do not seem to assume c eteris p aribus . Rather, implicitly , they seem to invite a consideration of other factors, hidden fe atur es that are affecting the outcome. F or instance, if loan-amount is not the main factor affecting m y refusal, what is? Am I b eing rejected b ecause of my age (I am too y oung) or income level (its to o low) or maybe it’s m y credit rating (its to o lo w). This observ ation suggests that semi-factual explanations Informativ e Semi-F actuals for XAI 3 Fig. 1: The decision space for three loans, with tw o features shown (i.e., Loan Amoun t in $s and Credit Score as CS), for three applicants: John, Mark and Mary . John and Mark hav e their loans accepted but Mary has been rejected. Mark asks for an explanation ab out how to get a b etter deal. The semi-factual (SF) tells him that with his 550 credit score, he can actually get a $65k loan. Mark previously though t that if he ask ed for more, he w ould end up b eing rejected like Mary . The semi-factual shows Mark the limits on his loan aplication giv en his credit score (n.b., if he asked for $70k, he w ould b e rejected like Mary). could b e made m uch more informative, if we could identify such hidden features in the decision pro cess and inform people ab out them. Figure 1 sho ws a loan scenario in whic h a semi-factual explanation could be made more informative by rev ealing information about other features. Imagine Mark has tw o friends – John and Mary – who hav e recen tly applied for loans to the same bank as Mark. John, who has a decent credit score (of 700), asked for a lo wish loan ($17k) and w as successful. Mary was unsuccessful, p erhaps because she asks for a higher loan ($70k) and/or b ecause she has a p o or credit score (of 300). Mark has a lo w-to-fair credit score (of 550) and when he applies for a mo dest loan (of $20k), he is successful. But, he wan ts to know if he can get a b etter deal. Could he p erhaps b orrow more? Here, the semi-factual explanation could tell him, that even if he asked for a $65k loan he would b e successful, as his credit score is go o d enough to make him less of a risk than Mary . A t present, no existing semi-factual metho d considers this additional information and such explanations ha ve not been user-tested. In this pap er, we consider b oth. 1.2 Computing More Informative Semi-F actuals Ary al & Keane [2] found that most semi-factual methods compute explanations that hav e maximal v alue-changes, t ypically to a single key feature of a query instance, that lea ve the outcome unaltered. F or example, their Most Distant Neigh b or (MDN) metho d considers eac h feature-dimension of the query and 4 Saugat Aryal ( ) and Mark T. Keane Fig. 2: The righ tmost graph shows a decision space for Mark and his semi-factual explanation (SF), with a path betw een them based on tw o p erturbation steps (Q’ and Q”) in whic h the key-feature lo an amount is systematically increased from $20k to $65K, without c hanging cr e dit-sc or e (which sta ys at 550). The leftmost graphic shows the relative changes in the marginal con tributions of these tw o features across these p erturbed instances as they remain in the loan-accept class. As lo an amount increases its marginal con tribution to keeping instances in the loan-accept class decreases (see purple plot) and even though cr e dit-sc or e’s v alue do es not c hange, it’s marginal con tribution increases (see or ange plot) revealing this se esaw p attern betw een the tw o features. tries to find another instance in the dataset that is furthest from it, while still b eing in the same class. Ho wev er, none of these metho ds consider "why" it is p ossible to radically change a k ey-feature’s v alue without causing a class-c hange. So, none of these metho ds pro vide users with a r e al ly informative semi-factual, one that explains the other hidden features influencing the decision outcome (e.g., explaining to Mark that loan amoun t ma y not b e the most imp ortan t factor, but that credit score b ecomes more important). It is the computation of these more informativ e semi-factuals that is the main fo cus of this pap er. Our hypothesis is that these more informative semi-factuals reflect lo cal c hanges in the relativ e importance of different features across differen t instances in the data distribution. Imagine a p erturbation path b etw een Mark and his semi-factual (SF), created b y systematically changing only the v alue of the loan amoun t in incremental steps (see right of Figure 2). F or any given predictive mo del, w e can assess the marginal con tribution of these feature c hanges for a giv en instance with resp ect to it remaining in its curren t class or mo ving to another class. Over these p erturbation steps, as lo an amount increases, in- stances mov e closer to the decision b oundary with the loan-reject class. But, these c hanges do not tip it into the loan-reject class because credit-score’s influ- ence is simultaneously increasing (see left of Figure 2). Ev en though, inevitably , increasing lo an amount will even tually flip the class, ov er these p erturbations cr e dit sc or e is effectiv ely blo cking that class change, as its marginal contribution Informativ e Semi-F actuals for XAI 5 increases (n.b., ev en though credit-score’s v alue do es not c hange). Hence, there is a c haracteristic se esaw p attern in the imp ortance of these tw o features, as the lo an-amount key-feature weak ens and credit-score hidden-feature strengthens. Based on these ideas, we prop ose a nov el explanation algorithm – the Infor- mative Semi-factuals (ISF) metho d – that relies on computing these changing feature contribution patterns in different feature-t yp es as a new constrain t in a m ulti-ob jectiv e XAI method (see Section 2). W e then rep ort some user studies to test whether p eople actually find these elab orated semi-factuals to b e more useful as explanations of automated decisions (see Section 4). Our intuition was that these patterns of changing imp ortance b et ween key- and hidden-features occur in most goo d semi-factuals. T o test this in tuition w e carried out an extensiv e test on a large sample of the best semi-factuals pro duced by an ensemble of the main semi-factual metho ds in the literature (see App endix A.1). This dataset of explanations came from comprehensive tests of 8 differen t semi-factual methods applied to 7 represen tative tabular datasets (using 5-fold cross-v alidation) ev aluated against 5 key metrics (i.e., L2-norm distance, plausibilit y , confusability , robustness, sparsity) [3]. Based on a large sample of queries from these datasets, ∼ 10,000 of the b est semi-factuals were identified irresp ectiv e of the explanation metho d that produced them (n.b., most were generated-instance explanations rather than existing data-p oints). This analysis sho wed that 89% of the b est semi-factuals found show the seesaw pattern of c hanging marginal contributions b et ween key- and hidden-features (akin to that sho wn in Fig. 2). So, it app ears that this prop erty of semi-factuals has alw ays b een present in go o d semi-factuals, and can, therefore, b e used to compute more informativ e semi-factuals for end users. Hence, w e pro ceeded to implemen ted a new semi-factual explanation metho d with these new constrain ts. 1.3 Outline of Paper & Con tributions In the remainder of this paper, we begin by formally defining informativ e semi- factuals that include new constrain ts along with their traditional requirements (Section 2.1). Subsequently , w e introduce a nov el metho d that computes these informativ e semi-factuals based on the defined prop erties (Section 2.2). In Sec- tion 3, computational exp erimen ts are run to ev aluate the p erformance of this new metho d in obtaining informative and go o d semi-factuals by comparison to existing methods. Next, w e rep ort tw o user studies to examine whether p eople find these elaborated explanations to be more useful (Section 4). Finally , w e review the existing works in semi-factual literature (Section 5), b efore closing with some discussion (Section 6). As such, the pap er makes three new con tributions to the field of semi-factual explanations by (1) defining a new desideratum for semi-factuals, namely the necessit y to surface hidden features to pro vide more informative explanations, (2) prop osing a nov el metho d for computing this new requirement, the Informative Semi-factuals (ISF) metho d, along with tests showing it pro duces the b est semi- factuals, (3) rep orting t wo nov el user tests sho wing that people prefer these elab orated semi-factual explanations o v er ones lacking suc h elab oration. 6 Saugat Aryal ( ) and Mark T. Keane 2 Computing Informative Semi-factuals Earlier, we adv anced the argumen t for computing more informative semi-factuals, ones that conv ey a better men tal mo del of the feature contributions leading to v arious automated decisions. This argument hinged on the proposal that go o d semi-factual instances inv olve a seesa w pattern in which the marginal contri- bution of key-features w eaken (i.e, key-fe atur e we akening ) as the con tribution of hidden-features simultaneously strengthen (i.e, hidden-fe atur e str engthening ) relativ e to the presented query instance. In this section, we prop ose a new al- gorithm for computing these more informative semi-factuals - the Informative Semi-factual (ISF) metho d – based on implementing these ideas as new con- strain ts on semi-factual generation. Accordingly , we need to extend the current desiderata for semi-factuals to formally sp ecify these new constrain ts (see Def- inition 2). Then, armed with this new sp ecification w e set ab out defining a m ulti-ob jectiv e optimization metho d for computing “b etter” semi-factuals, ones that giv e p eople more informativ e explanations (see Section 2.2). 2.1 F ormalizing Informative Semi-factuals Informativ e Semi-factuals are formalized in the following definitions that are distinguished from previously-prop osed semi-factuals by the addition of tw o new constrain ts ab out feature-con tribution changes. Preliminaries. Let ˆ f : X D → Y b e a prediction mo del, X the D-dimensional feature space and Y a set of desired outcomes. Let γ : [0 , 1] → X b e a path from x q to x sf in the feature space, with γ (0) = x q and γ (1) = x sf , where x q is the query and x sf is the semi-factual explanation. F or a feature j , let ϕ j ( t ) denote its marginal con tribution to the prediction ˆ f ( γ ( t )) at p oint t where t ∈ [0 , 1] and T ϕ j is the trend strength of the marginal con tribution measured by: T ϕ j = Z 1 0 d dt ϕ j ( t ) dt (1) Definition 1 (Semi-factual Explanation). A semi-factual explanation, x sf for a query instanc e x q is a data p oint that satisfies the fol lowing: (i) x sf has the same pr e diction as x q , (ii) x sf differs fr om x q on a key-fe atur e dimension, k (ide al ly 1), (iii) x sf is close to x q along al l other fe atur es, and (iv) x sf is a plausible instanc e ac c or ding to the pr ob ability distribution P X . Definition 2 (Informativ e Semi-factual Explanation). A given semi-factual explanation, x sf (as define d in Definition 1), wil l b e an informative semi-factual explanation if it additional ly satisfies two pr op erties: – Key-fe atur e W e akening: The key-fe atur e’s mar ginal c ontribution, ϕ k ( t ) has a de cr e asing tr end when moving fr om x q to x sf along γ : T ϕ k < ϵ (2) wher e ϵ < 0 is the tr end str ength p ar ameter. Informativ e Semi-F actuals for XAI 7 – Hidden-fe atur e Str engthening: Ther e exists a non-key hidden-fe atur e, which simultane ously exhibits the maximum incr e asing tr end in its mar ginal c on- tribution ϕ j ( t ) when tr ansitioning fr om x q to x sf along γ : j ∗ = arg max j ∈{ 1 ,...,D }\{ k } T ϕ j (3) In the next sub-section, we show ho w these definitions can b e implemen ted in the Informativ e Semi-factual metho d. 2.2 ISF: The Informative Semi-factual Metho d T aking the ab o ve sp ecifications we implement this new Informative Semi-factual (ISF) metho d using a multi-ob jective optimization approac h where the tradi- tional requiremen ts for a go o d semi-factual are pitted against the new constrain ts on patterns of marginal contribution changes. Stated simply , this method tries to balance the generation of semi-factuals with maximal v alue-change on key- features against the marginal con tribution trends of key- and hidden-features. The semi-factual generation problem can b e translated as following multi- ob jective minimization task: min x F ( x ) := min x ( - o 1 ( x, x q ) , o 2 ( x, x q )) sub ject to: g 1 ( ˆ f ( x ) , ˆ f ( x q )) ≤ 0 and g 2 ( x ) ≤ 0 (4) Here, the first ob jective o 1 ensures maxim um distance b et ween x and x q along k ey-feature dimension, k : o 1 ( x, x q ) = | x k − x k q | (5) Since, the goal is to maximize this distance, we minimize - o 1 . The second ob- jectiv e o 2 ensures minimizing the cumulativ e distance across all features except the k ey feature, encouraging similarity on non-k ey features: o 2 ( x, x q ) = X i = k | x i − x i q | ∀ i ∈ D (6) This g 1 constrain t ensures that x and x q ha ve the same class: g 1 ( ˆ f ( x ) , ˆ f ( x q )) = I ( ˆ f ( x ) = ˆ f ( x q )) = 0 (7) The second constraint, g 2 ensures that x remains within a plausible region of the data distribution. T o do so, we in tro duce a constraint suc h that the Proba- bilit y Densit y F unction (PDF) of x lies within a dynamic threshold range. The range is based on the mean of the probability distribution of the observ ed data adjusted b y an adaptive factor, whic h scales with the v ariability of the data: g 2 ( x ) = I [( µ − ∆δ ) ≤ log P ( x ) ≤ ( µ + ∆δ )] (8) 8 Saugat Aryal ( ) and Mark T. Keane where µ is the mean log-p df of the data distribution, P X and ∆δ is an adaptiv e threshold range, defined as: ∆δ = θ ∗ σ (9) where σ is the standard-deviation of the log-p df of the data distribution and θ is a scaling parameter whic h controls the strictness of the constrain t. This optimization metho d pro duces a set of div erse and equally v alid semi- factuals. Next, we analyze the marginal con tribution of th e features in these ex- planations to obtain informative semi-factuals. T o do so, for eac h of the explanation- solutions, w e linearly interpolate from x q to x sf as: x ( t ) = (1 − t ) x q + tx sf (10) where t ∈ [0 , 1] and x ( t ) is an instance during interpolation at p oin t t with t = 0 at x q and t = 1 at x sf . During each step of interpolation, the marginal con tribution of all the features (both key and non-key) on the outcome are noted. Sp ecifically , their pure main effects, ϕ j ( t ) , are determined to obtain a go od estimation of how feature-influences are changing independently during in- terp olation. T rends in marginal contributions are identified using the Kendall’s tau of Mann-Kendall test [18]. Finally , we select those instances in which the k ey-feature’s con tribution has the low est decreasing trend as the best candidate semi-factual explanation. Concurrently , for this selected explanation, we iden- tify the non-k ey feature with the highest increasing trend as the hidden-feature comp onen t, to form the most informative semi-factual explanation. F or a giv en query , we run the metho d by treating eac h of its features as a key-feature to obtain multiple informative semi-factuals across each feature- dimension before selecting the best of the best as the final informativ e explana- tion that has the o verall lo west k ey-feature-weak ening trend. 3 T esting ISF Algorithm T wo computational experiments compared ISF’s p erformance on represen tative datasets to the performance of an ensemble of leading semi-factual metho ds. The first exp eriment determined whether ISF’s semi-factual generation process cor- rectly pro duced explanations with the requisite prop erties (i.e., the k ey-feature w eakening and hidden-feature strengthening pattern) relativ e to ensemble meth- o ds that w ere not sp ecifically designed to compute these properties. The second exp erimen t ev aluated the semi-factuals generated by ISF b y comparison to the b est semi-factuals generated by the ensemble metho ds to determine their rel- ativ e go o dness on the traditional metrics. In b oth exp erimen ts a lea ve-one-out cross-v alidation was p erformed in which eac h query instance w as used to gener- ate candidate semi-factuals for every dataset (for source co de and data see her e ). T aken together these exp erimen ts determine whether (i) ISF really do es what it claims to do in generating informativ e explanations, and (ii) ISF pro duces qualit y semi-factual explanations that are comp etitive with the SOT A. Informativ e Semi-F actuals for XAI 9 Setup: Datasets & Benchmarks. Both exp erimen ts used fiv e b enc hmark, publically-a v ailable tabular datasets, all of whic h w ere binary-classed: Adult In- come, Blo od Alcohol, PIMA Diab etes, German Credit, and HELOC. F ollo wing [24], all categorical features in these datasets were enco ded in to a numerical space using distance metrics. ISF’s p erformance was b enc hmarked against the b est explanations pro duced b y an ensemble of leading semi-factual metho ds: the CBR-based Lo cal-Region metho d [23], Knowledge-Ligh t Explanation-Oriented Retriev al (KLEOR)[5], Diverse Semi-factual Explanations of Reject (DSER) [1], PIECE [14], C2C-V AE [28], MDN[2], S-GEN[13], and DiCE [20]. PIECE and C2C-V AE had to b e modified to w ork with tabular data. F or DiCE, the desired class of the explanation was set to b e the same as that of the query , to allow it to generate semi-factuals not counterfactuals. App endices A.1, A.2 hav e full description of the models, the mo difications made to them and parameters used. ISF Implemen tation. ISF implemen ts the semi-factual generation as a m ulti-ob jectiv e minimization task using Equations (4)-(10). W e used Gaussian copula [21] to mo del the joint distribution of features and obtain P X . In Eq.(9) the threshold w as set as θ = 1 . 5 . The Nondominate d Sorting Genetic Algorithm II (NSGA-II) [7] w as used to solv e the constrained m ulti-ob jectiv e semi-factual problem. The algorithm efficiently approximates the P areto front to produce a set of div erse and equally-v alid semi-factual solutions. W e used an initial p opulation size of 50 for 100 generations (see Appendix A.3 for full details on parameters). A Random F orest Classifier mo del was used to determine class-mem b ership (i.e., as in the g 1 constrain t). The pure marginal contribution of features was com- puted using the diagonal en tries of the SHAP in teraction matrix [17] as it iso- lates the main effects. Sp ecifically , the T reeSHAP v arian t [16] w as used to w ork with the Random F orest mo del. T o compute the c hanges in marginal contribu- tions, we created 10 in termediate instances in terp olating from the query to the generated semi-factual. The trend in feature contributions o ccurring ov er these p erturbed instances w as analyzed using the Mann-Kendall trend test. The re- sulting Kendall’s tau ( τ ) coefficient w as used to measure trend strength, where τ ∈ [ − 1 , 1] indicates the direction and strength of the trend. W e set ϵ = − 0 . 3 in Eq.(2) as the trend strength for k ey-feature weak ening. 3.1 Exp erimen t 1: Informative Semi-factuals? Exp erimen t 1 w as designed to determine whether ISF really do es what it claims to do in generating informativ e explanations; namely , do es it identify semi- factuals with the seesa w pattern sho wing a w eakening of the key-feature along- side a strengthening hidden-feature. If these prop erties are prop erly iden tified then ISF will be able to provide informativ e explanations (e.g., as in “Mark, y ou can get a $65k loan, as y ou hav e a fair credit score”). Pro cedure. Across 5 datasets, a total of 38,223 queries w ere tested, record- ing the semi-factuals generated by ISF and the ensem ble. F or a given query , the b est semi-factual from the ensemble mo dels was selected to compare to that gen- erated b y ISF. Note, although none of the ensemble mo dels explicitly compute 10 Saugat Aryal ( ) and Mark T. Keane Fig. 3: F rom Expt.1, the p ercen tage of semi-factuals, for five datasets, generated b y the ISF and Ensem ble-metho ds (N=38,233 in total), that manifested the seesa w pattern in key-feature v ersus hidden-feature contributions. patterns of marginal con tributions, earlier tests show ed that they tend to gener- ate semi-factuals with these prop erties (though p erhaps not optimally so). The measure used was the percentage of semi-factuals generated by ISF/ensemble that sho wed the seesa w pattern in the changing marginal con tributions. Results. Figure 3 shows the p ercentage of semi-factuals generated b y ISF and the ensem ble that sho w ed the requisite seesa w pattern needed to compute informativ e semi-factual explanations. It shows that across all datasets ISF is able to produce more informative semi-facutals than the ensemble of leading metho ds, at v ery high lev els of almost 100% in 4 out of 5 datasets. 3.2 Exp erimen t 2: Informative Semi-factuals Are Also Go o d? In Exp erimen t 1, w e sa w that ISF regularly generates semi-factuals with the requisite seesaw pattern needed for more informative explanations. Using the same setup and procedure, Experiment 2 aimed to determine whether ISF’s semi-factuals were also the best semi-factuals relative to those pro duced b y the ensem ble of methods. So, it ev aluated the quality of semi-factuals generated by ISF and the ensem ble using standard metrics for assessing semi-factual go odness [2,3]. F our commonly-used ev aluation metrics were applied to all semi-factuals: – Distanc e: measures the L 2 -norm distance b et ween a query and its semi- factual where higher v alue is preferred. – Sp arsity: measures feature differences b et ween the query and semi-factual as a ratio of the desired- (set to 1) to observed-difference, where a higher v alue is b etter. – Plausibility: is measured as the distance b et ween a semi-factual and the nearest training datap oin t, where smaller v alue is b etter. – T rustworthiness: measures the confidence for a semi-factual for b eing in the query class compared to the counterfactual class, measured as the ratio of their class distances (normalized), where higher score is b etter. Informativ e Semi-F actuals for XAI 11 (a) Distance (b) Sparsity (c) Plausibility (d) T rustw orthiness Fig. 4: F rom Expt.2, the mean go odness scores for semi-factuals generated b y the ISF and Ensem ble-metho ds for the five datasets (N=38,233 in total), in each of the four ev aluation metrics (a-d). Results. Figure 4 sho ws that ISF produces goo d semi-factuals, that are consisten tly b etter than those produced b y the ensemble of leading metho ds on k ey ev aluation metrics. It consistently outp erforms the ensemble on Sparsity and T rustw orthiness for all datasets. ISF’s semi-factuals are sparse as they focus on c hanging only one k ey-features and are trusted to b e classified as b eing within the query class. These higher trust scores probably occur b ecause of supp ort from hidden features that k eep the semi-factual in the query class. ISF also do es better on Distance and Plausibilit y measures across most datasets. Ov erall, it is clear that ISF pro duces b oth informative and high-quality semi-factual explanations, ones that are generally b etter than the SOT A in the field. 4 T esting P eople’s Preferences for Explanations The computational exp erimen ts sho wed that ISF can generate v ery goo d, infor- mativ e semi-factuals, where we define an “informative” semi-factual to b e one sho wing the k ey-feature and its supp orting hidden feature (e.g., “Even if you ask ed for $65k you would be successful, as you hav e a fair credit score”). Ho w- ev er, user studies are also required to determine whether people think ISF’s ex- planations are acceptable and useful. T wo psychological exp erimen ts were carried 12 Saugat Aryal ( ) and Mark T. Keane Fig. 5: The p ercentage of p eople c ho osing the (a) Bare Semi-factual or Informa- tiv e Semi-F actual in User Study 1, and (b) the Go od or Bad Semi-factuals in User Study 2, for scenarios with the loan-accepted or loan-rejected outcomes out to assess this question, in which p eople assessed the utility of semi-factuals in a forced-c hoice task; that is, they w ere sho wn several loan-scenarios eac h of which had tw o semi-factual explanations and asked to select the one they though t was the most useful. Study 1 gav e p eople scenarios with and without the hidden-feature added to the explanation. Study 2 ga ve p eople scenarios with semi-factual explanations lac king hidden-features, but whic h w ere deemed to be go od or bad by the virtue of k ey-feature’s decreasing trend. 4.1 User Study 1: Do P eople Prefer Informative Explanations? T o our knowledge, Kenn y & Huang’s [13] study examining p eople’s preferences for counterfactuals and semi-factuals is the only XAI user test in this area; so, we adapted their design to test the ISF metho d. User Study 1 tested whether p eople prefer bare semi-factual explanations or the more elab orated ones generated by ISF (i.e., mentioning the key feature and the hidden feature). Participan ts w ere presen ted with loan-scenarios for different individuals, eac h of which had five features (Duration, Credit Amount, Age, Installment P ercent, Existing Loans) with loan-accepted/loan-rejected outcomes. F or each scenario, they w ere sho wn t wo explanations (counterbalanced in order of presen tation across items), one with the semi-factual on its own (Bare-SF; e.g., “Even if y ou ask ed for $65k you w ould b e successful”) and one showing the semi-factual with the added hidden feature (Informative-SF; e.g., “Ev en if you asked for $65k you would b e successful, as you hav e a fair credit score”). They were then ask ed to select the explanation they though t was the most useful as feedbac k to the customer. Metho d: Participan ts, Design, Materials & Pro cedure. P articipants ( N = 15 , based on a p ow er analysis for the single-group design) w ere recruited from Prolific.com and w ere pre-screened to b e nativ e English speakers from Ire- land/UK/USA/Australia/Canada/New Zealand who had not participated in previous related studies. They w ere paid £ 14/hr for their participation. The study emplo yed a 2 (Explanation T yp e: Bare-SF v Informative-SF) X 2 (Loan Informativ e Semi-F actuals for XAI 13 Outcome: Loan Accepted v Loan Rejected) within-sub ject design. Each partici- pan t w as presented with 32 differen t scenarios, half with loan-accepted and half with loan-rejected outcomes. Eac h scenario w as presen ted with the t wo versions of the explanation, with and without the hidden feature. F or eac h scenario the participan ts had to select the explanation they thought w as the most useful. F or analysis, the count for either c hoice for b oth loan outcome scenarios w ere coun ted, to b e expressed as a p ercen tage. Results. Figure 5(a) shows that p eople find the informative semi-factual ex- planations with the supp orting hidden-feature to more useful than those without that feature (69% v. 31% in loan accept and 80% v. 20% in loan reject scenarios). Binomial tests further confirmed that these preference differences is statistically significan t with p < . 0001 for b oth loan outcome scenarios. 4.2 User Study 2: Preferring Go od or Bad Explanations? Most semi-factual algorithms can b e t weak ed to pro duce goo d or bad explana- tions, but we kno w of no user study that has explicitly tested whether p eople consider such explanations to b e b etter or worse than one another. User Study 2 tested whether semi-factual explanations deemed to be goo d/bad by ISF w ere also deemed to b e go o d/bad b y p eople. Using the same loan materials, ISF’s pa- rameters w ere mo dified to pro duce semi-factuals with high or low scores on key ev aluation metrics. These semi-factuals w ere then presented as in User Study 1, with p eople being asked to select the one they though t was the most useful. T o mak e this a simple test, the explanations w ere presen ted as unelab orated, bare semi-factuals (even though, according to ISF, they had different hidden-feature patterns). So, all of these explanation-pairs used the same k ey-feature and w ere classed as go od or bad b y having distan t/close v alues for this key-feature and b y having strong/w eak see-saw patterns in their hidden features, respectively . Metho d: P articipan ts, Design, Materials & Pro cedure. A new sample of participan ts ( N = 15 ) w ere recruited using the same criteria and comp ensation as User Study 1. The exp erimental design and pro cedure remained the same, with the only difference b eing the Explanation Type. The study employ ed a 2 (Explanation T yp e: Goo d-SF v Bad-SF) X 2 (Loan Outcome: Load A ccepted v Loan Rejected) within-sub ject design. Each participant w as presented with 32 differen t scenarios, half with loan-accepted and half with loan-rejected outcomes. F urthermore, eac h scenario had “go o d” and “bad” semi-factuals from whic h the participan ts had to select the one they found the most useful. The go o d and bad semi-factuals were obtained from ISF by setting the trend parameter within − 1 ≤ ϵ ≤ − 0 . 8 and − 0 . 6 ≤ ϵ ≤ − 0 . 3 in Eq. (2) resp ectiv ely . Results. Figure 5(b) sho ws that p eople find ISF’s goo d semi-factuals to b e significan tly more useful than its bad semi-factuals (69% v. 31% in loan accept and 81% v. 19% in loan reject), discriminating their relativ e go odness as explanations, even when their underlying hidden-features are not pro vided. So, ev en when p eople encounter semi-factual explanations without hidden-feature elab orations, at some level, they ma y “kno w” that there is another factor at w ork (and hav e some sense of the strength of that other factor). 14 Saugat Aryal ( ) and Mark T. Keane 5 Related W ork While there are no previous studies which considers computing informativ e semi- factuals, w e review some of the key works in semi-factual literature from com- putational and psyc hological standp oin t (see [2] for comprehensive review). Computational XAI Research. Researc h on semi-factual explanations in XAI originated in early 2000s in the field of Case-Based Reasoning (CBR) [22,23,5]. This w ork characterized semi-factuals as "a fortiori" argumen ts to pro- vide b etter and more con vincing explanations. They used utility functions [8], similarit y methods [5], and lo cal-region based pro xy models [23] to compute suc h explanations. Kenn y & Keane [14] revisited semi-factuals more systematically ex- tending to generative AI, using GANs based on the exploitation of "exceptional features". This work w as follow ed by Zhao et al. [28], who used class-to-class v ariational auto encoders (V AEs) to compute semi-factuals efficiently and V ats et al. [25] who used the laten t space of these generative models to obtain semi- factuals to explain the classification of medical images suc h as ulcers. Aryal & Keane [2] survey ed the semi-factual literature to define the "requirements" for cognitively and computationally go od semi-factuals. They proposed a nov el b enc hmark method, Most Distant Neighbors (MDNs), whic h used a scoring func- tion to select the most distan t same-class instance as the semi-factual. In other w ork, Ary al & Keane [3] demonstrated that semi-factuals are conceptually and computationally distinct from counterfactuals, p ossessing their own unique dy- namics rather than b eing mere "b y-pro ducts". Kenn y & Huang [13] adv anced the researc h further by introducing "gain" as a new constrain t for semi-factual expla- nations. They argued that semi-factuals can provide b etter recourses for p ositive outcomes whereas counterfactuals are more useful for negative outcomes, which they v alidated through user studies. Other Computational Research. Semi-factuals hav e also been used for mo del auditing; sp ecifically for iden tifying spurious patterns and bias [15] or for providing unified explanatory frameworks via Gaussian mixture mo dels [27]. Similarly , Artelt & Hammer[1] utilized semi-factuals to justify "reject" decisions made b y a mo del. Dandl et al. [6] prop osed In terpretable Region Descriptors (IRDs) for semi-factuals which maps the stable region around the query through "h yp erb o xes". More recently , the scop e of semi-factual explanations hav e ex- panded into dynamic en vironments. Ga jcin et al. [10] successfully adapted semi- factual desiderata to Reinforcement Learning (RL) agents using genetic algo- rithms to iden tify stable states. Jiang et al. [12] generated semi-factual explana- tions for Rew ard Mo dels (RMs) to analyze their lo cal and global behavior. Psyc hological Research. The research on the cognitiv e effects of semi- factuals w ere originally carried out in the field of psyc hology . The seminal w ork of McCloy & Byrne [19] found that semi-factual can weak en the causal rela- tion betw een an input and outcome, con vincing p eople that the outcome w ould ha ve o ccurred regardless. Similarly , they also show ed that semi-factual thoughts decrease the emotion of regret. On the other hand, Green [11] show ed that a semi-factual supp orts dissuasion con vincing p eople to not take further action. Informativ e Semi-F actuals for XAI 15 6 Discussion Semi-factual explanations emplo y Even if reasoning to explain ho w c hanges to certain input-features do not c hange the outcome. In XAI, all the existing w orks on semi-factuals ha ve fo cused on computing the farthest instances from the query , within the same class, using v arious differen t tec hniques. Ho wev er, to the b est of our kno wledge, none of these mo dels examine "why" it is p ossible for a semi-factual to ha ve suc h maximal v alue-changes and y et remain in the same class. This work adv ances the research on semi-factual explanations by intro- ducing the notion of informative semi-factuals . These explanations complement a standard semi-factual with hidden fe atur es that further explain ho w the semi- factual can o ccur in the data distribution of a class. T o compute these informativ e semi-factuals, we proposed a no vel – the Informative Semi-factual (ISF) method – whic h performs b etter than the SOT A metho ds in computational exp erimen ts. W e also conducted user studies which sho ws that p eople find these elab orated semi-factual explanations b etter and more useful than the simple standard ones. A notable limitation of our w ork is its computational efficiency when there are large n umber of features to consider in the multi-ob jectiv e setting. How ever, this ma y b e addressed with feature-selection tec hniques that identify the most relev ant or locally-sparse features. As part of future work, it w ould also b e in- teresting to explore ho w this concept can b e formalized in other domains such as images, and time series whic h may require specific considerations. A ckno wledgmen ts. This w ork has emanated from researc h conducted with the finan- cial supp ort of T aighde Éireann – Research Ireland under Grant num b er: 12/RC/2289_P2. Disclosure of Interests. The authors hav e no comp eting in terests to declare that are relev ant to the conten t of this article. References 1. Artelt, A., Hammer, B.: "ev en if..."–diverse semifactual explanations of reject. arXiv preprint arXiv:2207.01898 (2022) 2. Ary al, S., Keane, M.T.: Ev en if explanations: Prior work, desiderata & b enc hmarks for semi-factual xai. arXiv preprin t arXiv:2301.11970 (2023) 3. Ary al, S., Keane, M.T.: Even-ifs from if-onlys: Are the best semi-factual expla- nations found using coun terfactuals as guides? In: International Conference on Case-Based Reasoning. pp. 33–49. Springer (2024) 4. Byrne, R.M.: Counterfactuals in explainable artificial in telligence (xai): evidence from human reasoning. In: Proceedings of the T wen ty-Eigh th In ternational Joint Conference on Artificial Intelligence, IJCAI-19. pp. 6276–6282 (2019) 5. Cummins, L., Bridge, D.: Kleor: A kno wledge lite approac h to explanation orien ted retriev al. Computing and Informatics 25 (2-3), 173–193 (2006) 6. Dandl, S., Casalicchio, G., Bisc hl, B., Bothmann, L.: In terpretable regional descrip- tors: Hyp erb o x-based local explanations. arXiv preprin t arXiv:2305.02780 (2023) 7. Deb, K., Pratap, A., Agarw al, S., Meyariv an, T.: A fast and elitist multiob jectiv e genetic algorithm: Nsga-ii. IEEE transactions on ev olutionary computation (2002) 16 Saugat Aryal ( ) and Mark T. Keane 8. Do yle, D., Cunningham, P ., Bridge, D., Rahman, Y.: Explanation oriented re- triev al. In: Europ ean Conference on Case-Based Reasoning. Springer (2004) 9. Europ ean P arliament and Council of the EU: Regulation (eu) 2024/1689 (artificial in telligence act) (2024) 10. Ga jcin, J., Jeromela, J., Dusparic, I.: Semifactual explanations for reinforcemen t learning. In: 12th International Conference on Human-Agent Interaction (2024) 11. Green, D.W.: Persuasion and the contexts of dissuasion: Causal models and infor- mal arguments. Thinking & reasoning 14 (1), 28–59 (2008) 12. Jiang, J., Bewley , T., Mishra, S., Lécué, F., V eloso, M.: Interpreting language re- w ard mo dels via contrastiv e explanations. arXiv preprint arXiv:2411.16502 (2024) 13. Kenn y , E., Huang, W.: The utility of “even if ” semifactual explanation to optimise p ositiv e outcomes. A dv ances in Neural Information Processing Systems 36 (2023) 14. Kenn y , E.M., Keane, M.T.: On generating plausible counterfactual and semi- factual explanations for deep learning. In: Pro ceedings of the 35th AAAI Con- ference on Artificial Intelligence (AAAI-21). pp. 11575–11585 (2021) 15. Lu, J., Y ang, L., Mac Namee, B., Zhang, Y.: A rationale-centric framework for h uman-in-the-lo op mac hine learning. arXiv preprin t arXiv:2203.12918 (2022) 16. Lundb erg, S.M., Erion, G., Chen, H., DeGrav e, A., Prutkin, J.M., Nair, B., Katz, R., Himmelfarb, J., Bansal, N., Lee, S.I.: F rom lo cal explanations to global under- standing with explainable ai for trees. Nature Machine Intelligence 2 (1) (2020) 17. Lundb erg, S.M., Lee, S.I.: A unified approach to interpreting model predictions. A dv ances in neural information pro cessing systems 30 (2017) 18. Mann, H.B.: Nonparametric tests against trend. Econometrica: Journal of the econometric so ciety pp. 245–259 (1945) 19. McClo y , R., Byrne, R.M.: Semifactual "ev en if" thinking. Thinking & Reasoning 8 (1), 41–67 (2002) 20. Mothilal, R.K., Sharma, A., T an, C.: Explaining mac hine learning classifiers through diverse counterfactual explanations. In: Proceedings of the 2020 conference on fairness, accoun tability , and transparency . pp. 607–617 (2020) 21. Nelsen, R.B.: An introduction to copulas. Springer (2006) 22. Nugen t, C., Cunningham, P ., Doyle, D.: The b est w ay to instil confidence is by b eing righ t. In: International Conference on Case-Based Reasoning. Springer (2005) 23. Nugen t, C., Doyle, D., Cunningham, P .: Gaining insight through case-based expla- nation. Journal of Intelligen t Information Systems 32 (3), 267–295 (2009) 24. V an Loov eren, A., Klaise, J.: Interpretable coun terfactual explanations guided b y protot yp es. In: Join t European Conference on Mac hine Learning and Kno wledge Disco very in Databases. pp. 650–665. Springer (2021) 25. V ats, A., Mohammed, A., P edersen, M., Wiratunga, N.: This c hanges to that: Com bining causal and non-causal explanations to generate disease progression in capsule endoscopy . arXiv preprin t arXiv:2212.02506 (2022) 26. W ac hter, S., Mittelstadt, B., Russell, C.: Counterfactual explanations without op ening the blac k b ox. Harv. JL & T ech. 31 , 841 (2017) 27. Xie, Z., He, T., Tian, S., F u, Y., Zhou, J., Chen, D.: Joint gaussian mixture mo del for versatile deep visual model explanation. Knowledge-Based Systems 280 (2023) 28. Zhao, Z., Leak e, D., Y e, X., Crandall, D.: Generating coun terfactual images: T o- w ards a c2c-v ae approach. In: 4th W orkshop on XCBR: Case-Based Reasoning for the Explanation of Intelligen t Systems (2022) Informativ e Semi-F actuals for XAI 17 A App endix A.1 T est for Seesaw P attern in Best Semi-factuals In this test, we computed the presence of seesaw pattern of marginal feature con tributions (key- and hidden-features) in best semi-factuals obtained from the ensem ble of standard semi-factual metho ds. Metho ds. The follo wing 8 SOT A semi-factual metho ds w ere considered for the ensem ble. – Lo cal-Region Mo del Nugen t et al. [23] prop osed the Lo cal-Region mo del, whic h analyses the lo cal region around the query , using a surrogate mo del (akin to wa y LIME w orks), to select the nearest neigh b or in the query class with the most marginal probability , as the semi-factual instance; as follows: Local - R egion ( q , C ) = arg min xϵC LR ( x ) (11) where, C is the set of candidate neighbors and LR() is the lo cal logistic regression mo del pro viding the probabilit y score. – Kno wledge-Light Explanation-Orien ted Retriev al (KLEOR) Cum- mins & Bridge [5] iden tified query-class instances which lie b et ween the query and its Nearest Unlike Neighbors (NUNs) (ak a its counterfactuals) using dis- tance measures and selected the b est semi-factual as the one whic h is closest to the NUN and furthest from the query . They prop osed three differen t v ari- an ts out of which Attr-Sim w as the most adv anced. It enforces similarity across all of the features b et ween the query and the candidate instance. Attr - S im ( q , nun, G ) = arg max xϵG S im ( x, nun ) + max aϵF count [ S im ( q a , x a ) > S im ( q a , nun a )] (12) where q is the query , x is a candidate instance, G is the set of query-class instances, nun is the NUN, Sim is Euclidean Distance and F is the feature set. – Div erse Semifactual Explanations of Reject (DSER) Artelt & Ham- mer [1] proposed a semi-factual metho d based on optimization metho ds to explain reject decisions in mac hine learning; that is, to explain why a mo del should not make a prediction. It applies its loss function using four con- strain ts for go o d semi-factuals (i.e., feasibility , sparsit y , similarity , div ersity): DSER ( q ) = arg min q sf ϵ R d ℓ ( q sf ) (13) where, q sf is the semi-factual of query q and ℓ () represents the combined loss function suc h that, 18 Saugat Aryal ( ) and Mark T. Keane ℓ ( q sf ) = ℓ f easibile ( q sf ) + ℓ sparse ( q sf ) + ℓ similar ( q sf ) + ℓ div erse ( q sf ) (14) where feasibilit y is cast as, ℓ feasible ( q sf ) = C feasible · max ( r ( q sf ) − θ, 0) + C sf · max ( r ( q ) − r ( q sf ) , 0) (15) whic h ensures that the semi-factual is also predictively uncertain but more certain than the original query , q (to be convincing). Here, C represents the regularization parameters for eac h component, r () is the reject function based on the certain ty of predictiv e function and θ is the reject threshold. ℓ sparse ( q sf ) = C sparse · max d X i =1 1 ( q sf − q ) i = 0 − µ, 0 ! (16) co vers sp arsity promoting candidates with few er feature differences b et ween the semi-factual and the query . Here d is the num b er of feature dimen- sions and µ ≥ 1 is a hyperparameter that controls the num b er of feature- differences. ℓ similar ( q sf ) = − C similar · ∥ q sf − q ∥ 2 (17) deals with similarity promoting greater distance b etw een the query and the semi-factual in Euclidean space, and finally , ℓ diverse ( q sf ) = C diverse · X j ∈F 1 (( q sf − q ) = 0) (18) handles diversity ensuring that several featurally-distinct semi-factuals are generated. Here, F represen ts the set of features that ha ve already b een used to generate semi-factuals, feature-sets that should b e a voided: F = n j | ∃ i : q i sf − q j = 0 o (19) – PlausIble Exceptionalit y-based Con trastive Explanations (PIECE) This metho d prop osed by Kenny & Keane [14] computes semi-factuals “on the wa y to” computing coun terfactuals using statistical tec hniques and a Generativ e Adv erserial Net work (GAN) mo del. It identifies "exceptional" (i.e., probabilistically-low) features in a query with resp ect to its counterfac- tual class and iteratively mo difies these features until they become "normal" (i.e., probabilistically-high). As these exceptional features are incremen tally altered, the generated instances gradually mov e aw ay from the query to- w ards the counterfactual class, with the last instance just b efore the decision b oundary b eing selected to b e the semi-factual. So, the semi-factual is like a p oin t on the tra jectory from the query to the counterfactual. Informativ e Semi-F actuals for XAI 19 Exceptional features are iden tified using the statistical probabilities in the training distribution of the counterfactual class c ′ . Sp ecifically , a tw o-part h urdle pro cess is used to mo del the latent features of the query (when it is an image) in the feature-extracted lay er ( X ) of a Conv olutional Neural Net work (CNN) w ith an ReLU activ ation function. The first h urdle pro cess is modelled as a Bernoulli distribution and the second as a probabilit y densit y function (PDF) as: p ( x i ) = (1 − θ i ) δ ( x i )(0) + θ i f i ( x i ) , s.t. x i ≥ 0 (20) where p ( x i ) is the probability of the laten t feature v alue x i for c ′ , θ i is the probabilit y of the neuron in X activ ating for c ′ (initial h urdle pro cess), and f i is the subsequen t PDF mo delled (the second hurdle pro cess). The constrain t of x i ≥ 0 refers to the ReLU activ ations, and δ ( x i )(0) is the Kroneck er delta function, returning 0 for x i > 0 , and 1 for x i = 0 . After mo delling the distribution, a feature v alue x i is regarded as an exceptional feature for the query in situations where, x i = 0 | p (1 − θ i ) < α (21) if the neuron X i do es not activ ate, given the probabilit y of it not activ ating b eing less than α for c ′ , and, x i > 0 | p ( θ i ) < α (22) if a neuron activ ates, given that the probability of it activ ating b eing less than α for c ′ , where α is a threshold. Once the exceptional features are iden tified, the query’s features are adjusted to their exp ected v alues ( x ′ ) with generated instances b eing c heck ed by the CNN to be in the query or counterfactual-class. The semi-factual is the last generated instance in the query-class b efore crossing into the coun terfactual- class. Finally , a GAN is used to visualize the explanations by iden tifying a laten t vector ( z ′ ) suc h that loss b etw een x ′ and C ( G ( z ′ )) is minimized as, z ′ = arg min z ∥ C ( G ( z )) − x ′ ∥ 2 2 (23) PIECE ( q ) = G ( z ′ ) (24) where C is a CNN classifier and G is the GAN generator. – Class-to-Class V ariational Auto enco der (C2C-V AE) Zhao et. al [28] prop osed an efficient wa y to obtain semi-factuals based on auto encoders. They used a v ariational autoenco der (V AE) with an enco der ( f ) and a de- co der ( f ′ ) to learn the embedding space represen ting the d ifferences b et ween feature patterns in t w o classes. In the initial learning phase, giv en a pair of cases s and t from t wo classes, C2C-V AE enco des the feature difference, f ∆ , where f ∆ ( s, t ) = f ( s ) − f ( t ) using an enco der g , as g ( < f ∆ , C s , C t > ) and deco des the em b edding using a decoder g ′ as f ′ ∆ = g ′ ( g ( < f ∆ , C s , C t > ) 20 Saugat Aryal ( ) and Mark T. Keane T o deriv e an explanation for a query , q in class C q , the method first gener- ates a guide t in the counterfactual class C t . This guide selection lev erages the feature difference em b edding space g . Specifically , the metho d randomly samples v ectors from g , deco des them back to the original feature space, and selects the one with the least mean squared error compared to q . Finally , it in terp olates b et ween the extracted features of f ( q ) and f ( t ) in the V AE’s laten t space to obtain semi-factuals as, C 2 C - V AE ( q ) = f ′ ((1 − λ ) ∗ f ( q ) + λ ∗ f ( t )) , 0 ≤ λ ≤ 1 (25) where λ is a hyperparameter whic h determines the w eight of interpolation b et w een q and t and con trols whether the output is more similar to q (for a semi-factual) or t (for a coun terfactual). – Most Distan t Neighbor (MDN) Aryal & Keane [3] prop osed and this metho d as a naïve, ben c hmark algorithm to find query-class instances that are most distant from the query on some dimension(s), while also sharing man y common features. MDN scores all the query-class’s instances on the extremit y of their feature-v alues, determining whether they are m uch higher or low er than the feature-v alues of the query , q , to find its most distant neigh b or. Its custom distance function, Semi-F actual Sc oring ( sfs ), priori- tises instances that are sparse relativ e to the query (i.e., few er feature differ- ences), but ha ve the highest v alue-differences in their non-matching features, as follo ws: sfs ( q , S, F ) = same ( q , x ) F + diff ( q f , x f ) diff max ( q f , S f ) (26) where S is Higher/Low er Set and x ∈ S , same() counts the n umber of fea- tures that are equal b et ween q and x , F is the total num b er of features, diff() giv es the difference-v alue of key-feature, f , and diff max () is the max- im um difference-v alue for that k ey-feature in the Higher/Low er Set. The b est-feature-MDN is selected as the instance with the highest sfs score from the Higher/Low er set for eac h feature, indep enden tly . Finally , the b est of the b est-feature-MDNs across all dimensions is chosen as the o verall semi-factual for the query , MDN ( q , S ) = arg max x ∈ S sf s ( x ) (27) – Explanations for Positiv e Outcomes (S-GEN) Kenny & Huang [13] prop osed the no v el concept of “gain" (akin to “cost" in counterfactuals) as a new constrain t for semi-factual metho ds. They argue that semi-factuals b est explain p ositiv e outcomes, whereas counterfactuals w ork b est for negative outcomes. Their S-GEN method uses gain , along with traditional constrain ts (suc h as plausibility , robustness and diversit y) to compute semi-factuals that inform users ab out better and p ositiv e recourses. It’s ob jectiv e function is: Informativ e Semi-F actuals for XAI 21 S - GE N ( q ) = max a 1 ,..., a m 1 m m X i =1 f ( P ( q , a i ) , G ( q , a i )) + γ R ( { q ′ 1 , . . . , q ′ m } ) s.t. ∀ i, j : q ′ i = S M ( q , a i ) , H j ( q ′ i ) ≥ 0( or > ) (28) where, a i represen ts an action taken on i th feature-dimension, m is the de- sired num b er of semi-factuals to b e generated. P ( q , a i ) = Pr ( S M ( q , a i )) denotes the plausibilit y of explanation for q by taking action a i where P r is the distribution densit y . S-GEN uses a Structural Causal Model (SCM), S M to b etter capture the causal dep endencies b et w een the features and hence obtain feasible explanations. G ( q , a i ) = P S F ◦ δ ( q , S M ( q , a i )) (29) represen ts the gain function for q by taking action a i where δ () is the distance function. In tuitively , it measures the difference b etw een original state q and the new state obtained by the transition from q by taking action a i through an SCM, S M ( q , a i ) . Greater differences indicate higher “gains” (i.e., better explanations). R ( { q i } m i =1 ) = 2 m ( m − 1) m X i =1 m X j >i L p ◦ δ ( q i , q j ) (30) sho ws the diversit y function which is regularized by γ in Eq. (28). L p is the L p -norm and δ () is the distance function used, so as many distinct expla- nations as possible are generated that are also far from eac h other. Finally , robustness is achiev ed in a post-ho c manner as a hard constrain t defined b y: H ( q , a ) = min q ′ ∈ B s ( q , a ) h ( q ′ ) − ψ (31) where H ( q , a ) denotes the p ost-robustness of an action a for a test instance q . The intuition is that any instances lying in the neighborho od B s of the generated semi-factual q ′ = S M ( q , a ) after taking the action a also hav e a positive outcome. This function ensures that the output of a predictive mo del h for q ′ is higher than a threshold ψ = 0 . 5 (in case of binary classes). – Div erse Counterfactual Explanations (DiCE) Mothilal et. al [20] used an optimization metho d based on v arious constraints such as distance, di- v ersity (using determinantal p oint pro cesses) and feasibility (using causal information from users) to compute counterfactuals which can b e used to obtain semi-factuals b y adjustments to the loss function: D iC E ( q ) = arg min c 1 ,...,c k 1 k k X i =1 yloss ( f ( c i ) , y ) + λ 1 k k X i =1 dist ( c i , q ) − λ 2 dpp_div ersity ( c 1 , ..., c k ) (32) 22 Saugat Aryal ( ) and Mark T. Keane where q is the query input, c i is a counterfactual explanation, k is the to- tal n umber of div erse coun terfactuals to be generated, f () is the black b ox ML model, y loss () is the metric that minimizes the distance b etw een f () ’s prediction for c i and the desired outcome y , dist () is the distance measure b et w een c i and q , and dpp_div ersity() is the div ersity metric. λ 1 and λ 2 are h yp erparameters that balance the three comp onen ts of the loss function. Metrics. The follo wing 5 key metrics w ere used to assess the qualit y of semi-factuals generated from eac h metho d. – Distanc e. It measures the L 2 -norm distance b etw een query and the semi- factual where higher is b etter. – Sp arsity. It measures the num b er of feature difference b et ween query and the semi-factual as a ratio of desired (set to 1) to observed-difference where higher v alue is preferred. S par sity = desir ed diff obser ved diff (33) – Plausibility. It measures the distance b etw een the semi-factual and the near- est training instance where lo wer v alue is b etter. – T rustworthiness. It measures the confidence for the semi-factual b eing in the query class compared to the counterfactual class measured as a ratio of their class distance where higher score is b etter. T rustworthiness(x) = d(x,CF) d(x,Q) (34) where x is the semi-factual, CF is the coun terfactual-class, Q is the query- class and d () measures the distance. – R obustness. It measures the difference in semi-factuals obtained through small perturbations of the query measured using Lipsc hitz con tinuit y where lo wer v alue is b etter. Robustness ( x ) = argmax x i ∈ B ϵ ( x ) ∥ f ( x ) − f ( x i ) ∥ 2 ∥ x − x i ∥ 2 (35) where x is the input query , B ϵ ( x ) is the ball of radius ϵ centered at x , x i is a p erturbed instance of x and f () is the explanation metho d. Datasets. The ev aluation was carried out across 7 b enc hmark tabular datasets whic h are all binary-classed. – A dult Income (N=26,540, 12 features) – Blo od Alcohol (N=2000, 5 features) – PIMA Diab etes (N=392, 8 features) Informativ e Semi-F actuals for XAI 23 – Default Credit Card (N=30,000, 23 features) – German Credit (N=1000, 20 features) – HELOC (N=8291, 20 features) – Lending Club (N=39,239, 8 features) Pro cedure. F or a given query in a dataset, its corresp onding semi-factual w as computed using all the 8 semi-factual methods along with their resp ectiv e v alues for each ev aluation metric. The semi-factual which had the highest aggre- gated score com bining all the metrics was determined to b e the b est semi-factual explanation for the query . This pro cess w as carried out across all datasets to ob- tain b est semi-factuals for eac h query-instance. A sample of b est semi-factuals from eac h dataset was then used to analyze the seesa w pattern. Results. The results in T able 1 show that out of 10,300 best semi-factuals sampled, 9175 (or 89%) of them revealed the seesa w pattern of changing marginal con tributions b etw een key- and hidden-features. This v alidates our intuition that this prop ert y exists in most go od semi-factuals. T able 1: T able sho wing the num b er of b est semi-factuals sampled from each dataset and ho w many of those had the seesa w pattern. Dataset Sample of Best Semi-factuals Best-Semi-factuals with Seesaw Pattern A dult Income 1200 1029 Blo od Alcohol 400 360 PIMA Diab etes 100 92 Default Credit Card 3200 2826 German Credit 400 358 HELOC 2000 1820 Lending Club 3000 2690 T otal 10,300 9,175 A.2 Baseline Implemen tation In this section, we discuss the implementation details and parameter specifica- tions for the existing semi-factual metho ds. – Lo cal Region Mo del The local surrogate mo del was trained with a mini- m um of 200 instances from each class. – KLEOR A k-NN mo del with k=3 was used to compute the distances b e- t ween the instances and obtain NUN. – DSER The mo del was implemen ted based on the publicly a v ailable library 3 . A k-NN classifier w as used to fit the conformal predictor with k=5. The 3 https://github.com/HammerLabML/DiverseSemifactualsReject 24 Saugat Aryal ( ) and Mark T. Keane reject threshold θ was set to 0.4. The regularization parameter C for eac h comp onen t in the loss function w as set to 1. The hyperparamter µ to control the n umber of feature-differences was set to 2. – PIECE The framew ork w as mo dified to w ork with the tabular data inspired b y Kenny & Huang’s [13] mo dification. The training data was partitioned in to t wo subsets based on model predictions: instances predicted as the origi- nal class c and those predicted as the coun terfactual class c ′ . F or each subset, feature distributions were modeled indep enden tly , using Beta distributions for con tinuous features and categorical distributions for discrete features. T o construct a semi-factual predicted as c , we ev aluate the probabilit y of each query feature v alue under the distributions of class c ′ . F eatures are then sequen tially adjusted to their exp ected v alues under c ′ , starting from the lo west-probabilit y feature, until the next modification would cross the deci- sion boundary . F or contin uous features, the probabilit y of a v alue is defined as the minimum of the tw o in tegrals on either side of that v alue in the distri- bution. If an exp ected v alue lies outside the p ermitted actionabilit y range, it is clipp ed to the nearest feasible v alue. – C2C-V AE T o adapt to the tabular data, the enco der and deco der in b oth V AE and C2C-V AE w ere implemen ted using 3 and 2 fully connected lay ers, resp ectiv ely , with the laten t dimension z set to 4. The v alue of in terp olation parameter λ w as set to 0.2. – MDN In the sfs() function, the categorical features w ere determined to be similar b y direct comparison of their v alues whereas the con tinuous features w ere considered to b e the same if the v alues lie within ± 20% of standard deviation of the selected feature. – S-GEN W e follo w ed the publicly a v ailable implemen tation of S-GEN 4 with default actionabilit y constraints and h yp erparameter sp ecifications for causal and non-causal settings. – DiCE The DiCE metho d w as implemented u sing the publicly a v ailable li- brary 5 . The random searc h method w as used and all parameters were kept at their default settings except the desired _ cl ass was set to "same" in the ob jective function to ensure the generation of semi-factuals. A.3 NSGA-I I Implemen tation in ISF The NSGA-II algorithm used to solv e the constrained m ulti-ob jective optimiza- tion in ISF was implemented via the pymoo 6 framew ork. The algorithm was initialized using random float sampling and ev olved using standard evolutionary 4 https://github.com/EoinKenny/Semifactual_Recourse_Generation 5 https://github.com/interpretml/DiCE 6 https://github.com/anyoptimization/pymoo Informativ e Semi-F actuals for XAI 25 op erators. P arent selection was p erformed using tournamen t selection, while off- spring were generated using simulated binary crossov er (SBX) (crosso ver proba- bilit y = 0.9, distribution index = 15) and polynomial m utation (m utation prob- abilit y = 0.9, distribution index = 20). En vironmen tal selection follow ed the standard NSGA-II rank-and-cro wding surviv al strategy , whic h performs non- dominated sorting and maintains diversit y using cro wding distance. Duplicate solutions were eliminated during evolution. The algorithm was executed with a p opulation size of 50 for 100 generations, while all other parameters were kept at their default v alues provided in the p ymo o implemen tation. A.4 User Studies The materials for the user studies were based on German Credit dataset. W e used 5 imp ortan t features and modified the dep enden t v ariable (class) to b e loan accepted and rejected rather than the original go od and bad credit. The semi-factual explanations in both user studies were generated using ISF method. Belo w we show the initial setup of b oth user studies before showing some sample scenarios for eac h study . 26 Saugat Aryal ( ) and Mark T. Keane Informativ e Semi-F actuals for XAI 27 User Study 1: Do P eople Prefer Informative Explanations? Sample Scenario 1 Sample Scenario 2 28 Saugat Aryal ( ) and Mark T. Keane User Study 2: Preferring Go od or Bad Explanations? Sample Scenario 1 Sample Scenario 2
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment