Papers
Topics
Authors
Recent
Search
2000 character limit reached

ControlSHAP: Variance Reduction for Shapley Values

Updated 13 May 2026
  • ControlSHAP is a methodology that stabilizes Monte Carlo Shapley value estimates for complex machine learning models using classical control variate techniques.
  • It employs a Taylor-based surrogate model to dramatically reduce estimation variance while maintaining theoretical guarantees of unbiasedness.
  • ControlSHAP integrates with existing workflows across various model classes and data distributions to enhance ranking consistency and efficiency in high-dimensional settings.

ControlSHAP is a methodology designed to stabilize Monte Carlo estimates of Shapley values for complex black-box machine learning models. Leveraging the classical control variates technique from Monte Carlo estimation, ControlSHAP exploits a computationally efficient Taylor-based surrogate model to dramatically reduce the variance of Shapley value approximations while maintaining theoretical guarantees of unbiasedness. Its design requires minimal modification to existing Shapley estimation workflows and is broadly applicable across model classes and datasets, offering a scalable solution to the inherent stochasticity of Shapley sampling in high-dimensional settings (Goldwasser et al., 2023).

1. Shapley Values and Monte Carlo Approximation

Given a predictive model f:Rd→Rf:\mathbb{R}^d \to \mathbb{R} and a query point x∈Rdx \in \mathbb{R}^d, the Shapley value ϕj(x)\phi_j(x) for feature jj quantifies its average additive contribution to the model output, marginalizing over all possible feature orderings. The conditional expectation

vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]

captures the expected prediction when features in SS are known. The exact Shapley value is

ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]

or, equivalently, as an expectation over a uniformly random feature permutation. Due to 2d2^d combinatorics, practical estimation relies on Monte Carlo:

ϕ^jMC(x)=1M∑m=1M[vx(Sm∪{j})−vx(Sm)]\widehat{\phi}_j^{\mathrm{MC}}(x) = \frac{1}{M}\sum_{m=1}^M [v_x(S^m \cup \{j\}) - v_x(S^m)]

where SmS^m is formed by randomly permuting x∈Rdx \in \mathbb{R}^d0 and taking the prefix up to x∈Rdx \in \mathbb{R}^d1.

2. Sources of Variability in Shapley Estimates

Monte Carlo Shapley approximations x∈Rdx \in \mathbb{R}^d2 are subject to sampling error, as they average over only x∈Rdx \in \mathbb{R}^d3 random coalitions instead of the full x∈Rdx \in \mathbb{R}^d4 set. With x∈Rdx \in \mathbb{R}^d5,

x∈Rdx \in \mathbb{R}^d6

Further variance is induced when x∈Rdx \in \mathbb{R}^d7 is computed via nested Monte Carlo (i.e., expectation over unknown features is itself approximated).

3. Control Variates for Variance Reduction

Classical control variates use a secondary estimator x∈Rdx \in \mathbb{R}^d8 with known expectation x∈Rdx \in \mathbb{R}^d9 to reduce the variance of a primary Monte Carlo estimate. For estimators ϕj(x)\phi_j(x)0 and ϕj(x)\phi_j(x)1, one constructs:

ϕj(x)\phi_j(x)2

where ϕj(x)\phi_j(x)3 remains unbiased for ϕj(x)\phi_j(x)4. The optimal ϕj(x)\phi_j(x)5 minimizing variance is

ϕj(x)\phi_j(x)6

giving residual variance ϕj(x)\phi_j(x)7, where ϕj(x)\phi_j(x)8 is the correlation between ϕj(x)\phi_j(x)9 and jj0.

4. ControlSHAP: Surrogate-based Control Variate Selection

ControlSHAP instantiates the control variate framework by setting

  • jj1: the empirical Shapley value for model jj2,
  • jj3: the empirical Shapley value for a surrogate model jj4 (a local Taylor expansion),
  • jj5: the analytically computed Shapley value for jj6.

The surrogate jj7 exploits the local differentiability of jj8 and the data distribution moments.

4.1 Independent Features Case

Assuming feature independence, with data mean jj9, covariance vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]0, Jacobian vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]1, and Hessian vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]2, the closed-form surrogate Shapley value (Goldwasser & Hooker Thm 1) is

vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]3

4.2 Correlated Features Case

For correlated features, assuming vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]4 is approximately Gaussian,

vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]5

where vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]6 is precomputed once (at vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]7 complexity) and then reused.

5. Algorithmic Workflow for ControlSHAP

The principal steps in ControlSHAP are as follows:

  1. Precompute vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]8 matrices (correlated case).
  2. For vx(S):=E[f(X)∣XS=xS]v_x(S) := \mathbb{E}[f(X)\mid X_S = x_S]9:
    • Sample a random coalition SS0.
    • Evaluate SS1 on SS2 and SS3 to get SS4.
    • Evaluate the Taylor surrogate SS5 on analogous inputs for SS6.
  3. Calculate Monte Carlo estimates for each SS7 for both SS8 and SS9.
  4. Compute closed-form ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]0.
  5. Estimate variance and covariance terms empirically, by regression theory, or bootstrap.
  6. Set ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]1.
  7. Form the final ControlSHAP estimator:

ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]2

6. Theoretical Properties and Performance Guarantees

  • Unbiasedness: Both constituent Monte Carlo estimators are unbiased, ensuring the final corrected estimator is unbiased for the true Shapley value of Ï•j(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]3.
  • Variance Reduction: For oracle Ï•j(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]4, variance reduces by a factor Ï•j(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]5 relative to the baseline, where Ï•j(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]6 is the empirical correlation between model and surrogate Shapley estimates. In empirical settings, Ï•j(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]7 is estimated from data.

7. Empirical Evaluation and Practical Considerations

ControlSHAP was evaluated on a synthetic 10-dimensional Gaussian block-correlated dataset and four UCI datasets (Bank Marketing, German Credit, Adult/Census, BRCA subtyping, ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]8–ϕj(x)=1d∑S⊆[d]∖{j}(d−1∣S∣)−1[vx(S∪{j})−vx(S)]\phi_j(x) = \frac{1}{d}\sum_{S \subseteq [d] \setminus \{j\}} \binom{d-1}{|S|}^{-1} [v_x(S \cup \{j\}) - v_x(S)]9):

  • Models: logistic regression, two-layer neural network, random forest.
  • Protocol: For each of 40 held-out 2d2^d0, 50 independent runs with 2d2^d1 coalitions per run.
  • Variance Reduction: Median variance reduction of 80–95% for top features in logistic regression and neural nets; up to 90% in synthetic data. For tree-based models (using finite-difference surrogates), variance reduced by 50–60%.
  • Ranking Consistency: The average number of pairwise rank changes among features decreased by 30–50%.
  • Bias: No detectable bias; sums of corrected Shapley values matched 2d2^d2 as well or better than the basic estimators.

Practical considerations include:

  • The base sample size 2d2^d3 remains the main lever for controlling absolute variance. ControlSHAP effectively multiplies this by 2d2^d4.
  • For non-differentiable models, derivatives required for Taylor surrogates can be approximated using finite-differences.
  • Correlated features require one-time 2d2^d5 precomputation, but per-point computation is then constant time.
  • Variance and covariance may be estimated directly, via regression for KernelSHAP, or via bootstrap.

Primary limitations are tied to the fidelity of the Taylor surrogate: for highly non-smooth 2d2^d6, correlation 2d2^d7 may be modest, thus diminishing variance reduction. The correlated-features surrogate assumes elliptical or Gaussian data structure.

8. Summary and Significance

ControlSHAP integrates seamlessly with existing Shapley value estimation pipelines, introducing negligible computational overhead and leveraging shared random subsets. By incorporating a locally analytic surrogate with closed-form Shapley values as a control variate, it preserves unbiasedness while affording substantial variance reductions (80–90% in practice), with broad applicability across model types and data distributions (Goldwasser et al., 2023).

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

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 Control Variates (ControlSHAP).