TreeSHAP-IQ: Exact Any-Order Tree Interactions
- The paper extends TreeSHAP by introducing an exact, model-specific polynomial algorithm to compute any-order Shapley interactions in tree ensembles.
- It employs a single recursive tree traversal with polynomial arithmetic to replace exponential subset enumeration, yielding efficient and principled interaction scores.
- Empirical results demonstrate significant speed-ups over naive methods and reveal insightful interactions, such as the critical latitude × longitude effect in housing data.
Searching arXiv for papers on TreeSHAP-IQ and closely related tree-specific SHAP interaction methods. TreeSHAP-IQ is an exact, model-specific algorithm for computing Shapley interaction attributions of arbitrary order for tree ensembles. It was introduced in “Beyond TreeSHAP: Efficient Computation of Any-Order Shapley Interactions for Tree Ensembles” as a principled extension of TreeSHAP and Linear TreeSHAP from individual-feature attributions to interaction attributions over subsets of features. Its central contribution is a mathematical framework that exploits polynomial arithmetic to compute the interaction scores in a single recursive traversal of the tree, akin to Linear TreeSHAP, thereby replacing generic exponential subset enumeration with a tree-structured exact method for fixed interaction order (Muschalik et al., 2024).
1. Explanatory target and model scope
TreeSHAP-IQ addresses the limitation of standard SHAP explanations that assign additive contributions only to single features. In the tree-ensemble setting, this is often insufficient because many predictions depend on combinations of features rather than on isolated main effects. TreeSHAP-IQ therefore targets Shapley interactions: scores assigned to subsets of features, where order $1$ corresponds to ordinary feature effects, order $2$ to pairwise interactions, order $3$ to triple interactions, and so on (Muschalik et al., 2024).
The method is developed for tree-based models. The paper first considers a single decision tree , then extends to ensembles by linearity. Each leaf has a leaf value ; denotes the path from root to ; denotes a branch probability on edge $1$0; and $1$1 denotes the edges in $1$2 labeled by feature $1$3. The restricted tree model under partial feature knowledge is defined leafwise and then summed over leaves, so the explanation problem is reduced to a structured coalition game over feature subsets (Muschalik et al., 2024).
A central term in the paper is “any-order additive Shapley interactions.” “Any-order” means arbitrary subset cardinality $1$4, not merely singleton or pairwise terms. “Additive” refers to the use of an efficiency-preserving aggregation such as n-SII up to some maximum order $1$5, so that the prediction can be organized as a baseline plus main effects plus interactions up to the chosen order. The underlying interaction score used by TreeSHAP-IQ is the Shapley Interaction Index (SII), while the paper also discusses the efficient additive aggregation n-SII and the broader Cardinal Interaction Index (CII) family (Muschalik et al., 2024).
For trees, the paper adopts the path-dependent handling of missing features: when a split feature is unknown, traversal is weighted by empirical branch proportions $1$6. This places TreeSHAP-IQ within the same missing-feature semantics as TreeSHAP-style path-dependent explanations. The paper notes that the framework can also be adapted to interventional SHAP semantics, but then complexity grows with background sample count, as in interventional TreeSHAP (Muschalik et al., 2024).
2. Formal game-theoretic formulation
The explanation setting uses a feature set
$1$7
a point $1$8, and an extended model
$1$9
where $2$0 denotes the prediction when only the feature subset $2$1 is known. The paper abbreviates
$2$2
This induces the local coalition value function
$2$3
which is the cooperative game on which all Shapley and interaction quantities are defined (Muschalik et al., 2024).
The ordinary Shapley value is written as
$2$4
TreeSHAP-IQ generalizes from singleton attributions to subset interactions through the discrete derivative
$2$5
defined for $2$6 and $2$7. This derivative isolates the pure joint effect of the subset $2$8 in context $2$9 (Muschalik et al., 2024).
The paper uses the Shapley Interaction Index (SII):
$3$0
For $3$1, this recovers the ordinary Shapley value. For $3$2, it gives pairwise interactions; higher cardinalities produce higher-order interaction scores. The paper is explicit that TreeSHAP-IQ reduces to TreeSHAP and Linear TreeSHAP in the singleton case (Muschalik et al., 2024).
The paper distinguishes three closely related notions. SII is the base interaction index and does not generally satisfy generalized efficiency. n-SII is an aggregation of SII scores up to order $3$3 that does satisfy generalized efficiency, enabling additive decompositions of the prediction across interactions up to order $3$4. CII is the broader class
$3$5
where $3$6 and the weights depend only on interaction order and context size. TreeSHAP-IQ is developed for SII, but the framework extends to general CII-type interaction indices (Muschalik et al., 2024).
3. Polynomial arithmetic and recursive computation
The algorithmic core of TreeSHAP-IQ is a generalization of the polynomial formulation of Linear TreeSHAP. For a leaf $3$7, the paper defines the restricted leaf rule
$3$8
with
$3$9
and
0
taking 1 if 2. The restricted tree model is then
3
This factorization is the basis for encoding coalition sums through generating polynomials (Muschalik et al., 2024).
The Summary Polynomial (SP) is
4
where 5 is the set of features appearing on the path to leaf 6. The associated weighting functional is
7
The paper emphasizes two properties:
8
and
9
These identities support bottom-up aggregation of subtree summaries (Muschalik et al., 2024).
For a leaf rule, the interaction derivative factorizes as
0
and the SII of a leaf rule becomes
1
This separates the interaction score into a discrete-derivative term and a weighted coalition-sum term, both encoded polynomially (Muschalik et al., 2024).
To lift this leafwise identity to the whole tree, TreeSHAP-IQ introduces two additional polynomial families. The Interaction Polynomial (IP) is
2
the Quotient Polynomial (QP) is
3
and the coefficient-sum functional is
4
Applied to the IP,
5
The paper also states a useful simplification: if there exists 6 with 7, then 8, so the corresponding interaction contribution vanishes (Muschalik et al., 2024).
The resulting main theorem is an edge-based SII formula analogous to Linear TreeSHAP’s edge theorem. For
9
TreeSHAP-IQ expresses 0 as a sum over edges in 1, with a local edge term and an ancestor-correction term that telescope properly along the path structure. This is the step that converts exponential subset summation into a recursively computable polynomial expression over tree edges (Muschalik et al., 2024).
Operationally, “single recursive traversal” means that for a fixed explanation point 2 and a fixed interaction order 3, the tree is traversed once while maintaining polynomial state for all order-4 interactions currently relevant and accumulating all their contributions. The paper’s pseudocode maintains a running summary polynomial 5, interaction and quotient states 6 and 7, ancestor references, and output accumulators 8. The implementation stores the relevant polynomials in multipoint interpolation form, uses Chebyshev points for numerical stability, and evaluates 9 and 0 through precomputed transforms (Muschalik et al., 2024).
4. Exactness, complexity, and computational regime
TreeSHAP-IQ is an exact algorithm for the chosen tree-based value function 1. The exactness claim is with respect to the path-dependent missingness semantics used in TreeSHAP-style methods. The paper notes that explanations depend on how absent features are modeled; this is not incidental, because the restricted model 2 is part of the mathematical definition of the game being explained (Muschalik et al., 2024).
For all interactions of a fixed order 3, for 4 explanation points, tree leaf count 5, and maximum depth 6, the paper states
7
and
8
Compared with naive exact interaction computation, which is exponential in the number of features, this replaces exponential dependence by polynomial dependence on tree size together with a combinatorial dependence on the chosen interaction order 9 (Muschalik et al., 2024).
The complexity has a clear interpretation. For 0, TreeSHAP-IQ essentially matches the Linear TreeSHAP regime. As 1 increases, the factor 2 reflects the number of size-3 interactions involving the current feature. The paper therefore presents TreeSHAP-IQ as practical for small or moderate 4, moderate feature count, and tree depth that is not too large. “Any-order” denotes mathematical generality of the framework, not uniform cheapness for arbitrarily high orders (Muschalik et al., 2024).
A later comparison in “Quadrature-TreeSHAP: Depth-Independent TreeSHAP and Shapley Interactions” presents TreeSHAP-IQ as the prior method that “extends Linear TreeSHAP polynomial arithmetic to any order interactions” and gives its complexity, when computing order-5 interactions on a dataset with 6 features, as
7
That paper argues that TreeSHAP-IQ carries both a depth factor 8 and a combinatorial dependence on feature count and interaction order, and uses TreeSHAP-IQ as the main higher-order baseline in Python experiments (Wettenstein et al., 6 May 2026).
The interventional variant is explicitly described as costlier. The TreeSHAP-IQ paper notes that the framework can be adapted to interventional SHAP semantics, but then complexity rises with background sample count, as in interventional TreeSHAP. This places path-dependent and interventional versions within the familiar trade-off between computational efficiency and the semantics of missing features (Muschalik et al., 2024).
5. Relation to SHAP-IQ, TreeSHAP, and later tree-interaction methods
Despite the similarity of names, SHAP-IQ and TreeSHAP-IQ are different objects. SHAP-IQ is a general, sampling-based approximator for arbitrary cardinal interaction indices on black-box models. It provides a unified representation
9
an unbiased and consistent Monte Carlo estimator, variance estimates, and support for arbitrary CII-type interaction definitions. It is foundational for any-order interaction explanations, but it is not tree-specific and does not present a tree algorithm analogous to TreeSHAP (Fumagalli et al., 2023). TreeSHAP-IQ, by contrast, is a tree-specific exact algorithm that exploits root-to-leaf structure and polynomial recursion to compute local interactions in tree ensembles (Muschalik et al., 2024).
TreeSHAP-IQ is best understood as extending the line of work represented by TreeSHAP and Linear TreeShap. Linear TreeShap is an exact first-order algorithm for decision trees that recasts TreeSHAP using rule linearization, summary polynomials, subtree reuse, and telescoping corrections over repeated features. It reduces the single-tree time complexity from 0 to 1 while preserving the standard TreeSHAP missingness semantics and the same asymptotic space complexity (Yu et al., 2022). TreeSHAP-IQ inherits the polynomial-arithmetic viewpoint and generalizes it from singleton Shapley values to subset interactions (Muschalik et al., 2024).
A different adjacent line is the path-sparsity proof framework developed in “Understanding Interventional TreeSHAP : How and Why it Works.” That paper proves correctness for interventional TreeSHAP and shows that essentially the same proof pattern extends to Shapley-Taylor indices and one-hot-encoded features. Its path-local Boolean reduction
2
explains why higher-order attribution formulas can collapse from exponential sums to a constant number of nonzero terms per path under interventional semantics (Laberge et al., 2022). This does not present TreeSHAP-IQ, but it supplies a closely related structural justification for exact higher-order attribution on trees.
Two later exact alternatives situate TreeSHAP-IQ as a predecessor rather than an endpoint. WOODELF is a Boolean-logic-based exact framework for tree explanations that can compute standard Shapley values, pairwise Shapley interaction values, Banzhaf values, and pairwise Banzhaf interaction values under both Path-Dependent SHAP and Background SHAP. It is “metric-generic,” but its interaction support in the paper is only for pairwise interactions 3 and 4, not arbitrary order 5 (Nadel et al., 12 Nov 2025). Quadrature-TreeSHAP instead targets Path-Dependent SHAP and any-order interactions directly. It presents TreeSHAP-IQ as the prior any-order exact method, reformulates the same target quantities through weighted-Banzhaf interaction polynomials and Gauss–Legendre quadrature, and reports higher-order interaction speedups of up to 6 compared to TreeSHAP-IQ (Wettenstein et al., 6 May 2026).
6. Empirical applications, interpretive use, and limitations
The TreeSHAP-IQ paper evaluates the method on seven benchmark tabular datasets: German Credit, Bank, Adult Census, Bike, COMPAS, Titanic, and California Housing. It applies the method to XGBoost (XGB), Gradient Boosted Trees (GBT), Random Forests (RF), and Decision Trees (DT). The quantitative runtime baseline is naive exact computation of SII, and the paper reports approximate speed-ups over naive computation of 7 on Credit, 8 on Bank and Adult, 9 on Bike and Titanic, $1$00 on COMPAS, and $1$01 on California (Muschalik et al., 2024).
The empirical section emphasizes interpretive rather than predictive findings. On California Housing, ordinary TreeSHAP gives a strong positive attribution to latitude and longitude individually, but TreeSHAP-IQ reveals that much of the effect is really due to the interaction latitude × longitude. On German Credit, network plots show that some features act strongly individually while others matter mostly through interactions, such as credit amount interacting with installment rate or duration. On the Bike dataset, waterfall plots with n-SII up to order $1$02 show joint effects such as evening hour with non-working day contributing negatively, while interactions with temperature features contribute positively. The paper also plots interaction magnitudes up to order $1$03 on German Credit and reports that interaction magnitude decays with order, with orders $1$04 and $1$05 nearly absent for the displayed instance (Muschalik et al., 2024).
These case studies clarify the practical role of TreeSHAP-IQ. Positive interaction scores indicate that the joint presence of features in $1$06 pushes the prediction upward relative to baseline and context; negative scores indicate downward joint contribution. For higher orders, the score is the pure joint term that remains after inclusion–exclusion removes lower-order parts. Raw SII scores do not generally provide an additive decomposition satisfying efficiency, which is why the paper uses n-SII for additive visual explanations such as force plots and waterfall charts (Muschalik et al., 2024).
The paper also makes several limitations explicit. First, the results depend on the chosen missing-feature semantics; the main development uses path-dependent perturbation. Second, the interventional variant is costlier because complexity rises with background sample count. Third, even with efficient computation, the number of interaction subsets $1$07 grows rapidly. Fourth, extending beyond SII to other CII members requires explicit derivative-weight representations, and for some indices such as FSI this is only known in limited cases. Fifth, exact computation does not resolve the human interpretability challenge of presenting many high-order interactions (Muschalik et al., 2024).
In sum, TreeSHAP-IQ established the first exact, tree-structured route from TreeSHAP-style local explanations to any-order local Shapley interactions for tree ensembles. Its lasting significance lies in combining the cooperative-game definition of interaction scores with a model-specific polynomial calculus over tree paths, thereby making higher-order interaction attribution exact and computationally feasible for fixed order on practical tree models (Muschalik et al., 2024).