NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the Computational Tractability of the (Many) Shapley Values

Reda Marzouk, Shahaf Bassan, Guy Katz, De la Higuera

Abstract

Recent studies have examined the computational complexity of computing Shapley additive explanations (also known as SHAP) across various models and distributions, revealing their tractability or intractability in different settings. However, these studies primarily focused on a specific variant called Conditional SHAP, though many other variants exist and address different limitations. In this work, we analyze the complexity of computing a much broader range of such variants, including Conditional, Interventional, and Baseline SHAP, while exploring both local and global computations. We show that both local and global Interventional and Baseline SHAP can be computed in polynomial time for various ML models under Hidden Markov Model distributions, extending popular algorithms such as TreeSHAP beyond empirical distributions. On the downside, we prove intractability results for these variants over a wide range of neural networks and tree ensembles. We believe that our results emphasize the intricate diversity of computing Shapley values, demonstrating how their complexity is substantially shaped by both the specific SHAP variant, the model type, and the distribution.

Introduction

Shapley Additive Explanations (SHAP) have become the gold standard for explainable AI, providing a theoretically grounded method to attribute a model's prediction to its input features. However, calculating exact SHAP values is often a combinatorial challenge. While practitioners frequently use Interventional SHAP for its speed, most theoretical research has focused on Conditional SHAP, which assumes feature dependency. This paper addresses two critical gaps: the lack of formal complexity analysis for non-conditional SHAP variants and the reliance of existing tractable algorithms (like TreeSHAP) on simplistic feature independence assumptions.

The authors aim to map the boundaries of tractability—determining exactly when SHAP can be computed in polynomial time (PTIME) versus when it becomes NP-Hard or worse—across various model architectures, SHAP variants, and data distributions.

Methodology

The research employs formal computational complexity theory to analyze the problem. Key methodological pillars include:

  • Weighted Automata (WA) Reductions: The authors demonstrate that several model classes, including decision trees (DT), linear regression (LINR), and certain regression tree ensembles, can be reduced to Weighted Automata. Proving tractability for WAs thus establishes tractability for these models.
  • Hidden Markov Models (HMMs): The analysis extends to HMM distributions, which offer a more expressive way to model feature dependencies than standard independent assumptions.
  • Hardness Reductions: Intractability is proven using reductions from classic hard problems, such as 3-SAT for tree ensembles and the Closest String Problem for Recurrent Neural Networks (RNNs).
  • Local vs. Global Scope: The study distinguishes between local explanations (specific predictions) and global explanations (averaging importance over a distribution).

Key Results and Insights

The core contribution of this work is a comprehensive "complexity map" that categorizes the computational cost of SHAP across different scenarios.

Table 1: Computational complexity of SHAP variants across different models and distributions.

The Tractability of Trees and Linear Models

One of the most significant findings is that Decision Trees (DT), Linear Regression (LINR), and Regression Tree Ensembles (ENS-DTR) are tractable (PTIME) for Interventional and Baseline SHAP. Crucially, this tractability holds even under complex distributions like HMMs, suggesting that we can move beyond the "independent features" assumption without losing computational efficiency.

The Intractability of Neural Networks

In contrast, neural networks remain fundamentally difficult. Even in simplified settings with uniform distributions, computing SHAP for Sigmoidal or ReLU-based RNNs is NP-Hard. This indicates that exact SHAP values for deep learning models will likely always require approximation methods.

Variant-Specific Complexity

There is a stark "complexity gap" between SHAP variants. While Conditional SHAP is often NP-Hard or #P-Hard for most models under Empirical or HMM distributions, Interventional and Baseline SHAP remain tractable for the same models. Additionally, the study reveals that obtaining SHAP for tree ensembles used in regression is strictly easier than for those used in hard-voting classification (ENS-DTC).

Discussion and Limitations

While this work provides a rigorous theoretical foundation, several areas remain for future exploration:

  • Continuous Domains: The proofs primarily assume discrete input spaces. While the authors suggest many results extend to continuous domains, formal proofs for continuous neural networks are still needed.
  • Algorithmic Optimization: The study identifies polynomial-time solvability but does not focus on optimizing constant factors for production-scale implementation.
  • Approximation Theory: For settings proven to be NP-Hard, the next logical step is investigating "approximability"—determining if high-quality approximations can be achieved in polynomial time.
  • Extended Metrics: Future work could apply this complexity lens to other emerging metrics like SAGE or asymmetric SHAP variants.

Summary updated

BibTeX
@inproceedings{marzouk2025computational,
  author = {Reda Marzouk and Shahaf Bassan and Guy Katz and De la Higuera},
  title = {{On the Computational Tractability of the (Many) Shapley Values}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=xit2wOU09f},
}
Figure