Unified Uncertainty Calibration

Kamalika Chaudhuri, David Lopez-PazarXiv 2023 · DOI · arXiv

Abstract

In high-stakes applications like medical diagnosis and autonomous driving, an AI’s ability to admit uncertainty is as critical as its predictive accuracy. Traditional "reject-or-classify" (RC) strategies treat epistemic uncertainty (model ignorance) and aleatoric uncertainty (data noise) as isolated factors, often resulting in overconfident or miscalibrated models. This paper introduces Unified Uncertainty Calibration (U2C), a holistic framework that integrates both uncertainty types into a single $(c+1)$-dimensional probability vector. By enabling interaction through a shared softmax operation, U2C significantly enhances classification accuracy and calibration across a wide spectrum of distribution shifts.

Introduction: The Challenge of Uncertainty

Current AI systems grapple with two distinct forms of uncertainty. Aleatoric uncertainty refers to the inherent noise in data—for instance, a blurry image that could plausibly belong to multiple classes. Epistemic uncertainty represents the model's lack of knowledge regarding data it hasn't encountered during training, such as an animal classifier being shown a tool.

The conventional approach, known as Reject-or-Classify (RC), handles these separately. It applies a hard threshold to epistemic uncertainty to decide whether to "abstain" from a prediction. If the model proceeds, it predicts using a standard softmax based on aleatoric factors. This binary separation leads to three primary failures:

  1. Lack of Communication: The two uncertainties do not influence one another, leading to rigid decisions.
  2. Miscalibration: RC often produces binary confidence—either total abstention or absolute certainty—ignoring environmental nuances.
  3. Unit Mismatch: Epistemic scores (e.g., Mahalanobis distance) use different scales than model logits, complicating their integration.

Unified Uncertainty Calibration (U2C)

The U2C framework addresses these issues by appending an "abstain" class (the $c+1$ class) directly to the model's output. The process involves three key steps:

  1. Extended Logits: The original $c$ logits are augmented with a $(c+1)$-th logit derived from the epistemic uncertainty score $u(x)$.
  2. Non-linear Calibration: A learned non-linear function, $\tau_u$, maps raw epistemic scores to the logit space. This is optimized by minimizing cross-entropy on a relabeled validation set where the most uncertain samples are assigned to the "abstain" class.
  3. Unified Softmax: A final softmax is performed over all $c+1$ classes. This normalization allows a high "abstain" logit to naturally suppress the confidence of in-domain classes, facilitating a "soft" interaction between uncertainty types.

Key Insights and the Dunning-Kruger Effect

A significant contribution of this work is identifying the "Dunning-Kruger" region—a failure mode where a model exhibits high confidence despite having seen very little relevant data (high epistemic uncertainty). U2C effectively mitigates this by allowing the calibrated epistemic logit to "outvote" overconfident class logits.

Figure 3: (a) Scatter plot of max logit vs. calibrated epistemic uncertainty highlighting the Dunning-Kruger region (C). (b, c) Distribution of correct and incorrect predictions across aleatoric and epistemic uncertainty for IID and OOD data.

As shown in Figure 3, the interaction between these uncertainties is non-trivial. In the OOD case (c), many incorrect predictions (red) occur when epistemic uncertainty is low but aleatoric uncertainty is high, or vice versa. U2C's unified approach allows the model to adjust its confidence dynamically based on both signals.

Experimental Results

The researchers evaluated U2C across a "full-spectrum" suite of ImageNet benchmarks, including covariate shifts (ImageNet-C/R), near-OOD (NINCO), and far-OOD (iNaturalist) datasets. U2C consistently outperformed the standard RC recipe across various architectures (ResNet, ViT):

  • Calibration: U2C achieved massive reductions in Expected Calibration Error (ECE), improving by up to 26.2% on ImageNet-C.
  • Accuracy: In challenging near-OOD tasks like NINCO, U2C reduced classification error by up to 9.6%.
  • Robustness: Even when raw error rates were comparable, U2C provided significantly more reliable confidence scores.

Conclusion and Future Directions

U2C demonstrates that treating uncertainty as a unified signal rather than a binary switch leads to more robust and trustworthy AI. While the framework currently faces limitations such as "feature myopia" (where models remain blind to features irrelevant to their training), it opens promising avenues for future research. Applying U2C to Large Language Models (LLMs) to aggregate "I don't know" signals token-by-token could be a vital step in preventing hallucinations and improving the reliability of generative AI.

Summary updated

Abstract

To build robust, fair, and safe AI systems, we would like our classifiers to say ``I don't know'' when facing test examples that are difficult or fall outside of the training classes.The ubiquitous strategy to predict under uncertainty is the simplistic \emph{reject-or-classify} rule: abstain from prediction if epistemic uncertainty is high, classify otherwise.Unfortunately, this recipe does not allow different sources of uncertainty to communicate with each other, produces miscalibrated predictions, and it does not allow to correct for misspecifications in our uncertainty estimates. To address these three issues, we introduce \emph{unified uncertainty calibration (U2C)}, a holistic framework to combine aleatoric and epistemic uncertainties. U2C enables a clean learning-theoretical analysis of uncertainty estimation, and outperforms reject-or-classify across a variety of ImageNet benchmarks. Our code is available at: https://github.com/facebookresearch/UnifiedUncertaintyCalibration
BibTeX
@misc{chaudhuri2023unified,
  author = {Kamalika Chaudhuri and David Lopez-Paz},
  title = {{Unified Uncertainty Calibration}},
  year = {2023},
  eprint = {2310.01202},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.01202},
}
Figure