Papers
Topics
Authors
Recent
Search
2000 character limit reached

ViaSHAP: Unified Prediction & Explanation

Updated 23 March 2026
  • 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 f(x)f(x), one employs combinatorial, sampling-based, or surrogate approaches to estimate per-feature contributions ϕi(x)\phi_i(x). 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 VθV_\theta that outputs both the prediction and its Shapley-value decomposition. For an input xRnx\in\mathbb{R}^n, Vθ(x)V_\theta(x) yields a vector of attributions ϕi(x;θ)\phi_i(x;\theta) such that their sum reconstructs (or closely approximates) f(x)f(x). 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 f:XRnRf: X \subset \mathbb{R}^n \rightarrow \mathbb{R} (regression or post-link classification), Shapley values ϕi(x)\phi_i(x) assign additive contributions to each feature ii per the classical cooperative game formulation: ϕi(x)=SN{i}S!(nS1)!n![f(xS{i})f(xS)]\phi_i(x) = \sum_{S \subset N \setminus \{i\}} \frac{|S|! (n - |S| - 1)!}{n!} \left[f(x_{S \cup \{i\}}) - f(x_S)\right] where xSx_S denotes xx with features not in SS masked to a baseline (e.g., zero or E[X]\mathbb{E}[X]). The explanation model must satisfy:

  • Local accuracy: iϕi(x)=f(x)f(0)\sum_i \phi_i(x) = f(x) - f(0) (baseline ϕ0=f(0)\phi_0 = f(0))
  • Missingness: features set to baseline yield zero attribution
  • Consistency: attributions do not decrease if marginal effects do not decrease

ViaSHAP directly parameterizes a function ϕV(x;θ)Rn\phi^V(x;\theta)\in\mathbb{R}^n and enforces that the sum iϕiV(x;θ)f(x)\sum_i \phi^V_i(x;\theta) \approx f(x), 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:
    • MLPV^V (Universal Approximation): A multilayer perceptron produces nn-dimensional attributions per instance, trained with both prediction and Shapley-interpolation losses. Masked versions of each input xSx^S are formed during training to simulate coalitions SS and enforce additive decomposition.
    • KANV^V (Kolmogorov-Arnold Networks): Leverages the Kolmogorov-Arnold representation theorem to capture continuous f(x)f(x) 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 N×KN \times K (patch ×\times 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: L(θ)=xtrain[logpθ(yx)+βESp(S)(iϕiV(xS;θ)iϕiV(x;θ))2]L(\theta) = \sum_{x \in \text{train}} \Big[-\log p_{\theta}(y^*|x) + \beta \, \mathbb{E}_{S \sim p(S)} \left(\sum_{i} \phi_i^V(x^S;\theta) - \sum_{i} \phi_i^V(x;\theta)\right)^2 \Big] where xSx^S represents xx with its features or patches masked outside coalition SS, and p(S)p(S) is the KernelSHAP weighting over coalitions.

For vision models, the combined objective is

Ltotal=Lcls+λLshap\mathcal{L}_{\text{total}} = \mathcal{L}_{\text{cls}} + \lambda \mathcal{L}_{\text{shap}}

with Lcls\mathcal{L}_{\text{cls}} the cross-entropy over patch-summed logits, and Lshap\mathcal{L}_{\text{shap}} 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 O(nh)O(nh) for network size hh. This stands in contrast to:

  • Exact Shapley: O(2n)O(2^n) model calls for each instance.
  • KernelSHAP: O(Kn)O(Kn) model calls per instance (e.g., K10244096K \approx 1024-4096).
  • FastSHAP: Cost of running the explainer network O(nH)O(nH) plus the original model call.
  • ViaSHAP: One pass through VθV_\theta, matching or only slightly exceeding the cost of f(x)f(x).

Empirically, ViaSHAP delivers 10310^3104×10^4\times speedup over KernelSHAP and 10×10\times 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 (N×KN\times K 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: KANV^V matches XGBoost and Random Forests (mean rank: KANV2.3^V\approx2.3, XGBoost2.7\approx2.7), outperforming MLPV^V and TabNet.
  • Explanation fidelity: KANV^V achieves cosine similarity 0.94\approx0.94 to KernelSHAP ground-truth, with Spearman-rank 0.85\approx0.85, significantly better than both FastSHAP and MLPV^V.
  • Inference speed: ViaSHAP reaches 0.002\approx0.002–$0.005$ s per instance, compared to 50\approx50 s for 10310^3 KernelSHAP samples (Alkhatib et al., 7 May 2025).

For image data (e.g., CIFAR-10):

  • Classification accuracy: ResNet18V^V and U-NetV^V maintain $91$–98%98\% AUC, matching conventional backbones.
  • Explanation tests: On Inclusion/Exclusion benchmarks, ViaSHAP yields higher inclusion accuracy (e.g., ResNet18V^V 99.0%99.0\% vs FastSHAP 95.4%95.4\%) and lower exclusion accuracy (61.1%61.1\% vs 75.5%75.5\% 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 β\beta or λ\lambda improves attribution fidelity without degrading predictive accuracy; explanations remain robust to masking granularity and the number of mask samples per batch.

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

Definition Search Book Streamline Icon: https://streamlinehq.com
References (3)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to ViaSHAP Method.