Abstract
Shapley value is a widely used tool in explainable artificial intelligence (XAI), as it provides a principled way to attribute contributions of input features to model outputs. However, estimation of Shapley value requires capturing conditional dependencies among all feature combinations, which poses significant challenges in complex data environments. In this article, EmSHAP (Energy-based model for Shapley value estimation), an accurate Shapley value estimation method, is proposed to estimate the expectation of Shapley contribution function under the arbitrary subset of features given the rest. By utilizing the ability of energy-based model (EBM) to model complex distributions, EmSHAP provides an effective solution for estimating the required conditional probabilities. To further improve estimation accuracy, a GRU (Gated Recurrent Unit)-coupled partition function estimation method is introduced. The GRU network captures long-term dependencies with a lightweight parameterization and maps input features into a latent space to mitigate the influence of feature ordering. Additionally, a dynamic masking mechanism is incorporated to further enhance the robustness and accuracy by progressively increasing the masking rate. Theoretical analysis on the error bound as well as application to four case studies verified the higher accuracy and better scalability of EmSHAP in contrast to competitive methods.
Introduction
In Explainable AI (XAI), the Shapley value is considered the "gold standard" for feature attribution because it fairly distributes a model's output among its input features based on cooperative game theory. However, calculating exact Shapley values is computationally "NP-hard" because it requires evaluating the model across an exponential number of feature subsets.
The primary challenge lies in estimating the conditional expectation—how a model behaves when some features are missing. Most existing methods either assume features are independent (which is rarely true in real-world data) or use generative models like Variational Autoencoders (VAEs) that suffer from "amortization gaps" and approximation errors. This research introduces EmSHAP, a framework designed to be mathematically grounded with clear error bounds and flexible enough to handle complex, high-dimensional feature dependencies.
Methods
EmSHAP (Energy-based model for SHAPley estimation) consists of three innovative components designed to accurately capture feature dependencies and estimate conditional probabilities.
1. Energy-Based Model (EBM)
Unlike standard classifiers, EBMs model the "energy" (unnormalized probability) of feature configurations. They are highly flexible and can capture complex, multi-modal distributions without needing restrictive assumptions about the data. This allows the model to better represent the underlying structure of the input features.
2. GRU-Coupled Partition Function
A major hurdle for EBMs is calculating the "partition function" (the normalization constant). EmSHAP uses a Gated Recurrent Unit (GRU) network to estimate a "proposal distribution." The GRU captures long-term dependencies between features and maps them into a latent space, which helps the model mitigate the "feature ordering" problem where the sequence of inputs might otherwise bias the explanation.
3. Dynamic Masking Mechanism
During training, the model utilizes a "curriculum learning" approach where the masking rate gradually increases (e.g., from 0.2 to 0.8). This allows the model to learn simple feature dependencies first before tackling the more complex task of predicting many missing values from a few observed ones, enhancing overall robustness.
Experimental Results
The authors validated EmSHAP on four diverse real-world benchmarks: MNIST (Image), ADTI (Tabular), ETT (Time-series), and MIMIC-III (Text/NLP). Performance was measured using the Softmax Information Curve (SIC AUC), where a higher "ADD" (adding important features improves performance) and a lower "DEL" (deleting important features drops performance) indicate a better explanation.
- Superior Accuracy: On MNIST, EmSHAP achieved an SIC AUC-ADD of 0.965, outperforming ST-SHAP (0.953) and VAEAC (0.714).
- Clinical Relevance: In the MIMIC-III medical text study, EmSHAP successfully identified clinically meaningful terms like "renal," "failure," and "hyperkalemia" as the primary drivers for specific diagnosis codes, whereas other methods often highlighted irrelevant connective words.
- Robustness to Noise: EmSHAP proved significantly more robust to Gaussian noise and adversarial attacks than its competitors, maintaining clearer and more accurate heatmaps of digit features.
Discussion and Limitations
Theoretical analysis demonstrates that EmSHAP provides tighter error bounds than KernelSHAP and VAEAC. By using a GRU with a context vector, the model effectively connects the energy network and the proposal network, solving the ordering bias common in autoregressive models.
Despite its strengths, the framework has limitations:
- Complexity: Computational complexity is proportional to the square of the input dimensions, which may be resource-intensive for extremely high-dimensional datasets.
- Concept Drift: Performance might degrade if the underlying data distribution shifts significantly over time.
Future work will focus on incorporating causal attribution to disentangle spurious correlations and developing adaptive sampling strategies to focus on "hard-to-model" feature subsets during training.
Summary updated