[Paper Review] Understanding Interventional TreeSHAP : How and Why it Works
This paper provides the first formal mathematical proof of how and why Interventional TreeSHAP works, demonstrating its correctness for explaining tree ensemble models via Shapley values. The proof is extendable to Shapley-Taylor indices and one-hot encoded features, enabling broader application and improved interpretability of machine learning models.
Shapley values are ubiquitous in interpretable Machine Learning due to their strong theoretical background and efficient implementation in the SHAP library. Computing these values previously induced an exponential cost with respect to the number of input features of an opaque model. Now, with efficient implementations such as Interventional TreeSHAP, this exponential burden is alleviated assuming one is explaining ensembles of decision trees. Although Interventional TreeSHAP has risen in popularity, it still lacks a formal proof of how/why it works. We provide such proof with the aim of not only increasing the transparency of the algorithm but also to encourage further development of these ideas. Notably, our proof for Interventional TreeSHAP is easily adapted to Shapley-Taylor indices and one-hot-encoded features.
Motivation & Objective
- To provide a rigorous mathematical proof of the correctness of Interventional TreeSHAP, addressing the lack of formal justification in prior work.
- To enhance transparency and trust in TreeSHAP by revealing its theoretical foundations and underlying assumptions.
- To demonstrate that the proof framework can be easily adapted to other game-theoretic attribution methods, such as Shapley-Taylor indices.
- To extend TreeSHAP to handle one-hot encoded categorical features, which are common in real-world ML pipelines but unsupported in current SHAP implementations.
- To support educational and research applications by providing a C++-based, mathematically aligned implementation for teaching and further development.
Proposed method
- Formal proof of Interventional TreeSHAP using coalitional game theory, showing that the algorithm computes correct Shapley values for tree ensembles under interventional (do-calculus) assumptions.
- Derivation of a recursive algorithm for computing Shapley values by traversing decision trees and aggregating contributions across feature subsets.
- Extension of the proof to Shapley-Taylor indices by redefining the game-theoretic value function to capture higher-order feature interactions.
- Introduction of a feature embedding framework that maps one-hot encoded features into a continuous space, enabling consistent attribution via Partition-TreeSHAP.
- Definition of a surjective mapping 𝒫 from embedded coordinates to original features, allowing aggregation of attributions back to original feature space.
- Implementation of Taylor-TreeSHAP and Partition-TreeSHAP in C++ with Python wrapping, using the same notation as in the theoretical proof for clarity and educational use.
Experimental results
Research questions
- RQ1How can the correctness of Interventional TreeSHAP be formally proven using game-theoretic principles?
- RQ2Can the proof framework for Interventional TreeSHAP be adapted to compute Shapley-Taylor indices for higher-order feature interactions?
- RQ3How can TreeSHAP be extended to handle one-hot encoded categorical features while preserving accurate attribution?
- RQ4What is the theoretical basis for the equivalence between the recursive aggregation in TreeSHAP and the full Shapley value computation?
- RQ5How can the theoretical insights be translated into a reusable, educational, and extensible implementation?
Key findings
- The paper provides the first complete formal proof that Interventional TreeSHAP correctly computes Shapley values for tree ensemble models under the interventional assumption.
- The proof structure is directly transferable to Shapley-Taylor indices, enabling efficient computation of higher-order feature interaction effects.
- The method supports one-hot encoded features through a novel embedding and attribution aggregation framework, extending TreeSHAP beyond binary or numerical features.
- A C++ implementation of Partition-TreeSHAP and Taylor-TreeSHAP is provided, using the same notation as the theoretical analysis for consistency and educational clarity.
- The theoretical framework enables accurate attribution for mixed feature types, including both continuous and one-hot encoded features, without requiring model retraining.
- The results validate that TreeSHAP’s efficiency and correctness stem from a sound game-theoretic foundation, supporting its use as a reliable interpretability tool.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.