Back to Archive
uq, regression

Uncertainty Quantification using Deep Evidential Regression

2026-06-30

This is a follow-up article from Amitesh's post on Evidential Learning, which covers uncertainty quantification (UQ) for discrete classification tasks. It's a great pre-read.

Citing from the same, imagine an image classification model trained on car vs. truck tasks, but which is being inferred for, let's say, a horse image. The model's softmax would still output something like [0.6, 0.4] and is incapable of saying that it doesn't know because this example doesn't match anything it was trained on. This is the main motivator behind UQ: to give the model the capability of expressing its uncertainty.

In this article, we will review the Deep Evidential Regression paper by A. Amini [1]. It's a workaround of the original Evidential Deep Learning paper by Sensoy [2], to enable UQ on regression tasks.

Epistemic uncertainty is: "How much does the model not know about the true function at this point?" It can be both high in the In-Distribution (ID) region and low in the Out-Of-Distribution (OOD) region. While ID/OOD is a statement about the data distribution, epistemic uncertainty is a statement about model knowledge.

Precise and calibrated uncertainty estimates are useful for interpreting confidence, capturing domain shift of out-of-distribution (OOD) test samples, and recognizing when the model is likely to fail.

There are two axes of NN uncertainty that can be modeled:

  1. Uncertainty in the data, called aleatoric uncertainty.
  2. Uncertainty in the prediction, called epistemic uncertainty.

There exist several approaches for estimating epistemic uncertainty, such as Bayesian NNs, which place probabilistic priors over network weights and use sampling to approximate output variance [3]. However, Bayesian NNs face several limitations, including the intractability of directly inferring the posterior distribution of the weights given data, the requirement and computational expense of sampling during inference (this refers to multiple inference runs on the same input but with different weights based on the approximate posterior), and the question of how to choose a weight prior.

Instead of placing priors on network weights, as is done in Bayesian NNs, evidential approaches place priors directly over the likelihood function. By training a neural network to output the hyperparameters of the higher-order evidential distribution, a grounded representation of both epistemic and aleatoric uncertainty can then be learned without the need for sampling.


The Evidential Regression Framework

We consider the problem where the observed targets, yiy_i, are drawn i.i.d. from a Gaussian distribution, as in standard MLE, but now with unknown mean and variance (μ,σ2)(\mu, \sigma^2), which we seek to also probabilistically estimate. Here the paper actually proposed a vague definition as given below:

p(y1,…,yN∣μ,σ2)=∏i=1N12πσ2exp⁡(−(yi−μ)22σ2)p(y_1, \dots, y_N | \mu, \sigma^2) = \prod_{i=1}^N \frac{1}{\sqrt{2\pi\sigma^2}} \exp \left( -\frac{(y_i - \mu)^2}{2\sigma^2} \right)

Here it's saying that all targets are sampled from a common normal distribution, but this is vague, because each task output is dependent on the corresponding xix_i. So the paper is being slightly loose. It really means:

  • Independent : yes, strictly speaking.
  • Identically distributed : only in the sense that the same network generates all (μi,σi2)(\mu_i, \sigma_i^2), not that every sample comes from the literal same Gaussian.

A better setting would have been: yi∣xi∼N(μi,σi2)y_i | x_i \sim \mathcal{N}(\mu_i, \sigma_i^2) where μi=fμ(xi;w)\mu_i = f_\mu(x_i; w) and σi2=fσ(xi;w)\sigma_i^2 = f_\sigma(x_i; w)

In standard MLE, μ\mu and σ2\sigma^2 are fixed but unknown constants. The network learns single fixed values for them.

Now the paper says: what if μ\mu and σ2\sigma^2 are not fixed? What if we are also uncertain about what the true μ\mu and σ2\sigma^2 are?

In a crux, instead of saying:

  • "yᵢ comes from a Gaussian with fixed μᵢ, σᵢ²"

We say:

  • "yᵢ comes from a Gaussian, but we don't even know μᵢ and σᵢ² exactly, they are themselves random variables."

This embeds the learning of epistemic uncertainty into the learning of the model.

NOTE: In the normal MLE settings, the model would have learnt (μi,σi2)=f(xi;w)(\mu_i, \sigma_i^2) = f(x_i; w) which only covers the aleatoric uncertainty, i.e., σi2\sigma_i^2.

Again, the paper does its sloppy act and talks of computing a posterior over μ\mu and σ2\sigma^2 given the examples. This didn't make sense to me, so I reasoned a lot with Claude over this and we came to a common decision.

CLAUDE's response on Posterior Framing

The notation p(μ,σ2∣y1...yn)p(\mu, \sigma^2 | y_1...y_n) is problematic for two reasons:

Reason 1: Which μ,σ2\mu, \sigma^2? As you correctly identified — in heteroscedastic regression each input has its own (μi,σi2)(\mu_i, \sigma_i^2). So asking for a posterior over a single (μ,σ2)(\mu, \sigma^2) given all NN observations makes no sense. It would need to be a per-input posterior conditioned on that specific observation and input, not a global posterior over all NN points.

Reason 2: μ,σ2\mu, \sigma^2 are outputs, not parameters A posterior is meaningful when you are being uncertain about parameters — like weights ww in a Bayesian NN. But here (μi,σi2)(\mu_i, \sigma_i^2) are deterministic outputs of the network given xix_i. There is nothing to put a posterior over in the traditional sense.

What the paper is really doing is placing a prior over (μi,σi2)(\mu_i, \sigma_i^2) for each input and then maximizing the marginal likelihood — not computing any posterior at all.

Bottom line: The posterior framing in Section 3.1 is largely cosmetic. The paper never computes a posterior, never uses the posterior, and the notation p(μ,σ2∣y1...yn)p(\mu, \sigma^2 | y_1...y_n) is technically incoherent given the heteroscedastic setup. It is misleading framing dressed up to sound Bayesian.

So for now, you can settle on the fact that we have designed the prior over μi\mu_i and σi2\sigma_i^2 as a Normal Inverse-Gamma (NIG) distribution.

The NIG prior factorizes as: p(μ,σ2)=p(μ∣σ2)⋅p(σ2)p(\mu, \sigma^2) = p(\mu | \sigma^2) \cdot p(\sigma^2)

where:

  • μ∣σ2∼N(γ,σ2ν−1)\mu | \sigma^2 \sim \mathcal{N}(\gamma, \sigma^2\nu^{-1})
  • σ2∼Γ−1(α,β)\sigma^2 \sim \Gamma^{-1}(\alpha, \beta)

Multiplying these two densities gives the NIG distribution: p(μ,σ2∣γ,ν,α,β)=βανΓ(α)2πσ2⋅(1σ2)α+1⋅exp⁡{−2β+ν(γ−μ)22σ2}p(\mu, \sigma^2 | \gamma, \nu, \alpha, \beta) = \frac{\beta^\alpha \sqrt{\nu}}{\Gamma(\alpha)\sqrt{2\pi\sigma^2}} \cdot \left(\frac{1}{\sigma^2}\right)^{\alpha+1} \cdot \exp\left\{-\frac{2\beta + \nu(\gamma-\mu)^2}{2\sigma^2}\right\}

From the paper:

A popular interpretation of the parameters of this conjugate prior distribution is in terms of "virtual observations" in support of a given property. For example, the mean of a NIG distribution can be intuitively interpreted as being estimated from ν\nu virtual-observations with sample mean γ\gamma, while its variance is estimated from α\alpha virtual-observations with sample mean γ\gamma and sum of squared deviations 2ν2\nu. Following from this interpretation, we define the total evidence, Φ\Phi, of our evidential distributions as the sum of all inferred virtual-observations counts: Φ=2ν+α\Phi = 2\nu + \alpha.

"In this work, we use neural networks to infer, given an input, the hyperparameters, mm, of this higher-order, evidential distribution." (Amini et al., p. 4)

"Third, we can effectively estimate the epistemic or model uncertainty associated with the network's prediction by simply evaluating the variance of our inferred evidential distribution." (Amini et al., p. 4)

Var[μ]=βν(α−1)\text{Var}[\mu] = \frac{\beta}{\nu (\alpha - 1)} This is the term representing the epistemic uncertainty, how much certain is the the model of the prediction. A lower variance of μ\mu means the model is more certain of the prediction.

Remember: The virtual observation interpretation says: higher ν,α\nu, \alpha means more evidence, meaning the model has "seen more support" for its prediction. The implicit promise is that evidence should grow as the model sees more of a particular input region.


Learning the evidential distribution

"For clarity, we structure the learning process as a multi-task learning problem, with two distinct parts: (1) acquiring or maximizing model evidence in support of our observations and (2) minimizing evidence or inflating uncertainty when the prediction is wrong." (Amini et al., p. 4)

The regularizer specifically targets this — it says: if you are wrong, you must be uncertain.

(1) Maximizing the model fit using Maximum Marginal Likelihood Estimate

p(yi∣m)=∬p(yi∣μ,σ2)p(μ,σ2∣m)dμdσ2p(y_i | m) = \iint p(y_i | \mu, \sigma^2) p(\mu, \sigma^2 | m) d\mu d\sigma^2

Ignore the middle part, then it's simply a weighted average over the probability distribution. In Maximum Likelihood Estimate, we use the point estimate:

p(yi∣μ^,σ^2)p(y_i | \hat{\mu}, \hat{\sigma}^2)

But since now we have a distribution over μ\mu and σ2\sigma^2 as well, we use a weighted average. We know p(y∣μ,σ2)p(y | \mu, \sigma^2) is Gaussian and we chose p(μ,σ2∣m)p(\mu, \sigma^2 | m) as NIG, and so this intractable solution becomes tractable as:

p(yi∣m)=St(yi;γ,β(1+ν)να,2α)p(y_i | m) = \text{St}\left(y_i; \gamma, \frac{\beta(1+\nu)}{\nu \alpha}, 2\alpha\right)

where St(y;μSt,σSt2,νSt)\text{St}(y; \mu_{St}, \sigma^2_{St}, \nu_{St}) is the Student-t distribution evaluated at yy with location μSt\mu_{St}, scale σSt2\sigma^2_{St}, and νSt\nu_{St} degrees of freedom.

Applying NLL on this gives:

LiNLL(w)=12log⁡(πν)−αlog⁡(2β(1+ν))+(α+12)log⁡(2β(1+ν)+ν(yi−γ)2)+log⁡(Γ(α)Γ(α+1/2))\mathcal{L}_i^{NLL}(w) = \frac{1}{2} \log \left( \frac{\pi}{\nu} \right) - \alpha \log\left( 2\beta(1+\nu) \right) + \left( \alpha + \frac{1}{2} \right) \log \left( 2\beta(1+\nu) + \nu (y_i - \gamma)^2 \right) + \log \left( \frac{\Gamma(\alpha)}{\Gamma(\alpha+1/2)} \right)

In this section our aim is to design an objective using which the model learns to output correct predictions for the training data points. Without any constraints the model can just learn to be highly confident everywhere, because these NN's can span any function and it would be easy for them to just overfit on the training examples atleat in terms of its certainty. This is not what we want, so we add a regularization term.

(2) Minimizing evidence on errors

Next, we describe how to regularize training by applying an incorrect evidence penalty (i.e., high uncertainty prior) to try to minimize evidence on incorrect predictions.

This has been demonstrated with success in the classification setting where non-misleading evidence is removed from the posterior, and the uncertain prior is set to a uniform Dirichlet [2]. The analogous minimization in the regression setting involves KL[p(θ∣m)∣∣p(θ∣m~)]\text{KL}[p(\theta|m) || p(\theta|\tilde{m})], where m~\tilde{m} are the parameters of the uncertain NIG prior with zero evidence (i.e., α,ν=0\alpha, \nu = 0). Unfortunately, the KL between any NIG and the zero evidence NIG prior is undefined.

To address these challenges in the regression setting, the authors formulate a novel evidence regularizer:

LiR(w)=∣yi−γ∣⋅(2ν+α)\mathcal{L}_i^R(w) = |y_i - \gamma| \cdot (2\nu + \alpha)

This loss imposes a penalty whenever there is an error in the prediction and scales with the total evidence of our inferred posterior.

NOTE: This is the most important part because it is here that we can design the objective or what being uncertain means for us. So, in the paper they have used the heuristic that uncertainty should be high when the prediction is wrong. This intuitively seems right as well but there can be other ways to define this as well. We can design a method which assigns uncertainty based on the density of training examples it has seen in that region. Remember we defined Evidential learning to be evidence acquisition process which actually should be framed with how many examples the model has seen that are similar to the present one. I am open to discussing more on this, so please feel free to reach out to me on my mail or x.

The total loss, Li(w)\mathcal{L}_i(w), consists of the two loss terms for maximizing and regularizing evidence, scaled by a regularization coefficient, λ\lambda:

Li(w)=LiNLL(w)+λLiR(w)\mathcal{L}_i(w) = \mathcal{L}_i^{NLL}(w) + \lambda \mathcal{L}_i^{R}(w)

Loophole: The regularizer mixes two fundamentally different failure modes: prediction error due to in-distribution data noise, and prediction error due to out-of-distribution inputs. For in-distribution training points where the model errs, the NLL loss and the regularizer send contradictory signals simultaneously: the former pushes the predicted mean toward the target while the latter penalizes evidence, effectively teaching the model to be uncertain in a region where it has already learned or has evidence to be certain. A principled regularizer would need to distinguish between these two cases rather than treating prediction error as a uniform proxy for epistemic uncertainty.

  • amini2020: Amini, A., Schwarting, W., Soleimany, A., & Rus, D. "Deep Evidential Regression." Advances in Neural Information Processing Systems, 2020. Link
  • sensoy2018: Sensoy, M., Kaplan, L., & Kandemir, M. "Evidential Deep Learning to Quantify Classification Uncertainty." Advances in Neural Information Processing Systems, 2018. Link
  • blundell2015: Blundell, C., Cornebise, J., Kavukcuoglu, K., & Wierstra, D. "Weight Uncertainty in Neural Networks." ICML, 2015.

Use of AI: Yes, I used a lot of AI to understand and used some sentences where I found it did a really good job explaining the objective, but overall this is my review with my findings and shortcomings, so enjoy learning!