Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Two reasons to be unsure
A rover’s slip sensor gives a slightly different reading every time on the same patch of gravel: that scatter is aleatoric uncertainty, from the Latin for dice. Driving over more gravel will not make it go away. On sand the rover has never seen, its slip model is simply guessing: that is epistemic uncertainty, uncertainty from lack of knowledge, and a few test drives on sand would reduce it. A good model reports both, and says which is which. The demo shows the two bands: drag the number of samples and watch only one of them shrink.
Separating the two decides the action: epistemic uncertainty says collect data, ask a human or fall back to a safe controller; aleatoric uncertainty says widen margins, filter, or buy a better sensor. Active learning, safe exploration and out-of-distribution alarms all use the epistemic part.
- 1. Sensor noise that stays the same no matter how much data you collect is…
- 2. Uncertainty about terrain the model has never seen is…
- 3. Which kind shrinks as you collect more relevant data?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The two decompositions
- Setting: a model with parameters θ (or an ensemble of M models) predicts p(y | x, θ). The predictive distribution averages over what is unknown: p(y | x, D) = E over θ ~ p(θ | D) of p(y | x, θ).
- Regression (law of total variance): Var[y | x] = E_θ[Var(y | x, θ)] + Var_θ[E(y | x, θ)].
- First term: aleatoric, the noise each model predicts, averaged.
- Second term: epistemic, how much the models disagree about the mean.
- Example: four ensemble members predict means 2.0, 2.2, 1.8, 2.0 with variances 0.04, 0.05, 0.03, 0.04. Aleatoric = 0.04, epistemic = 0.02, total = 0.06.
- Classification (entropy decomposition): H[E_θ p] = E_θ H[p] + I(y; θ | x, D).
- Total entropy of the averaged prediction = expected entropy (aleatoric) + mutual information between label and parameters (epistemic, the BALD score of Houlsby et al., 2011).
- Two members predicting 0.9 and 0.1: total H(0.5) = 0.693 nats, aleatoric H(0.9) = 0.325, epistemic 0.368.
- Two members both predicting 0.5: total 0.693, all aleatoric, epistemic 0.
- Simplest case: the mean of n observations with known noise variance σ². A new observation has predictive variance σ² + σ²/n: aleatoric σ², epistemic σ²/n. With σ² = 4 and n = 4 that is 4 + 1 = 5.
- Homoscedastic vs heteroscedastic: aleatoric noise may be constant or depend on x (a dust storm, a grazing viewing angle). Heteroscedastic models predict a variance σ²(x) as well as a mean.
- Calibration check: a 90% Gaussian interval μ ± 1.645 σ should contain 90% of new observations. If the predicted sd is half the truth it contains only 58.9%.
- 1. In the law of total variance, the variance of the predicted means is…
- 2. The mutual information between label and parameters is zero when…
- 3. Predictive variance for the mean of n samples with noise σ² is…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Estimating both parts
Exercise 1.
- Split ensemble predictions into aleatoric and epistemic variance.
- Split classification entropy into expected entropy and mutual information.
- Measure the empirical coverage of Gaussian intervals.
Practice.
- Aleatoric: train a heteroscedastic head that outputs a mean and a log-variance with the Gaussian negative log-likelihood (Nix and Weigend, 1994; Kendall and Gal, 2017). Use the β-NLL variant (Seitzer et al., 2022) if the variance head starves the mean fit.
- Epistemic: a Bayesian posterior (GPs, Laplace, VI, MCMC) or a deep ensemble of 5 independently initialised networks (Lakshminarayanan et al., 2017); MC dropout is cheaper but usually weaker.
- Combine them with the law of total variance, or with the entropy decomposition for classifiers.
- Validate on held-out data: coverage of intervals, NLL, and calibration curves, checked separately in-distribution and on shifted data.
- Report which part dominates where. Large epistemic regions are candidates for new data (active learning) or for refusing to act.
import torch, torch.nn as nn
class HeteroNet(nn.Module): # one ensemble member: mean and log-variance heads
def __init__(s, d, h=64):
super().__init__(); s.body = nn.Sequential(nn.Linear(d, h), nn.SiLU(), nn.Linear(h, h), nn.SiLU())
s.mu, s.logvar = nn.Linear(h, 1), nn.Linear(h, 1)
def forward(s, x): z = s.body(x); return s.mu(z), s.logvar(z).clamp(-10, 5)
nll = lambda mu, lv, y: (0.5 * (lv + (y - mu) ** 2 / lv.exp())).mean() # Gaussian NLL
# after training 5 members: mus, lvs of shape (5, N, 1)
# aleatoric = lvs.exp().mean(0); epistemic = mus.var(0, unbiased=False); total = aleatoric + epistemic- 1. A deep ensemble estimates epistemic uncertainty from…
- 2. A heteroscedastic head is trained with…
- 3. Coverage should be checked…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Where the split comes from. For any joint distribution of y and θ, Var[y] = E[Var(y | θ)] + Var[E(y | θ)] (tower property). With entropy, H[y] = H[y | θ] + I(y; θ). Both say: total = what remains if you knew the model + what you would learn about y by learning the model. The first term is aleatoric relative to the model class; the second is epistemic.
Epistemic uncertainty shrinks at rate 1/n. For Bayesian linear regression with features φ(x), the epistemic variance φᵀ S φ with S = (αI + Φᵀ W Φ)⁻¹ decreases roughly like 1/n wherever the training data put mass, because ΦᵀWΦ grows linearly in n. Where the data put no mass, nothing constrains the weights and the variance stays near the prior.
The split is model-relative. Hüllermeier and Waegeman (2021) stress that the boundary moves with the hypothesis space. A model that is too simple turns systematic error into apparent aleatoric noise; an input that is not observed (a missing feature) makes real-world variability look aleatoric. Der Kiureghian and Ditlevsen (2009) make the same point for engineering reliability: the labels are a modelling choice that should be stated.
Known weaknesses.
- The mutual-information split is not a clean separation: Wimmer et al. (2023) show the entropy terms can move together. Variance-based and entropy-based measures can rank inputs differently.
- The aleatoric estimate is itself learned. Away from data the variance head extrapolates arbitrarily, so a model can report small aleatoric and small epistemic uncertainty at the same time (shown in Exercise 2).
- Approximate posteriors (MC dropout, mean-field VI) tend to underestimate epistemic uncertainty; in a large benchmark under dataset shift, deep ensembles were the most reliable (Ovadia et al., 2019).
- 1. The law of total variance follows from…
- 2. A model that is too simple tends to report its systematic error as…
- 3. Where there is no data, a learned variance head…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How do aleatoric and epistemic uncertainty behave as data grow, and in regions without data?
History.
- D. Nix and A. Weigend, “Estimating the mean and variance of the target probability distribution” (1994).
- N. Houlsby, F. Huszár, Z. Ghahramani and M. Lengyel, “Bayesian active learning for classification and preference learning” (2011): the mutual-information (BALD) score.
- A. Kendall and Y. Gal, “What uncertainties do we need in Bayesian deep learning for computer vision?” (2017).
- S. Depeweg et al., “Decomposition of uncertainty in Bayesian deep learning for efficient and risk-sensitive learning” (2018).
- E. Hüllermeier and W. Waegeman, “Aleatoric and epistemic uncertainty in machine learning: an introduction to concepts and methods” (2021).
Exercise 2. A 1-D regression problem with a gap.
- Truth: f(x) = sin(1.5x) + 0.3x with noise sd rising from 0.1 at x = −3 to 0.7 at x = 3.
- Training inputs: n points uniform on [−3, −1] ∪ [1, 3], with n = 25, 100, 400 and 1600. The interval (−1, 1) is a gap.
- Model: Bayesian linear regression on 25 Gaussian bumps plus a bias (prior N(0, 1)) for the mean, with a second ridge regression on log squared residuals for the noise variance (adding 1.27 to correct for E[log χ²₁] = −1.27), iterated 4 times.
- Measures: on 4000 fresh test points, the average epistemic variance φᵀSφ and aleatoric variance σ̂²(x) in the data region (1 ≤ |x| ≤ 3) and in the gap (|x| ≤ 0.7), and the coverage of 90% intervals built from the total, aleatoric-only or epistemic-only variance.
| n | epistemic (data) | aleatoric (data, true 0.206) | coverage total / aleatoric-only / epistemic-only (data) | epistemic (gap) | aleatoric (gap, true 0.162) | coverage total / aleatoric-only (gap) |
|---|---|---|---|---|---|---|
| 25 | 0.0496 | 0.222 | 0.842 / 0.765 / 0.515 | 1.219 | 0.018 | 0.993 / 0.14 |
| 100 | 0.0136 | 0.149 | 0.861 / 0.842 / 0.307 | 0.586 | 0.196 | 0.997 / 0.90 |
| 400 | 0.0035 | 0.171 | 0.871 / 0.868 / 0.183 | 0.334 | 0.134 | 0.976 / 0.783 |
| 1600 | 0.0012 | 0.211 | 0.895 / 0.894 / 0.11 | 0.222 | 0.846 | 1.0 / 0.996 |
- Epistemic variance among the data fell about 41-fold for 64 times more data, close to the 1/n rate; in the gap it fell only 5.5-fold, because no point lies there.
- Aleatoric variance did not fall: it converged to the true noise (0.211 vs 0.206). At n = 1600 the total interval is essentially the aleatoric one, and epistemic-only intervals cover just 11%.
- In the gap, aleatoric-only intervals failed at small n (14% coverage at n = 25); total intervals covered 97.6–100% there, conservative but safe.
- Negative result: the aleatoric estimate in the gap was erratic, from 0.018 to 0.846 against a true 0.162, and did not improve with n. The noise model has epistemic uncertainty of its own that the split ignores.
- Seeds 1 and 2: epistemic (data, n = 1600) 0.0013 and 0.0012; total coverage 0.894 and 0.898; gap aleatoric estimates again ranged widely (0.057 to 0.511).
Aleatoric and epistemic uncertainty in AI, robotics and aerospace
- Safe control: learned dynamics models (PETS, Chua et al., 2018) use ensembles for epistemic uncertainty and heteroscedastic heads for process noise; planners penalise the epistemic part.
- Perception: Kendall and Gal’s per-pixel aleatoric maps flag reflective surfaces and object boundaries in depth and segmentation; epistemic maps flag unfamiliar scenes.
- Earth observation: retrieval products (e.g. biomass, soil moisture) report per-pixel uncertainty; the epistemic part is largest in biomes missing from the training set.
- Active learning and test planning: BALD picks the next sample, simulation run or flight test where models disagree most.
References
- D. Nix and A. Weigend (1994). “Estimating the mean and variance of the target probability distribution.” IEEE ICNN.
- A. Der Kiureghian and O. Ditlevsen (2009). “Aleatory or epistemic? Does it matter?” Structural Safety, 31.
- N. Houlsby, F. Huszár, Z. Ghahramani and M. Lengyel (2011). “Bayesian active learning for classification and preference learning.” arXiv.
- A. Kendall and Y. Gal (2017). “What uncertainties do we need in Bayesian deep learning for computer vision?” NeurIPS.
- B. Lakshminarayanan, A. Pritzel and C. Blundell (2017). “Simple and scalable predictive uncertainty estimation using deep ensembles.” NeurIPS.
- S. Depeweg, J. M. Hernández-Lobato, F. Doshi-Velez and S. Udluft (2018). “Decomposition of uncertainty in Bayesian deep learning.” ICML.
- Y. Ovadia et al. (2019). “Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift.” NeurIPS.
- E. Hüllermeier and W. Waegeman (2021). “Aleatoric and epistemic uncertainty in machine learning: an introduction to concepts and methods.” Machine Learning, 110.
- M. Seitzer, A. Tavakoli, D. Antic and G. Martius (2022). “On the pitfalls of heteroscedastic uncertainty estimation with probabilistic neural networks.” ICLR.
- L. Wimmer, Y. Sale, P. Hofman, B. Bischl and E. Hüllermeier (2023). “Quantifying aleatoric and epistemic uncertainty in machine learning: are conditional entropy and mutual information appropriate measures?” UAI.