Papers
Topics
Authors
Recent
Search
2000 character limit reached

FastSHAP: Real-Time Shapley Explanations

Updated 12 July 2026
  • FastSHAP is an amortized method for estimating Shapley values, replacing costly per-instance computations with a one-time training phase.
  • It leverages a weighted least-squares formulation to learn full attribution vectors directly from sampled coalitions while preserving Shapley properties.
  • Empirical results demonstrate that FastSHAP can be up to 600× faster than KernelSHAP, offering efficient explanations in both tabular and image domains.

FastSHAP is an amortized method for estimating Shapley-value explanations in real time. Introduced as a learned explainer that outputs a full attribution vector in a single forward pass, it reframes Shapley estimation from a per-instance combinatorial computation into a supervised optimization problem over sampled coalitions. The method is motivated by the weighted least-squares characterization of Shapley values and is designed to preserve Shapley-style attribution while eliminating the repeated model evaluations required by classical model-agnostic estimators such as KernelSHAP (Jethani et al., 2021).

1. Conceptual position

FastSHAP addresses the central computational obstacle of Shapley explanations: exact Shapley values require aggregation over exponentially many feature subsets, and even stochastic approximations remain expensive because they query the explained model many times for each new input. FastSHAP shifts this cost from explanation time to a one-time training phase by learning a parametric mapping from inputs to attribution vectors, so that explanation becomes a direct prediction task rather than an instance-specific estimation procedure (Jethani et al., 2021).

In this sense, FastSHAP belongs to the broader class of amortized explainers. Its defining characteristic is that it learns Shapley values themselves, rather than a proxy saliency score or a post hoc visualization heuristic. This places it closer to KernelSHAP in objective than to gradient-based methods such as GradCAM, Integrated Gradients, or SmoothGrad, although those methods are often used as empirical baselines because they are also fast at inference time (Jethani et al., 2021).

FastSHAP should be distinguished from several neighboring lines of work that also emphasize speed. “Fast Hierarchical Games for Image Explanations” introduces h-Shap, a hierarchical game construction for image explanations, but it is not FastSHAP and does not use the learned one-pass explainer formulation (Teneggi et al., 2021). Fast TreeSHAP accelerates TreeSHAP for tree models by reorganizing path computations, and WOODELF gives a unified exact framework for tree ensembles using pseudo-Boolean formulas; both are fast SHAP methods, but neither is an amortized explainer for arbitrary black-box models (Yang, 2021, Nadel et al., 12 Nov 2025).

2. Shapley-theoretic formulation

FastSHAP starts from the standard Shapley-value problem for a value function v:2dRv:2^d \mapsto \mathbb{R}. In the formulation given for feature ii,

ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).

This expression is theoretically attractive but computationally prohibitive, because the summation ranges over coalitions of features (Jethani et al., 2021).

The methodological pivot of FastSHAP is the weighted least-squares characterization of Shapley values. In a finite-dimensional form, FastSHAP learns an explainer Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n by minimizing

L(θ)=Ex,Spw ⁣[(vx(S)Φθ(x),1S)2],\mathcal L(\theta) = \mathbb E_{x,\,S\sim p_w}\!\left[\bigl(v_x(S)-\langle\Phi_\theta(x),1_S\rangle\bigr)^2\right],

subject to the efficiency constraint

Φθ(x),1N=vx(N).\langle\Phi_\theta(x),1_N\rangle = v_x(N).

This recasts Shapley estimation as regression over random coalitions sampled from the Shapley kernel, so that the explainer learns to approximate coalition values linearly through its predicted attribution vector (Stiller et al., 26 Jun 2026).

The subset distribution used in FastSHAP is the Shapley kernel,

p(s)d1(d1s)1s(d1s),p(s) \propto \frac{d - 1}{\binom{d}{\mathbf{1}^\top s} \cdot \mathbf{1}^\top s \cdot (d - \mathbf{1}^\top s)},

for coalitions with 0<1s<d0 < \mathbf{1}^\top s < d. This is the same weighted-regression viewpoint that underlies KernelSHAP, but FastSHAP amortizes the solution across inputs by training one explainer model instead of fitting a separate regression for each explained instance (Jethani et al., 2021).

The paper’s theoretical claim is that, if efficiency is enforced, the global optimizer of the training objective recovers the true Shapley values almost surely under the data distribution. This claim is central to the method’s identity: FastSHAP is not merely a fast heuristic for importance scores, but a learned estimator grounded in the least-squares characterization of Shapley values (Jethani et al., 2021).

3. Training mechanics and inference

FastSHAP trains a separate parametric explainer model that outputs a full attribution vector in one pass. The original formulation samples triples consisting of an input, a target class, and a coalition, then penalizes the squared discrepancy between the coalition value and the linear reconstruction induced by the predicted attribution vector. Optimization uses standard stochastic gradient descent, with minibatching, multiple coalition samples per input, averaging over all classes, and paired sampling with complementary coalitions as variance-reduction strategies (Jethani et al., 2021).

Efficiency can be handled in two ways. The first is additive efficient normalization, which evenly distributes the efficiency gap across features. The second is efficiency regularization, implemented as a penalty on the efficiency gap with parameter γ>0\gamma>0. The original experiments report that normalization works better in practice, especially on tabular data, while image experiments can still perform strongly when efficiency is relaxed (Jethani et al., 2021).

At inference time, FastSHAP does not solve an optimization problem. It applies the trained explainer once, optionally followed by a lightweight normalization step, and returns the full attribution vector. This single-pass property is the immediate source of its “real-time” designation and the principal reason it differs computationally from KernelSHAP and other stochastic estimators that must repeatedly query the original predictor for each example (Jethani et al., 2021).

A concrete downstream realization appears in CASPER, a gravitational-wave detection pipeline that couples a residual CNN classifier with a FastSHAP explainer. There, FastSHAP is implemented as a U-Net trained to approximate pixel-wise Shapley values on STFT spectrograms of shape (65,69,1)(65,69,1), with skip connections preserving spatial resolution. The explainer is trained with a masked-prediction consistency objective,

ii0

using Adam at learning rate ii1, batch size ii2, for ii3 epochs, with Bernoulliii4 masks and random noise frames as background references. The stated runtime benefit is “single pass generation of attribution maps” (Rai et al., 15 Jun 2026).

4. Empirical behavior and application domains

The original FastSHAP experiments cover both tabular and image tasks. On tabular datasets—Census, Marketing, Bankruptcy, and News—the method is evaluated against approximations to ground-truth Shapley values obtained by running KernelSHAP to convergence. The reported finding is that FastSHAP matches the accuracy of KernelSHAP-style estimators while using far fewer model evaluations: KernelSHAP requires about ii5–ii6 evaluations on news, census, and bankruptcy to match FastSHAP, paired sampling reduces this to roughly ii7–ii8, permutation baselines require about ii9–ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).0, and FastSHAP is reported as at least ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).1 faster than original KernelSHAP and about ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).2 faster than the best non-amortized baseline (Jethani et al., 2021).

On images, the original study evaluates CIFAR-10 and Imagenette using Inclusion AUC and Exclusion AUC. FastSHAP is reported as the strongest overall method, with best or near-best Exclusion AUC on both datasets and strong Inclusion AUC, second only to KernelSHAP-S in some cases. For explaining ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).3 images, the reported runtime is about ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).4 minutes for FastSHAP, compared with ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).5 minutes and ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).6 minutes for KernelSHAP on CIFAR-10 and Imagenette, respectively, while the training cost is ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).7 minutes on CIFAR-10 and ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).8 minutes on Imagenette. These numbers illustrate the method’s central tradeoff: high upfront training cost in exchange for negligible marginal explanation cost (Jethani et al., 2021).

CASPER provides an application in scientific machine learning and detector interpretability rather than generic computer vision. In that system, FastSHAP does not improve classification accuracy directly; it serves as a post hoc explainer for a customized 7-layer ResNet/2D CNN used on real GWOSC data from the H1 and L1 detectors. The classifier achieves AUC of ϕi(v)=1dsi1(d11s)1(v(s+ei)v(s)).\phi_i(v) = \frac{1}{d} \sum_{s_i \neq 1} \binom{d - 1}{\mathbf{1}^\top s}^{-1} \Big( v(s + e_i) - v(s) \Big).9, Platt calibration reduces ECE by Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n0, and FastSHAP attribution maps are reported to recover the complete chirp morphology. In a perturbation-fidelity experiment, masking the top Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n1 of pixels by absolute Shapley value reduces average confidence by about Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n2, and masking the top Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n3 reduces it to about Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n4. The full classifier-plus-FastSHAP pipeline remains under Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n5 ms on a standard laptop CPU, with the classifier alone taking Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n6 ms (Rai et al., 15 Jun 2026).

These empirical results support two distinct uses of FastSHAP. The first is high-throughput explanation of many samples when amortization can dominate per-instance cost. The second is low-latency interpretability in end-to-end systems, where the one-pass nature of the explainer makes it compatible with operational constraints that would preclude repeated coalition sampling (Jethani et al., 2021, Rai et al., 15 Jun 2026).

5. Relations to later variants and adjacent methods

Subsequent work has treated FastSHAP both as a baseline and as a template for broader families of amortized Shapley estimators. Some extensions generalize its least-squares framework, others criticize its post hoc separation between predictor and explainer, and others address architectural or domain restrictions.

Method Core mechanism Relation to FastSHAP
PDD-SHAP (Gevaert et al., 2022) Learns an ANOVA/PDP-style surrogate of the model and computes Shapley values analytically Same amortization goal, but approximates the model rather than learning a direct explainer
FW-Shapley (Panda et al., 9 Mar 2025) Learned estimator for weighted Shapley values via weighted least squares Generalizes FastSHAP from standard to weighted Shapley values
SimSHAP (Zhang et al., 2023) Amortized estimator trained with a plain Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n7 objective against an unbiased stochastic target Positions FastSHAP as more complicated than necessary and removes its special metric and normalization
ViaSHAP (Alkhatib et al., 7 May 2025) Learns Shapley values as part of the predictive model itself Contrasts with FastSHAP’s post hoc explainer design
FourierShap (Gorji et al., 2024) One-time sparse Fourier approximation of the model, then exact SHAP in Fourier space Amortized like FastSHAP, but learns a model representation instead of the SHAP mapping
OperatorSHAP (Stiller et al., 26 Jun 2026) Neural-operator explainer producing a continuous attribution field Extends the FastSHAP idea to grid-agnostic function-space settings

PDD-SHAP is explicitly described as belonging to the same broad family as FastSHAP, because both amortize explanation cost over many inputs. The difference is conceptual: FastSHAP learns a neural explainer that directly outputs Shapley values in one forward pass, whereas PDD-SHAP learns a structured functional decomposition of the original model and derives Shapley values analytically from the decomposition terms Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n8. A stated advantage of PDD-SHAP is that it exposes interaction structure, which a direct explainer like FastSHAP does not retain (Gevaert et al., 2022).

FW-Shapley recasts FastSHAP as the natural prior learned-estimator baseline for feature attribution and extends the same amortized-learning principle to weighted Shapley values. In the reported feature-attribution experiments, FW-Shapley outperforms FastSHAP by Φθ(x)Rn\Phi_\theta(x)\in\mathbb{R}^n9 on average in Inclusion AUC, while matching FastSHAP’s runtime of L(θ)=Ex,Spw ⁣[(vx(S)Φθ(x),1S)2],\mathcal L(\theta) = \mathbb E_{x,\,S\sim p_w}\!\left[\bigl(v_x(S)-\langle\Phi_\theta(x),1_S\rangle\bigr)^2\right],0 s in the cited setting (Panda et al., 9 Mar 2025).

SimSHAP offers a more foundational critique. It places FastSHAP, KernelSHAP, and related estimators into a unified framework and argues that FastSHAP’s special metric matrix and efficiency-normalization machinery are redundant. In the reported experiments, SimSHAP achieves accuracy comparable to FastSHAP, with lower tabular inference and training time, although its image-training cost is higher than FastSHAP’s (Zhang et al., 2023).

ViaSHAP presents a stronger architectural alternative by integrating prediction and explanation rather than learning a post hoc explainer for a pretrained predictor. The reported results state that ViaSHAP explanations are significantly more accurate than FastSHAP on both tabular data and images, with Wilcoxon signed-rank tests rejecting the null hypothesis of no difference on cosine similarity, Spearman rank, and L(θ)=Ex,Spw ⁣[(vx(S)Φθ(x),1S)2],\mathcal L(\theta) = \mathbb E_{x,\,S\sim p_w}\!\left[\bigl(v_x(S)-\langle\Phi_\theta(x),1_S\rangle\bigr)^2\right],1 for tabular explanation quality (Alkhatib et al., 7 May 2025).

OperatorSHAP identifies a structural limitation of FastSHAP: standard FastSHAP assumes homogeneous inputs on a fixed player set. For neural operators and heterogeneous meshes, this fixed-dimensional assumption fails. OperatorSHAP therefore lifts the FastSHAP idea to function space by learning a continuous attribution density field that transfers across grid sizes without retraining (Stiller et al., 26 Jun 2026).

6. Limitations, assumptions, and ongoing issues

FastSHAP’s acceleration is amortized rather than free. The original paper is explicit that the method incurs a fixed training cost and is therefore most compelling when many explanations are required from the same model. This makes the method especially attractive in deployment settings with repeated inference, but less obviously advantageous in low-volume explanation regimes where the training overhead cannot be amortized effectively (Jethani et al., 2021).

The method also depends on the availability of an appropriate value function L(θ)=Ex,Spw ⁣[(vx(S)Φθ(x),1S)2],\mathcal L(\theta) = \mathbb E_{x,\,S\sim p_w}\!\left[\bigl(v_x(S)-\langle\Phi_\theta(x),1_S\rangle\bigr)^2\right],2. In practice, especially for classification, the original experiments often use a surrogate model to approximate conditional feature marginalization. This means that FastSHAP may inherit approximation error not only from the learned explainer but also from the choice of value-function construction and feature-removal semantics (Jethani et al., 2021).

A second limitation is architectural. OperatorSHAP explicitly characterizes FastSHAP as restricted to homogeneous, fixed-dimensional feature spaces, which is problematic for neural operators, irregular meshes, and resolution-varying physical data. This suggests that the original FastSHAP formulation is naturally suited to conventional tabular and fixed-grid vision settings, but does not transfer directly to grid-agnostic operator learning without methodological modification (Stiller et al., 26 Jun 2026).

A third issue concerns post hoc faithfulness. ViaSHAP’s comparison argues that FastSHAP remains a post hoc explainer and therefore introduces a separation between the predictive model and the explanation model. This suggests a potential source of mismatch: explanation quality depends not only on the fidelity of the learned Shapley approximation, but also on how well a separately trained explainer aligns with the predictor it is asked to explain (Alkhatib et al., 7 May 2025).

Finally, FastSHAP does not preserve explicit interaction structure. PDD-SHAP contrasts its surrogate-decomposition approach with FastSHAP on precisely this point: once FastSHAP has learned to output attributions directly, it does not expose the decomposition terms that would reveal which features interact with which others. A plausible implication is that FastSHAP is best regarded as an efficient local attribution engine rather than an interaction-aware structural model of the predictor (Gevaert et al., 2022).

Taken together, these limitations do not negate FastSHAP’s core contribution. They instead define the main research directions that have followed from it: broader value notions such as weighted Shapley values, simpler amortized objectives, predictor-explainer unification, interaction-aware surrogates, and function-space generalizations. Across these developments, FastSHAP remains the canonical reference point for learned one-pass Shapley estimation (Jethani et al., 2021).

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 FastSHAP.