Abstract
Heteroscedastic regression models a Gaussian variable's mean and variance as a function of covariates. Parametric methods that employ neural networks for these parameter maps can capture complex relationships in the data. Yet, optimizing network parameters via log likelihood gradients can yield suboptimal mean and uncalibrated variance estimates. Current solutions side-step this optimization problem with surrogate objectives or Bayesian treatments. Instead, we make two simple modifications to optimization. Notably, their combination produces a heteroscedastic model with mean estimates that are provably as accurate as those from its homoscedastic counterpart (i.e.~fitting the mean under squared error loss). For a wide variety of network and task complexities, we find that mean estimates from existing heteroscedastic solutions can be significantly less accurate than those from an equivalently expressive mean-only model. Our approach provably retains the accuracy of an equally flexible mean-only model while also offering best-in-class variance calibration. Lastly, we show how to leverage our method to recover the underlying heteroscedastic noise variance.
Introduction
In many predictive modeling tasks, providing a point estimate (the mean) is insufficient. We often require a measure of uncertainty (the variance) to understand the model's confidence. Heteroscedastic regression addresses this by modeling both the mean ($\mu$) and the variance ($\sigma^2$) as functions of the input $x$. While neural networks are naturally suited for this, training them using the standard Negative Log Likelihood (NLL) objective frequently leads to a phenomenon the authors term "unfaithful" behavior.
The Problem: Unfaithful Optimization
The core issue with standard NLL optimization is a "rich-get-richer" dynamic. In the NLL loss, the gradient for the mean is scaled by $1/\sigma^2$. If a model initially makes a poor mean prediction for a specific data point, it can minimize the loss by simply increasing the predicted variance $\sigma^2$ for that point. This effectively "silences" the learning signal for the mean, causing the model to "give up" on learning difficult or noisy regions of the data rather than improving its accuracy. Consequently, adding a variance-prediction head often makes the mean prediction worse than a simpler, mean-only model.
Proposed Method: Faithful Heteroscedastic Regression
To restore "faithfulness"---ensuring the heteroscedastic model's mean is at least as accurate as a homoscedastic baseline---the authors propose two "incredibly easy to implement" modifications to the optimization process:
- Mean Gradient Scale (Newton Step): The authors multiply the mean gradient by $\sigma^2$, canceling out the $1/\sigma^2$ scaling in the NLL gradient. This ensures the mean sub-network receives the same learning signal as a standard squared-error model, regardless of the current variance estimate.
- Variance Stop-Gradient: They prevent gradients from the variance head from flowing back into the "trunk" (the shared layers) of the neural network. This ensures that the shared features are learned solely to optimize the mean prediction, preventing the variance head from "corrupting" the underlying representations to explain away errors.
By combining these, the resulting model is mathematically guaranteed to produce mean estimates as accurate as a dedicated mean-only model while still learning a calibrated variance.
Experimental Evaluation
The authors validated their approach across several domains:
- UCI Regression Benchmarks: Testing general regression performance on 11 standard datasets.
- Computer Vision (VAEs): Using MNIST and Fashion-MNIST within Variational Autoencoders to assess handling of complex image data.
- Biological Discovery: Applying the model to CRISPR-Cas13 efficacy datasets. Interestingly, the model revealed that high-efficacy genetic guides often have higher measurement noise---a discovery that would be obscured by uncalibrated models.
Key Results
A striking demonstration of the "unfaithful" problem occurs in synthetic tests with isolated data points or high-noise regions. As shown in the figure below, standard NLL models (Conventional Heteroscedastic) often fail to learn the mean of outliers by "explaining them away" with infinite variance. In contrast, the Faithful model converges perfectly, matching the performance of the mean-only baseline.
On the UCI datasets, the Faithful model consistently achieved the best combination of low Root Mean Squared Error (RMSE) and low Expected Calibration Error (ECE). In image tasks, it avoided the "blurry" reconstructions typical of standard NLL models, which often use high variance to ignore difficult-to-reconstruct edges.
Conclusion
Faithful Heteroscedastic Regression offers a robust solution to a long-standing optimization issue in uncertainty quantification. By decoupling the learning of the mean from the variance through simple gradient modifications, it ensures that reliability is never traded for accuracy. This method requires no extra hyperparameters and can be implemented with just a few lines of code, making it a practical choice for any neural network-based regression task.
Summary updated