Introduction
Explainable Artificial Intelligence (XAI) has become a cornerstone of trustworthy machine learning, with Shapley values serving as the "gold standard" for feature attribution. Derived from cooperative game theory, Shapley values offer unique mathematical guarantees for fairness and consistency. However, their adoption in real-time applications is severely limited by computational complexity; calculating exact Shapley values is NP-hard. Existing post-hoc approximation methods, such as KernelSHAP, require thousands of model evaluations per prediction, introducing significant latency.
To bridge this gap, the authors propose ViaSHAP, a novel framework that integrates Shapley value estimation directly into the model's architecture. Rather than explaining a black-box model after the fact, ViaSHAP trains a neural network to output Shapley values as its primary internal representation, which are then summed to produce the final prediction.
The ViaSHAP Framework
The core innovation of ViaSHAP is the reformulation of the prediction task. In a standard neural network, the input $\mathbf{x}$ is mapped directly to an output $y$. In ViaSHAP, the network $\phi^{Via}$ maps the input to a vector of feature contributions $\phi$, where each element represents the Shapley value of a specific feature.
The final prediction is calculated as the sum of these values: $\hat{y} = \sum \phi_i$. This structure ensures that the resulting explanation is perfectly faithful to the model's internal logic—the explanation is the prediction.
Dual-Objective Training
Training a ViaSHAP model requires balancing two goals: predictive accuracy and explanation fidelity. The authors employ a dual-objective loss function:
- Prediction Loss ($\mathcal{L}_{pred}$): A standard loss (e.g., Mean Squared Error or Cross-Entropy) that ensures the sum of the generated values matches the ground-truth labels.
- Shapley Loss ($\mathcal{L}_{\phi}$): A loss term that encourages the generated values to align with true Shapley values by sampling feature coalitions during the training process, similar to the sampling strategy used in KernelSHAP.
Architectures: MLPs vs. KANs
The authors explored two primary architectures for the $\phi^{Via}$ function: Multi-Layer Perceptrons (MLPs) and the recently proposed Kolmogorov-Arnold Networks (KANs). KANs differ from traditional MLPs by placing learnable activation functions on the edges (weights) of the network rather than using fixed activation functions at the nodes.
A significant finding of the study was the superior performance of KANs in the ViaSHAP framework. While MLPs often struggled to satisfy the dual-objective constraints simultaneously, KAN-based models demonstrated a remarkable ability to maintain high predictive accuracy while generating precise Shapley values.
Experimental Results
The authors conducted an extensive evaluation across 25 diverse tabular datasets from OpenML and the CIFAR-10 image dataset.
Predictive Performance
On tabular data, KAN-based ViaSHAP models achieved competitive results against state-of-the-art tree-based ensembles. As shown in the Critical Difference (CD) plot below, $KAN^{Via}$ and its variants performed on par with XGBoost and Random Forests, while significantly outperforming traditional MLPs and specialized tabular architectures like TabNet.
Explanation Fidelity and Efficiency
ViaSHAP's generated explanations were compared against ground-truth values obtained via exhaustive KernelSHAP. The results showed extremely high alignment, with cosine similarity and Spearman rank correlation often exceeding 0.95.
Crucially, ViaSHAP provides these explanations "for free" during inference. In a test on the Adult dataset, explaining 1,000 instances took just 0.0026 seconds with ViaSHAP, compared to 56.92 seconds for KernelSHAP—a speedup of over four orders of magnitude.
Conclusion and Future Work
ViaSHAP represents a paradigm shift in XAI by moving from post-hoc explanation to intrinsic interpretability. By leveraging KANs, the method achieves the "holy grail" of XAI: high predictive performance combined with real-time, mathematically grounded explanations.
Despite its success, the method has limitations. It requires differentiable models, meaning it cannot be applied directly to existing non-neural models like standard decision trees. Additionally, the choice of feature masking strategies significantly impacts performance. Future research will focus on extending ViaSHAP to large-scale vision and language models and exploring its robustness against adversarial manipulation.
Summary updated