The Computational Complexity of Understanding Binary Classifier Decisions

Stephan Wäldchen, Jan MacDonald, Sascha Hauch, Gitta KutyniokJAIR 2021 · DOI

Abstract

As machine learning models, particularly neural networks, are increasingly deployed in critical decision-making contexts, the need for rigorous explanations of their outputs has become paramount. This paper investigates the computational complexity of finding "probabilistic explanations"—minimal subsets of input features that determine a classifier's output with high probability. We prove that identifying these sets is $\mathsf{NP^{PP}}$-complete, and that even approximating the size of the smallest such set is $\mathsf{NP}$-hard. These results establish fundamental theoretical limits on the performance of explainable AI (XAI) methods.

Introduction: The Quest for Explainability

Modern binary classifiers often function as "black boxes," making it difficult to understand the rationale behind specific decisions. A traditional approach to explaining a Boolean classifier's decision is to find a "prime implicant": a minimal subset of input variables that, if held fixed, guarantees the output remains unchanged regardless of the values of the remaining variables.

However, in high-dimensional spaces like image recognition, the requirement for a 100% guarantee is often too rigid. For example, an adversarial patch in a distant corner of an image might technically be able to flip a classification, forcing a prime implicant to include nearly the entire image. To address this, practitioners use a probabilistic relaxation: finding a subset of features that keeps the output the same with high probability ($\delta$) when the remaining features are randomized.

Defining Probabilistic Explanations

The core concept analyzed in this work is the $\delta$-relevant set. Given a classifier $\Phi$ and an input $x$, a subset of features is $\delta$-relevant if, when these features are fixed to their values in $x$, the classifier produces the same output for at least a fraction $\delta$ of all possible completions of the remaining features.

Visualizing a $\delta$-relevant set: a subset of fixed features (0s) determines the classifier output even when others are randomized (*).

While heuristic algorithms like Anchors or SHAP attempt to find these sets, this paper asks a fundamental question: How computationally hard is it to find the absolute smallest $\delta$-relevant set?

A Computational Framework for Classifiers

To analyze this problem rigorously, the authors model binary classifiers as Boolean circuits or threshold networks. This allows the problem to be mapped onto well-studied classes in computational complexity theory.

Representing a binary classifier $\Phi$ as a logic circuit (a), a threshold network (b), and a mathematical expression (c).

By treating the classifier as a mathematical object, the task of finding an explanation becomes a search problem over the power set of input features, combined with a counting problem to determine the probability of the output remaining constant.

The Intractability of Finding Explanations

The paper's primary result is that the decision problem of whether a $\delta$-relevant set of size $k$ exists is $\mathsf{NP^{PP}}$-complete. This complexity class is significantly harder than standard $\mathsf{NP}$. It represents the combination of two difficult tasks:

  1. Search ($\mathsf{NP}$): Navigating the combinatorial explosion of all possible feature subsets.
  2. Counting ($\mathsf{PP}$): Exactly counting the number of satisfying assignments to calculate the probability $\delta$.

One might hope that sampling could simplify the problem. By estimating the probability rather than calculating it exactly, we define a "gapped" version of the problem where we only need to distinguish between sets that are $\delta$-relevant and those that are significantly less relevant ($\delta - \gamma$). While this reduces the checking complexity to $\mathsf{BPP}$ (bounded-error probabilistic polynomial time), the authors prove that the overarching search for the optimal subset remains $\mathsf{NP}$-hard.

The Limits of Approximation

Perhaps the most discouraging result for XAI practitioners is the proof of inapproximability. The authors show that for any $\alpha \in (0, 1)$, there is no polynomial-time algorithm that can approximate the size of the minimum gapped $\delta$-relevant set within a factor of $d^{1-\alpha}$ (where $d$ is the number of features) unless P=NP. This means that for arbitrary networks, we cannot even efficiently find an explanation that is guaranteed to be "close" to the smallest possible one.

Conclusion and Future Directions

These findings provide a theoretical justification for why current XAI tools must rely on heuristics. There is a fundamental mathematical barrier to building a fast, perfectly accurate explainer for arbitrary neural networks.

However, the authors note that these results reflect worst-case scenarios using pathological Boolean circuits. Real-world neural networks trained on natural data likely possess structural properties that make them more amenable to explanation. Future research must move beyond treating models as arbitrary black boxes and instead identify the specific architectural and data-driven constraints that allow for efficient, provable explainability.

Summary updated

BibTeX
@article{waldchen2021computational,
  author = {Stephan Wäldchen and Jan MacDonald and Sascha Hauch and Gitta Kutyniok},
  title = {{The Computational Complexity of Understanding Binary Classifier Decisions}},
  journal = {J. Artif. Intell. Res.},
  year = {2021},
  doi = {10.1613/jair.1.12359},
}
Figure