Nonparametric Uncertainty Quantiﬁcation for Single Deterministic Neural Network
Abstract
This paper proposes a fast and scalable method for uncertainty quantiﬁcationof machine learning models’ predictions.
First, we show the principled way tomeasure the uncertainty of predictions for a classiﬁer based on Nadaraya-Watson’snonparametric estimate of the conditional label distribution.
Importantly, theapproach allows to disentangle explicitly aleatoric and epistemic uncertainties.
Theresulting method works directly in the feature space.
However, one can apply itto any neural network by considering an embedding of the data induced by thenetwork.
We demonstrate the strong performance of the method in uncertaintyestimation tasks on text classiﬁcation problems and a variety of real-world imagedatasets, such as MNIST, SVHN, CIFAR-100 and several versions of ImageNet
Introduction
In many machine learning applications, it is crucial to complement model predictions with uncertainty 12 scores that reﬂect the degree of trust in these predictions.
The total uncertainty of a prediction sumsfrom two uncertainty types, arising from different sources: aleatoric and epistemic [10, 25].
The 14 former reﬂects the irreducible noise and ambiguity in the data due to class overlap, while the latteris related to the lack of knowledge about model parameters, and can be reduced by expanding the 16 training dataset.
Disentangling epistemic uncertainty can help to identify out-of-distribution (OOD)data or to spot instances important for annotation during active learning [17].
The areas with high 18 aleatoric uncertainty might contain some incorrectly labeled instances.
If we quantify both typesof uncertainty well, we can effectively abstain from predictions in unreliable areas and address a 20 decision to a human expert [13], which is important in safe-critical ﬁeld, such as medicine [38],autonomous driving [31, 15], and ﬁnance [3].
There is no universally accepted uncertainty measure, and diverse, often heuristic treatments are 23 usually used in practice.
For this purpose, one could use maximum softmax probabilities of deepneural networks (MaxProb).
However, MaxProb represents only aleatoric uncertainty and the resulting 25 measure is notorious to be overconﬁdent for data the model did not see during training [44].
Methodsbased on ensembling [28] or Bayesian techniques [16] can capture both types of uncertainty and 27 yield more reliable uncertainty estimates (UEs).
However, they also introduce large computationaloverhead or require big modiﬁcations to a model architecture and a training procedure.
Recently, a series of UE methods based on a single deterministic neural network model has been 30 developed [51, 32, 52].
The main idea behind these methods is to leverage proximity of instances in avector space of neural network hidden representations that capture geometrical relationships between 32 instances in the input space.
Such methods are very perspective since they are computationallyefﬁcient and usually do not require big changes in network architectures and training procedures, 34 which gives them versatility.
Many of these methods rely on the assumption that (conditionally on the class) training instances are 36 distributed normally in the latent space of a trained neural network.
However, this assumption doesnot always hold.
For example, a border between classes might be more complex, as well as the border 38 between the in-domain and the out-of-domain region.
This happens when training is accomplishedin a low-resource regime with small amounts of labeled instances.
Another problem is that some 40 methods are hard to train and the model performance can substantially deteriorate without properhyperparameter tuning.
Finally, some methods require computing the covariance matrix of training 42 data.
This operation might be computationally unstable if the training dataset is not large enough.
In this work, we propose a new principled approach to UE that overcomes these limitations and 44 demonstrates very robust performance both in low-resource and in high-resource regimes.
We suggestto look at the pointwise Bayes risk (probability of the wrong prediction) as the natural measure 46 of the model prediction uncertainty at a particular data point.
Then we consider the NadarayaWatson estimator of the conditional label distribution.
Its asymptotic Gaussian approximation allows 48 deriving uncertainty estimate based on the upper bound for the risk.
The resulting Nonparametric
Uncertainty Quantiﬁcation (NUQ) method is amenable for uncertainty disentanglement (into aleatoric 50 and epistemic) and is implemented in a scalable manner, which allows it to be used on large datasetssuch as ImageNet.
To illustrate the strong points of the proposed method, we suggest to look at a toy example in Figure 1.
Here, we compare NUQ with MaxProb and DDU [40], one of the strong baselines in deterministicuncertainty estimation aimed at epistemic uncertainty.
MaxProb as a measure of aleatoric uncertainty 55 gives high values only in-between classes while being very conﬁdent far from the data.
We also seethat for a larger data set of 2000 points NUQ and DDU show similar results.
However, when the 57 neural network model is trained only on 200 labeled instances, DDU scores become very rough.
Itcannot spot an unreliable area in-between classes, while NUQ-based total uncertainty measure is able 59 to precisely spot it with high uncertainty.
Importantly, the presented total uncertainty for NUQ can bealso disentangled into aleatoric and epistemic ones.
Below we give a summary of contributions for the present paper.
We develop a new and theoretically grounded method for nonparametric uncertainty quantiﬁ-
cation (see Section 2), which is (1) applicable to any deterministic neural network model, (2)has an efﬁcient implementation, (3) allows to disentangle aleatoric and epistemic uncertainty,(4) outperforms other techniques on image and text classiﬁcation tasks.
We formally prove the consistency of the NUQ-based estimator when applied to the problem
of classiﬁcation with the reject option, see Section 3.
We conduct a vast empirical investigation of NUQ and other UE techniques on image andtext classiﬁcation tasks that supports our claims, see Section 5.
Nonparametric Uncertainty Quantiﬁcation2.1 Classiﬁcation under Covariate Shift
In this section and below, for the sake of clarity, we provide derivations for the binary case.
We derive 73 a generalization to a multi-class setting in Supplementary Material (SM), Section A.
Let’s consider the standard binary classiﬁcation setup ( X, Y ) 2 R d ⇥ { 0 , 1 } with ( X, Y ) ⇠ P .
Weassume that we observe the dataset D =  ( x i , y i ) } Ni =1 of i.i.d.
points from P = P train .
Here, X, Y 76 denote random variables, while x , y are their realisations.
The classical problem in statistics and machine learning is to ﬁnd a rule ˆ g based on the dataset D 78 which approximates the optimal one:
[Equation]
Here g : R d ! { 0 , 1 } is any classiﬁer and the probability of wrong classiﬁcation P ( g ( X ) 6 = Y ) is 80 usually called risk .
The rule g ⇤ is given by the Bayes optimal classiﬁer :
[Equation]
where ⌘ ( x ) = p ( Y = 1 | X = x ) which is the conditional probability of Y given X = x under the 82 distribution P .
In this work, we consider a situation when the distribution of the test samples P test is different 84 from the one for the training dataset P train , i.e. P test 6 = P train .
Obviously, the rule g ⇤ obtained 85 for P = P train might no longer be optimal if the aim is to minimize the error on the test data
P test ( g ( X ) 6 = Y ) .
In order to formulate a meaningful estimation problem, some additional assumptions are needed.
We 88 assume that the conditional label distribution p ( Y | X ) is the same under both P train and P test .
This 89 assumption has two important consequences:
All the difference between P train and P test is due to the difference between marginaldistributions of X : p train ( X ) and p test ( X ) .
The situation when p test ( X ) 6 = p train ( X ) isknown as covariate shift .
The rule g ⇤ is still valid, i.e., optimal under P test .
However, while the classiﬁer g ⇤ is still optimal under covariate shift, its approximation ˆ g might be 95 arbitrarily bad.
The reason for that is that we can’t expect ˆ g to approximate g ⇤ well in the areas wherewe have few samples from the training set or don’t have them at all.
Thus, some special treatment of 97 covariate shift is required.
2.2 Pointwise Risk and Its Estimation
We consider a classiﬁcation rule
ˆ g ( X )
=
ˆ g D ( X ) constructed based on the dataset D .
Let us start 100 from deﬁning pointwise risk of prediction:
[Equation]
where P (ˆ g ( X ) 6 = Y | X = x ) ⌘ P train (ˆ g ( X ) 6 = Y | X = x ) ⌘ P test (ˆ g ( X ) 6 = Y | X = x ) 102 under the assumptions above.
The value R ( x ) is independent of covariate distribution p test ( X ) and 103 essentially allows to deﬁne a meaningful target of estimation which is based solely on the quantitiesknown for the training distribution.
Let us note that the total risk value R ( x ) admits the following decomposition:
[Equation]
where R ⇤ ( x ) = P ( g ⇤ ( X ) {+
+}
= Y | X = x ) is Bayes risk and ˜ R ( x ) =
P (ˆ g ( X ) {+
+}
= Y | X = 107 x )  P ( g ⇤ ( X ) {+
+}
= Y | X = x ) is an excess risk.
Here R ⇤ ( x ) corresponds to aleatoric uncertainty asit completely depends on the data distribution.
Excess risk ˜
R ( x ) directly measures imperfectness of 109 the model ˆ g and thus can be seen as a measure of epistemic uncertainty.
To proceed, we ﬁrst assume that the classiﬁer ˆ g has the standard form:
[Equation]
where ˆ ⌘ ( x ) = ˆ p ( Y = 1 | X = x ) is an estimate of the conditional density ⌘ ( x ) .
For such an estimate we can upper bound the excess risk via the following classical inequality [11]:
[Equation]
It allows us to obtain an upper bound for the total risk:
[Equation]
where R ⇤ ( x ) = min { ⌘ ( x ) , 1  ⌘ ( x ) } in the case of binary classiﬁcation.
While this upper bound 115 still depends on the unknown quantity ⌘ ( x ) , we will see in the next section that L ( x ) allows for an 116 efﬁcient approximation under mild assumptions.
2.3 Nonparametric Uncertainty Quantiﬁcation2.3.1 Kernel Density Estimate and Its Asymptotic Distribution
To obtain an estimate of L ( x ) and, consequently, bound the risk, we need to consider some particular 120 type of estimator ˆ ⌘ .
In this work, we choose the classical kernel-based Nadaraya-Watson estimator ofthe conditional label distribution as it allows for a simple description of its asymptotic properties.
Let us denote by K h : R d 7! R the multi-dimensional kernel function with bandwidth h .
Typically, 123 we consider a multi-dimensional Gaussian kernel, but other choices are also available.
We referreaders to SM, Section C.1 for details.
Then, the conditional probability estimate is expressed as ( y i is either 0 or 1):
[Equation]
The difference between ˆ ⌘ ( x )  ⌘ ( x ) for properly chosen bandwidth h converges in distribution as 127 follows (see, e.g. [47]):
[Equation]
where N is the number of data points in the training set, and  2 ( x ) is the standard deviation of thedata label at point x .
Now we are equipped with an estimate of the distribution for ˆ ⌘ ( x )  ⌘ ( x ) .
Let us denote by ⌧ ( x ) the 131 standard deviation of a Gaussian from equation (2):
[Equation]
In the following sections, we ﬁrst show how to use the obtained property for uncertainty estimation, 133 and then we will show how it can be computed.
2.3.2 Total, Aleatoric and Epistemic Uncertainty and Their Estimates
In this work, we suggest a particular uncertainty quantiﬁcation procedure inspired by the derivation 136 above which we call Nonparametric Uncertainty Quantiﬁcation (NUQ) .
More speciﬁcally, we suggestto consider the following measure of the total uncertainty:
[Equation]
This measure is obtained by considering an asymptotic approximation of expected value of total risk 139 upper bound:
[Equation]
in a view of (2) and the fact, that E | ⇠ | = std ( ⇠ ) q 2 ⇡ for the zero-mean normal variable ⇠ .
Theresulting estimate upper bounds the average error of estimation at point x and thus indeed can be 142 used as the measure of total uncertainty.
We also can write the corresponding measures of aleatoric and epistemic uncertainties:
[Equation]
Finally, the data-driven uncertainty estimates ˆ U a ( x ) ,
ˆ U e ( x ) and ˆ U t ( x ) can be obtained via plug-inusing estimates ˆ ⌘ ( x ) , ˆ  ( x ) , ˆ p ( x ) and, consequently, ˆ ⌧ 2 ( x ) = 1 N ˆ  2 ( x ) ˆ p ( x )
[Equation]
We should note that despite being based on asymptotic approximation, the resulting formulas for 147 uncertainties are very natural and make a sense for ﬁnite samples (for example, epistemic uncertaintyproportional to  2 ( x ) /p
( x ) ).
We also should note that even known non-asymptotic decompositionsfor the risk of NW-estimator still contain the same  2 ( x ) /p
( x ) component, see Proposition 1 in [4].
That means that the proposed estimate well captures the general uncertainty trend.
Efﬁcient computation.
We note that computation of nonparametric estimate (1) involves a sum 152 over the whole available data.
This could be intractable in practice when we are working with largedatasets.
However, the typical kernel K h quickly approaches zero with the increase of the norm of 154 the argument: k x  x i k .
Thus, we can use an approximation of kernel estimate: instead of the sum 155 over all elements in the dataset, we consider the contribution of only several nearest neighbors.
Itrequires a fast algorithm for ﬁnding the nearest neighbors.
For this purpose, we use the approach 157 of [37] based on Hierarchical Navigable Small World graphs (HNSW).
It provides a fast, scalable,and easy-to-use solution to the computation of nearest neighbors.
Application to NN and Comparison with Existing Methods.
The resulting NUQ method can 160 be applied to NN in the postprocessing fashion, i.e. one can ﬁt it on top of the embeddings of thetrained NN model.
One may wonder about the difference between NUQ and other embedding based 162 methods such as, for example, DUQ [51] or DDU [40].
The difference is twofold: (i) NUQ is basedon the rigorous derivation of total, aleatoric and epistemic uncertainties, while other methods usually 164 consider more heuristic treatment and don’t allow for uncertainty disentaglement; (ii) NUQ considersmore ﬂexible estimator of density in the embedding space that allows to achive better quality in small 166 sample regime or for complicated data; see experimental evaluation in Section 5.
Consistency of NUQ-based Classiﬁcation with Reject Option
Above we obtained uncertainty estimates that characterize the classical risk of prediction.
However, 169 they are also helpful to solve the formal problem of classiﬁcation with reject option.
In this problem,for any input x we can choose either we perform prediction or reject it.
Following [5], we assume 171 that in case of prediction we pay binary price depending whether the prediction was correct or not,while in the case of rejection we pay the constant price  2 (0 , 1) .
For this task the risk function is
[Equation]
where ↵ ( x ) is an indicator of the rejection.
The minimizer of R  ( x ) is given by the optimal Bayes classiﬁer g ⇤ ( x ) and the abstention function
[Equation]
To approximate ↵ ⇤ ( x ) , we utilize hypothesis testing:
[Equation]
We choose the conﬁdence level  > 0 and consider the statistic ˆ U  ( x ) =
min  ˆ ⌘ ( x ) , 1  ˆ ⌘ ( x ) +z 1   ˆ ⌧ ( x ) , where z 1   is 1   quantile of the standard normal distribution.
The statistic ˆ U  ( x )combines the plug-in estimate of the Bayes risk min  ˆ ⌘
[Equation] x ) , 1  ˆ ⌘ ( x ) and the term z 1   ˆ ⌧ ( x ) 179 accounting for the conﬁdence of estimation.
The resulting abstention rule is given by:
[Equation]
Finally, if we consider the pair of kernel classiﬁer ˆ g ( x ) and ˆ ↵  ( x ) then we can prove the consistencyresult for the corresponding risk ˆ R  ( x ) under standard assumptions on nonparametric densities, see 182 SM, Section B for details.
Theorem 3.1.
Suppose that assumptions B.1-B.3 hold and p ( x ) > 0 , the bandwidth h ! 0 and
Nh d ! 1 as N tends to inﬁnity.
Then, for any  < 1 / 2 :
[Equation]
This result shows the validity of the NUQ-based abstention procedure.
Interesting future work is to 186 obtain a precise convergence rate for the method.
It should be possible based on the ﬁnite samplebounds provided in SM,
Section B. We also experimentally illustrate the beneﬁts of the proposed 188 estimator in SM, Section B.1.
Related Work
The notion of uncertainty naturally appears in Bayesian statistics [19], and, thus, Bayesian methods 191 are often used for uncertainty quantiﬁcation.
Exact Bayesian inference is computationally intractable,and approximations are used.
Two popular ideas are Markov Chain Monte Carlo sampling (MCMC; 193 [42]) and Variational Inference (VI; [2]).
MCMC has theoretical guarantees to be asymptoticallyunbiased but high computational cost.
VI-based approaches [48, 12, 45, 26] are more scalable, they 195 are biased and at least double the number of parameters.
That is why some alternatives are considered,such as the Bayesian treatment of Monte-Carlo dropout [16].
Deep Ensemble [28] is usually considered as a quite strong yet expensive approach.
A series of 198 papers developed ways of approximating the distribution obtained using an ensemble of models by asingle probabilistic model [35, 36, 50].
These methods require changing the training procedure and 200 need more parameters to train.
Recently, a series of uncertainty quantiﬁcation approaches for a single deterministic neural network 202 model was proposed.
In DUQ [51], an RBF layer is added to the network with a custom procedure toadjust the centroid points (in the embedding space).
The downside of the method is its inability to 204 distinguish aleatoric and epistemic uncertainty.
Another approach to capture epistemic uncertaintywas proposed in DDU [40].
It uses a Gaussian mixture model to estimate the density of objects in 206 the embedding space of a trained neural network.
The density values are then used as a conﬁdencemeasure.
SNGP [32] and DUE [52] are similar but use a Gaussian process as the ﬁnal layer, requiring 208 estimating covariance with the use of inducing points or RFF expansion.
There is a wide range of papers discussing classiﬁcation with the reject option.
Most likely, the 210 problem was ﬁrstly studied by Chow in papers [6, 5].
Moreover, in [5], he introduced a risk functionused across this paper.
Herbei et al.
[24] studied an optimal procedure for this risk and provided 212 a plug-in rule.
In the following works, empirical risk minimization among a class of hypotheses(see [1, 7]) or other types of risk (see [9, 14, 30]) were investigated.
Besides, a number of practical 214 works have been presented, see, for example, [20, 18, 41].
Experiments
We conduct a series of experiments on image and text classiﬁcation datasets.
In each experiment, 217 (1) we train a parametric model – a neural network, which we call a base model ; (2) ﬁt NUQ on thetraining data using the embeddings obtained from the base model.
We use logits as extracted features, 219 if not explicitly stated otherwise.
However, other options are also possible; see Section E.4.
Following SNGP and DDU, we use spectral normalization to train the base model to achieve bi- 221 Lipschitz property and avoid the feature collapse problem.
However, NUQ works sufﬁciently goodeven without this regularization (see Table 6 in Section E.4).
5.1 How NUQ Affects Model Predictions?
One may ask whether nonparametric classiﬁcation method used in NUQ, trained on some embedding 225 from the base model, has any relation to the original neural network.
To reassure the reader,we provide an argument that it well approximates the predictions of the base model and NUQ- 227 based uncertainty estimates can be used for the base model as well.
Speciﬁcally, we computethe agreement between predictions obtained from the Bayes classiﬁer based on kernel estimate 229 (i.e. the one used in NUQ) and base models’ predictions.
This metric formally can be deﬁned as
[Table] [Table]
P
[Equation]
I ⇥
[Table]
[-ni =
-]ˆ p
[Equation] x i ) =
arg max j p ( y =
j | x i ) ⇤ .
For CIFAR-100 231 (see experiments with this dataset in Section 5.2.1), this metric gives us the agreement of 0.975,which tells that the approach is accurate.
Additionally, we computed the aleatoric uncertainty for all 233 test objects and found the average percentile of the objects with disagreement is 94. ± 4.75.
Thus, 234 disagreement appears for high uncertainty points as expected.
5.2 Image Classiﬁcation
The main experiments with image classiﬁcation are conducted on CIFAR-100 [27] and ImageNet [8].
However, several additional experiments with other image classiﬁcation datasets such as MNIST and
SVHN can be found in SM, Section E.
We compare NUQ with popular UE methods, which do not require signiﬁcant modiﬁcations to model 240 architectures and training procedures.
More speciﬁcally, we consider Maximum probability (MaxProb) of softmax response of NN, Entropy of predictive distribution, Monte-Carlo (MC) dropout [16], 242 ensemble of models trained with different random seeds (deep ensemble), Test-Time Augmentation(TTA) [34], DDU [40], SNGP [32], DUQ [51], and an Energy-based approach [33].
For Monte-Carlo dropout, Ensembles, and TTA, we ﬁrst compute average predicted class probabilities 245 and then compute their entropy.
More details can be found in SM, Section C. For Deep Ensembles,we ﬁxed the number of models to 5.
Additional experiments where we changed the number of models 247 are presented in SM, Section E.5.
5.2.1 CIFAR-100
In this experiment, we test UE methods on the out-of-distribution detection task.
We treat the OOD 250 detection as binary classiﬁcation (OOD/not-OOD) using only uncertainty score.
Following the setupfrom the recent works [51, 52, 49], we use SVHN, LSUN [53], and Smooth [21] as OOD datasets.
The reported metric is ROC-AUC.
As a base model, we train a ResNet-50 model from scratch on the CIFAR-100 dataset.
NUQ was 254 applied to the features from the penultimate layer of the model, and the density estimate is givenby GMM, as it provides the best results (see the results for other choices of hyperparameters in 256 Section E.4).
The results are presented in Table 1.
We can clearly see that NUQ and DDU show close results while 258 outperforming the competitors with a signiﬁcant margin.
5.2.2 ImageNet
To demonstrate the applicability of NUQ to large-scale data, we evaluate it in the OOD detection 261 task on ImageNet [8].
As OOD data, we use the ImageNet-O [23] and ImageNet-R [22] datasets.
ImageNet-O consists of images from classes not found in the standard ImageNet dataset.
ImageNet-R 263 contains different artistic renditions of ImageNet classes.
[Figure]
In contrast to the previous experiment, we found that for NUQ, it is more beneﬁcial to use KDE 265 as a density estimator p ( x ) , rather than GMM.
Importantly, it took us approximately 5 minutes toreceive uncertainties over all ImageNet datasets with CPU, i.e. our NUQ implementation is readily 267 applicable to large-scale data.
The results are summarized in Table 2.
We see that for ImageNet-O, many methods show good OOD 269 detection quality, but NUQ achieves an almost perfect result.
For ImageNet-R, simple approachescompletely fail while DDU, SNGP, and DUQ perform well, and NUQ shows the best result with a 271 large margin.
Note that unlike in the CIFAR-100 experiment, for ImageNet, NUQ signiﬁcantly outperforms DDU.
We conjecture that GMM struggles to approximate density here as an embedding structure is muchmore complicated for ImageNet compared to CIFAR-100 (see some visualizations in Section E.3).
275 NUQ is beneﬁcial in this case as KDE is much more ﬂexible than GMM and provides a better result.
Additionally, we looked at some typical samples from ImageNet-R with low, moderate, and high 277 levels of uncertainty as assigned by NUQ, see Figure 2.
Here, low, medium, and high uncertaintiescorrespond to 10, 50, and 90% quantiles of epistemic uncertainty distribution for images from the 279 ImageNet-R dataset.
We observe that uncertainty values corresponds well to these images’ intuitivedegree of complexity compared to the original ImageNet data.
5.3 Text Classiﬁcation
Experiments on textual data are performed in low-resource settings, where we train models on small 283 subsamples of original datasets.
This regime can be challenging for many UE methods, while NUQis naturally adapted to it.
We compare NUQ to the best performing methods on image classiﬁcation: 285 DDU and deep ensemble, and to the standard baselines MC dropout and MaxProb.
We use a pre-trained ELECTRA model with 110 million parameters.
The features for NUQ and 287 DDU are taken from the penultimate layer.
The model details, ﬁne-tuning hyperparameters, and otherdetails of UE methods are presented in SM (Section F).
Classiﬁcation with rejection experiments are conducted on SST-2, MRPC, and CoLA.
The evaluation 290 metric is RCC-AUC [13].
Experiments with OOD detection, are conducted on ROSTD and CLINC,which contain instances marked as OOD, and a benchmark composed from SST-2 (in-domain), 292 20 News Groups, TREC-10, WMT-16, Amazon (sports and outdoors categories), MNLI, and RTE.
SST-2 is used as an in-domain dataset, while the rest as OOD datasets.
The ﬁnal score is averaged 294 across all OOD datasets.
Evaluation metric is ROC-AUC as in the image classiﬁcation task.
Thedataset statistics is presented in SM (Section F).
5.3.1 Classiﬁcation with Rejection
Figure 3 presents the results for classiﬁcation with rejection.
For the MRPC dataset, we can note 298 that NUQ, SNGP, and MC dropout show similar results to the MaxProb baseline.
DDU stands out,demonstrating substantially worse performance in settings with small amount of training data.
A similar dynamic for DDU can be noted on the CoLA dataset, where it works substantially worse 301 than the baseline till 10% of training data is unlocked.
SNGP in this experiment has the samepattern as DDU with slightly better results.
On contrary, NUQ is always on par or better than the
[Figure] [Figure]
baseline outperforming all other computationally efﬁcient methods and has similar performance as [Figure] computationally expensive MC
[Figure] On SST-2, NUQ works similar to SNGP, while substantially outperforming DDU, the MaxProb 306 baseline, and MC dropout in the extremely low resource setting.
Starting from 1.5%, all methodswork similarly with small advantage over the baseline.
Overall, we can conclude that in the settings with a small amount of training data, NUQ can be the 309 best choice for estimating uncertainty for the misclassiﬁcation detection task: it works similar toother methods when there is much training data and does not deteriorate in the low-resource regime, 311 demonstrating much better results than others.
SNGP is able to approach NUQ on SST-2.
However,its performance is not stable, which is illustrated by poor results on CoLA.
DDU always fails to 313 outperform the baseline with small amount of training data, which might be due to its reliance on theassumption that training data has a Gaussian distribution, which does not hold in this setting.
5.3.2 Out of Distribution Detection
[Figure] Figure 4 presents the results of OOD detection.
We see that NUQ conﬁdently outperforms MC 317 dropout and DDU, especially for extremely low-resource settings.
SNGP has some advantage over
NUQ on ROSTD, but it notably falls behind on CLINC.
However, unlike SNGP, NUQ always 319 outperforms the MaxProb baseline, therefore, it might be a better choice for OOD detection inlow-resource regimes.
Finally, DDU works poorly, often failing to outperform the MaxProb baseline, 321 which stems from incorrect assumption about the Gaussian distribution of training data.
Conclusions
This work proposes NUQ, a new principled uncertainty estimation method that applies to a wide range 324 of neural network models.
It does not require retraining the model and acts as a postprocessing stepworking in the embedding space induced by the neural network.
NUQ signiﬁcantly outperforms the 326 competing approaches with only recently proposed DDU method [40] showing comparable results.
Importantly, in the most practical example of OOD detection for ImageNet data, NUQ shows the 328 best results with a signiﬁcant margin.
NUQ is also superior to DDU and other methods on textclassiﬁcation datasets in both OOD detection and classiﬁcation with rejection.
The code to reproduce 330 the experiments is available online at http://github.com/omitted/to/preserve/anonymity .
We hope that our work opens a new perspective on uncertainty quantiﬁcation methods for deterministic 332 neural networks.
We also believe that NUQ is suitable for in-depth theoretical investigation, whichwe defer to future work.
Checklist
The checklist follows the references.
Please read the checklist guidelines carefully for information on 472 how to answer these questions.
For each question, change the default [TODO] to [Yes] , [No] , or[N/A] .
You are strongly encouraged to include a justiﬁcation to your answer , either by referencing 474 the appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license to the code and datasets?
[Yes] See Section ...•
Did you include the license to the code and datasets?
[No] The code and the data areproprietary.•
Did you include the license to the code and datasets?
[N/A]
Please do not modify the questions and only use the provided macros for your answers.
Note that the 480 Checklist section does not count towards the page limit.
In your paper, please delete this instructionsblock and only keep the Checklist section heading above along with the questions/answers below.
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reﬂect the paper’scontributions and scope?
[Yes](b) Did you describe the limitations of your work?
[Yes](c)
Did you discuss any potential negative societal impacts of your work?
[No] Ourproposed method is widely applicable, almost any modern neural network can beequipped with this mechanism.
Potential social impact will highly depend on thespeciﬁc domain and task.(d)
Have you read the ethics review guidelines and ensured that your paper conforms tothem?
[Yes]2.
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[Yes](b) Did you include complete proofs of all theoretical results?
[Yes] Proofs for our resultsare in Supplementary Material, see Section B3.
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] We provide thelink to our code in Conclusion.(b)
Did you specify all the training details (e.g., data splits, hyperparameters, how theywere chosen)?
[Yes] We discuss this in Supplementary Material, Sections C.1, C, F(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes](d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)?
[No] It is not included in the main paper,but will be addressed in Supplementary material.4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] We provide referencesto the datasets in the 5 section.
For our comparisons with existing approaches we haveused the author’s implementations that were provided in the respective original papersthat we cite.(b) Did you mention the license of the assets?
[No] We use only open source code anddatasets.(c)
Did you include any new assets either in the supplemental material or as a URL?
[Yes]We provide the link to our code in Conclusion.(d)
Did you discuss whether and how consent was obtained from people whose data you’reusing/curating?
[N/A] All the assets used are free for research purposes.(e)
Did you discuss whether the data you are using/curating contains personally identiﬁableinformation or offensive content?
[No] We use publicly available datasets to benchmarkour results and show only numeric values and abstract plots.
To the best of ourknowledge we have not exposed any personal information or offensive content.
If you used crowdsourcing or conducted research with human subjects...
[Table]
(a) Did you include the full text of instructions given to participants and screenshots, ifapplicable?
[N/A]
[Table] (b) Did you describe any potential participant risks, with links to Institutional Review [Table]
Board (IRB) approvals, if applicable?
[N/A]
[Table]
(c) Did you include the estimated hourly wage paid to participants and the total amountspent on participant compensation?
[N/A]
[Table]