Papers
Topics
Authors
Recent
Search
2000 character limit reached

SHAP: Additive Feature Attribution in ML

Updated 2 May 2026
  • SHAP is an additive explanation framework that assigns feature attributions based on average marginal contributions from cooperative game theory.
  • It distinguishes between interventional and conditional approaches, enabling tailored explanations for independent and correlated features with methods like KernelSHAP and TreeSHAP.
  • Recent advancements extend SHAP to capture higher-order interactions and provide reliable global importance metrics for practical interpretability in high-dimensional models.

SHapley Additive Explanation (SHAP) assigns to each feature of a predictive model a local attribution value representing its average marginal contribution to the model output, calculated over all possible feature coalitions. SHAP fundamentally links cooperative game theory, additive surrogate modeling, and modern algorithmic tools to provide theoretically principled and practically tractable local explanations for black-box predictors. It is uniquely characterized by a set of axiomatic properties, supports both interventional (marginal) and conditional expectations in its valuation functional, and underlies an ecosystem of efficient estimation procedures, interaction indices, and summary statistics for feature importance at local and global scales.

1. Foundations: Shapley Values and the Additive Explanation Model

SHAP is rooted in the Shapley value formalism from cooperative game theory, which uniquely allocates the value of a coalition game among dd players satisfying efficiency, symmetry, linearity, and dummy axioms. Given a model f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}, SHAP constructs an additive surrogate g(z′)=ϕ0+∑i=1dϕizi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i, with zi′∈{0,1}z'_i\in\{0,1\} indicating the presence of feature ii. For a specific instance xx, the feature attribution is

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

where N={1,…,d}N = \{1,\ldots,d\}, and v(S)v(S) is a set function assigning value to any subset SS of features, typically realized as f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}0 (conditional SHAP) or f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}1 (interventional SHAP) (Lundberg et al., 2017, Richman et al., 2023).

SHAP is uniquely determined among additive local explanation models by simultaneous satisfaction of local accuracy (additivity), missingness, and monotonicity (consistency) (Lundberg et al., 2017). The "base value" f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}2 is the expected model output under a background distribution.

2. Functional Forms: Interventional vs. Conditional SHAP

A fundamental distinction in SHAP instantiations is the choice of the set function f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}3. The unconditional (interventional) variant, which assumes feature independence, defines

f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}4

The conditional variant respects the features' joint law: f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}5 ensuring that dependencies—such as support or collinearity among features—are preserved when forming coalitions (Richman et al., 2023).

Except in tree-based models where specialized algorithms exist, the interventional SHAP is predominantly used, as direct computation of the conditional version is often intractable. The surrogate neural network approach efficiently approximates all conditional sub-models f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}6 by training a shared NN with masked inputs, enabling tractable conditional SHAP computation for arbitrary models (Richman et al., 2023).

3. Efficient Computation: KernelSHAP, TreeSHAP, and Extensions

Naïve evaluation of SHAP is exponential, as it requires f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}7 marginalizations. SHAP introduces scalable algorithmic relaxations:

  • KernelSHAP: Interprets SHAP as a weighted linear regression problem in the binary second-order feature presence space. It approximates the Shapley kernel via Monte Carlo sample weighting and solves for f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}8 using weighted least-squares regression (Lundberg et al., 2017). Complexity is f:Rd→Rf:\mathbb{R}^d\to\mathbb{R}9 for g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i0 samples.
  • TreeSHAP: Exploits tree structure; traverses all paths of a decision tree to compute exact Shapley values in polynomial time, g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i1, where g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i2 is number of trees, g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i3 is max depth (2207.14490).
  • Surrogate Conditional-Expectation Networks: For conditional SHAP, a masked-input NN is trained to approximate all conditional submodels simultaneously, reducing conditional SHAP's complexity to that of NN inference (Richman et al., 2023).

Further computational gains are reported via pseudo-Boolean encoding (e.g., WOODELF (Nadel et al., 12 Nov 2025)) and model-order-aware strategies that permit polynomial-time computation of SHAP when the underlying model has low-order (e.g., additive or pairwise) interactions (Hu et al., 2023).

4. Extensions: Interaction Effects, Generalizations, and Beyond

Classical (main-effect) SHAP values conflate all synergistic effects between features into their marginal attributions, making interpretation of higher-order interactions ambiguous. Recent frameworks extend SHAP to capture these:

  • Shapley-Taylor indices: Decompose main and interaction attributions via Taylor expansion on the model’s multilinear extension, enabling explicit recovery of pairwise and higher-order interaction terms (Nohara et al., 2022, Bordt et al., 2022).
  • n-Shapley Values: Parameterize the explanation by interaction order g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i4, bridging SHAP (order-1, main effects only) up to the full functional decomposition (Harsanyi/Möbius transform) for g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i5 (Bordt et al., 2022). This frame aligns SHAP with generalized additive models (GAMs) and clarifies its agnosticism to interaction structure.
  • Generalized SHAP (G-SHAP): Replaces the local "why g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i6?" question with broader queries, such as explaining class separation, intergroup disparities, or aggregate loss, by generalizing the set function g(z′)=Ï•0+∑i=1dÏ•izi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i7 (Bowen et al., 2020).

WeightedSHAP generalizes the Shapley weighting kernel, relaxing the efficiency axiom to yield data-adaptive semivalues, often improving the fidelity of attributions for tasks such as prediction recovery, especially in settings with heterogeneous coalition informativeness (Kwon et al., 2022).

5. Statistical Properties, Inference, and Practical Guidance

SHAP provides both locally faithful and globally summarizable attributions. For aggregation to reliable global importance metrics (e.g., mean absolute or mean squared SHAP), statistical inferential guarantees can be established by treating the SHAP curve as a nuisance function and constructing Neyman-orthogonal estimators, including de-biased U-statistics and orthogonal empirical risk minimization for learning the full SHAP curve (Whitehouse et al., 11 Feb 2026).

Confidence intervals and asymptotic normality hold for powers of SHAP under minimal smoothing for g(z′)=ϕ0+∑i=1dϕizi′g(z') = \phi_0 + \sum_{i=1}^d \phi_i z'_i8 and cross-fitted regression/density-ratio estimation. For interpretability in practice:

  • Background dataset selection and size crucially influence stability and reliability of SHAP values, especially for deep models (Yuan et al., 2022).
  • Algorithmic approximations (segment-based, surrogate models) should be tuned to the complexity and interaction structure of the data and model (Serramazza et al., 3 Sep 2025, Hu et al., 2023).
  • Statistically-sound pipelines, such as CLE-SH, automate feature selection and interaction testing based on hypothesis testing on SHAP outputs—reducing subjective "eyeballing" (Lee et al., 2024).

6. Applications, Diagnostics, and Limitations

SHAP serves as a standard explainer in numerous domains, including structured tabular modeling (finance, healthcare), high-stakes anomaly detection, time-series, and human activity recognition with deep architectures. SHAP values underlie transparent feature selection procedures (e.g., in network anomaly detection (Roshan et al., 2021), DDoS classification (Wei et al., 2023)), model debugging, and recourse analysis (CF-SHAP for actionable recommendations (Albini et al., 2021)).

However, canonical SHAP is provably blind to effects beyond its chosen interaction order. In models with non-trivial higher-order interactions, first-order SHAP attributions can misattribute synergy, and uniform weighting can be suboptimal in non-cooperative or highly correlated settings. For deep CV/NLP models, SHAP's limited interaction resolution and computational burden may render explanations only partially faithful (Enouen et al., 20 Feb 2025).

7. Synthesis and Directions

SHAP provides a theoretically rigorous framework for decomposing model predictions into feature-wise attributions via the unique solution to the additive explanation axioms. Modern computational strategies and theoretical advances have broadened its tractability, interaction awareness, and applicability. Yet, interpretability in the presence of complex feature dependencies, high-order interactions, and causal structure remains an area of active research, with ongoing efforts targeting relaxation of axioms, optimization of coalition weighting, robust inference, and integration with task-specific explanation modalities (Richman et al., 2023, Bordt et al., 2022, Enouen et al., 20 Feb 2025).

SHAP's foundational role in interpretable ML continues to drive both methodological innovation and critical reflection on the meaningfulness, stability, and statistical validity of local and global attributions in high-dimensional data-driven environments.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (17)

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 Shapley Additive Explanation (SHAP).