arXiv:2609.04626cs.CRSep 2026

Manuscript Offprint

arXiv:2609.04626

Why Is SHAP Not a Reliable Standalone Explanation Framework for Malware Detection?

Seyedreza Mohseni, Edward Raff, Manas Gaur

Seyedreza Mohseni*, Edward Raff†, Manas Gaur

*University of Maryland Baltimore County, Baltimore, USA

mohseni1@umbc.edu, manas@umbc.edu

†CrowdStrike, New York, USA, edward.raff@crowdstrike.com

Abstract—Machine learning is widely used for malware detection, but its decisions must be explained. An analyst needs to know whether a model has learned genuine malicious behavior or only dataset-specific patterns [1]. SHapley Additive exPlanations (SHAP) is the standard tool for this, backed by formal properties such as local accuracy, missingness, and consistency. We argue that these guarantees are insufficient for reliable malware interpretation. We claim SHAP explains a chosen feature-coalition game, not malware behavior in the data. That game is fixed only after the analyst selects the feature players, the missing feature rule, the background distribution, and the simplified input mapping. In static Portable Executable feature spaces, groups such as byte histograms, byte-entropy, strings, headers, sections, imports, and data-directories are not independent signals but are jointly shaped by file structure, packing, compiler behavior, and family conventions. We prove that this dependence makes conditional SHAP dilute a model's feature credit by a factor of 1/m across m−1m-1 redundant features, attributes importance to features the model never uses, and even reverses the sign of an unused feature's attribution when the data distribution changes; interventional SHAP, meanwhile, queries off-manifold coalitions that no real executable would exhibit. Experiments on EMBER-2018, EMBER-2024, and BODMAS with fixed LightGBM and XGBoost detectors confirm these effects. We therefore position SHAP as a limited diagnostic that requires an explicitly stated data distribution and domain validation, not a standalone account of malware behavior.

Index Terms—Explainable machine learning, SHAP, Shapley values, feature attribution, malware detection, static PE analysis, feature dependence, interpretability, model explanation.

I. INTRODUCTION

Machine learning is now a core component of modern malware detection, processing large volumes of files and uncovering discriminative patterns that are difficult for human analysts to identify manually [2]–[5]. In static analysis of Portable Executable (PE) files, gradient-boosted trees and deep networks routinely achieve high detection rates and are increasingly deployed in operational security pipelines [6]. In these settings, raw accuracy is not sufficient. An analyst who must triage an alert, justify a quarantine, or audit a model before deployment needs to know why a file was flagged, whether the model relies on genuine malicious behavior or on incidental dataset artifacts, and whether the same explanation would hold for similar files [7]–[10]. This demand for accountability has made post-hoc feature attribution a standard part of the malware-ML toolchain [11]–[14].

Among these methods, SHapley Additive exPlanations (SHAP) [15] is the most widely adopted. Rooted in coopera-

tive game theory [16], SHAP assigns each feature an additive importance value and unifies a family of attribution methods under formal properties such as local accuracy, missingness, and consistency. Efficient estimators such as TreeSHAP [17] and KernelSHAP [18] have lowered the cost of applying SHAP to high-dimensional malware feature spaces, and SHAP attributions now frequently serve as de facto evidence that a classifier has learned the right thing.

This paper argues that such trust is misplaced when SHAP is used as a standalone interpreter of static PE malware models. Our concern is not that SHAP computes incorrect numbers. For a fixed value function and simplified input mapping, its attributions are well-defined, and its axioms hold. Our concern is not the numerical validity of SHAP attributions for a fixed value function and simplified input mapping. Rather, it is the semantic object those attributions characterize: SHAP explains the selected feature-coalition game, which need not correspond to the malware behavior represented by the data [19]. That game is fixed only after the analyst has selected the feature players, the missing feature rule, the background distribution, and the simplified input mapping; in the malware setting, these choices are neither neutral nor obvious, and different choices yield different attributions for the same model and file [20], [21].

This gap between the features and malware matters more for malware than for many domains because of feature dependence. In static PE feature representations such as EMBER-2018 [22], EMBER-2024 [23] and BODMAS [24], the standard feature groups such as byte-histograms, byte-entropy, strings, headers, sections, imports, and data-directories are not independent signals. They come from the same executable and are jointly shaped by file structure, packing, compiler behavior, family conventions, and time-dependent collection effects known to bias malware benchmarks [25] (e.g., obfuscations transform all features together [26], [27]). SHAP's coalition mechanism, however, treats features as separable players that can be added to or removed from a coalition. Under such dependence, the two ways of realizing this mechanism diverge, and each becomes problematic.

Interventional SHAP replaces missing features with background draws, producing combinations that no real PE file would exhibit and evaluating the model in regions it never learned [28], [29]; we show empirically that the measured group-level dependence in these datasets makes such off-manifold coalitions the rule rather than the exception. Conditional SHAP respects the data distribution but can instead credit proxy features that merely predict others, absorb dataset artifacts such as family signatures, and require estimating high-dimensional conditional densities that are themselves error-prone [30], [31]; we make these failures precise as lemmas in Section III. The analyst is thus pushed toward either an explanation of artificial interventions or one of indirect statistical association, neither of which is guaranteed to describe the malicious behavior under study.

These tensions are not new in general machine learning. Kumar et al. [32] show that Shapley-based importance behaves counterintuitively under dependence and redundancy in features. Janzing et al. [28] frame feature relevance as a causal problem motivating the interventional formulation; Chen et al. [33] crystallize the choice as true to the model or true to the data; and Sundararajan and Najmi [20] show that incompatible value functions yield many Shapley values for the same prediction. Reliability concerns extend even to adversarial manipulation of SHAP outputs [34], and global Shapley-style importance inherits the same dependence sensitivities [35]. In security specifically, Warnecke et al. [8] found that explanation methods struggle with structured security data and produce unstable outputs. What has been missing is a focused, mathematically explicit account of how these abstract failure modes manifest on the static PE feature groups the community actually uses, and what they imply for an analyst reading a SHAP plot as evidence of malware behavior. This paper provides that account, a set of lemmas for the interventional and conditional cases with the underlying classifiers held fixed, together with a controlled empirical study, so that any instability is attributable to the explanation process rather than to model quality.

Contributions. This article supports its results through a combination of theoretical exposition showing that multiple issues can occur, followed by empirical validation.

  • A domain-specific articulation of the problem. We formalize, for static PE malware feature groups, why interventional and conditional SHAP diverge under feature dependence, and we identify the resulting failure modes: off-manifold coalition queries for interventional SHAP, and redundancy dilution, proxy crediting, and sign instability for conditional SHAP.

  • An interventional off-manifold failure (Lemma 1). We prove that whenever PE feature groups are statistically dependent ( IP(XC;XCˉ)>0I_P(X_C; X_{\bar{C}}) > 0), interventional SHAP evaluates the classifier on synthetic group-mixed coalitions whose distribution differs from the real data distribution.

  • Conditional attribution failures (Lemmas 2–4). We prove that conditional SHAP (i) dilutes the attribution of a model-used feature by a factor 1/m1/m when m - 1 redundant features (proxies) encoding the same latent malware factor are added (Lemma 2, redundancy); (ii) assigns nonzero attribution to a feature that the classifier never uses whenever that feature is statistically informative about a used feature (Lemma 3, proxy attribution); and (iii) can reverse the attribution sign of such an unused feature across two valid dataset distributions (Lemma 4, sign instability).

  • A controlled empirical demonstration. On EMBER-2018 [22], EMBER-2024 [23], and BODMAS [24], we (i) measure the group-level dependence structure and show that PE feature groups are far from the independent players that SHAP's coalition mechanism assumes, and (ii) for EMBER-2018, with strong LightGBM and XG-Boost detectors held fixed, we sweep injected redundant features and observe attribution migrating off the model used features in close agreement with the 1/m prediction of Lemma 2, while predictive performance remains unchanged, isolating the instability to the explanation process rather than the detector.

References (36)