← Back to blogs

Uncertainty Quantification: Predictive Variance, MC Dropout, and Deep Ensembles

Aleatoric and epistemic uncertainty in deep models

The UQ literature for deep nets splits along a methodological axis (how uncertainty is produced) and an operational axis (what guarantee is offered) (Figure fig:uq-taxonomy).

Bayesian methods (BNNs, deep ensembles, MC dropout, Laplace) produce a posterior predictive whose moments decompose into epistemic and aleatoric components (Kendall and Gal 2017; Lakshminarayanan et al. 2017). The cost is extra compute and the usual approximation concerns covered in Part III. Prior networks (Malinin and Gales 2018) reach the same decomposition from the other side, learning a distribution over categorical distributions directly and buying a single-forward-pass score in exchange for an auxiliary OOD training set.

Post-hoc calibration methods (Platt scaling, isotonic regression, temperature scaling (Guo et al. 2017)) are nearly free, a single scalar applied to the softmax logits. They correct the marginal confidence histogram and leave the ranking untouched. How much correction a modern network needs turns out to depend on its architecture family (Minderer et al. 2021), and every fitted calibrator degrades under distribution shift (Ovadia et al. 2019).

Conformal prediction (Vovk et al. 2005; Angelopoulos and Bates 2021) sidesteps the probabilistic modeling question entirely and instead delivers a distribution-free finite-sample coverage guarantee at a target level 1−α1 - \alpha1. The trade-off is that individual set sizes can be large if the base model is poor.

OOD detection is the sister literature that reuses these signals as scores for a binary "in-distribution vs. out-of-distribution" classifier (Hendrycks and Gimpel 2017; Liang et al. 2018; Liu et al. 2020), with a feature-space branch that scores distance from class prototypes rather than logit shape (Lee et al. 2018).

Probabilistic programming languages (Pyro, NumPyro, TFP, Stan) (Bingham et al. 2019; Phan et al. 2019; Tran et al. 2018; Carpenter et al. 2017) are the infrastructure layer that ties posteriors, calibrations, and predictive distributions into one model. Bayesian RL (Ghavamzadeh et al. 2015; Osband et al. 2016; Depeweg et al. 2018) applies the decomposition to a dynamics model and uses the epistemic component as an intrinsic reward driving Thompson sampling and information-directed exploration.

Table 1. Reported results, mixed protocols: ECE (15 equal-width bins) and NLL of a CIFAR-100 ResNet-110 from (Guo et al. 2017) Tables 1 and S3; AUROC on CIFAR-10 vs. SVHN for a WideResNet from (Liu et al. 2020) Table 4 unless the cell cites another paper; coverage at target 0.9 from each row's paper; n/r means not reported.
Method CIFAR-100 ECE CIFAR-100 NLL AUROC (C10 vs. SVHN) Coverage at 0.9
Softmax baseline (Hendrycks and Gimpel 2017) 16.53% 1.498 91.89 n/r
Temperature scaling (Guo et al. 2017) 1.26% 1.044 n/r n/r
Histogram binning (Guo et al. 2017) 2.66% 1.438 n/r n/r
Vector scaling (multiclass Platt) (Platt 1999) 1.32% 1.049 n/r n/r
Deep ensemble (5 models) (Lakshminarayanan et al. 2017) n/r n/r 89.5 (VGG-16, mutual information) (Malinin and Gales 2019) n/r
ODIN (Liang et al. 2018) n/r n/r 91.96 n/r
Energy score (Liu et al. 2020) n/r n/r 90.96 n/r
Mahalanobis, penultimate layer (Lee et al. 2018) n/r n/r 97.62 n/r
Likelihood ratio, PixelCNN++ (Ren et al. 2019) n/r n/r 93.1 (Ren et al. 2019) n/r
CQR, neural net, eleven datasets (Romano et al. 2019) n/r n/r n/r 0.9005
Weighted conformal, airfoil, oracle weights (Tibshirani et al. 2019) n/r n/r n/r 0.908

Three methodological observations follow from the reported results (Table 1). First, post-hoc calibration dominates accuracy-matched cost: one extra scalar parameter (the temperature TT) reduces ECE by roughly an order of magnitude on CIFAR-100 at zero accuracy cost2 (Guo et al. 2017), making temperature scaling the default first step for any deployed classifier. Second, OOD detection and calibration are separate problems: a perfectly calibrated model can still fail catastrophically on inputs from outside the training distribution (ImageNet-trained ResNet assigns confident softmax to texture noise), which is why the OOD literature designs a different score (energy, ODIN, likelihood-ratio) rather than reading off softmax confidence. Third, conformal prediction is orthogonal to both: it wraps any base model and converts its score into a set with exact marginal coverage, regardless of whether the score was calibrated or how the model was trained.

Historical Notes

The separation of reducible from irreducible uncertainty predates deep learning by centuries. Laplace's Essai philosophique sur les probabilités (1814) distinguishes between "ignorance of the causes" (epistemic) and "inherent variability" (aleatoric) in the context of classical mechanics. Knight's Risk, Uncertainty, and Profit (1921) made the same distinction in economics, calling the epistemic component true uncertainty and the aleatoric component risk. In machine learning, the distinction was re-introduced by (Neal 1996) in the context of Bayesian neural networks: the posterior variance over weights is epistemic, the likelihood variance (observation noise) is aleatoric. Modern deep-learning UQ is thus not a new paradigm but a practical engineering of ideas that have been known for generations.

Calibration as a desideratum goes back at least to Brier's (1950) meteorological scoring rule, which rewarded reliable probabilistic forecasts of rain. Platt (1999) (Platt 1999) was the first to apply calibration to machine-learning classifiers (SVMs). The "deep learning is overconfident" observation by (Guo et al. 2017) was partly a rediscovery of the same phenomenon that had been noted in boosted trees and had been partly understood as a general property of margin-maximizing classifiers.

Conformal prediction originated in (Vovk et al. 2005), who developed the theory for online sequential prediction with exchangeability. The framework was largely unknown outside the learning-theory community until (Angelopoulos and Bates 2021) wrote an accessible tutorial for deep-learning practitioners, triggering rapid adoption. The tutorial paper became the most-cited introduction to conformal prediction within three years of publication, showing that exposition can be as impactful as novel theory in moving a field.

OOD detection has its roots in the anomaly detection literature (Chandola et al. 2009 survey) but became a deep-learning-specific research program with (Hendrycks and Gimpel 2017), who framed it as a binary classification task with a specific evaluation protocol (CIFAR-10 vs. SVHN, TinyImageNet vs. LSUN). The AUROC/FPR-at-95-TPR metrics became the de facto OOD benchmark3.

References

Angelopoulos, Anastasios N., and Stephen Bates. 2021. "A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification." arXiv Preprint arXiv:2107.07511. https://arxiv.org/abs/2107.07511.
Bingham, Eli, Jonathan P. Chen, Martin Jankowiak, et al. 2019. "Pyro: Deep Universal Probabilistic Programming." Journal of Machine Learning Research 20 (28): 1-6.
Carpenter, Bob, Andrew Gelman, Matthew D. Hoffman, et al. 2017. "Stan: A Probabilistic Programming Language." Journal of Statistical Software 76 (1): 1-32. https://doi.org/10.18637/jss.v076.i01.
Depeweg, Stefan, José Miguel Hernández-Lobato, Finale Doshi-Velez, and Steffen Udluft. 2018. "Decomposition of Uncertainty in Bayesian Deep Learning for Efficient and Risk-Sensitive Learning." Proceedings of the 35th International Conference on Machine Learning, 1184-93. https://arxiv.org/abs/1710.07283.
Ghavamzadeh, Mohammad, Shie Mannor, Joelle Pineau, and Aviv Tamar. 2015. "Bayesian Reinforcement Learning: A Survey." Foundations and Trends in Machine Learning 8 (5-6): 359-483. https://doi.org/10.1561/2200000049.
Guo, Chuan, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. 2017. "On Calibration of Modern Neural Networks." Proceedings of the 34th International Conference on Machine Learning, 1321-30. https://arxiv.org/abs/1706.04599.
Hendrycks, Dan, and Kevin Gimpel. 2017. "A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks." International Conference on Learning Representations. https://arxiv.org/abs/1610.02136.
Hendrycks, Dan, Mantas Mazeika, and Thomas Dietterich. 2019. "Deep Anomaly Detection with Outlier Exposure." ICLR. https://arxiv.org/abs/1812.04606.
Kendall, Alex, and Yarin Gal. 2017. "What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?" NeurIPS.
Kumar, Ananya, Percy Liang, and Tengyu Ma. 2019. "Verified Uncertainty Calibration." Advances in Neural Information Processing Systems 32. https://arxiv.org/abs/1909.10155.
Lakshminarayanan, Balaji, Alexander Pritzel, and Charles Blundell. 2017. "Simple and Scalable Predictive Uncertainty Estimation Using Deep Ensembles." NeurIPS.
Lee, Kimin, Kibok Lee, Honglak Lee, and Jinwoo Shin. 2018. "A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks." NeurIPS.
Liang, Shiyu, Yixuan Li, and R. Srikant. 2018. "Enhancing the Reliability of Out-of-Distribution Image Detection in Neural Networks." International Conference on Learning Representations. https://arxiv.org/abs/1706.02690.
Liu, Weitang, Xiaoyun Wang, John D. Owens, and Yixuan Li. 2020. "Energy-Based Out-of-Distribution Detection." NeurIPS.
Malinin, Andrey, and Mark Gales. 2018. "Predictive Uncertainty Estimation via Prior Networks." Advances in Neural Information Processing Systems 31. https://arxiv.org/abs/1802.10501.
Malinin, Andrey, and Mark Gales. 2019. "Reverse KL-Divergence Training of Prior Networks: Improved Uncertainty and Adversarial Robustness." NeurIPS. https://arxiv.org/abs/1905.13472.
Minderer, Matthias, Josip Djolonga, Rob Romijnders, et al. 2021. "Revisiting the Calibration of Modern Neural Networks." Advances in Neural Information Processing Systems 34. https://arxiv.org/abs/2106.07998.
Neal, Radford M. 1996. Bayesian Learning for Neural Networks. Springer.
Osband, Ian, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. 2016. "Deep Exploration via Bootstrapped DQN." NeurIPS.
Ovadia, Yaniv, Emily Fertig, Jie Ren, et al. 2019. "Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift." NeurIPS.
Phan, Du, Neeraj Pradhan, and Martin Jankowiak. 2019. "Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro." arXiv Preprint arXiv:1912.11554. https://arxiv.org/abs/1912.11554.
Platt, John. 1999. "Probabilistic Outputs for Support Vector Machines and Comparisons to Regularized Likelihood Methods." In Advances in Large Margin Classifiers, edited by A. Smola, P. Bartlett, B. Scholkopf, and D. Schuurmans. MIT Press.
Ren, Jie, Peter J. Liu, Emily Fertig, et al. 2019. "Likelihood Ratios for Out-of-Distribution Detection." Advances in Neural Information Processing Systems 32. https://arxiv.org/abs/1906.02845.
Romano, Yaniv, Evan Patterson, and Emmanuel J. Candès. 2019. "Conformalized Quantile Regression." Advances in Neural Information Processing Systems 32. https://arxiv.org/abs/1905.03222.
Tibshirani, Ryan J., Rina Foygel Barber, Emmanuel J. Candès, and Aaditya Ramdas. 2019. "Conformal Prediction Under Covariate Shift." Advances in Neural Information Processing Systems 32. https://arxiv.org/abs/1904.06019.
Tran, Dustin, Matthew D. Hoffman, Dave Moore, et al. 2018. "Simple, Distributed, and Accelerated Probabilistic Programming." Advances in Neural Information Processing Systems 31. https://arxiv.org/abs/1811.02091.
Vovk, Vladimir, Alexander Gammerman, and Glenn Shafer. 2005. Algorithmic Learning in a Random World. First. Springer.

  1. Conformal exchangeability requirement: split conformal's marginal-coverage guarantee assumes calibration and test points are exchangeable (e.g., i.i.d. from the same distribution); the guarantee fails outright under covariate shift, label shift, or temporal drift. Weighted conformal (Tibshirani et al. 2019) restores coverage when the shift's likelihood ratio is known, but the ratio itself is rarely available in practice.↩︎

  2. ECE bin-choice sensitivity: with 15 bins the calibration error of a recalibrated ImageNet VGG16 reads about 0.02, while finer binning shows it is at least twice as high (Kumar et al. 2019), so reported ECE numbers are only comparable across papers that fix the same binning scheme. Adaptive binning (one bin per quantile, plus debiased estimators) reduces variance but is not yet the field default.↩︎