Quantifying Uncertainty in the Presence of Distribution Shifts

Yuli Slavutsky, David M. Blei

TL;DR

Neural networks are great at making predictions but often fail to tell us how confident they are, especially when the data they see in the real world differs from their training data. This paper introduces VIDS, a Bayesian approach that explicitly models these "distribution shifts" to provide more reliable uncertainty estimates, leading to better performance and calibration on shifted data.

What Problem Does This Paper Address?

Modern machine learning models, particularly deep neural networks, have achieved remarkable success in various tasks. However, a critical limitation is their often unreliable uncertainty estimation. This is especially problematic in real-world applications like medicine, where a model's confidence in its prediction can be as important as the prediction itself. A major challenge arises when the distribution of input data at test time differs from the distribution of data the model was trained on – a phenomenon known as "distribution shift" or "covariate shift." In such scenarios, even if a model makes accurate predictions on its training data, its uncertainty estimates can become wildly inaccurate, potentially leading to harmful decisions. Existing methods often struggle to capture this shift-induced uncertainty, either by relying on fixed priors or by using distance-based measures that don't always correlate with performance degradation.

Methods

The core innovation of VIDS lies in its Bayesian framework that explicitly accounts for covariate shifts. Instead of using a fixed prior distribution over the model's parameters, VIDS employs an adaptive prior that is conditioned on both the training data and the new test covariates ($p(\theta | X_{1:n}, x^*)$). This adaptive prior allows the model to increase its uncertainty for inputs that are far from the training distribution, reflecting the expected drop in predictive performance.

To efficiently compute the resulting posterior predictive distribution, VIDS utilizes amortized variational inference. This means they train a network that, given a test covariate $x^*$, can directly output an approximate posterior distribution for the model parameters. This avoids the need to re-run inference for every new test point.

A key practical challenge is that shifted test data is often unavailable during training. VIDS addresses this by creating synthetic environments through bootstrap sampling from the original training data. These synthetic environments simulate a range of plausible covariate shifts, allowing the model to learn to be robust across various potential shifts. The training objective is then adapted to balance performance across these synthetic environments.

Datasets

The paper evaluates VIDS on both synthetic and real-world datasets:

  • Synthetic Data:
    • Heteroscedastic linear regression.
  • Logistic regression with missing data.
  • Real-world Data:
    • Classification:
      • Corrupted CIFAR-10 (using defocus blur, glass blur, and contrast corruptions).
  • Celeb-A (with shifts induced by different attribute annotations, e.g., "Pale Skin" to "Blond Hair").
  • Regression: * Boston housing dataset.
  • Concrete compressive strength dataset.
  • Wine quality dataset.

Key Insights and Ideas

  • Adaptive Priors are Crucial for Shifted Data: The paper's central idea is that uncertainty should not just stem from uncertainty about model parameters, but also from how far a new data point is from the training distribution. An adaptive prior that depends on test covariates is key to capturing this.
  • Synthetic Environments for Robustness: By creating synthetic datasets that mimic covariate shifts, VIDS learns to generalize better and provide more reliable uncertainty estimates even when faced with unseen shifts. This is a clever way to train for robustness without needing actual shifted test data during training.
  • Balancing Performance Across Shifts: The VIDS objective function balances predictive performance with uncertainty estimation across multiple synthetic environments. This ensures the model doesn't just perform well on one type of shift but is robust to a range of them.
  • VIDS Captures Variance Structure: In experiments, VIDS is shown to be better at capturing the true variance structure of the data, especially in heteroscedastic (non-constant variance) scenarios, leading to more accurate uncertainty estimates.

Key Results

VIDS consistently outperforms existing methods (DUE, SNGP, DUL) in terms of:

  • Predictive Accuracy: Achieves higher accuracy in classification tasks and lower RMSE in regression tasks across various synthetic and real-world datasets. For example, on CIFAR-C, VIDS achieves higher accuracy in all 6 classification experiments. On UCI regression datasets, VIDS achieves the lowest average RMSE.
  • Uncertainty Calibration: VIDS provides more accurate and reliable uncertainty estimates, especially under distribution shifts. It correctly models higher uncertainty in the "unseen" regions of the data distribution.
  • Robustness: VIDS demonstrates superior robustness to covariate shifts compared to other methods.

Limitations and Future Work

  • Computational Cost: The paper notes that for smaller models (like linear regression), VIDS can be more computationally expensive due to per-environment optimization. However, for larger models, it can have an advantage.
  • Synthetic Environment Design: While synthetic environments are effective, the paper acknowledges that it's still an open question which specific synthetic environments best approximate unknown real-world shifts.
  • Future Work: The paper suggests exploring more sophisticated ways to construct synthetic environments and potentially extending the framework to other types of distribution shifts beyond covariate shifts.

Summary updated

BibTeX
@inproceedings{slavutsky2025quantifying,
  author = {Yuli Slavutsky and David M. Blei},
  title = {{Quantifying Uncertainty in the Presence of Distribution Shifts}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=04p7u1gIsv},
}
Figure