Source-linked AI summary
Good Counterfactuals and Where to Find Them: A Case-Based Technique for Generating Counterfactuals for Explainable AI (XAI)
Mark T. Keane, Barry Smyth
TL;DR
Current counterfactual-generation methods can produce sparse and implausible explanations, while many datasets contain few good counterfactuals. The paper proposes reusing case-based patterns and adapting them to new queries, improving explanatory competence and counterfactual distance across datasets.
Problem
Existing counterfactual-generation methods can suffer from sparsity and plausibility problems, and good counterfactuals are rare in commonly used datasets.
Method
The paper uses a case-based approach that retrieves known counterfactual cases and adapts their feature differences to generate plausible, sparse counterfactuals for new queries.
Results
Explanatory competence increased from an average baseline of about 11% to just over 40%, while selecting the closest generated counterfactual produced RCF<1 on all five datasets.
Takeaways & Limitations
Reusing and adapting counterfactual patterns can improve the explanatory coverage and proximity of case-bases that initially contain few good counterfactuals.
Takeaways & Limitations
For multi-class datasets, the evaluated adaptation could be extended to search ordered nearest neighbours across different classes, but this variation was left for future work.
Abstract
from arXiv · showhide
Recently, a groundswell of research has identified the use of counterfactual explanations as a potentially significant solution to the Explainable AI (XAI) problem. It is argued that (a) technically, these counterfactual cases can be generated by permuting problem-features until a class change is found, (b) psychologically, they are much more causally informative than factual explanations, (c) legally, they are GDPR-compliant. However, there are issues around the finding of good counterfactuals using current techniques (e.g. sparsity and plausibility). We show that many commonly-used datasets appear to have few good counterfactuals for explanation purposes. So, we propose a new case based approach for generating counterfactuals using novel ideas about the counterfactual potential and explanatory coverage of a case-base. The new technique reuses patterns of good counterfactuals, present in a case-base, to generate analogous counterfactuals that can explain new problems and their solutions. Several experiments show how this technique can improve the counterfactual potential and explanatory coverage of case-bases that were previously found wanting.
1 Introduction
XAI research has renewed interest in counterfactual explanations because opaque machine-learning predictions require greater transparency, while CBR offers explanations grounded in precedent-like cases. This paper examines whether CBR case-bases contain comprehensible counterfactuals for explaining predictions.
- XAI research has expanded amid concerns that machine-learning advances may lack transparency and face regulatory constraints.
- CBR has historically explained predictions through cases, drawing on reasoning from precedent or example.
- Counterfactual explanations can contrast an actual refusal with a nearby changed request that would have produced approval.
- The paper studies the feasibility of counterfactual explanations from a CBR perspective within a twin-system setting.
- Its focus is how many comprehensible, or “good,” counterfactuals are available in case-bases and how they are distributed across their topology.
2 Counterfactual Explanation: Promise, Problems & Prospects
Counterfactual explanations promise psychologically, computationally, and legally useful contrasts, but current generation methods face prolixity, sparsity, and plausibility problems. The paper therefore considers whether case-based reasoning can reuse plausible, sparse counterfactual cases.
- Counterfactual explanations contrast the observed prediction with an alternative outcome produced by changing selected variables while holding others constant.
- Counterfactuals are argued to offer psychological, technical, and legal advantages over other XAI explanation techniques.
- Counterfactual Problems: Current systems often generate many candidate counterfactuals through random perturbation and search, creating prolixity that minimal-change methods attempt to reduce.
- Counterfactual Problems: Good explanatory counterfactuals should change few features, because sparse changes are easier to understand and communicate.
- Counterfactual Problems: Plausibility remains difficult when generated explanations propose unrealistic salary changes or immutable personal-attribute changes.
- CBR’s Prospects for Counterfactuals: A case-based approach could support sparse and plausible counterfactuals by reusing previously encountered training cases, but its counterfactual potential must first be established.
3 Experiment 1: Plotting Counterfactual Potential
The first experiment measures counterfactual potential across 20 widely used UCI datasets by comparing cases across decision boundaries and counting feature differences. Good counterfactuals are rare, with nearly every dataset containing fewer than 1% of cases differing by one or two features.
- The experiment evaluates counterfactual potential in 20 classic UCI datasets commonly used in CBR research.
- Counterfactual potential is estimated from pairwise comparisons of cases across decision boundaries, using the number of differing features.
- The analysis treats a good counterfactual as one differing from the query by no more than 2 features.
- < 1% of counterfactuals fall into the 1-difference or 2-difference categories in nearly every dataset.
- Most counterfactuals involve >5 feature differences, indicating poor sparsity across the evaluated datasets.
- Feature-matching tolerance can improve availability, but the fraction of good counterfactuals typically remains very low.
4 A Case-Based Technique for Good Counterfactuals
The paper proposes generating plausible counterfactual explanations by reusing patterns from existing good explanation cases, addressing the scarcity of good counterfactuals in many case-bases. The approach represents explanatory competence through counterfactual coverage and uses retrieval, reuse, and revision to construct counterfactuals for new queries.
- Motivation: Good counterfactuals are rare in many case-bases, motivating a case-based technique grounded in known training cases rather than blind perturbation.The authors report repeated absence of good counterfactuals across sampled BAC case-bases and argue that existing counterfactuals provide plausible adaptation guidance.
- Explanatory Competence: Explanatory competence measures a case-base’s potential to provide counterfactual explanations for future problem cases.The paper introduces explanatory competence as a parallel to predictive competence and operationalizes it through explanatory coverage.
- Explanation Cases: Explanation cases pair unlike cases that form good counterfactuals, recording shared match-features and up to two difference-features.These pairs are treated symmetrically, so either member can serve as the query or counterfactual.
- Generation Procedure: The method retrieves the explanation case whose query most resembles the target, copies matching values from the target, and transfers difference-feature values from the paired counterfactual.The resulting candidate differs from the target in no more than two features, preserving the pattern associated with the original class change.
- Generation Procedure: If reuse does not change the target’s predicted class, the method revises difference-feature values until a class change is obtained.Match-features remain fixed during adaptation, while the difference-features are adjusted to produce a valid counterfactual.
- Advantages: Reusing feature values from real cases is intended to produce more plausible counterfactuals than arbitrary perturbation and can identify feature combinations relevant near a query.The adaptation step may also locate a counterfactual closer to the query than retrieval alone.
5 Experiment 2: Evaluating Explanation Competence
Across five datasets, the case-based-counterfactual technique substantially increases explanatory competence over baseline good-counterfactual availability, while adaptation also improves counterfactual proximity. Evaluation uses explanatory competence and counterfactual distance under cross-validation.
- Future Work: The multi-class adaptation variation could search neighbours from all different classes, but its evaluation is left for future work.The proposed modification would provide a larger pool of difference-feature values and could increase the likelihood of finding a good counterfactual.
- Method: Data & Procedure: The evaluation measures explanatory competence as the fraction of queries associated with good counterfactuals and counterfactual distance from each query.A 10-fold cross-validation selects 10% of cases randomly as queries, with a 1–2% matching tolerance for the baseline competence.
- Results & Discussion: Explanatory Competence: Adaptation increases average explanatory competence from about 11% at baseline to just under 94%, after retrieval and reuse alone reach just over 40%.The baseline is the fraction of cases naturally associated with good counterfactuals; retrieval and adaptation generate synthetic counterfactuals.
- Results & Discussion: Explanatory Competence: The 6,400-case Wine dataset rises from 6% baseline explanatory competence to almost 90% using 559 XC cases.The Wine dataset contains 12 features and 7 classes, illustrating improvement even when baseline competence is very low.
- Results & Discussion: Counterfactual Distance: Relative counterfactual distance compares generated distances with each dataset’s baseline average, with RCF>1 indicating a farther generated counterfactual.The measure is used as a proxy for explanation utility because closer counterfactuals are considered more likely to be useful.
6 Conclusions & Future Directions
The paper concludes that case-based counterfactual generation can improve the counterfactual potential of datasets by reusing and adapting known counterfactual associations. It also identifies assumptions that may limit the approach beyond the discussed datasets.
- Conclusions: The case-based technique addresses sparsity and plausibility deficits in synthetic counterfactual generation by adapting known counterfactual associations from a case-base.The paper frames this as a way to improve the counterfactual potential of many datasets.
- Conclusions: The paper contributes a definition of good counterfactuals, the concept of explanation competence, and evidence for the technique’s utility.These contributions are stated as the paper’s principal developments.
- Future Directions: The approach assumes access to at least some existing counterfactuals and makes assumptions that may limit its utility beyond the datasets discussed.The supplied conclusion begins identifying these assumptions but does not specify all of them.