Evaluating Model Robustness and Stability to Dataset Shift

Adarsh Subbaswamy, Roy Adams, Suchi Saria

Abstract

As the use of machine learning in high impact domains becomes widespread, the importance of evaluating safety has increased. An important aspect of this is evaluating how robust a model is to changes in setting or population, which typically requires applying the model to multiple, independent datasets. Since the cost of collecting such datasets is often prohibitive, in this paper, we propose a framework for evaluating this type of stability using the available data. We use the original evaluation data to determine distributions under which the algorithm performs poorly, and estimate the algorithm’s performance on the "worst-case" distribution. We consider shifts in user defined conditional distributions, allowing some distributions to shift while keeping other portions of the data distribution fixed. For example, in a healthcare context, this allows us to consider shifts in clinical practice while keeping the patient population fixed. To address the challenges associated with estimation in complex, high-dimensional distributions, we derive a "debiased" estimator which maintains root-N consistency even when machine learning methods with slower convergence rates are used to estimate the nuisance parameters. In experiments on a real medical risk prediction task, we show this estimator can be used to analyze stability and accounts for realistic shifts that could not previously be expressed. The proposed framework allows practitioners to proactively evaluate the safety of their models without requiring additional data collection.

Introduction

Machine learning models are notoriously brittle. A model that works perfectly in a lab can fail spectacularly when deployed in the real world because the environment has changed—a phenomenon known as dataset shift. Traditionally, checking for this requires collecting expensive new datasets from every possible deployment site. This paper presents a framework to "stress-test" models using only existing data by identifying distributions under which the algorithm performs poorly.

A Framework for Fine-Grained Stability Analysis

The core challenge in high-stakes domains like healthcare is safety. We need to know if a diagnostic model will still work if a hospital changes its testing protocols or if the patient demographics shift. Existing evaluation tools like cross-validation assume the future will look exactly like the past. While Distributionally Robust Optimization (DRO) can estimate worst-case performance, it often shifts the entire data distribution in unrealistic ways.

This framework addresses the need for fine-grained stability analysis by allowing users to specify exactly which parts of the distribution should change while keeping others fixed. Users partition variables into three sets:

  1. Immutable: Variables whose distribution must remain fixed (e.g., age, medical history).
  2. Mutable: Variables whose conditional distribution is allowed to shift (e.g., test ordering patterns).
  3. Remaining: Dependent variables.

The framework identifies a "worst-case subsample"—a subpopulation of a specific size where the model performs most poorly, subject to the constraint that the immutable variables still look like the original population.

Figure 1: Comparing how different shift formulations affect the age distribution. The conditional shift (green) keeps the population characteristics fixed while testing changes in practice.

Debiased Machine Learning Estimator

To make this work with complex, high-dimensional data, the authors derived a "debiased" machine learning (DML) estimator. Standard plug-in estimators can be biased when using flexible models like neural networks to estimate internal parameters. The DML estimator maintains $\sqrt{N}$-consistency, providing reliable performance estimates and valid confidence intervals even when using "black-box" ML components like Random Forests or Deep Learning within a rigorous evaluation framework.

Experimental Validation

The framework was validated using both synthetic data and a real-world sepsis diagnosis task. For the sepsis task, a model was trained on data from Hospital A (278,947 encounters). A separate dataset from Hospital B served as a real-world benchmark. Hospital B had a significantly higher test-ordering rate (23%) compared to Hospital A (11%), representing a realistic shift in clinical practice.

The framework's estimated worst-case accuracy for the specific shift seen at Hospital B matched the model's actual performance almost exactly. The analysis revealed that the "classical" model's performance degrades when clinicians order tests more widely (less selectively), whereas a "robust" model maintained much higher stability.

Figure 2: Predicted worst-case accuracy vs. subpopulation size. The blue curve represents the framework's prediction, while the orange dot indicates the actual performance observed at Hospital B.

Conclusion

The proposed framework allows practitioners to proactively evaluate the safety of their models without requiring additional data collection. By isolating "mutable" variables, users can simulate specific policy changes and identify "canaries in the coal mine"—subpopulations where the model is most likely to fail. While limited by the variation present in the original dataset, this method provides a statistically rigorous way to bridge the gap between model development and safe deployment.

Summary updated

BibTeX
@inproceedings{subbaswamy2021evaluating,
  author = {Adarsh Subbaswamy and Roy Adams and Suchi Saria},
  title = {{Evaluating Model Robustness and Stability to Dataset Shift}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=iim8htlnTpR},
}
Figure