Table of Contents
Fetching ...

On the Hardness of Computing Counterfactual and Semifactual Explanations in XAI

André Artelt, Martin Olsen, Kevin Tierney

TL;DR

This paper tackles the problem of understanding when counterfactual and semi-factual explanations can be computed efficiently by surveying the literature and presenting new inapproximability results. It analyzes non-causal formulations, notably $MCR$ and $WACHTER-CFE$, across a range of model classes (including ReLU networks, additive trees, and $k$-NN), using reductions from $3$-SAT to establish hardness. The main contributions are (i) a comprehensive taxonomy of computational hardness for counterfactuals and semi-factuals, (ii) novel $2^{p(n)}$-approximation inapproximability results under $P eq NP$ for key architectures, and (iii) a discussion of the implications for XAI practice, policy, and future research directions. The findings highlight fundamental limits on obtaining optimal explanations in many realistic settings and motivate a shift toward average-case analysis and practical, non-optimal explanation strategies appropriate for regulatory contexts.

Abstract

Providing clear explanations to the choices of machine learning models is essential for these models to be deployed in crucial applications. Counterfactual and semi-factual explanations have emerged as two mechanisms for providing users with insights into the outputs of their models. We provide an overview of the computational complexity results in the literature for generating these explanations, finding that in many cases, generating explanations is computationally hard. We strengthen the argument for this considerably by further contributing our own inapproximability results showing that not only are explanations often hard to generate, but under certain assumptions, they are also hard to approximate. We discuss the implications of these complexity results for the XAI community and for policymakers seeking to regulate explanations in AI.

On the Hardness of Computing Counterfactual and Semifactual Explanations in XAI

TL;DR

This paper tackles the problem of understanding when counterfactual and semi-factual explanations can be computed efficiently by surveying the literature and presenting new inapproximability results. It analyzes non-causal formulations, notably and , across a range of model classes (including ReLU networks, additive trees, and -NN), using reductions from -SAT to establish hardness. The main contributions are (i) a comprehensive taxonomy of computational hardness for counterfactuals and semi-factuals, (ii) novel -approximation inapproximability results under for key architectures, and (iii) a discussion of the implications for XAI practice, policy, and future research directions. The findings highlight fundamental limits on obtaining optimal explanations in many realistic settings and motivate a shift toward average-case analysis and practical, non-optimal explanation strategies appropriate for regulatory contexts.

Abstract

Providing clear explanations to the choices of machine learning models is essential for these models to be deployed in crucial applications. Counterfactual and semi-factual explanations have emerged as two mechanisms for providing users with insights into the outputs of their models. We provide an overview of the computational complexity results in the literature for generating these explanations, finding that in many cases, generating explanations is computationally hard. We strengthen the argument for this considerably by further contributing our own inapproximability results showing that not only are explanations often hard to generate, but under certain assumptions, they are also hard to approximate. We discuss the implications of these complexity results for the XAI community and for policymakers seeking to regulate explanations in AI.
Paper Structure (16 sections, 5 theorems, 13 equations, 4 figures, 2 tables)

This paper contains 16 sections, 5 theorems, 13 equations, 4 figures, 2 tables.

Key Result

Theorem 1

If P$\neq$NP, then the following holds for any polynomial $p(n)$: There is no polynomial time $2^{p(n)}$-approximation algorithm for the WACHTER-CFE problem (Definition def:CFE_Problem) for neural networks (ReLU) with $n$ nodes and one hidden layer.

Figures (4)

  • Figure 1: Overview of the classifier types for which the computational complexity of counterfactuals and/or semi-factuals has been studied in the literature.
  • Figure 2: A neural network with one hidden layer used as the regressor $h(\cdot)$ in the reduction from the 3-SAT problem to the WACHTER-CFE problem (Definition \ref{['def:CFE_Problem']}). The clause $\neg x_1 \vee x_2 \vee \neg x_3$ is a clause in the CNF formula defining the 3-SAT instance. Connections with no weight shown in the figure have weight $1$.
  • Figure 3: For each clause in the 3-SAT instance, we have a decision tree in the additive tree model producing a high output if the clause is not satisfied. The figure shows a decision tree for the example clause $\neg x_1 \vee x_2 \vee \neg x_3$.
  • Figure 4: The figure shows the $8$ vectors in the kNN-regressor for the clause $\neg x_1 \vee x_2 \vee \neg x_3$ with labels after the colon symbol. The input vector $x'$ does not satisfy the clause, so it is closest to the vector with label $cM$.

Theorems & Definitions (13)

  • Definition 1: (Classic) Counterfactual Explanation
  • Remark 1
  • Definition 2: WACHTER-CFE problem
  • Theorem 1
  • Theorem 2
  • Theorem 3
  • Corollary 1
  • proof
  • Corollary 2
  • proof
  • ...and 3 more