On the Pitfalls of Heteroscedastic Uncertainty Estimation with Probabilistic Neural Networks

Maximilian Seitzer, Arash Tavakoli, Dimitrije Antic, Georg Martius

Introduction

In high-stakes applications such as autonomous driving, robotics, and medical diagnostics, a neural network's ability to quantify its own uncertainty is as critical as its predictive accuracy. Researchers typically distinguish between two types of uncertainty: epistemic (model uncertainty, which decreases with more data) and aleatoric (inherent noise in the data).

To capture heteroscedastic aleatoric uncertainty—where the noise level varies depending on the input—the standard approach is to train a probabilistic neural network to output both a mean ($\mu$) and a variance ($\sigma^2$). This is traditionally optimized using the Negative Log-Likelihood (NLL) loss. However, this paper identifies a fundamental flaw in NLL training that often leads to suboptimal performance and training instability.

The "Vicious Cycle" of NLL Training

The standard NLL loss for a Gaussian distribution is defined as: $$\mathcal{L}_{NLL} = \frac{(y - \hat{\mu})^2}{2\hat{\sigma}^2} + \frac{1}{2}\log\hat{\sigma}^2$$

While mathematically sound, the authors demonstrate that NLL training is prone to a "vicious cycle." In the early stages of training, if a model struggles to fit a complex or high-frequency region of the data, the residual $(y - \hat{\mu})^2$ remains high. To minimize the loss, the model can simply increase the predicted variance $\hat{\sigma}^2$.

Because the squared error term is weighted by $1/\hat{\sigma}^2$, a high variance prediction effectively scales down the gradient signal for the mean. This creates a feedback loop: the model predicts high uncertainty for difficult points, which reduces the incentive for the network to improve its mean prediction for those points. Consequently, the model "gives up" on learning difficult patterns, attributing them to noise rather than refining its internal representations. This is particularly problematic when the network's initial features are too coarse to distinguish between different inputs, leading the model to perceive structural complexity as irreducible noise.

Proposed Method: $\beta$-NLL

To break this cycle, the authors propose a modified loss function called $\beta$-NLL. The core innovation is to weight the standard NLL loss by the predicted variance raised to the power of $\beta$, while applying a "stop gradient" operation to the weighting term:

$$\mathcal{L}_{\beta-NLL} = \text{stop\_gradient}(\hat{\sigma}^{2\beta}) \cdot \mathcal{L}_{NLL}$$

By treating the variance as an adaptive, input-dependent learning rate, $\beta$-NLL allows for a tunable interpolation between standard NLL and Mean Squared Error (MSE):

  • $\beta = 0$: Recovers the standard NLL loss, where high-variance points are suppressed.
  • $\beta = 1$: The gradient for the mean prediction becomes identical to standard MSE. In this regime, every data point provides an equal gradient signal regardless of its predicted uncertainty.
  • $0 < \beta < 1$: Provides a balance, ensuring that even high-uncertainty points contribute sufficiently to the learning process.

Experimental Evaluation

The authors evaluated $\beta$-NLL across a wide range of benchmarks to test its robustness and accuracy:

  1. Synthetic Regression: On sinusoidal tasks with input-dependent noise, $\beta$-NLL demonstrated superior convergence and stability compared to standard NLL, which frequently failed to fit the underlying function.
  2. UCI Regression: Across 12 real-world datasets, $\beta$-NLL consistently improved predictive performance.
  3. Dynamics Modeling: In reinforcement learning environments (ObjectSlide and Fetch-PickAndPlace), $\beta$-NLL proved far more robust to hyperparameter choices, yielding significantly lower Root Mean Squared Error (RMSE) in state prediction.
  4. Computer Vision: In depth regression on the NYUv2 dataset, $\beta$-NLL produced sharper, more detailed depth maps. Standard NLL tended to blur edges by assigning them high uncertainty, whereas $\beta$-NLL forced the model to learn the underlying geometry.
  5. Generative Modeling: The method was also successfully applied to Variational Autoencoders (VAEs) on MNIST and Fashion-MNIST.

Key Insights

  • The Sweet Spot ($\beta = 0.5$): While $\beta$ is a hyperparameter, the authors found that $\beta = 0.5$ (weighting by the predicted standard deviation) consistently offered the best trade-off. It prevents the model from ignoring hard points while still allowing it to account for genuine noise.
  • Improved Stability: $\beta$-NLL mitigates the sensitivity of probabilistic networks to learning rates and initialization, making them easier to deploy in complex pipelines.
  • No Loss in Uncertainty Quality: Importantly, improving the mean prediction (RMSE) does not come at the cost of uncertainty quality. $\beta$-NLL maintains competitive test-set NLL values, indicating that the resulting uncertainty estimates remain well-calibrated.

Conclusion

$\beta$-NLL addresses a significant pitfall in heteroscedastic uncertainty estimation. By preventing the model from using high uncertainty as an "excuse" for poor fitting, the proposed loss function leads to more robust training and more accurate predictions across various domains. This simple yet effective modification is a valuable tool for any practitioner training probabilistic neural networks for real-world regression tasks.

Summary updated

BibTeX
@inproceedings{seitzer2022pitfalls,
  author = {Maximilian Seitzer and Arash Tavakoli and Dimitrije Antic and Georg Martius},
  title = {{On the Pitfalls of Heteroscedastic Uncertainty Estimation with Probabilistic Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=aPOpXlnV1T},
}
Figure