ControlSHAP: Variance Reduction for Shapley Values
- 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 and a query point , the Shapley value for feature quantifies its average additive contribution to the model output, marginalizing over all possible feature orderings. The conditional expectation
captures the expected prediction when features in are known. The exact Shapley value is
or, equivalently, as an expectation over a uniformly random feature permutation. Due to combinatorics, practical estimation relies on Monte Carlo:
where is formed by randomly permuting 0 and taking the prefix up to 1.
2. Sources of Variability in Shapley Estimates
Monte Carlo Shapley approximations 2 are subject to sampling error, as they average over only 3 random coalitions instead of the full 4 set. With 5,
6
Further variance is induced when 7 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 8 with known expectation 9 to reduce the variance of a primary Monte Carlo estimate. For estimators 0 and 1, one constructs:
2
where 3 remains unbiased for 4. The optimal 5 minimizing variance is
6
giving residual variance 7, where 8 is the correlation between 9 and 0.
4. ControlSHAP: Surrogate-based Control Variate Selection
ControlSHAP instantiates the control variate framework by setting
- 1: the empirical Shapley value for model 2,
- 3: the empirical Shapley value for a surrogate model 4 (a local Taylor expansion),
- 5: the analytically computed Shapley value for 6.
The surrogate 7 exploits the local differentiability of 8 and the data distribution moments.
4.1 Independent Features Case
Assuming feature independence, with data mean 9, covariance 0, Jacobian 1, and Hessian 2, the closed-form surrogate Shapley value (Goldwasser & Hooker Thm 1) is
3
4.2 Correlated Features Case
For correlated features, assuming 4 is approximately Gaussian,
5
where 6 is precomputed once (at 7 complexity) and then reused.
5. Algorithmic Workflow for ControlSHAP
The principal steps in ControlSHAP are as follows:
- Precompute 8 matrices (correlated case).
- For 9:
- Sample a random coalition 0.
- Evaluate 1 on 2 and 3 to get 4.
- Evaluate the Taylor surrogate 5 on analogous inputs for 6.
- Calculate Monte Carlo estimates for each 7 for both 8 and 9.
- Compute closed-form 0.
- Estimate variance and covariance terms empirically, by regression theory, or bootstrap.
- Set 1.
- Form the final ControlSHAP estimator:
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 3.
- Variance Reduction: For oracle 4, variance reduces by a factor 5 relative to the baseline, where 6 is the empirical correlation between model and surrogate Shapley estimates. In empirical settings, 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, 8–9):
- Models: logistic regression, two-layer neural network, random forest.
- Protocol: For each of 40 held-out 0, 50 independent runs with 1 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 2 as well or better than the basic estimators.
Practical considerations include:
- The base sample size 3 remains the main lever for controlling absolute variance. ControlSHAP effectively multiplies this by 4.
- For non-differentiable models, derivatives required for Taylor surrogates can be approximated using finite-differences.
- Correlated features require one-time 5 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 6, correlation 7 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).