DEUP: Direct Epistemic Uncertainty Prediction

Salem Lahlou, Moksh Jain, Hadi Nekoei, Victor Ion Butoi, Paul Bertin, Jarrid Rector-Brooks, Maksym Korablyov, Yoshua Bengio

TL;DR

Standard methods for estimating epistemic uncertainty rely on the variance of a model's predictions, but they completely miss errors caused by model misspecification (bias). This paper introduces DEUP (Direct Epistemic Uncertainty Prediction), a framework that directly estimates epistemic uncertainty by training a secondary "error predictor" to map out-of-sample generalization errors. DEUP significantly improves exploration and decision-making in sequential optimization, reinforcement learning, and out-of-distribution detection.

What Problem Does This Paper Address?

When deploying machine learning models in high-stakes or interactive environments (like active learning or reinforcement learning), knowing what the model doesn't know—its epistemic uncertainty (EU)—is crucial.

The machine learning community typically estimates EU using discrepancy-based methods, such as the variance of a Gaussian Process (GP) or Deep Ensembles. However, the authors point out a major pitfall: epistemic uncertainty actually consists of two parts:

  1. Approximation uncertainty: Lack of knowledge due to a finite training dataset.
  2. Model uncertainty (or bias): Lack of knowledge because the chosen model class cannot perfectly represent the true data-generating process (model misspecification).

Traditional variance-based methods only capture approximation uncertainty. If an entire ensemble of neural networks or a GP is misspecified, they can all agree on a wrong prediction, yielding a variance of nearly zero. This leads to dangerous overconfidence, causing active learners or RL agents to get stuck in suboptimal regions because they don't realize they are wrong.

Figure 2: Graphical representations of the two components of epistemic uncertainty. Inspired by Fig. 4 of Hüllermeier & Waege- man (2019).

Methods

Instead of relying on the internal disagreement of a model, DEUP proposes to estimate epistemic uncertainty by directly predicting the excess risk—the gap between a predictor's generalization error and the irreducible intrinsic noise (aleatoric uncertainty).

The core DEUP framework operates as follows:

  1. Train the Main Predictor: Train your primary model on the available dataset.
  2. Train an Error Predictor: Train a secondary model (the error predictor) to estimate the point-wise out-of-sample loss (risk) of the main predictor.
  3. Subtract Aleatoric Uncertainty: If an estimate of aleatoric uncertainty is available, subtract it from the predicted risk to isolate the epistemic uncertainty. Otherwise, the predicted risk serves as a conservative upper bound.

Handling Interactive Settings

In interactive settings like Reinforcement Learning (RL) or Sequential Model Optimization (SMO), the data distribution shifts as the agent collects new samples. To help the error predictor generalize across changing datasets, the authors introduce stationarizing features as inputs to the secondary model. These features include:

  • The raw input $x$.
  • A density estimate of the training data $\hat{q}(x|z^N)$.
  • The main model's internal variance estimate $\hat{V}(x)$.
  • A binary indicator showing whether the point was already seen in the training set.

To kickstart the error predictor before interactive data collection begins, DEUP utilizes a $K$-fold cross-validation strategy on the initial dataset to generate out-of-sample error targets.

Datasets

The authors evaluated DEUP across a diverse set of synthetic and real-world benchmarks:

  • Synthetic Optimization Functions: 1D multi-modal functions, 2D Levi N.13 function, and high-dimensional (10D to 100D) Ackley functions.
  • Reinforcement Learning: The classic CartPole environment from the bsuite benchmark.
  • Real-World Regression: DrugComb and LINCS L1000, used to predict the synergistic effects of anti-cancer drug combinations.
  • Image Classification & OOD Detection: CIFAR-10 (training/in-distribution), SVHN (out-of-distribution), and CIFAR-10-C (corrupted images for distribution shift evaluation).

Key Insights and Ideas

  • Misspecification is Everywhere: Even highly flexible models like neural networks or non-parametric GPs suffer from misspecification in practice due to finite compute budgets, early stopping, or the implicit biases of optimization algorithms like SGD.
  • Treating Error as a Regression Target: By framing uncertainty estimation as a standard regression problem on out-of-sample errors, DEUP bypasses complex Bayesian approximations.
  • Leveraging "Flawed" Baselines: DEUP doesn't replace variance-based methods; it can actually use them. By taking a misspecified GP's underestimated variance as an input feature, DEUP learns to map those flawed variances to actual $L_2$ errors, successfully correcting the underestimation.
Figure 1: Top. A GP is fit on (dark blue) points in [0, 0.5] ∪[1.5, 2]. The shaded area represents the GP standard deviation, often used as a measure of epistemic uncertainty: note how it fails badly to enclose the ground function in [0.5, 1.5]. Bottom left. A second GP fit on the same points, with 5 extra points (green crosses). This second GP predicts almost 0 standard deviation everywhere, even though the first GP significantly underestimated the uncertainty in [0.5, 1.5], because no signal is given to the learner that the region [0.5, 1.5] should be explored more. Bottom right. DEUP learns to map the underestimated variances of the first GP to the L2 errors made by that GP, and yields more reasonable uncertainty estimates that should inform the learner of what area to explore.

Key Results

1. Sequential Model Optimization (SMO)

When optimizing complex functions with multiple local maxima, standard GP methods with Expected Improvement (GP-EI) frequently got trapped in local optima. DEUP-EI consistently found the global maximum across 1D, 2D, and high-dimensional (10D/100D) Ackley functions, showing superior robustness to dimensionality.

2. Reinforcement Learning

On the CartPole task, integrating DEUP's uncertainty estimates as an exploration bonus (DEUP-DQN) achieved lower average regret faster than standard DQN ($\epsilon$-greedy), MC-Dropout, and Bootstrapped DQN.

3. Real-World Drug Synergy Prediction

DEUP captured the true order of magnitude of model residuals significantly better than baselines. It achieved a Spearman rank correlation with actual residuals of 0.47, compared to 0.30 for Deep Ensembles and 0.12 for Deterministic Uncertainty Estimation (DUE).

4. Out-of-Distribution Detection

When evaluating ResNet models trained on CIFAR-10 and tested on OOD SVHN data, DEUP achieved the highest rank correlation with the true generalization error:

  • ResNet-18: DEUP achieved an SRCC of 0.426, outperforming Deep Ensembles (0.381) and DUE (0.378).
  • ResNet-50: DEUP achieved an SRCC of 0.465, outperforming Deep Ensembles (0.401).

Limitations and Future Work

  • Computational Overhead: Training a secondary model adds computational cost. While the authors note that training DEUP with density and variance features is computationally on-par with a 5-network Deep Ensemble, scaling this to massive architectures remains a challenge.
  • Aleatoric Uncertainty Dependency: To perfectly isolate epistemic uncertainty, DEUP ideally requires a reliable estimate of aleatoric uncertainty. When replicates are unavailable to calculate data noise, DEUP must rely on a pessimistic upper bound.
  • Feature Selection: Performance is sensitive to the choice of stationarizing features, and the optimal subset of features can vary depending on the specific downstream task.

Summary updated

Abstract

Epistemic Uncertainty is a measure of the lack of knowledge of a learner which diminishes with more evidence. While existing work focuses on using the variance of the Bayesian posterior due to parameter uncertainty as a measure of epistemic uncertainty, we argue that this does not capture the part of lack of knowledge induced by model misspecification. We discuss how the excess risk, which is the gap between the generalization error of a predictor and the Bayes predictor, is a sound measure of epistemic uncertainty which captures the effect of model misspecification. We thus propose a principled framework for directly estimating the excess risk by learning a secondary predictor for the generalization error and subtracting an estimate of aleatoric uncertainty, i.e., intrinsic unpredictability. We discuss the merits of this novel measure of epistemic uncertainty, and highlight how it differs from variance-based measures of epistemic uncertainty and addresses its major pitfall. Our framework, Direct Epistemic Uncertainty Prediction (DEUP) is particularly interesting in interactive learning environments, where the learner is allowed to acquire novel examples in each round. Through a wide set of experiments, we illustrate how existing methods in sequential model optimization can be improved with epistemic uncertainty estimates from DEUP, and how DEUP can be used to drive exploration in reinforcement learning. We also evaluate the quality of uncertainty estimates from DEUP for probabilistic image classification and predicting synergies of drug combinations.
BibTeX
@article{lahlou2023deup,
  author = {Salem Lahlou and Moksh Jain and Hadi Nekoei and Victor Ion Butoi and Paul Bertin and Jarrid Rector-Brooks and Maksym Korablyov and Yoshua Bengio},
  title = {{DEUP: Direct Epistemic Uncertainty Prediction}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2023},
}
Figure