TL;DR
SHAPSHIFT is a novel framework that explains why a machine learning model's average predictions change over time or across different datasets. By leveraging the hierarchical structure of decision trees, it breaks down complex prediction shifts into the contributions of interpretable data subgroups using Shapley values, offering a faithful and near-complete explanation for trees, ensembles, and black-box models alike.
What Problem Does This Paper Address?
When machine learning models are deployed in production, the real-world data distribution inevitably drifts. This drift often causes a "prediction shift"—a change in the model's average output (e.g., a sudden drop in a bank's loan approval rate or a shift in a hospital's diagnosis rate). While existing data-monitoring tools can alert engineers that a shift has happened, figuring out why it happened is notoriously difficult.
Prior methods either explain changes in the data itself (ignoring the model's logic) or try to attribute shifts to joint feature probabilities. However, using joint probabilities is mathematically ill-posed: changing one joint probability in a dataset requires arbitrarily adjusting others to ensure they still sum to one. SHAPSHIFT addresses this gap by cleanly decomposing prediction shifts using the conditional probabilities of interpretable data subgroups.
Methods
The authors build their method on the cooperative game theory framework of Shapley values (SVs), which fairly distributes "credit" (or blame) for a change across multiple factors. Instead of joint probabilities, SHAPSHIFT uses subgroup conditional probabilities (e.g., the probability of being low-income given that the applicant is employed) derived from decision tree splits.
The paper rolls out this approach in three stages:
- Single Decision Trees: Since a tree's predictions are entirely determined by the conditional probabilities at its split nodes, SHAPSHIFT computes exact Shapley attributions for each split.
- Tree Ensembles (Random Forests/XGBoost): Analyzing an entire forest jointly is computationally intractable. Instead, SHAPSHIFT evaluates individual trees and introduces a novel "unexplained" term ($\phi_{\text{LeafMeans}}$) to capture the residual effects from the rest of the ensemble. It then selects the single tree that minimizes this unexplained variance.
- Model-Agnostic (Black-Boxes): To explain complex models like neural networks, the authors train a surrogate decision tree. Crucially, standard tree-building metrics (like Gini impurity) perform poorly here. The authors introduce a novel distribution-aware impurity function that explicitly minimizes the unexplained prediction shift during the tree's recursive growth.
To scale the method to massive trees, the authors integrate Kernel SHAP estimators and tree-pruning techniques.
Datasets
The method was validated across several standard tabular benchmarks and a large-scale real-world evaluation:
- California House Prices (Regression)
- Breast Cancer Wisconsin (Classification)
- Home Equity Line of Credit (HELOC) & Pima Indians Diabetes (used to test the black-box surrogate approach)
- Folktables: A massive suite of US Census datasets (covering income, employment, health insurance, mobility, and travel time) spanning 51 states/territories over 5 years. The authors generated 250 distinct real-world distribution shifts from this data for rigorous quantitative testing.
Key Insights and Ideas
- Conditionals over Joints: Factoring distributions into conditional probabilities completely bypasses the "renormalisation problem." Swapping a conditional probability from distribution $P$ to $Q$ leaves other conditionals untouched, making the Shapley math mathematically sound and intuitive.
- The Power of a Single Tree: Surprisingly, you don't need to explain a whole random forest to understand its prediction shift. A single, well-chosen tree from the ensemble can often explain over 94% of the entire forest's shift.
- Standard Surrogates Fail: Standard surrogate trees try to mimic a model's exact decision boundaries everywhere. For explaining shifts, however, you only care about regions where the data distributions actually differ. The proposed proxy impurity function focuses the surrogate tree precisely on these high-shift regions.
Key Results
- High Completeness: On the 250 Folktables shifts, SHAPSHIFT left an average of less than 6% of the prediction shift unexplained across all model types.
- Superior Faithfulness: The method achieved a median Pearson correlation (R-Faithfulness) of over 0.998, proving that the calculated Shapley values accurately mirror the true causal impact of the data shifts on the model's predictions.
- Outperforming Baselines: Compared to adapted Optimal Transport baselines (OT-C and OT-S), SHAPSHIFT was roughly 10x faster, yielded significantly lower-entropy (more concise) explanations, and demonstrated much higher faithfulness.
Limitations and Future Work
- Black-Box Causality: For black-box models, the surrogate tree relies on statistical correlations. A feature might appear important in the explanation due to correlation in the data shift, even if the underlying black-box model doesn't actually use it.
- The "Why" Behind the Shift: SHAPSHIFT tells you which subgroup conditional changed and how it affected the model, but it cannot explain why that real-world change happened in the first place (e.g., why more people became unemployed). That requires a true causal model of the domain.
- Tabular Limitation: The current implementation is strictly tied to finite-dimensional tabular data with interpretable features. Extending this to unstructured data like text, images, or audio via representation learning remains an open challenge.
Summary updated