ViaSHAP: Unified Prediction & Explanation
- ViaSHAP is a unified framework that integrates prediction and Shapley-value explanation into a single model, eliminating post-hoc explanation steps.
- It directly outputs both forecasts and additive feature attributions, achieving significant speedups over classical Shapley methods.
- The method is effective in both tabular and vision domains, delivering high attribution fidelity and efficient inference performance.
ViaSHAP is a family of predictive modeling techniques that unify prediction and Shapley value explanation within a single model, eliminating the need for post-hoc explanation procedures. Unlike classical approaches such as Exact Shapley, KernelSHAP, and FastSHAP, which operate after the main model is trained, ViaSHAP directly learns to output both the model’s prediction and an additive Shapley-value decomposition in a single forward pass. This paradigm targets both tabular domains and large-scale vision architectures, offering orders-of-magnitude benefits in inference cost while preserving or exceeding the fidelity of traditional Shapley-based explanations (Alkhatib et al., 7 May 2025, Fan et al., 16 Dec 2025).
1. Motivation and Conceptual Distinction
Classical Shapley-value explanation methods are inherently post-hoc: after training a predictor , one employs combinatorial, sampling-based, or surrogate approaches to estimate per-feature contributions . This procedure introduces inference-time computational overhead proportional to the number of features or required samples. Notably, even methods designed to accelerate computation, such as FastSHAP, train a separate explainer model and still add inference cost (Alkhatib et al., 7 May 2025).
ViaSHAP dispenses with this pipeline separation by training a single model that outputs both the prediction and its Shapley-value decomposition. For an input , yields a vector of attributions such that their sum reconstructs (or closely approximates) . Thus, there is zero post-hoc explainer cost: both prediction and explanation are obtained from one forward pass (Alkhatib et al., 7 May 2025, Fan et al., 16 Dec 2025).
2. Mathematical Framework and Shapley Axioms
For a predictive mapping (regression or post-link classification), Shapley values assign additive contributions to each feature per the classical cooperative game formulation: where denotes with features not in masked to a baseline (e.g., zero or ). The explanation model must satisfy:
- Local accuracy: (baseline )
- Missingness: features set to baseline yield zero attribution
- Consistency: attributions do not decrease if marginal effects do not decrease
ViaSHAP directly parameterizes a function and enforces that the sum , targeting the unique Shapley solution by design (Alkhatib et al., 7 May 2025).
3. Implementation Strategies
ViaSHAP has been realized across tabular and vision domains with two principal architectural families:
- Tabular Data:
- MLP (Universal Approximation): A multilayer perceptron produces -dimensional attributions per instance, trained with both prediction and Shapley-interpolation losses. Masked versions of each input are formed during training to simulate coalitions and enforce additive decomposition.
- KAN (Kolmogorov-Arnold Networks): Leverages the Kolmogorov-Arnold representation theorem to capture continuous as sums of univariate function compositions, enabling more parameter-efficient and theoretically-aligned additive decomposition than generic MLPs.
- Vision Models:
- Backbone + Shapley Head: Any compatible backbone (e.g., ViT, ResNet) is modified by appending a lightweight "Shapley head" to per-patch features, yielding (patch class) Shapley attributions. Training involves a dual-branch structure: the main branch handles standard classification; an auxiliary branch samples masks of input patches and supervises patch-level Shapley consistency via a KernelSHAP-motivated loss (Fan et al., 16 Dec 2025).
Both architectures train end-to-end on a dual objective: (1) prediction accuracy; (2) consistency of the additive decomposition with sampled mask perturbations, typically using KernelSHAP-style sampling weights (Alkhatib et al., 7 May 2025, Fan et al., 16 Dec 2025).
4. Optimization Objectives and Training Regime
The core loss in ViaSHAP balances predictive accuracy and the faithfulness of the learned attributions: where represents with its features or patches masked outside coalition , and is the KernelSHAP weighting over coalitions.
For vision models, the combined objective is
with the cross-entropy over patch-summed logits, and the auxiliary Shapley regression loss encouraging per-patch attributions to match marginal effects under mask perturbations (Fan et al., 16 Dec 2025).
The interpolation term in both domains enforces the additive decomposition’s accuracy for any sampled feature coalition or mask, thereby encouraging explanations that adhere to the Shapley axioms even for partial inputs.
5. Computational and Architectural Advantages
The computational cost of ViaSHAP at inference is dominated by a single forward pass through the prediction model, with overall complexity for network size . This stands in contrast to:
- Exact Shapley: model calls for each instance.
- KernelSHAP: model calls per instance (e.g., ).
- FastSHAP: Cost of running the explainer network plus the original model call.
- ViaSHAP: One pass through , matching or only slightly exceeding the cost of .
Empirically, ViaSHAP delivers – speedup over KernelSHAP and over FastSHAP, while achieving exact-quality attributions up to training error (Alkhatib et al., 7 May 2025).
For vision applications, ViaSHAP fine-tunes pre-trained backbones, introducing only a compact Shapley head ( output). FLOPs increase is negligible for ViT, modest for ResNet-50. Inference time and memory match the baseline model; no additional computation is required at test time for explanation output (Fan et al., 16 Dec 2025).
6. Empirical Performance and Application Results
In large-scale tabular benchmarks covering 25 datasets:
- Predictive AUC: KAN matches XGBoost and Random Forests (mean rank: KAN, XGBoost), outperforming MLP and TabNet.
- Explanation fidelity: KAN achieves cosine similarity to KernelSHAP ground-truth, with Spearman-rank , significantly better than both FastSHAP and MLP.
- Inference speed: ViaSHAP reaches –$0.005$ s per instance, compared to s for KernelSHAP samples (Alkhatib et al., 7 May 2025).
For image data (e.g., CIFAR-10):
- Classification accuracy: ResNet18 and U-Net maintain $91$– AUC, matching conventional backbones.
- Explanation tests: On Inclusion/Exclusion benchmarks, ViaSHAP yields higher inclusion accuracy (e.g., ResNet18 vs FastSHAP ) and lower exclusion accuracy ( vs for FastSHAP).
- Benchmarks on ImageNet: ViaSHAP modifies ResNet-50 and ViT-B with no increase (ViT) or small increase (ResNet-50) in FLOPs. Faithfulness metrics (AOPC, LOdds, SaCo) are superior to self-explaining and post-hoc baselines. Object-localization performance (Pix Acc, mAP, mIoU) is also improved (Fan et al., 16 Dec 2025).
Ablation studies indicate that increasing the Shapley loss coefficient or improves attribution fidelity without degrading predictive accuracy; explanations remain robust to masking granularity and the number of mask samples per batch.
7. Limitations, Future Directions, and Related Work
Current limitations of ViaSHAP include attribution resolution tied to the patch size in vision backbones and the computational overhead of mask sampling during training. For tabular domains, the primary constraints center on the underlying architecture’s capacity to approximate highly non-linear functions under the additive decomposition requirement (Alkhatib et al., 7 May 2025, Fan et al., 16 Dec 2025).
Prospective enhancements involve adaptive and stratified mask sampling, per-object explanations through integration with detection/segmentation heads, and extension to higher-order (non-cooperative) feature interactions. Applying ViaSHAP to video, 3D, and multi-modal input spaces is an active area of development.
A historical context: ViaSHAP is built on the unique theoretical guarantees of the Shapley-value framework established by SHAP, which offers additive explanations satisfying local accuracy, missingness, and consistency (Lundberg et al., 2017). However, whereas SHAP and its efficient implementations (TreeSHAP, DeepSHAP, KernelSHAP) operate in a post-hoc, model-agnostic manner, ViaSHAP makes the explanation mechanism intrinsic to the predictor, yielding explanations that are aligned with model logic at no additional runtime cost.
References
- "Prediction via Shapley Value Regression" (Alkhatib et al., 7 May 2025)
- "Enhancing Interpretability for Vision Models via Shapley Value Optimization" (Fan et al., 16 Dec 2025)
- "A Unified Approach to Interpreting Model Predictions" (Lundberg et al., 2017)