Introduction
SHAP (Shapley Additive exPlanations) has emerged as a gold standard for local model explainability, primarily due to its rigorous grounding in cooperative game theory. However, a significant gap exists between the theoretical ideal of SHAP and its practical application. To remain computationally feasible, most implementations rely on the feature independence assumption, which assumes that features do not correlate with one another. In real-world scenarios, this assumption is rarely met, and relaxing it often causes the computational complexity of SHAP to jump from manageable to #P-Hard.
This paper identifies a critical "sweet spot" between the unrealistic assumption of total independence and the intractable complexity of full correlation: Markovian distributions. The authors prove that exact SHAP scores can be computed in polynomial time for several important model classes—including Weighted Automata, Disjoint DNFs, and Decision Trees—even when features are correlated via a Markovian structure.
The Challenge of Correlation
The difficulty in computing SHAP lies in calculating conditional expectations across an exponential number of feature coalitions. When features are independent, these expectations are relatively straightforward to compute. However, when researchers attempt to use more realistic distributions (such as Naive Bayes or empirical distributions), the math becomes extremely difficult. This paper proposes that Markovian distributions are expressive enough to model many stochastic phenomena and feature correlations while remaining structured enough to allow for efficient algorithmic manipulation.
Methodological Framework
The authors utilize a formal language and automata-theoretic approach to solve the complexity problem. Their methodology involves several key innovations:
- Sequential Reformulation: Feature coalitions are represented as "patterns" (regular expressions over an extended alphabet). This allows the authors to use the machinery of regular languages to navigate the exponential space of possible feature combinations.
- Automata Representation: Models are represented as Weighted Automata (WAs) and Weighted Transducers (WTs)—mathematical structures that assign scores to sequences.
- Algorithmic Decomposition: The authors show that the SHAP formula can be broken down into a finite sequence of operations: the Hadamard product, the partition constant, and the projection operator.
- Closure Properties: Crucially, the paper proves that WAs and WTs are "closed" under these operations. This means that if you start with a WA and a Markovian distribution, you can perform the necessary SHAP calculations and still end up with a result that can be solved in polynomial time.
- Sequentialization of Boolean Models: To extend these results to Decision Trees and Disjoint DNFs (d-DNFs), the authors employ a "sequentialization" strategy, mapping these boolean functions into the language of automata.
Key Results
The paper establishes several foundational complexity results that move the field toward more robust explainability:
- Theorem 3.1: Computing the SHAP score for the class of Weighted Automata under Markovian distributions is in FP (Functional Polynomial time).
- Theorem 4.2 & Corollary 4.3: Computing the SHAP score for Disjoint DNFs and Decision Trees under Markovian distributions is also in FP.
- Complexity Scaling: The proposed algorithms run in $O(poly(size(A), |\Sigma|, |w|))$, where $size(A)$ is the model size, $|\Sigma|$ is the alphabet size, and $|w|$ is the length of the input sequence. This confirms that the approach scales efficiently with both the complexity of the model and the data.
Discussion and Implications
A significant insight of this work involves the popular TreeSHAP algorithm. While TreeSHAP is widely used for its speed, the authors note that it actually computes "interventional SHAP" (which assumes independence) rather than the original, correlation-aware SHAP score. This research provides a theoretical path toward an exact, tractable version of the original SHAP for trees under correlation.
Limitations
While the results are a major step forward, they are currently limited to "glass-box" or structured models. While Weighted Automata can act as proxies for some Recurrent Neural Networks (RNNs), the results do not yet extend to general deep neural networks. Additionally, while the authors suggest the logic extends to higher-order $n$-gram models, the formal proofs in this paper focus primarily on first-order Markov chains.
Conclusion
By proving that SHAP is tractable under Markovian distributions, this paper provides a more robust theoretical foundation for explaining sequential and rule-based models. It moves the field beyond the restrictive independence assumption without falling into the trap of computational intractability, offering a promising framework for future explainability tools.
Summary updated