NOMU: Neural Optimization-based Model Uncertainty

Jakob Heiss, Jakob Weissteiner, Hanna S. Wutte, Sven Seuken, Josef Teichmann

TL;DR

NOMU (Neural Optimization-based Model Uncertainty) is a novel framework for estimating epistemic uncertainty in neural networks by directly enforcing theoretical "desiderata" through a specialized architecture and loss function. Unlike standard methods like MC Dropout that often fail in data-scarce, noiseless settings, NOMU provides reliable uncertainty bounds that significantly improve performance in high-stakes tasks like Bayesian Optimization.

What Problem Does This Paper Address?

Quantifying what a model doesn't know—epistemic or model uncertainty—is crucial for active learning and Bayesian Optimization (BO). While Bayesian Neural Networks (BNNs) are the theoretical gold standard, they are often computationally prohibitive. In practice, researchers use "shortcuts" like Monte Carlo (MC) Dropout or Deep Ensembles.

However, the authors uncover a major issue: these popular benchmarks often fail to capture basic properties of model uncertainty when data is scarce and noise is negligible. For example, MC Dropout often produces "tubular" uncertainty bounds that don't narrow at training points, meaning the model remains uncertain even about data it has already seen. This leads to poor exploration strategies in BO, where the algorithm might get "bored" or stuck in local optima because it cannot distinguish between known and unknown regions.

Methods

The authors propose NOMU, which moves away from trying to approximate a complex Bayesian posterior and instead directly optimizes for five key desiderata:

  1. Non-Negativity: Uncertainty must be $\ge 0$.
  2. In-Sample: In noiseless settings, uncertainty at training points should be exactly zero.
  3. Out-of-Sample: Uncertainty should increase as you move away from training data.
  4. Metric Learning: The model should learn which features are important for uncertainty (e.g., changing a core feature should increase uncertainty more than changing an irrelevant background detail).
  5. Vanishing: Uncertainty should go to zero as the number of training points approaches infinity.

The Architecture

NOMU uses a modular design with two sub-networks: an $\hat{f}$-network for the actual prediction and an $r_{\hat{f}}$-network for raw uncertainty. To achieve "Metric Learning," the uncertainty network is connected to the last hidden layer of the prediction network, allowing it to reuse features that the model has already deemed important for the task.

NOMU's modular architecture connects the prediction and uncertainty sub-networks to share learned features.

The Loss Function

The "secret sauce" is a carefully designed loss function with three terms:

  • Term (a): Standard regression loss to ensure accurate predictions.
  • Term (b): Minimizes uncertainty at training points (enforcing the In-Sample desideratum).
  • Term (c): An exponential term that pushes uncertainty toward infinity across the entire input space.

The interplay between terms (b) and (c), combined with standard regularization, naturally forces uncertainty to grow as the model moves away from observed data points.

Datasets

The authors evaluated NOMU across a wide range of settings:

  • 1D/2D Synthetic Functions: Classic benchmarks like the Levy, Forrester, and Sine functions to visualize uncertainty behavior.
  • Generative Test-bed: A novel benchmark where 200 datasets are sampled from a true BNN prior, allowing for a direct comparison against the "exact" Bayesian posterior.
  • Real-world Time Series: Solar irradiance data used to test the "Vanishing" property in a high-data regime.
  • UCI Regression Benchmarks: Standard real-world datasets (Boston Housing, Concrete, etc.) to show performance in noisy, high-dimensional settings.
  • High-Dimensional BO: Benchmarks ranging from 5 to 20 dimensions.

Key Insights and Ideas

  • Direct Enforcement vs. Approximation: NOMU's primary "aha moment" is that we don't need to perfectly approximate a BNN posterior to get useful uncertainty. By directly enforcing the properties we want that posterior to have, we get more robust results.
  • The Failure of MC Dropout: The paper provides striking visual evidence that MC Dropout's Bayesian interpretation doesn't hold up in practice for data-scarce settings. It consistently fails the "In-Sample" desideratum.
  • Feature-Aware Uncertainty: By sharing hidden layers, NOMU learns a task-specific distance metric. It understands that being "far" from data in a relevant feature dimension is more important than being far in an irrelevant one.
Comparison on the Levy function: NOMU's bounds (blue) tighten at data points and expand in gaps, whereas MC Dropout (green) remains a constant "tube."

Key Results

  • Consistency: In 1D regression tasks, NOMU was the only algorithm that never ranked worse than 3rd across ten different functions. Benchmarks like Deep Ensembles often produced arbitrary or "random" uncertainty shapes.
  • Posterior Approximation: On the generative test-bed, NOMU significantly outperformed MC Dropout and Deep Ensembles in approximating the true BNN posterior across 1D, 2D, and 5D tasks.
  • Bayesian Optimization: NOMU outperformed all benchmarks (including Gaussian Processes) in average final regret for 5D, 10D, and 20D optimization tasks. It is particularly effective at avoiding local optima by correctly identifying "known" regions.

Limitations and Future Work

While NOMU excels in noiseless, data-scarce environments, the current version does not explicitly model aleatoric (data) noise, though it performs surprisingly well on noisy UCI datasets regardless. The authors suggest that future iterations could incorporate a third output for data noise. Additionally, extending the NOMU loss to other architectures like CNNs or Transformers and applying it to classification tasks are promising next steps.

Summary updated

Abstract

We study methods for estimating model uncertainty for neural networks (NNs) in regression. To isolate the effect of model uncertainty, we focus on a noiseless setting with scarce training data. We introduce five important desiderata regarding model uncertainty that any method should satisfy. However, we find that established benchmarks often fail to reliably capture some of these desiderata, even those that are required by Bayesian theory. To address this, we introduce a new approach for capturing model uncertainty for NNs, which we call Neural Optimization-based Model Uncertainty (NOMU). The main idea of NOMU is to design a network architecture consisting of two connected sub-NNs, one for model prediction and one for model uncertainty, and to train it using a carefully-designed loss function. Importantly, our design enforces that NOMU satisfies our five desiderata. Due to its modular architecture, NOMU can provide model uncertainty for any given (previously trained) NN if given access to its training data. We evaluate NOMU in various regressions tasks and noiseless Bayesian optimization (BO) with costly evaluations. In regression, NOMU performs at least as well as state-of-the-art methods. In BO, NOMU even outperforms all considered benchmarks.
BibTeX
@inproceedings{heiss2022nomu,
  author = {Jakob Heiss and Jakob Weissteiner and Hanna S. Wutte and Sven Seuken and Josef Teichmann},
  title = {{NOMU: Neural Optimization-based Model Uncertainty}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=S42gyD7GRV},
}
Figure