A Two-Stage Algorithm for Cost-Efficient Multi-instance Counterfactual Explanations
André Artelt, Andreas Gregoriades
TL;DR
This paper addresses explainability for groups of instances by introducing multi-instance counterfactual explanations that are cost-efficient. It formalizes the problem as a multi-objective optimization over a dataset $\mathcal{D}$, balancing a per-instance loss $\ell$ and a shared change cost $\theta$, and seeks Pareto-optimal solutions $\vec{\delta}_{\text{cf}}$. A two-stage, data-agnostic algorithm is proposed: Stage 1 groups instances by the direction of their individual counterfactuals using cosine similarity, enabling cheaper shared changes; Stage 2 solves for a group counterfactual with a $\mu+\lambda$ evolutionary algorithm under feature-wise bounds, combining costs and losses into $\theta(\vec{\delta}_{\text{cf}}) + C \sum_{\vec{x}_i \in \mathcal{D}} \ell(h(\vec{x}_i \oplus \vec{\delta}_{\text{cf}}), y_{\text{cf}})$. Experiments on IBM HR Attrition and Law datasets show superior correctness and reduced feature-change costs compared to baselines, with direction-based clustering offering additional gains. The work advances model-agnostic explainability by enabling scalable, actionable multi-instance explanations, though it relies on per-instance counterfactuals and could benefit from gradient-based approximations in the future.
Abstract
Counterfactual explanations constitute among the most popular methods for analyzing black-box systems since they can recommend cost-efficient and actionable changes to the input of a system to obtain the desired system output. While most of the existing counterfactual methods explain a single instance, several real-world problems, such as customer satisfaction, require the identification of a single counterfactual that can satisfy multiple instances (e.g. customers) simultaneously. To address this limitation, in this work, we propose a flexible two-stage algorithm for finding groups of instances and computing cost-efficient multi-instance counterfactual explanations. The paper presents the algorithm and its performance against popular alternatives through a comparative evaluation.
