SHAP@k: Efficient and Probably Approximately Correct (PAC) Identification of Top-K Features

Sanjay Kariyappa, Leonidas Tsepenekas, Freddy Lécué, Daniele Magazzeni

Introduction

In highly regulated sectors like financial services, machine learning models cannot operate as "black boxes." When a lender denies a loan application, they are often legally required to provide an "adverse action notice" explaining the primary reasons for the decision. This typically involves identifying the top 3 or 4 most influential features, such as a low credit score or a high debt-to-income ratio.

While SHAP (SHapley Additive exPlanations) is the industry standard for these explanations, calculating exact SHAP values is computationally prohibitive for complex models. Existing approximation methods like KernelSHAP are often inefficient because they allocate equal computational effort to every feature, regardless of whether that feature is likely to be among the most important. To solve this, researchers at JPMorganChase have introduced SHAP@k, a framework that treats feature importance as a Multi-Armed Bandit problem to identify the top $k$ features with high efficiency and mathematical guarantees.

The Top-k Identification Problem (TkIP)

The authors define the Top-k Identification Problem (TkIP): finding the $k$ most important features (and optionally their relative order) as quickly as possible while maintaining a specific level of statistical confidence. By framing this as a Probably Approximately Correct (PAC) problem, they ensure that the identified features are truly the most important ones within a small error margin ($\epsilon$) with a high probability ($1-\delta$).

Methodology: SHAP as a Multi-Armed Bandit

The core innovation of SHAP@k is bridging explainable AI with Multi-Armed Bandits (MAB). In this analogy, each feature is an "arm," and its SHAP value is the "payoff." The algorithm seeks to find the best-performing arms using the fewest possible "pulls" (samples).

Two primary mechanisms drive the efficiency of the SHAP@k suite:

  1. Overlap-based Stopping Condition: The algorithm stops sampling as soon as the confidence interval of the "worst" feature in the top-$k$ set is statistically separated from the "best" feature in the remaining set. This avoids wasting samples on features that are clearly not in the top $k$.
  2. Greedy Sampling: Instead of sampling all features uniformly, the algorithm adaptively focuses on features that are currently "competing" for a spot in the top $k$ or whose values are near the boundary.

These innovations resulted in four new algorithms: KernelSHAP@k and SamplingSHAP@k for unordered sets, and KernelSHAP-O and SamplingSHAP-O for ordered lists.

Experimental Setup

The researchers evaluated the performance of SHAP@k using four real-world credit datasets, summarized in the table below. These datasets represent typical financial use cases with varying feature counts and sample sizes.

Summary of the four credit-related datasets used for evaluation.

Key Results

The quantitative improvements over standard sampling baselines are significant. On the German Credit dataset, SamplingSHAP@k required 40x fewer samples and achieved a 38.8x speedup in execution time compared to naive sampling.

The efficiency stems from the algorithm's ability to ignore irrelevant features early. As illustrated in the performance comparison below, standard SamplingSHAP (panel a) maintains tight confidence intervals for all features by sampling extensively. In contrast, SamplingSHAP@k (panel b) allows for larger variance in non-critical features, drastically reducing the total number of samples required (panel d) while still correctly identifying the top features.

Comparison of SamplingSHAP and SamplingSHAP@k performance. Panel (d) highlights the dramatic reduction in samples required by the @k variant.

Conclusion and Future Work

SHAP@k provides a mathematically rigorous and computationally efficient path for generating explanations in regulated environments. While the PAC guarantees are robust, the authors note that they rely on the assumption of unbiased sampling. Future research may involve integrating these MAB-based strategies into model-specific explainers like TreeSHAP or developing methods for adaptive $k$ selection based on the distribution of feature importance.

Summary updated

BibTeX
@inproceedings{kariyappa2024shap,
  author = {Sanjay Kariyappa and Leonidas Tsepenekas and Freddy Lécué and Daniele Magazzeni},
  title = {{SHAP@k: Efficient and Probably Approximately Correct (PAC) Identification of Top-K Features}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i12.29205},
}
Figure