Abstract
Shapley values are great analytical tools in game theory to measure the importance of a player in a game. Due to their axiomatic and desirable properties such as efficiency, they have become popular for feature importance analysis in data science and machine learning. However, the time complexity to compute Shapley values based on the original formula is exponential, and as the number of features increases, this becomes infeasible. Castro et al. [1] developed a sampling algorithm to estimate Shapley values. In this work, we propose a new sampling method based on a multilinear extension technique as applied in game theory. The aim is to provide a more efficient sampling method for estimating Shapley values. Our method is applicable to any machine learning model, in particular for either multi-class classifications or regression problems. We apply the method to estimate Shapley values for multilayer perceptrons (MLPs) and through experimentation on two datasets, we demonstrate that our method provides more accurate estimations of the Shapley values by reducing the variance of the sampling statistics.
Introduction
In the quest to make "black box" machine learning models interpretable, Shapley values have emerged as a gold standard. Derived from cooperative game theory, they provide a mathematically rigorous way to assign credit to each input feature for a model's prediction. However, calculating them exactly is an NP-hard problem. For a model with $n$ features, one must evaluate $2^n$ possible combinations, making exact calculation impossible for high-dimensional data.
To address this, researchers typically rely on sampling algorithms, such as the widely used Castro sampling. While effective, these estimates often suffer from high variance, requiring a massive number of samples to achieve stable results. This paper introduces Halved Owen Sampling, an algorithm that leverages multilinear extensions to estimate Shapley values up to three times faster than current state-of-the-art methods by significantly reducing estimation variance.
Methodology
The proposed approach shifts from traditional permutation-based sampling to utilizing Owen’s multilinear extension.
- Owen Sampling: Instead of permutations, this method treats each feature as having a probability $q$ of being active. The Shapley value is expressed as an integral of the feature's marginal contribution over all possible values of $q$ from 0 to 1.
- Halved Owen Sampling: This primary innovation exploits the symmetrical property of the multilinear integral. By sampling the model at probability $q$ and its complement $1-q$ simultaneously, the algorithm effectively "halves" the search space.
This acts as a variance reduction technique. Because the two samples ($q$ and $1-q$) are related, estimation errors tend to cancel each other out, leading to a much more stable result than random permutation sampling.
Experimental Setup
The algorithms were evaluated using Multilayer Perceptrons (MLPs) on two datasets:
- Credit Card Dataset (CC): A financial dataset with 23 features used to predict credit default. For ground-truth testing, the feature set was reduced to 15 to allow for exact Shapley calculation.
- Modified NIST (MNIST): The classic computer vision dataset of handwritten digits, serving as a high-dimensional test case with 784 features (pixels).
Key Results
Quantitative Performance
In tests on the Credit Card dataset with 2,000 samples, Halved Owen Sampling achieved a Mean Squared Error (MSE) of 0.1207, compared to 0.5575 for standard Castro sampling—a nearly 5x improvement in accuracy for the same computational budget. Furthermore, the Owen-based algorithms achieved roughly a 3-fold speedup in execution time.
Qualitative Clarity
When generating saliency maps for MNIST digit classification, Halved Owen Sampling produced significantly cleaner and more recognizable visualizations. With just 12 samples, the method produced maps that closely matched the ground truth (generated with 5,000 samples), whereas the baseline Castro method remained noisy and difficult to interpret.
Conclusion and Future Work
Halved Owen Sampling demonstrates that efficiency in explainability is driven by statistical stability. By exploiting mathematical symmetry, the method provides more reliable feature attributions with fewer computations. Future work will focus on testing the algorithm on more complex architectures like Transformers and developing automated methods for hyperparameter tuning to further optimize the balance between discretization levels and iterations.
Summary updated