Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
167 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

On the Tractability of SHAP Explanations (2009.08634v2)

Published 18 Sep 2020 in cs.AI, cs.CC, and cs.LG

Abstract: SHAP explanations are a popular feature-attribution mechanism for explainable AI. They use game-theoretic notions to measure the influence of individual features on the prediction of a machine learning model. Despite a lot of recent interest from both academia and industry, it is not known whether SHAP explanations of common machine learning models can be computed efficiently. In this paper, we establish the complexity of computing the SHAP explanation in three important settings. First, we consider fully-factorized data distributions, and show that the complexity of computing the SHAP explanation is the same as the complexity of computing the expected value of the model. This fully-factorized setting is often used to simplify the SHAP computation, yet our results show that the computation can be intractable for commonly used models such as logistic regression. Going beyond fully-factorized distributions, we show that computing SHAP explanations is already intractable for a very simple setting: computing SHAP explanations of trivial classifiers over naive Bayes distributions. Finally, we show that even computing SHAP over the empirical distribution is #P-hard.

Citations (200)

Summary

  • The paper finds that computing SHAP explanations under fully-factorized data distributions is equivalent to calculating the model's expected value, resulting in #P-hard complexity for models like logistic regression and neural networks.
  • The study reveals that complexity increases significantly beyond fully-factorized distributions, becoming NP-hard even for simple classifiers under naive Bayes assumptions with minimal feature dependencies.
  • The empirical distribution, derived directly from training data, also presents #P-hard complexity for SHAP explanations, indicating inherent computational challenges for exact SHAP calculation on real datasets.

Complexity of SHAP Explanations for Machine Learning Models

The paper "On the Tractability of SHAP Explanations" examines the computational complexity of calculating SHAP (Shapley additive explanations) values across various settings. SHAP is a prevalent method in explainable AI for attributing feature influence based on cooperative game theory. Despite its widespread use, the efficiency of SHAP calculations across different model and data distributions remains unclear. This paper systematically explores this issue, offering insights on the tractability of SHAP explanations.

Key Findings

  1. Tractability under Fully-Factorized Distributions:
    • The paper identifies that the complexity of computing SHAP explanations under fully-factorized data distributions is equivalent to the complexity of estimating a model's expected value under the same distribution. This equivalence extends to any predictive model.
    • Fully-factorized distributions assume feature independence, a common simplification in practice. While these distributions facilitate tractable SHAP computations for models like linear regression and decision trees, they become intractible for others like logistic regression and neural networks with sigmoid activations, which result in a #P-hard complexity.
  2. Complexity Beyond Fully-Factorized Distributions:
    • The paper extends the analysis to naive Bayes distributions and reveals that computing SHAP values already becomes NP-hard for trivial classifiers within these settings. This implies a significant complexity increase when even minimal dependencies exist among features, compared to fully-factorized cases.
    • By analyzing Bayesian networks and factor graphs, the paper emphasizes the increased computational burden of SHAP under any model assuming dependencies among features.
  3. Intractability with Empirical Distributions:
    • The empirical distribution, derived directly from training data, also exhibits #P-hard complexity for SHAP explanations. This result is surprising considering the empirical distribution's reduced domain size, suggesting inherent computational challenges in exact SHAP calculation on realistic datasets.

Implications

The findings suggest that the tractability of SHAP explanations is highly sensitive to assumptions about data distribution and model class. This insight challenges widespread assumptions regarding the ease of computing SHAP values in real-world scenarios. Practically, this analysis cautions against oversimplified assumptions about data independence in SHAP approximations, which may lead to misleading interpretations. Theoretically, it underscores the nuanced, often overlooked, role of data structure in the computational complexity of AI transparency methodologies.

Future Work

The results open several avenues for future research. One promising direction is exploring classes of models that allow tractable SHAP computation beyond fully-factorized settings. Additionally, investigating efficient approximations or alternative explanation techniques with lower computational complexity in dependent data settings offers significant practical value. The development of novel approaches that bridge the accuracy-interpretability tradeoff remains a fertile ground for innovation in explainable AI.

In conclusion, this paper provides a comprehensive complexity analysis of SHAP explanations, unveiling substantial challenges that must be addressed to harness the full potential of SHAP values as a tool for model interpretability in complex real-world applications.