Shapley Interactions in Machine Learning
- Shapley Interactions (SIs) are a game-theoretic framework that generalizes classic Shapley values to capture the joint contribution of features, neurons, or hyperparameters.
- The approach uses discrete derivatives and axioms like linearity, symmetry, and dummy to separate additive effects from higher-order interactions.
- Efficient computation of SIs is achieved through model-specific algorithms, sampling approximations, and weighted least squares methods, enhancing ML model interpretability.
Shapley Interactions (SIs) generalize the classic Shapley value—originally introduced to attribute the value (or "payout") among cooperating players in a game—to measure the joint contribution of groups of features, data points, neurons, or hyperparameters in machine learning models. The SI formalism decomposes model outputs into additive and non-additive (interaction) components using a principled game-theoretic approach and a sequence of axioms. Recent advances in SI theory, algorithms, and applications have established SIs as a cornerstone for interpretability in modern ML, with rigorous mathematical connections to functional decomposition, efficient computation in structured models, and unified software frameworks.
1. Mathematical Formulation and Axioms
Shapley Interactions are defined over a cooperative game setting: given a value function defined on all coalitions (where indexes features, neurons, or other entities), standard Shapley values allocate the difference equitably among individual elements using a weighted average over all possible orderings or subsets. SIs extend this allocation to interactions of arbitrary order , quantifying how the joint presence of a group (with ) modulates the output beyond the sum of their individual effects.
A central mathematical object for SI is the discrete derivative:
The Shapley Interaction Index (SII) for coalition is then given by
where is a weighting function (e.g., the Shapley kernel for basic SII, combinatorial coefficients for other indices).
Canonical axioms underpinning SI construction are linearity, symmetry, dummy, and, in advanced definitions, efficiency (the sum over all interaction attributions recovers the total output difference). The Faith-Shap index, for example, uniquely extends the Shapley axiomatic regime to interactions by posing SIs as coefficients in the weighted least-squares (WLS) best-fit polynomial decomposition of the value function, enforcing all standard axioms including efficiency (Tsai et al., 2022). Alternative indices such as the Shapley-Taylor index introduce an interaction distribution axiom (Dhamdhere et al., 2019).
2. Functional Decomposition and Connections to Additive Models
SIs closely relate to the Möbius transform (also called Harsanyi dividends) and generalized additive models (GAMs). For any value function , the Möbius coefficients for subset capture the "pure" effect of that coalition:
The value for any coalition is reconstructed additively:
Standard Shapley values distribute evenly among the members of , while higher-order SIs attribute joint effects.
The -Shapley value concept formalizes a hierarchy where explanations up to order recover the true functional decomposition of into GAM terms for (Bordt et al., 2022). SIs offer a precise mapping between SHAP local explanations and the functional basis underlying model outputs. Notably, first-order Shapley values "pool" higher-order effects into individual attributions, making SIs necessary to properly disentangle complex interactions.
3. Algorithms for Efficient Computation
Exact SI computation is exponential in the number of entities (), rendering naive approaches intractable for high-dimensional settings. Multiple advances exploit model structure, cardinal stratification, or sampling to scale computation:
- Model-Specific Algorithms: TreeSHAP-IQ exploits polynomial arithmetic and tree structure to compute any-order SIs in decision tree ensembles through a recursive traversal (Muschalik et al., 22 Jan 2024). GraphSHAP-IQ leverages GNN locality, restricting SI computation to node receptive fields and dramatically reducing complexity (Muschalik et al., 28 Jan 2025).
- Sampling and Approximation: SHAP-IQ provides unbiased, consistent sampling-based estimators for arbitrary cardinal interaction indices by updating all interaction orders with a single model evaluation; SVARM-IQ uses stratified sampling, decomposing the interaction index into strata of the coalition lattice for efficient reuse and variance control (Kolpaczki et al., 24 Jan 2024).
- Weighted Least Squares (WLS) Approaches: KernelSHAP-IQ and Faith-Shap formulate SIs as WLS estimation problems, extending the philosophy of KernelSHAP beyond first-order values (Fumagalli et al., 17 May 2024, Tsai et al., 2022). These approaches allow efficient inversion of sampled coalition data, supporting rigorous optimization and enforcement of axiomatic constraints.
Modern frameworks such as shapiq unify these algorithms under a common interface, providing both exact and approximate SI computation for arbitrary models, including vision transformers, LMs, XGBoost, and LightGBM (Muschalik et al., 2 Oct 2024).
4. Applications in Machine Learning Models
SIs have been applied to a diverse array of ML interpretability contexts:
- Tabular Models: Tree-based ensembles are explained by TreeSHAP-IQ, revealing both individual feature effects and higher-order synergistic or suppressive interactions, e.g., geographic pairs (longitude-latitude) in housing data (Muschalik et al., 22 Jan 2024).
- Graph Neural Networks: GraphSHAP-IQ enables exact SI computation for GNNs, visualizing molecule substructures ("benzene ring," "NOâ‚‚") or flow patterns in water distribution networks as SI-graphs, elucidating networked feature synergy (Muschalik et al., 28 Jan 2025).
- Deep Neural Networks: Neuron Shapley quantifies neuron/filter contributions and interactions, supporting model pruning, fairness repair, and adversarial vulnerability analysis (Ghorbani et al., 2020). In DNNs, SI-driven prototype extraction partitions inputs into coalitions representing abstract features (e.g., noun phrases, facial regions) (Zhang et al., 2020).
- Multimodal and Cross-Modal Models: MultiSHAP leverages SI to compute pairwise cross-modal interactions, interpreting fine-grained synergy and suppression between image regions and text tokens, enabling causal, counterfactual explanations for both open- and closed-source models (Wang et al., 1 Aug 2025).
- Hyperparameter Optimization (HPO): HyperSHAP applies SI to attributions and interactions among hyperparameters, uncovering tuner bias, redundancy, and synergistic tuning effects in AutoML pipelines (Wever et al., 3 Feb 2025).
5. Comparative Analysis of SI Indices
The field contains multiple SI indices, each with distinct axiomatic underpinnings and tradeoffs:
Index Name | Defining Properties | Efficiency Axiom | Computational Rationale |
---|---|---|---|
Shapley Interaction | Linearity, symmetry, dummy | Not satisfied | Classical, lacks sum-to-total |
Shapley-Taylor | Standard Shapley axioms + dist. | Satisfied | Taylor expansion, truncated order |
Faith-Shap | Shapley axioms for interactions | Satisfied | Polynomial best-fit, unique sol. |
KernelSHAP-IQ | WLS-based for SII/k-SII | As enforced | Iterated regression, high-order SI |
SVARM-IQ, SHAP-IQ | Stratified/sampling approx. | Varied | Efficient for practical settings |
Shapley-Taylor and Faith-Shap indices recover the full output with efficiency; SII (classical) may inflate interaction effects. Empirical studies show that most practical benefits accrue from lower-order SIs; higher-order terms often have diminished explanatory value in complex models.
6. Visualization and Interpretability Tools
Cutting-edge software frameworks (e.g., shapiq) support visualization of SIs as network graphs, heatmaps, or bar plots for local/global explanation (Muschalik et al., 2 Oct 2024, Wang et al., 1 Aug 2025). MultiSHAP, for instance, uses SI matrices to generate instance-level heatmaps and dataset-level metrics (synergy ratio, dominance) for cross-modal analyses, supporting detailed diagnosis in VQA, retrieval, and clinical diagnosis scenarios.
7. Limitations, Open Questions, and Future Directions
The principal limitation of SI methodology remains the exponential scaling with the number of entities and the interpretability bottleneck in presenting exponentially many interaction terms. Algorithms exploiting model structure (TreeSHAP-IQ, GraphSHAP-IQ) or stratified sampling (SVARM-IQ, SHAP-IQ) mitigate but do not eliminate this challenge. Open research areas include:
- Adaptive sampling and confidence allocation for interaction scores.
- Human-centered visualization and selection of salient interactions.
- Integration of SI-based explanations with functional decompositions and GAMs for global interpretability (Bordt et al., 2022).
- Theoretical refinement of higher-order WLS estimation and the development of optimal weighting strategies (Fumagalli et al., 17 May 2024).
Recent developments in unified packages (shapiq) and benchmarking suites facilitate empirical comparison and broader adoption across domains (Muschalik et al., 2 Oct 2024). SIs stand as a mathematically principled, computationally tractable, and substantively meaningful tool for contemporary machine learning interpretation.