---
title: 'do-SHAP: Causal Attribution Framework'
url: https://www.emergentmind.com/topics/do-shap
type: topic
---

# do-SHAP: Causal Attribution Framework

do-SHAP, also called do-Shapley or causal Shapley values, is a causal attribution framework that explains the contribution of features to an outcome by averaging **interventional** effects across coalitions rather than relying on correlation, conditional dependence, or purely observational masking rules. In a Structural Causal Model (SCM), it assigns to each variable an average contribution to a target under interventions of the form $\mathrm{do}(S=\mathbf{x}_S)$, thereby interpreting feature relevance as a causal effect on the outcome for a specific instance [2602.07203]. Recent work has developed both an exact computational theory based on irreducible sets and a practical estimation pipeline based on learned SCMs and estimand-agnostic causal inference, making do-SHAP substantially more usable on complex graphs than earlier estimand-specific workflows [2602.07203], [2509.20211].

## 1. Causal value function and Shapley construction

The defining object in do-SHAP is an interventional value function. In the SCM-based formulation, for a coalition $S \subseteq [d]$ one uses
\[
\nu(S) = \mathbb{E}[Y \mid \mathrm{do}(S=\mathbf{x}_S)],
\]
where the variables in $S$ are externally set to their observed values in the instance being explained [2602.07203]. In the practical formulation for a sample $x$ and coalition $S \subseteq X$, the same idea is written as
\[
\nu_x(S) := \mathbb{E}[Y \mid do(S=s)].
\]
This replaces the masking semantics of standard SHAP with an explicitly causal query [2509.20211].

The do-Shapley value for feature $i$ is then obtained by the usual Shapley averaging over marginal contributions:
\[
\phi_i = \sum_{S \subseteq [d] \setminus \{i\}} \big[\nu(S \cup \{i\}) - \nu(S)\big]\, p_{|S|},
\qquad
p_\ell = \frac{1}{d}\binom{d-1}{\ell}^{-1}.
\]
Equivalently, in the practical notation with $K$ variables,
\[
\phi_X = \sum_{S \subseteq X\setminus\{X\}} \frac{1}{K}\binom{K-1}{|S|}^{-1} \big(\nu(S\cup\{X\})-\nu(S)\big),
\]
or
\[
\phi_X = \frac{1}{K!}\sum_{\pi\in\Pi(X)} \big(\nu(X_{\le_\pi X})-\nu(X_{<_\pi X})\big).
\]
Thus do-SHAP answers the question: on average over all coalitions, how much does intervening on a feature change the expected outcome causally [2602.07203], [2509.20211].

This causal semantics distinguishes do-SHAP from standard SHAP variants. The practical do-SHAP literature explicitly contrasts it with **Marginal SHAP**, which replaces missing features by draws from the marginal distribution and can generate unrealistic, out-of-support feature combinations, and with **Conditional SHAP**, which respects correlations but can introduce anti-causal effects [2509.20211]. A concrete illustration given in that literature is that conditioning on education can induce changes in age, which is physically impossible [2509.20211].

## 2. Structural causal model setting and identifiability

The formal setting is an SCM with a causal graph, structural equations, and exogenous noise. One formulation assumes a DAG $G$ over observed variables and latent confounders, with each observed node generated by
\[
X := f_X(\mathrm{Pa}_G(X), E_X).
\]
Another writes the SCM as
\[
M=(V,W,P,F),
\]
where $V$ are measured variables, $W=E\cup U$ includes exogenous noise and latent confounders, and
\[
V_k = f_k(Pa_k, \mathcal{U}_k, E_k).
\]
Interventions are standard Pearl interventions: $\mathrm{do}(X=x)$ replaces the structural assignment for $X$ by the constant $x$ and removes incoming edges to $X$ [2602.07203], [2509.20211].

A central issue is identifiability. The exact-computation literature proves a strong reduction:
\[
\phi_i \text{ is identifiable } \iff \forall j \in [d],\ \nu(\{j\}) \text{ is identifiable}.
\]
Equivalently, non-parametric identifiability of do-Shapley values requires only the identification of interventional effects for the $d$ singleton coalitions, rather than all classes [2602.07203]. The practical consequence is that one can screen identifiability by checking only singleton interventions instead of all coalitions.

This result is conceptually important because naive do-SHAP appears to require causal identification for exponentially many coalition queries. The singleton reduction shows that the identifiability burden is much smaller than the combinatorial form of the Shapley sum initially suggests [2602.07203].

## 3. Exact computation via irreducible sets

The principal algorithmic advance in exact do-SHAP computation is a reformulation in terms of **irreducible sets** or causal equivalence classes. For a coalition $S \subseteq [d]$, the **basis** is
\[
\underline{S} = \{j \in S : \text{there exists a directed path from } j \text{ to } Y \text{ that intersects } S \text{ only at } j\},
\]
and the **closure** is
\[
\bar{S} = \{j \in [d] : \text{every directed path from } j \text{ to } Y \text{ intersects } S\}.
\]
A set is irreducible if it is equal to its basis [2602.07203].

These objects induce equivalence classes of coalitions. If $\underline{S} \subseteq T \subseteq \bar{S}$, then
\[
\nu(\underline{S}) = \nu(T) = \nu(\bar{S}).
\]
Hence the powerset $2^{[d]}$ is partitioned into classes $c_1,\dots,c_r$, where $r$ is the number of irreducible sets. The do-Shapley value can then be rewritten as
\[
\phi_i = \sum_{j=1}^r \nu(c_j)\, w_i(c_j),
\]
with class weights computed from the basis and closure of each class [2602.07203].

The computational gain is that exact computation depends on $r$, not on $2^d$. The number of irreducible sets is graph-dependent and can vary from $d$ to $2^d$. The exact algorithm is proved to run in
\[
O(r(d+e+T)),
\]
where $e$ is the number of edges in the causal graph and $T$ is the time to query $\nu(S)$ once [2602.07203]. This is linear in the number of classes rather than exponential in the number of features.

The same work also introduces a fixed-budget estimator based on a **boundary sampler**. It explores the lattice of classes rather than sampling coalitions blindly, discovers $\min(m,r)$ distinct classes with a budget of $m$ queries, runs in
\[
O(m \cdot d(d+e)),
\]
and returns the Shapley values up to machine precision when the budget reaches $r$ [2602.07203]. The sharp distinction between the number of coalitions and the number of causal classes is one of the defining computational insights of modern do-SHAP.

## 4. Practical do-SHAP with estimand-agnostic causal inference

A separate line of work addresses a different bottleneck: the original estimand-based workflow. In that setting, each query $\mathbb{E}[Y\mid do(S=s)]$ requires deriving an estimand and fitting models for the terms in that estimand, which becomes cumbersome when repeated for up to $2^{|X|}$ coalitions [2509.20211].

The proposed alternative is **estimand-agnostic causal inference**. Instead of deriving a bespoke observational formula for each coalition, one trains a proxy SCM $M_\theta$ with the same graph $G$ to fit the observational distribution $P(V)$. Then, for any identifiable query, one estimates it directly by sampling from the learned SCM, applying the intervention inside the SCM, and averaging the resulting outcomes [2509.20211]. In this formulation, one learned causal model answers all identifiable coalition queries without requiring a separate estimand derivation for each of them.

To reduce the number of coalition evaluations, this work introduces the **Frontier-Reducibility Algorithm (FRA)**. FRA exploits two causal facts. First, if a feature $X$ is not an ancestor of the target $Y$, then
\[
\phi_X=0.
\]
Second, if a set $S$ is a **frontier** between $X$ and $Y$—that is, $X\notin S$ and every directed path from $X$ to $Y$ is blocked by some node in $S$—then
\[
\nu(S\cup\{X\}) = \nu(S).
\]
Thus the presence of $X$ is causally redundant once the frontier is fixed [2509.20211].

The key theorem used by FRA states that for a coalition $S$, if
\[
Z := \{X \in S \mid S_{>_G X}\in Fr(X,Y)\},
\]
then
\[
\nu(S)=\nu(S\setminus Z),
\]
and $S\setminus Z$ is irreducible [2509.20211]. In effect, multiple superfluous variables can be removed at once, and many coalitions collapse to the same reduced representative. FRA does not change the exponential worst-case complexity of exact do-SHAP, but it substantially reduces redundant evaluations in practice and is reported to add negligible overhead [2509.20211].

The same practical framework also addresses inaccessible data-generating processes. Under an additive noise model with no latent confounders into $Y$,
\[
Y = f(Pa_Y) + E_Y,
\]
the noise variable can be treated as an extra player, with
\[
\phi_{E_Y} = y - \mathbb{E}[Y\mid pa_Y].
\]
Practically, one approximates $\mathbb{E}[Y\mid pa_Y]$ with a fitted model $f'(pa_Y)$ and defines
\[
\phi_{E_Y} := y - f'(pa_Y).
\]
This yields a decomposition that attributes the unexplained part of the realized outcome to the noise term [2509.20211].

## 5. Relation to neighboring SHAP formalisms

The term “do-SHAP” is frequently conflated with several adjacent but distinct lines of SHAP research.

**Conditional SHAP** is not do-SHAP. A conditional expectation network has been proposed to compute the conditional value function
\[
\nu({\cal C})=\mathbb E[\mu(X)\mid X_{\cal C}=x_{\cal C}]
\]
efficiently via a masked surrogate neural network, precisely to preserve feature dependence [2307.10654]. This is a conditional-expectation construction, not an intervention-based one.

**Trustable SHAP** is also not do-SHAP. One line of work argues that failures of standard SHAP arise from the characteristic function
\[
e(S;E)=E[\kappa(\mathbf{x})\mid \mathbf{x}_S=\mathbf{v}_S]
\]
and proposes alternative Shapley-compatible characteristic functions $s$, $a$, $c$, and $n$ based on prediction similarity and AXp/CXp logic [2405.00076]. It does not define do-SHAP and is described as orthogonal to the causal/interventional literature.

**Marginal SHAP with a causal reading** is not, by itself, formal do-SHAP. Statistical inference work on SHAP power summaries explicitly states that it uses the model-agnostic marginal SHAP definition and that the only place where “do” appears is a conceptual remark about marginal SHAP having a causal interpretation as a do-operation in Pearl’s sense; it does not define a do-SHAP functional or estimator [2602.10532].

**Interventional SHAP on extended support** is adjacent but distinct. A theoretical safe-feature-removal result shows that if SHAP vanishes on the product-of-marginals extended support, then a feature can be safely discarded on that support, and the paper describes this as a core “do-SHAP” style result [2503.23111]. This suggests a close connection to intervention-like semantics, but the construction is framed as a soundness result for aggregate SHAP rather than as the SCM-based do-Shapley formalism.

**Tensor-network SHAP** and **interaction tensor SHAP** operate on interventional or marginal value functions, and one tensor-network paper explicitly introduces a tensorized “do operator” in the construction of the value tensor [2510.21599]. Yet these works concern exact SHAP and higher-order interaction computation under Tensor Train structure, not the SCM-based do-Shapley framework itself [2510.21599], [2512.05338].

**Privacy-preserving SHAP regularization** is conceptually related only in the sense that it targets the explanation output itself. A privacy paper explicitly notes that its method is “not a do-SHAP algorithm in the causal/interventional sense”; it regularizes SHAP attribution entropy to reduce leakage while retaining interpretability [2511.09775].

These distinctions matter because “do-SHAP” is not a generic label for any SHAP variant with interventional language. In the strict sense developed in recent causal-XAI work, it denotes Shapley values of a genuinely interventional SCM value function [2602.07203], [2509.20211].

## 6. Limitations, caveats, and current research directions

Current do-SHAP methods retain several limitations. Exact do-Shapley computation is still exponential in the worst case because the number of irreducible sets can be $2^d$ [2602.07203]. FRA reduces redundancy but does not alter that worst-case complexity [2509.20211]. Practical deployment also requires a known causal graph and identifiable intervention queries [2509.20211].

The quality of practical do-SHAP depends on the quality of the learned SCM. In the estimand-agnostic framework, better fit to the observational distribution correlates with better do-SHAP estimation, and model class matters: linear SCMs perform worst on the reported synthetic experiments, while more expressive causal generative models perform better [2509.20211]. This suggests that do-SHAP inherits not only the conceptual strengths of causal modeling but also its model-misspecification risks.

A further caveat is that do-SHAP is population-interventional rather than a full counterfactual explanation. The practical literature addresses this partly by introducing an explicit noise-player attribution under additive noise models, but that construction relies on specific structural assumptions [2509.20211].

At the same time, the recent literature indicates a convergence of themes around causal semantics, tractable computation, and explanation reliability. Exact computation via irreducible classes reduces the combinatorial burden [2602.07203]. Estimand-agnostic SCM inference removes the need for per-query symbolic derivations [2509.20211]. Adjacent work on extended support, tensorized interventional operators, and trustability criteria suggests a broader shift toward explanations whose semantics are explicit rather than implicit [2503.23111], [2510.21599], [2405.00076].

In that sense, do-SHAP is best understood not as a minor variant of SHAP, but as a distinct causal attribution program: it replaces observational masking rules with SCM interventions, interprets feature relevance as an average causal effect across coalitions, and exploits graph structure to make that program computationally and statistically feasible in nontrivial settings [2602.07203], [2509.20211].

Source: https://www.emergentmind.com/topics/do-shap