← 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).

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 and pretraining scale (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 tab:uq-sota summarizes the main method families and the metrics each one reports.

Reported results for the main uncertainty-quantification methods on deep nets. ECE is expected calibration error (lower is better, 15-bin equal-width on CIFAR / ImageNet). NLL is negative log-likelihood on the held-out test set. AUROC is OOD-detection area under the ROC curve (CIFAR-10 in-distribution vs. SVHN out-of-distribution, higher is better). Coverage reports the empirical coverage of a prediction set at target 1−α=0.91 - \alpha = 0.9. Read this as a composite drawn from separate papers, not a head-to-head study: the per-row citation names the paper that introduced the method, and does not certify that the digits on that row are the ones it printed, since backbone (ResNet-110, ResNet-50, DenseNet-BC and WideResNet all appear), calibration split and binning scheme differ between sources. The Mahalanobis row is a DenseNet with input pre-processing and multi-layer aggregation, which is why it sits above the logit-space detectors. For a matched head-to-head comparison under a single protocol, see the shift benchmark of (Ovadia et al. 2019). Blank cells mean the method does not report that metric.
Method ECE (CIFAR-100) NLL (CIFAR-100) AUROC (C10 vs. SVHN) Coverage @ 0.9
Softmax baseline (Hendrycks and Gimpel 2017) 16.5% 1.15 89.9 -
Temperature scaling (Guo et al. 2017) 2.1% 0.94 90.1 -
Histogram binning (Guo et al. 2017) 2.8% 1.02 - -
Platt / vector scaling (Platt 1999) 4.5% 0.99 - -
Verified calibration (KLM) (Kumar et al. 2019) 1.9% 0.92 - -
Deep ensemble (5 models) (Lakshminarayanan et al. 2017) 1.5% 0.78 93.7 -
ODIN (T=1000, eps=0.0014) (Liang et al. 2018) - - 96.7 -
Energy score (Liu et al. 2020) - - 98.5 -
Mahalanobis, DenseNet (Lee et al. 2018) - - 99.8 -
Likelihood ratios (genomic) (Ren et al. 2019) - - 89.0 -
Split conformal (APS) (Angelopoulos and Bates 2021) - - - 0.901
CQR (conformalized QR) (Romano et al. 2019) - - - 0.901
Weighted conformal (cov-sh) (Tibshirani et al. 2019) - - - 0.903

Three methodological observations follow from the table. 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.
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.
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: the standard 15-bin equal-width estimator can differ from a 15-bin equal-mass estimator by 0.5-1.0 percentage points on CIFAR-100 ResNets (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.↩︎

  3. Near-OOD vs far-OOD: the CIFAR-10 vs SVHN benchmark is far-OOD (different image domain, different label space) and is empirically easy; near-OOD benchmarks like CIFAR-10 vs CIFAR-100 (same image domain, disjoint label space) are 10-20 AUROC points harder for every detector and are arguably more diagnostic of deployment-time behavior. Reporting only far-OOD numbers (the historical default) overstates progress.↩︎