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

On the Computational Tractability of the (Many) Shapley Values

Reda Marzouk, Shahaf Bassan, Guy Katz, Colin de la Higuera

Abstract

Recent studies have examined the computational complexity of computing Shapley additive explanations (SHAP) across various models and distributions, revealing a complex landscape of tractability. However, these studies primarily focused on Conditional SHAP, despite the existence of other variants that address different practical limitations. This work analyzes the complexity of a broader range of variants, including Conditional, Interventional, and Baseline SHAP, across local and global contexts. We demonstrate that Interventional and Baseline SHAP can be computed in polynomial time for several machine learning models under Hidden Markov Model (HMM) distributions. Conversely, we prove intractability for these variants when applied to various neural networks and hard-voting tree ensembles. Our results highlight how the complexity of SHAP is fundamentally shaped by the specific variant, model architecture, and underlying data distribution.

Introduction

Shapley Additive Explanations (SHAP) have emerged as a gold standard for interpreting machine learning model predictions. By assigning an importance value to each feature based on its contribution to a prediction, SHAP provides a theoretically grounded framework for transparency. However, SHAP is notoriously expensive to compute, as it requires evaluating a model across an exponential number of feature subsets.

Previous theoretical research into SHAP's complexity has largely focused on Conditional SHAP, frequently concluding that exact computation is NP-hard or #P-hard. Yet, popular practical implementations—such as TreeSHAP or KernelSHAP—often utilize Interventional or Baseline SHAP. This research addresses a critical gap: determining whether these practical variants are inherently easier to compute or if their perceived efficiency is limited to specific, simple distributions.

Defining the Tractability Landscape

To map the computational limits of SHAP, this study analyzes four primary dimensions:

  1. SHAP Variant: Conditional, Interventional, and Baseline.
  2. Model Type: Decision Trees (DT), Tree Ensembles (Regression/Classification), Linear Regression (LINR), Weighted Automata (WA), and Neural Networks (CNN/RNN).
  3. Distribution: Independent (IND), Empirical (EMP), and Hidden Markov Models (HMM).
  4. Scope: Local (explaining a single prediction) versus Global (explaining the model's overall behavior).

While most tractable algorithms assume feature independence, this work explores Hidden Markov Models (HMMs). HMMs represent a "sweet spot" in complexity; they are expressive enough to capture sequential dependencies and latent variables found in real-world data, yet mathematically structured enough to potentially allow for efficient computation.

Methodology: The Weighted Automata Bridge

To prove tractability, the authors utilize Weighted Automata (WA) as an algorithmic bridge. They demonstrate that many common model types, including decision trees and linear models, can be converted into WAs in polynomial time. By leveraging N-Alphabet WA operations—such as Kronecker products and projections—the researchers developed a framework to compute SHAP values efficiently within this representation. For establishing hardness, the study employs reductions from classic computational problems, including 3-SAT and the Closest String Problem.

Key Insights and Results

The Complexity Gap Between Variants

The research reveals a stark divergence in complexity between SHAP variants. For instance, while Conditional SHAP is NP-hard for decision trees under empirical distributions, Interventional SHAP remains in polynomial time (PTIME). This suggests that the choice of SHAP variant is not just a philosophical one regarding how to handle missing features, but a decisive factor in whether the explanation can be computed at scale.

Tractability of HMM Distributions

A major contribution of this work is the expansion of the "safe zone" for SHAP computation. The authors prove that Local and Global Interventional/Baseline SHAP are tractable for Decision Trees, Regression Tree Ensembles (ENS-DTR), Linear Regression, and Weighted Automata under HMM distributions. This extends the utility of SHAP beyond simple empirical or independent distributions to more complex, correlated data structures.

The Hardness of Neural Networks and Hard-Voting

Despite the gains in tree-based models, the study finds that neural networks remain fundamentally difficult. Even with simplified settings (e.g., uniform distributions or simple ReLU/Sigmoid activations), computing any SHAP variant for neural networks is NP-hard or worse. Furthermore, a distinction arises within tree ensembles: while regression and soft-voting ensembles are often tractable, hard-voting classification ensembles (ENS-DTC) are NP-hard even for the simplest Baseline SHAP.

Global vs. Local Computation

Interestingly, the study finds that computing Global SHAP (the average importance over an entire distribution) is often no more complex than computing Local SHAP for a single instance. This suggests that practitioners can derive aggregate model insights with the same computational overhead as individual explanations in many tractable settings.

Conclusion and Future Work

This analysis emphasizes that the computational feasibility of SHAP is not a monolithic property. It is an intricate function of the variant, the model, and the distribution. While Interventional SHAP offers a path to tractability for trees and linear models under complex distributions like HMMs, neural networks continue to pose significant challenges for exact computation.

Future research should address the limitations of the current discrete input space assumption, particularly for linear and neural models in continuous domains. Additionally, as exact computation remains hard for many architectures, investigating the approximability of SHAP—determining how closely we can estimate these values in polynomial time—remains a vital next step for the field.

Summary updated

BibTeX
@inproceedings{marzouk2025computational,
  author = {Reda Marzouk and Shahaf Bassan and Guy Katz and Colin 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