Papers
Topics
Authors
Recent
Search
2000 character limit reached

Tractability of SHAP Explanations

Updated 23 March 2026
  • The paper establishes a computational equivalence between SHAP value computation and expectation under product distributions, setting conditions for polynomial-time tractability in structured models.
  • It delineates tractability frontiers by contrasting model classes; decision trees and tractable circuits allow efficient computation, whereas neural nets and complex formulas are #P-hard.
  • The study discusses algorithmic mitigations—such as TreeSHAP, functional decomposition, and surrogate models—that offer practical strategies for approximating SHAP values in real-world applications.

SHAP (Shapley Additive Explanations) values are a principled feature attribution method grounded in cooperative game theory and have become central in model explainability research. The tractability of SHAP explanations—i.e., whether SHAP values can be computed or approximated efficiently—depends on the combination of model class, input distribution, SHAP variant, and, in some cases, the desired type of interaction explanation. Recent theoretical and algorithmic work has characterized this landscape in depth.

1. Formalization and General Algorithmic Equivalence

SHAP values for a function F:X→RF: \mathcal{X} \to \mathbb{R}, instance x∈Xx \in \mathcal{X}, and distribution P\mathcal{P} are defined as:

ϕi(F,x)=∑S⊆N∖{i}∣S∣!(n−∣S∣−1)!n!(v(S∪{i})−v(S))\phi_i(F, x) = \sum_{S \subseteq N \setminus\{i\}} \frac{|S|! (n - |S| - 1)!}{n!} \left( v(S \cup \{i\}) - v(S) \right)

where v(S)=EP[F(X)∣XS=xS]v(S) = \mathbb{E}_{\mathcal{P}}[F(X) \mid X_S = x_S], and N={1,…,n}N = \{1, \ldots, n\} indexes features. This formulation embodies the fundamental computational challenge—each ϕi\phi_i involves 2n−12^{n-1} terms, each term requiring conditional expectation computation.

A central result, formalized by Barceló, Cominetti, and Morgado, is that for any "simple" (cardinality-based) power index such as SHAP or Banzhaf, and for any model FF, computation of the index is polynomially equivalent to computing expectations under product distributions. Specifically:

  • If computing EP[F]\mathbb{E}_{\mathcal{P}}[F] is polynomial-time for the model class, so is SHAP.
  • Conversely, if expectation is #\#P-hard, so is SHAP. This reduction is tight and general, holding for all simple indices with positive mass on the empty coalition, such as SHAP and Banzhaf (Barceló et al., 4 Jan 2025).

2. Tractability Frontiers: Model and Distribution Classes

A precise taxonomy for tractable SHAP computation emerges when considering the interplay between model class and distributional assumptions:

Model Class Distributional Assumption SHAP Complexity Reference
Linear regression / Linear Gaussian Any product/factorized P\mathcal{P} Polytime (Broeck et al., 2020, Barceló et al., 4 Jan 2025)
Decision/regression trees; ensemble forests Any product/factorized P\mathcal{P} Polytime (TreeSHAP) (Broeck et al., 2020, Arenas et al., 2021)
Deterministic, decomposable Boolean circuits (d-DNNF, OBDD, SDD, FBDD) Product or uniform Polytime (Arenas et al., 2020, Arenas et al., 2021)
Tractable probabilistic circuits / low-treewidth Bayes nets Product Polytime (Broeck et al., 2020, Barceló et al., 4 Jan 2025)
Markov chain on features (first-order Markov) Weighted automata, disjoint DNF, trees Polytime (Marzouk et al., 2024)
Logistic regression, neural nets (sigmoids), naive Bayes Product or NB #\#P-/NP-hard (Broeck et al., 2020, Barceló et al., 4 Jan 2025)
General CNF/DNF Product/empirical #\#P-hard (Broeck et al., 2020, Arenas et al., 2021, Arenas et al., 2020)
Empirical distributions (training set) Any model FF #\#P-hard (Broeck et al., 2020)
HMM (for interventional-type SHAP) Trees, automata, lin reg Polytime (Marzouk et al., 17 Feb 2025)

Key points:

  • SHAP values are polytime on any model class (and input distribution) for which E[F]\mathbb{E}[F] under product/factorized distributions is polytime.
  • Decision trees, additive tree ensembles, tractable circuits are the frontier of polytime exact SHAP for common ML models under product distributions.
  • Logistic regression, sigmoidal NNs, Naive Bayes, and general CNF/DNF models are #\#P-hard even under feature independence, with further intractability in the presence of feature dependencies.

3. Structure-based and Distributional Extensions

Markovian and HMM Extensions

Recent advances transcend feature-independence by considering chain-structured Markov (and HMM) distributions:

  • For weighted automata, disjoint DNF, and decision trees, SHAP can be computed in polynomial time under Markovian input distributions, using automata-based dynamic programming (Marzouk et al., 2024, Marzouk et al., 17 Feb 2025).
  • This generalizes the independence frontier, maintaining tractability for an important class of sequential models relevant to time-series and NLP.
  • TreeSHAP polytime guarantees extend from empirical to general HMM backgrounds for Interventional and Baseline SHAP (Marzouk et al., 17 Feb 2025).

Tensor Network and Parameterized Complexity

Tensor network representations allow efficient SHAP computation for a wider range of models, especially when structured as tensor trains (TT). For TT models (and f and PP as TT), SHAP computation is in class NC2{}^2 (polylog parallel time), and this result transfers to trees, tree ensembles, linear models, and linear RNNs. For binarized neural networks, tractability is governed by network width: if width is fixed (but not depth), SHAP is tractable, but remains hard for arbitrary width (Marzouk et al., 24 Oct 2025).

4. Intractability and Hardness Reductions

Polytime tractability of SHAP depends critically on both model structure and feature distribution:

  • Under product distributions, SHAP computation is as hard as model expectation, thus inheriting known #\#P-hardness for logistic regression, DNF, and neural networks.
  • With dependencies (e.g., Naive Bayes or empirical distribution), SHAP may become NP-hard even for trivial classifiers (Broeck et al., 2020).
  • For Boolean circuits, tractability requires both determinism and decomposability; removing either restores #\#P-hardness (see Table below):
Boolean Circuit Type SHAP Complexity
d-DNNF Polytime
Only decomposable #\#P-hard
Only deterministic #\#P-hard
General DNF #\#P-hard, no FPRAS (Arenas et al., 2021)

No fully polynomial randomized approximation scheme (FPRAS) exists for SHAP on DNF/monotone DNF unless RP=NP, contrasting with the tractability of approximate model counting for DNF formulas (Arenas et al., 2021).

5. Algorithmic and Structural Mitigations

Given the exponential complexity of exact subset enumeration, several methods offer scalability or approximation without explicit enumeration:

  • TreeSHAP and Circuit SHAP: For tree ensembles and tractable Boolean circuits, dynamic programming enables exact polynomial-time calculation (Arenas et al., 2021, Arenas et al., 2020).
  • Functional Decomposition: For models expressible as low-dimensional additive/interacting structures (e.g., shallow trees/forests), the unique ANOVA-like decomposition can be exploited to yield exact interventional SHAP values in polynomial time, exponential only in the maximal interaction order—not total number of features (Hiabu et al., 2022).
  • Interaction-aware Explanations: Pruning exponentially many interaction terms by partitioning features into a small set of interacting groups (as in iSHAP/SIAE) suppresses the combinatorial blow-up to the Bell number of the group count, which remains small for sparse interaction graphs (Xu et al., 2024).
  • Conformal Regression Surrogates: Train a regression model to approximate SHAP values, then calibrate output intervals with inductive conformal prediction for statistical validity. This method achieves 5–10× speedups over exact SHAP for tree-based models and maintains informative confidence intervals (Alkhatib et al., 2023).
Approach Complexity Scope Reference
TreeSHAP (exact) O(Tâ‹…Lâ‹…D2)O(T \cdot L \cdot D^2) per sample Trees/ensembles (Broeck et al., 2020)
Functional decomp. Poly(nn), exp(qq) Trees/forests, low qq (Hiabu et al., 2022)
SIAE/iSHAP (partition) Poly(dd), exp(mm) Interaction groups m (Xu et al., 2024)
Surrogate+Conformal Fast (MLP/XGB prediction) General (Alkhatib et al., 2023)

6. Open Problems and Research Directions

Several open directions remain for enhancing the tractability and coverage of SHAP explanations:

  • Identifying novel model–distribution pairs (e.g., beyond Markov/chains or tractable circuits) that admit efficient SHAP.
  • Developing formal approximation schemes (FPTAS or parameterized algorithms) for intractable settings, especially for neural networks, DNF formulas, and realistic dependent features.
  • Extending the tractability frontier to tree-structured or more general Bayesian network dependencies beyond chains (Marzouk et al., 2024).
  • Leveraging low-dimensional submodular or hierarchical structure, or exploiting sparsity in model interactions, to further shrink the explanatory player set (Xu et al., 2024).
  • Formal characterization and practical optimization of constants in polynomial-time algorithms for automata-based or functional-decomposition-based SHAP, especially for high-dimensional or sequence data.

7. Practical Implications and Recommendations

  • For any model class where computing model expectation under feature independence is tractable (e.g., trees, additive models, d-DNNF/OBDD circuits, bounded-treewidth graphical models), SHAP computation is also tractable.
  • When feature dependencies cannot be ignored but are chain-structured (Markov), polynomial-time SHAP is possible for automata, decision trees, and disjoint DNF (Marzouk et al., 2024).
  • For models that are not tractable in expectation (e.g., logistic regression, general DNF), exact SHAP is #\#P-hard, and neither approximation nor even comparison between SHAP values is in BPP unless RP = NP (Arenas et al., 2021).
  • Approximate or surrogate-based SHAP with validity guarantees should be adopted when real-time explanations or high model complexity preclude exact computation (Alkhatib et al., 2023).
  • In high-dimensional domains, semantic/latent factors or feature grouping can yield interpretable and computationally feasible SHAP-style explanations (Mijolla et al., 2020, Kim et al., 3 Jan 2026).
  • Algorithm designers should exploit model structure (trees, circuits, automata, tensor networks) and interaction sparsity whenever possible.

The tractability of SHAP explanations delineates a sharp boundary in explainable AI: for simple models and certain structured dependencies, efficient and exact attribution is possible; but for general, highly expressive models, especially with complex dependencies, SHAP's theoretical guarantees do not translate to tractable computation, except through carefully optimized structure-exploiting algorithms or approximations (Broeck et al., 2020, Marzouk et al., 2024, Marzouk et al., 24 Oct 2025, Marzouk et al., 17 Feb 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Tractability of SHAP Explanations.