Machine learning models are notoriously finicky travelers. A model trained to predict hospital readmissions in San Francisco might suddenly stumble when deployed in Chicago. When this happens, engineers and clinicians face a high-stakes detective mission: Why did the performance drop? Is it because the patient population changed (covariate shift), or has the underlying nature of the disease evolved (concept shift)?
In their NeurIPS 2024 paper, "A hierarchical decomposition for explaining ML performance discrepancies," Harvineet Singh and colleagues introduce HDPD (Hierarchical Decomposition of Performance Differences). It’s a framework designed to move beyond vague hunches and provide precise, feature-level explanations for why models fail across different domains.
The Problem with "Aggregate" Explanations
When a model’s accuracy tanks in a new environment, practitioners usually look at aggregate decompositions. These tell us if the problem is a shift in the input distribution ($p(X)$) or a shift in the relationship between inputs and outputs ($p(Y|X)$).
However, knowing "the inputs changed" is a coarse explanation. If your model uses 500 features, this doesn't tell you which data pipeline to fix or which features to prune. Existing "detailed" methods that pinpoint specific features usually rely on the Oaxaca-Blinder decomposition (which assumes the world is linear) or require a known causal graph (which is often impossible to obtain in high-dimensional settings).
HDPD fills this gap by providing detailed, nonparametric explanations without needing a complete map of the causal universe.
How HDPD Works
HDPD operates on two levels to break down performance gaps:
- Aggregate Level: It splits the performance gap into shifts in baseline variables ($W$), shifts in conditional covariates ($Z|W$), and shifts in the outcome distribution ($Y|W,Z$).
- Detailed Level: It uses the Shapley attribution framework to distribute those aggregate gaps down to individual features.
The Secret Sauce: * $R^2$-based Value Functions: To score how much a specific feature contributes to a shift without knowing the causal graph, the authors measure how closely a "partial shift" (shifting just one feature) approximates the "aggregate shift" using a nonparametric extension of the $R^2$ metric. * Debiased Estimators: Standard "plug-in" ML estimators for these complex terms are often biased and don't allow for reliable confidence intervals. The authors derive one-step debiased estimators from semiparametric inference theory. This ensures that the importance scores are asymptotically normal, allowing the framework to output valid 90% confidence intervals.
Key Insights and Results
The authors validated HDPD across synthetic data, a hospital readmission dataset, and an ACS public coverage dataset.
- Actionability is King: HDPD distinguishes between things you can fix with an algorithm (like retraining for concept shift) and things you might need to fix operationally (like data collection bias in specific features).
- The "Aha" Moment in Healthcare: In the hospital case study, HDPD revealed that "Drug-induced or toxic-related conditions" were the primary drivers of the performance gap between general patients and heart failure patients. Clinicians confirmed this made sense, as the heart failure population had a much higher prevalence of substance use disorders.
- Don't Trust the Mean: Simple methods like "MeanChange" often point to the wrong features. HDPD shows that a feature can have a huge shift in mean but zero impact on the model's loss, making it irrelevant for explaining a performance drop.
- Statistical Rigor: In simulations, HDPD’s debiased estimators achieved the nominal 90% coverage rate for confidence intervals, while naive plug-in methods failed as sample sizes increased.
- Superior Diagnostics: When models were "fixed" by retraining them on the top features identified by HDPD, they achieved higher performance gains compared to fixes suggested by other popular methods.
Limitations and Future Work
Like most distribution shift methods, HDPD requires that the range of data in the target domain overlaps with the source (overlapping support). Currently, the framework cannot provide detailed scores for the "baseline" variables ($W$), only for the covariates ($Z$). While computationally efficient compared to full Shapley permutations, it still requires fitting several nuisance models. Future work aims to extend this to more complex performance metrics like AUC and unstructured data like images or text.
Summary updated