SHAP values via sparse Fourier representation
Ali Gorji, Andisheh Amrollahi, Andreas Krause
TL;DR
The paper tackles the prohibitive cost of computing SHAP values for high-dimensional predictors by exploiting sparse Fourier representations. It introduces FourierShap, a two-stage framework that first fits a sparse Fourier spectrum to the predictor (exact for tree ensembles, approximate for black-box models) and then computes SHAP values with a closed-form expression for each Fourier basis, reducing the problem to a linear, highly parallelizable summation with complexity $\Theta(n|\mathcal{D}|k)$. The key theoretical contribution is the exact SHAP formula for individual Fourier basis functions, enabling amortization of the Fourier fit across many explanations and yielding orders-of-magnitude speedups over KernelShap and related methods, with controllable accuracy via sparsity $k$. Empirically, FourierShap achieves near-ground-truth fidelity (e.g., $R^2$ approaching 0.99 against TreeSHAP) while delivering substantial speed improvements across diverse datasets and model families, including black-box neural nets and white-box tree ensembles. This work provides a scalable, parallelizable approach to model explanations that preserves SHAP's theoretical guarantees under sparse Fourier representations, broadening practical applicability to large-scale settings.
Abstract
SHAP (SHapley Additive exPlanations) values are a widely used method for local feature attribution in interpretable and explainable AI. We propose an efficient two-stage algorithm for computing SHAP values in both black-box setting and tree-based models. Motivated by spectral bias in real-world predictors, we first approximate models using compact Fourier representations, exactly for trees and approximately for black-box models. In the second stage, we introduce a closed-form formula for {\em exactly} computing SHAP values using the Fourier representation, that ``linearizes'' the computation into a simple summation and is amenable to parallelization. As the Fourier approximation is computed only once, our method enables amortized SHAP value computation, achieving significant speedups over existing methods and a tunable trade-off between efficiency and precision.
