From Decision Trees to Boolean Logic: A Fast and Unified SHAP Algorithm

📅 2025-11-12
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Existing SHAP algorithms suffer from low computational efficiency on tree ensemble models; mainstream approaches—Path-Dependent and Background SHAP—struggle to balance accuracy and scalability. This paper proposes WOODELF, the first unified SHAP framework based on pseudo-Boolean logic modeling, which jointly encodes decision tree structures and background data into efficiently solvable logical formulas. WOODELF is the first implementation to natively support Background SHAP, Path-Dependent SHAP, and Shapley/Banzhaf interaction values within a single, coherent framework. Implemented entirely in Python (NumPy/SciPy/CuPy), it requires no C++ or CUDA extensions. On a benchmark task with 3 million samples, 5 million background points, and 127 features, WOODELF achieves inference times of 162 seconds on CPU and 16 seconds on GPU—accelerating over state-of-the-art baselines by 16× to 165×. This advancement significantly enhances practicality and cross-platform compatibility for large-scale model interpretability.

Technology Category

Machine Learning: Ensemble MethodsKnowledge Representation and Reasoning: Description LogicsConstraint Satisfaction and Optimization: Satisfiability Modulo Theories

Application Category

Graph Algorithms and Modeling for the Web: Foundation models and LLMs for Web-related graphsSearch and Retrieval-Augmented AI: Web learning to rank, online learning, and counterfactual learning for rankingSystems and Infrastructure for Web, Mobile and WoT: Applied ML and AI for Web-based mobile applications
📝 Abstract
SHapley Additive exPlanations (SHAP) is a key tool for interpreting decision tree ensembles by assigning contribution values to features. It is widely used in finance, advertising, medicine, and other domains. Two main approaches to SHAP calculation exist: Path-Dependent SHAP, which leverages the tree structure for efficiency, and Background SHAP, which uses a background dataset to estimate feature distributions. We introduce WOODELF, a SHAP algorithm that integrates decision trees, game theory, and Boolean logic into a unified framework. For each consumer, WOODELF constructs a pseudo-Boolean formula that captures their feature values, the structure of the decision tree ensemble, and the entire background dataset. It then leverages this representation to compute Background SHAP in linear time. WOODELF can also compute Path-Dependent SHAP, Shapley interaction values, Banzhaf values, and Banzhaf interaction values. WOODELF is designed to run efficiently on CPU and GPU hardware alike. Available via the WOODELF Python package, it is implemented using NumPy, SciPy, and CuPy without relying on custom C++ or CUDA code. This design enables fast performance and seamless integration into existing frameworks, supporting large-scale computation of SHAP and other game-theoretic values in practice. For example, on a dataset with 3,000,000 rows, 5,000,000 background samples, and 127 features, WOODELF computed all Background Shapley values in 162 seconds on CPU and 16 seconds on GPU - compared to 44 minutes required by the best method on any hardware platform, representing 16x and 165x speedups, respectively.
Problem

Research questions and friction points this paper is trying to address.

Unifying SHAP calculation for decision trees using Boolean logic framework
Computing Background SHAP values in linear time with game theory
Enabling efficient CPU/GPU computation of multiple game-theoretic explanation values
Innovation

Methods, ideas, or system contributions that make the work stand out.

Unified framework integrating trees, game theory, Boolean logic
Linear time computation using pseudo-Boolean formulas
Hardware-agnostic implementation enabling CPU/GPU acceleration