The Computational Complexity of Machine Learning Explanations

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 121 papers30 conceptsfrozen 2026-10-04

In the quest to understand "black box" AI, we often rely on subjective measures of interpretability—like how many nodes a decision tree has or how many non-zero weights exist in a linear model. However, a growing body of research suggests that interpretability is not a matter of aesthetics, but a matter of computational complexity.

If an explanation for a model's decision is mathematically rigorous but takes a billion years to compute, is that model truly interpretable? Researchers in this field argue that a model class is only as interpretable as the "why" queries it can efficiently answer.

Interpretability as a Complexity Class

Traditionally, we think of models like decision trees as "interpretable" and neural networks as "opaque." Pablo Barcelo, Mikaël Monet, and their colleagues formalized this intuition in Model Interpretability through the lens of Computational Complexity. They propose that interpretability should be defined by the mathematical difficulty of answering specific post-hoc explainability queries.

Under this framework, a model is "computationally interpretable" if we can generate explanations—such as the smallest set of features that guarantee a prediction—in polynomial time (PTIME). This turns interpretability into a rigorous ranking: linear models and decision trees are fundamentally more interpretable than deep networks because the queries we care about are computationally tractable for the former but NP-hard for the latter.

The Search for "Sufficient Reasons"

What exactly is a "formal" explanation? A common standard is the Prime Implicant (PI) explanation, also known as a "sufficient reason." This is a minimal set of input features such that, no matter what values the other features take, the model's prediction remains the same.

The challenge is that finding these minimal sets is usually an NP-hard search problem. However, João Marques-Silva 0001 and Alexey Ignatiev have shown that for certain models, we can bypass this complexity. In Explaining Naive Bayes and Other Linear Classifiers with Polynomial Time and Delay, they demonstrate that for linear classifiers, these exact explanations can be computed in log-linear time. This provides a "ground truth" that can be used to audit popular but heuristic explainers like SHAP or Anchor, which offer no such mathematical guarantees.

Knowledge Compilation: Making Hard Queries Easy

When a model is too complex to explain directly (like a large random forest or a neural network), we can use Knowledge Compilation (KC). The idea is to "compile" the model into a structured logical representation, such as a Decomposable Negation Normal Form (d-DNNF).

As Xuanxiang Huang and others explain in Efficient Explanations for Knowledge Compilation Languages, once a model is in a KC format that supports polynomial-time conditioning and consistency checking, generating rigorous explanations becomes efficient. This shift allows us to move from heuristic approximations to real-time, non-heuristic explanations without sacrificing mathematical rigor. Similarly, Adnan Darwiche and Pierre Marquis have shown that operations like universal literal quantification can be performed in linear time on certain logical formats to compute "complete reasons" for a classifier's decision.

The Complexity Reversal

We often assume that if a model is easy to understand locally (explaining one prediction), it must be easy to understand globally (explaining the whole model). Shahaf Bassan, Guy Katz, and their team challenged this in Local vs. Global Interpretability: A Computational Complexity Perspective.

They discovered a "complexity reversal":

  • Linear Models: Easy to explain locally, but harder to explain globally.
  • Neural Networks/Decision Trees: Often, finding a global explanation is computationally simpler than finding a rigorous local explanation for a single, specific prediction.

This counterintuitive finding suggests that our "folklore" about model simplicity is often wrong. For instance, while we think of ensembles as just "more of the same," Bassan and Katz prove in What makes an Ensemble (Un) Interpretable? that ensembles of linear models become mathematically intractable far faster than ensembles of decision trees.

The Limits of Approximation

If exact explanations are hard, can we just approximate them? Research by André Artelt and Martin Olsen suggests a sobering "no." In On the Hardness of Computing Counterfactual and Semifactual Explanations in XAI, they prove that even approximating counterfactual explanations is computationally intractable for common models like ReLU networks and k-Nearest Neighbors.

This highlights a critical tension in the field: as regulations increasingly demand "the right to an explanation," the mathematical reality is that for many modern AI architectures, providing a rigorous, provable explanation is a task that computers simply cannot perform efficiently. The path forward lies in either restricting models to those with PTIME explanation queries or continuing to refine the logical compilation techniques that make the intractable tractable.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_the_computational_complexity_of_machine__d6026af1,
  title = {The Computational Complexity of Machine Learning Explanations},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/the-computational-complexity-of-machine-learning-explanations/rdr_d6026af18ac54b6183218735d1e79d43},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-12-06},
}

This exact version (version 1, frozen text):

@misc{lacuna_the_computational_complexity_of_machine__d6026af1_v1,
  title = {The Computational Complexity of Machine Learning Explanations},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/the-computational-complexity-of-machine-learning-explanations/rdr_d6026af18ac54b6183218735d1e79d43/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-06},
}