Calibrating Deep Ensemble through Functional Variational Inference
Authors: Zhijie Deng
Feng Zhou
Jianfei Chen
Guoqiang Wu
Jun Zhu
Venue: Accepted by TMLR ()

Abstract: Deep Ensemble (DE) is an effective and practical uncertainty quantification approach in deep learning.  The uncertainty of DE is usually manifested by the functional inconsistency among the ensemble members, which, yet, originates from unmanageable randomness in the initialization and optimization of neural networks (NNs), and may easily collapse in specific cases. To tackle this issue, we advocate characterizing the functional inconsistency with the empirical covariance of the functions dictated by the ensemble members, and defining a Gaussian process (GP) with it. We perform functional variational inference to tune such a probabilistic model w.r.t. training data and specific prior beliefs. This way, we can explicitly manage the uncertainty of the ensemble of NNs. We further provide strategies to make the training efficient. The proposed approach achieves better uncertainty quantification than DE and its variants across diverse scenarios, while consuming only marginally added training cost compared to standard DE. The code is available at https://github.com/thudzj/DE-GP.

Published in Transactions on Machine Learning Research (08/2024)
Calibrating Deep Ensemble through Functional Variational Inference
Zhijie Deng Qing Yuen Research Institute, SEIEE, Shonghai Jiao Tong University
shijied@xftu.edducc
Feng Zhou
Jeng.2hon@@ruc.cdn.cr
Center for Applied Statistics and School of Statistics, Renmin University of China
Jianfei Chen
jannfeic@tsinggwa.eeb.co
Dept. of Comp. Sci. & Tech., Tsinghua Unéversity
Guoqiang Wu
guoçiangeus00@@maall.om
School of Software, Shandong University
Jun Zhu
desej@tsiingwwa.du edu.cn
Dept. of Comp. Sci. 8 Tech., Tsinghua University
Reviewed on OpenReview: https: // openreviee.. net/ forum? id= wwPPTWLLLL
Abstract
Deep Ensemble (DE) is an effective and practical uncertainty quantification approach in deep learning. The uncortainty of DE is usually manifested by the functional inconsistency among the ensemble members, which, yet, originates from unmanageable randomness in the initialization and optimization of neural networks (NNs), and may easily collapse in specific cases. To tackle this issue, we advocate characterizing the functional inconsistency with the empirical covariance the functions dictated by the ensemble members, and defining a Gaussian process (GP) with it. We perform functional variational inference to tune such a probabilistic model w.r.t. training data and spocific prior beliefs. This way, we can explicitly manage the uncertainty of the ensemble of NNs. We further provide strategies to make the training efficient. The proposed approach achieves better uncertainty quantification than DE and its variants across diverse scenarios, while consuming only marginally added training cost compared to standard DE. The code is available at https://github. ctmcccoo//////ee tt/d///uud/--ee////e
1
Introduction
Bayesian treatment of deep neural networks (DNNs) is promised to enjoy principled Bayesian uncertainty while unleashing the capacity of DNNs, with Bayesian neural networks (BNNs) as popular examples (MacKay]
1992 Hinton & Van Camp
1993
Neal 1995 Graves 2011). Nevertheless, despite the surge advance
BNNs (Louizos & Welling 2016
Zhang et al. 2018). many existing BNNs still face obstacles accurate
and scalable inference (Sun al. 2019), and exhibit limitations in uncortainty quantification and out-of-
distribution robustness (Oaddaa et al. )019).
Deep Ensemble (DE) Lakshminarayanan et al. 2017 is an effective and practical method for uncertainty quantification, which assembles multiple independently trained DNNs for prediction. DE presents higher flexibility and effectiveness than typical BNN methods. Practitioners tend to interpret the functional inconsistency among the ensemble members, say, the disagreement among their predictions, as a proxy of DE's uncortainty (Smith Gal 20188). However, the functional inconsistency stems from the unmanageable randomness in DNN initialization and stochastic gradient descent (SGD), thus is likely to collapse in specific cases (see Fig. 1]. To fix this issue, recent works like randomised MAP sampling (RMS) (Lu & Van Roy

---

Published in Transactions on Machine Learning Research (08/2024)
2017
Osband et al. 2018 Pearce et al., 2020 Ciosek et al. 2019 and NTKGP HHe et al 2020 refine DE in
the spirit of "sample-then-opiinee like Gaussian likelihoods, innearize//infinittee width models, etc., having difficulties to generalize.
(Matthews et al. 201 but they often rely on restrictive assumptions
This paper aims to calibrate the uncertainty of DE in a more feasible way. We first reveal that there exists a gap between the training and test of DF: the functional inconsistency in DE has not been properly adapted w.r.t. training data and prior uncertainty but is used to quantify post data uncertainty in the test phase. To bridge the gap, we propose to incorporate functional inconsistency into modeling and training explicitly, Viewing the ensemble members as set of basis functions, the functional inconsistency can be formally described by their empirical covariance, which, along with their mean, specify Gaussian process (GP). We perform functional variational inference (IVI) (Sun et al. 2019) to holistically tune such a GP (dubbed as DE-GP), making it approximate the function-spast Bayesian posterior, during which the uncertainty of the NN ensemble explicitly calibrated.
In essence, DE-GP adds to the line of works that build low-rank approximations to the Bayesian posterior in function space (Deng et al.) 2022) or weight space (Maddox et al. 2019 Izmailov et al. 2020 Dusenberry et al., 2020). The success of these works signifies that in the case of DNNs, low-rank approximations to Bayesian posteriors can reasonably conjoin performance and efficiency. However, distinct from them, we confine the model family to expressive DNN ensembles, which significantly boosts the flexibility of the approximate posterior. Compared to related works on calibrating DE's uncertainty (e.g., He et al., 2020), our approach can handle classification problems directly, without casting them into regression ones, due to the use of IVI.
Technically, we adopt prior also in the GP family, and then the gradients of the KT, divergence between DE-GP and the GP prior involved in fVI can be casily estimated without relying complicated gradient estimators (Shi et al., 2018b). We provide recipes to make the training even faster, thus the additional computation overhead of DE-GP upon DE is minimal.
We study the behavior of DE-GP on diverse benchmarks. Empirically, DE-GP outperforms DE and its variants on various regression datasets and presents superior uncertainty estimates and out-of-listributin robustuess without compromising accuracy in standard image classification tasks. DE-GP also shows promise in solving contextual bandit problems, where uncertainty plays vital role in guiding exploration.
2
Related Work
Bayesian treataentt of DNNs is an emerging topic yet with long history (Mackay
1992 Hinton & Van Camp
1993 Neal 1995
Graves 2011). BNNs can be learned by variational inference (Blundell et al. 2015 Louizos
& Welling 2016 Zhang et al. 2018 Khan et al.) 2018 Deng et al.) 2020). Laplace approximation Mackay
1992 Ritter et al.) 2018), Markov chain Monte Carlo (Welling & Tch 2011
Chen ct al. 2014), Monte Carlo
dropout (Gal & Ghahramani] 2016), etc. To avoid the difficulties of posterior inference weight space, some
works advocate performing functional Bayesian inference (Sun et al. 2019 Rudner et al.) 2021 Wang et al., 2019). Rudner ct al. (2022) then improve such approaches by developing simple finite-sample estimator of the involved function-spp space KL divergence. In function space, BNNs of infinite or even finite width equal to GPs (Neal 1996 Lee et al. 2018 Novak et al. 2018 Khan et al. 2019). which provides supports for
constructing an approximate posterior in the form of GP.
2017 is a practical approach to uncertainty quantification and has shown promise in diverse scenarios (Ovadia et al. 2019). On one hand, DE has been interpreted as a method that approximates the Bayesian posterior predictive (Wilson & Izmailov] 2020); the approximation quality is . On the other hand, some works argue that DE lacks principled Bayesian justification (Pearee et al. 2020 He et al.) 2020) and propose refine DE by specific principles. For
DE Lakshminarayananccm et al.]
empirically studied by Izmailov et all 22021)
example, RMS {Lu & Van Roy] 2017 Osband et al., 2018 Pearce et al. 2020 Ciosek et al. 2019) regularizes the ensemble memberr towards randomised priors to obtain posterior samples, but it typically assumes linear data likelihood which is impractical for deep models and classification tasks. He et al. (He et al. 2020 propose to add a randomised function to each ensemble member to realize function-space Bayesian interpretation, but the method is asymptotically exact in the infinite width limit and is limited to regressions. By contrast, DE-GP calibrates DE's uncertainty without restrictive assumptions. A concurrent work proposes to add
2

---

Published in Transactions on Machine Learning Research (08/2024)
repulsive term to DE (D' (D'Angelo & Fortuin 2021 based on the principle of particle-pptimizztion based variational inference (POVT) (Liu & Wang 2016), but the method relies less scalable gradient estimators for optimization.
3 Motivation
Assume a dataset = (x. ((,, yo with o, E X as data and yi as C-dimensional targets. We can deploy a DNN ((; w) : X RC with weights ur for fitting. Despite impressive performance, the regularly trained DNNs are prone to over-confidence, making it hard to decide how certain they are about the predictions. Lacking the ability to reliably quantify predictive uncertainty is unacceptable for realistic decision-making scenarios.
A principled mechanism for uncertainty quantification in deep learning is to incorporate Bayesian treatment to reason about Bayesian uncertainty. The resulting models are known as BNNs. In BNNs, w treated as a random variable. Given some prior beliefs p(w), we chase the posterior p(w(D). In practice, it is intractable to analytically compute the true posterior p(w(D) due to the high non-lincarity of DNNs, so some approximate posterior g(w) is usually found by techniques like variational inference (Blundell et al.) 2015), Laplace approximation (Mackay 1992), Monte Carlo (MC) dropout (Gal & Ghahramani 2016), etc.
BNNs perform marginalization to predict for new data x" (a.k.a. posterior predictive):
s
1 plyl== D) p) w] x Fytw) un) 2
Σ 5
(1)
where w, ~ ((w): 1..... Nonetheless, most of the existing BNN approachos face obstacles in precise posterior inference due to non-trivial and convoluted posterior dependencies (Louizos & Welling 2016
Zhang et al. 2018 Shi et al. 2018a Sun et al. 2019). and deliver unsatisfactory uncertainty quantification
performance Ovadia et al. 2019).
As practical uncertainty quantification method, Deep Ensemble (DE) (Lakshminarayanann al. 2017 deploys set of M DNNs {g(: w.)] to interpret the data from different angles. The ensemble members are independently trained under deterministic learning principles like maximum likelihood estimation (MLE) and maximum a posteriori (MAP) (we refer to the resulting models as DE and regularized DE (rDE) respectively):
1 M
max
log ((D)us))
a0
M
i=1
(2)
MM
1
max
[log (D))w;) + logp(w:)).
M
The randomness in model initialization and SGD diversifies the ensemble members, driving them to explore distinct modes of the non-convex loss landscape of DNNs (Fort et al. 2019 Wilson & Tzmailov 2020). This not only boosts the ensemble performance but also renders DE an approach to uncertainty quantification (Lak- shminarayanan et al. 2017 Ovadia et al. 2019). The functional inconsistency among the ensemble members is usually interpreted as a proxy of DE's uncertainty (Smith & Gal 2018). Yet, we question its effectiveness given that the functional inconsistency caused by the aforementioned uncontrollable randomness instcad of explicit Bayesian inference. To check if this is the case, we evaluate DE and rDE on a 1-D regression problem. We choose neural network Gaussian process (NN-GP) (Neal) 1996) posteriors equal to infinite-widhh width well-trained BNNs and can be analytically estimated. We depict the results in Fig.
gold standard as they
The results echo our concerns on DE's uncertainty. It is evident that (1) DE and rDE collapse to a single model in the extreme linear case (i.e., without hidden layers), because the loss surface convex w.r.t. the model parameters; (it) DE and rDE reveal minimal uncertainty in in-distribution regions, although there is severe data noise; (Mi) the uncertainty of DE and rDE deteriorates the model size increases regardless of whether there is over-fitting.
3

---

Published in Transactions on Machine Learning Research (08/2024)
without hidden layers
with hidden layer
with hidden layers
without hidden layers
with hidden layer
with hidden layers
(a) DE
(b) rDE
(c) NN-GP
(d) DE-GP
Figure 1-D regression on y sin 2x +E 0.2). We 50 multilayer perceptrons (MLPs) for ensemble and experiment on 3 architectures (with different numbers of hidden layers). The weight-space priors for rDE, DE-GP, and NN-GP are Gaussian distributions. Red dots refer to the training data. Black lines for DE and rDE refer to the predictions of the ensemble members. Dark blue curves and shaded regions for DE-GP and NN-GP refer to mean predictions and uncertainty. Compared to NN-GP, DE and rDE suffer from crer-confidence and less calibrated uncertainty estimates. DE-GP can address these issues.
The functional inconsistency in DE has not been properly adapted w.r.t. training data and prior uncertainty, but is used to quantify post data uncertainty. Such a gap may be the cause of the unreliability issue of DE's uncertainty. Having identified this, we propose to incorporate the functional inconsistency into modeling, and perform functional Bayesian inference to tune the whole model. We describe how to realize this below.
4 Methodology
This section provides the details for the modeling, inference, and training DE-GP. We impress the readers in advance with the results of DE- GP on the aforementioned regression problem shown in Fig. [
4.1 Modeling
Viewing the ensemble members {g(-, w.)) as set of basis functions, the functional inconsistency among them be formally represented by the empirical covariance:
M
k(0, =
(gx(x) - m(x)) (g:(xt') m(x'))
(3)
M
1=1
where di refers to g(,, w.) and m(x) M ΣM (x). From the definition, A is matrix-valued kernel, with values in the space of C C matrices.
Then, the incorporation functional inconsistency amounts to building a model with k( x'). Naturally, the DE-GP comes into the picture, defined as (f()) k(x, x')). Given that k(x, x') is of low rank, we opt to add small scaled identity matrix AI upon k(n, x²) to avoid singularity. Unless specified otherwise, refer the resulting covariance kernel as k( æ²) in the following.
The variations in k(xx,z æ²) are confined to having up to M - rank, echoing the recent investigations showing that low-rank approximate posteriors for deep models conjoin effectiveness and efficiency (Deng et al. 2022 Maddox et al.] 2019 Izmailov et al. 2020 Dusenberry et al. 2020). Akin to typical deep kernels @Wilson et al.] 2016), the DE-GP kernels are highly ficxible, and may automatically discover the underlying structures of dige--imensionall data without manual participation.
IT refers the identity matrix
4

---

Published in Transactions on Machine Learning Research (08/2024)
4.2 Inference
DE-GP is Bayesian model instead of a point estimate, so tune it by approximate Bayesian inference principle take it as parametric approximate posterior, i.e.,
((f) = (Pf k(x)),((,,a)
(4)
and leverage IVT Sun et al. 2019 to push it towards the true posterior over functions associated with specific priors.
Prior In fV1, we can freely choose a distribution over functions (i.e., a stochastic process) as the prior. Noncthcless, to avoid unnccessary convoluted gradient estimation, we adopt prior also in the GP family:
p(f) kp,
(5)
where the prior mean is assumed to be zero by convention.
On the one hand, this way, we can easily incorporate prior knowledge by specifying a prior kernel which encodes appropriate structures like data similarity or periodicity for the sake of good data fitting, On the other hand, we can flexibly combine basic kernels by simple multiplication or addition to increase the expressiveness of the prior.
Typically, most well-evaluated kernels, dubbed as kp(x,, x'), are scalar-valued, but can extend them to be matrix-valued by enforcing isotropy via (x, x²) = (x x² Ic.
fELBO We maximize the functional Evidence Lower BOund (fELBO) (Sun et al. 2019 to perform fVV:
max (oggeel DkLla(f)ll(()). <())
(6)
Notably, there is a KT. divergence bet ween two GPs, which, on its own, is challenging to cope with. Fortunately, as proved by Sun et al. (2019), we can take the KI. divergence between the marginal distributions function evaluations as a substitute for it, giving rise to more tractable objective:
L E
Σ (EDD
logp(y:1/(=:i)) DKL [[(P5))((P2))
where X denotes a measurement set including all training inputs X, and fx is the concatenation of the vectorized outputs of for X, i.c., px E ERXC
It has been recently shown that (ELBO is often ill-defined and may lead to several pathologies the KL divergence in function space is infinite (Burt et al. 2020). Yet, the results in Fig. [ which serve as posterior approximation quality check, reflect that FELBO is empirically effective for tuning DE-GP.
4.3 Training
We outline the training procedure in Algorithm and claborate some details below.
Mini-batch training DE-GP should proceed by mini-bate batch training when facing large data. At each step, we manufacture a stochastic measurement set with mini-batch D, = (X,, Y.) from the training data D and some random samples X,, from a continuous distribution (c.g., a uniform distribution) v supported on X. Then, we adapt the objective defined in Eq. (7) to:
max L= max Byna())
Σ
logp(y:)f(xi)) aDKL [a(pX (1(P)))1((())]
(8)
Wii... M/ RPI.... RPM
(E.D)))
where X, indicates the union of X, and X,, Instead of fixing a as 1, we opt to fix the hyper-parameters specifying the prior p()), but to tune the positive coefficient to better trade off between data evidence and
We X notate the size of X.
5

---

Published in Transactions on Machine Learning Research (08/2024)
Algorithm 1 The training of DE-GP
1: Input: D: dataset; {o(s w a deep ensemble; kp: prior kernel; v: distribution for sampling extra measurement points; U: number of MC samples for estimating expected log- legllike
2: while not converged do
D, ,X,,, ,)) C CD X, U, X,X,- {x X
4: gi = =g(X,, s, wi), i= M.... MM
x,
5: m x, 1
M E, gi
X
X. M Li=i (g)
x,
m x, )g) mx.)T + 1112/0
6:
K & &, =kip(X,; xx)
P
L1 1 El= Σ (z. v),,), log logp(y)f((z)), f, ~ N(m (k&..,
L2 [ [M(m x, ,, )|,,, k, x,,
10:
+ v m. (Li -ab2), ,,.., M
11: end while
prior regularization. When tuning a, we intentionally set it as large possible avoid colder posteriors and worse uncertainly estimates.
The importance of the incorporation of extra measurement points X, depends on the data and the problem at hand. We perform a study on the aforementioned 1-D regression without incorporating X, in Appendix, and the results are still seemingly promising.
The marginal distributions in the KL are both multivariate Gaussians, i.e.,
q(Px = -N(x |mx k. p(PX:) = N(FX kx.,..).
with the kernel matrices k x, k K E IR &,ICx|&,IC as the joints of pair-wise outcomes. Thus, the marginal KL divergence and its gradionts can be estimated exactly without resorting to complicated approximations (Sun et al. 2019 Rudner et al., 2021).
Moreover, as discussed Section 4.2 (a x') (x, I' so we can write kx..x, by Kronecker product: p
kR..X. RR.,X. Ic, where x E 1x|&,1 corresponds to the evaluation of kernel Ryp Hence in the p
computation of the KI, we can exploit the property of Kronecker product to inverse k-X &8,,8 in x(xx,1) )))
complexity. Besides, as X. is low-rank, we can leverage the matrix determinant lemma Harville 1998) to
compute the determinant of k. &..... in O(XX|CMM² time given that usually M < |x|CC (e.g., 10 < 256C).
A qualified prior kernel When facing high- diggesiinesionnll data, we usually have no prior knowledge of them but only know that NNs are a good model family. In this case, NN-GPs (Neal 1996) can be good priors they correspond to the commonly used Gaussian priors on weights while carrying valuable inductive bias of specific NN architectures. However, the analytical estimation of NN-GPs prohibitive when the NN architecture is deep, so we advocate using the MC estimates of NN-GPs (MC NN-GPs) (Novak et al., 2018 alternative. They are more accessible and have been proven effective by Wang et al. 2019).
Concretely, given an NN composed of a feature extractor h(:,0)) : X' + Rº and a linear readout layer, we denote the Gaussian prior on the weights of h by No0 diag (6²)) and the prior variance of the readout layer by 22 (for weights) and of (for bias). Then the corresponding MC NN-GP kernel is
2 $ T Ih(x, ((e, h(ahhh(', (x))
kp(xxx') = :=
Ro( x' Io with (2(xx :== == of
Σ
(10)
SC
i. are i.i.d. samples from (O, diag (Q²)). As shown, S forward passes of h are needed to evaluate the MC NN-GP prior. h's weights are randomly generated, and its architecture can be freely chosen, not necessarily identical to that of g. In practice, DE-GP benefits from the lcarning in the parametric family specified by NN ensemble, and hence can frequently outperform the analytical NN-GP posteriors, which are even intractable for deep NN architectures, on some metrics.
6

---

Published in Transactions on Machine Learning Research (08/2024)
4.4 Discussion
Calibrated uncertainty As the prior p(f) has nondegenerate covariance, the KL in Eq. which aligns q(f) with p(f), will prevent the functional inconsistency among the ensemble members from collapsing. Mcanwhile, the expected log-likelihood in Eq. (8) enforces each ensemble member to yield the same, correct outcomes for the training data. Thereby, the model is able to yield relatively high functional inconsistency (i.e., uncertainty) for regions far away from the training data (see Fig. 1. By contrast, DE's uncertainty on these regions is shaped by uncontrollable randomness.
Efficiency Compared to the overhead introduced by DNNs, the effort for estimating the KL in Eq. ( is negligible. The added cost of DE-GP primarily arises from the introduction of the extra measurement points and the evaluation of prior kernels. In practice, we use a small batch size for the extra measurement points. When using the MC NN-GP prior, we set it using cheap architectures and perform MC estimation in parallel. Thereby, DE-GP only marginally slower than DE.
Weight sharing DE-GP does not care about how 9i are parameterized, so we can perform weight sharing among 9i, for example, using a shared feature extractor and M independent MLP classifiers to construct M ensemble members (Deng et al. 2021). With shared weights, DE-GP is still likely to be reliable because our learning principle induces diversity in function space. Experiments in Section 5.4
validate this.
Limitations DE-GP loses parallelisability, but this is not a specific issue of DE-GP, e.g., the variants of DE based on POVI also entail concurrent updates of the ensemble members D'Angelo & Fortuin. 2021).
5 Experiments
We perform extensive evaluation to demonstrate that DE-GP yields better uncertainty estimates than the basclines, while preserving non-degraded predictive performance. Given that the original Deep Ensemble itself is very performant in terms of accuracy and uncertainty quantification (Ovadia el al. 2019). we mainly focus on comparing to it and its popular variants, including DE, rDE, NN-GP, RMS, etc. Unless specified otherwise, we adopt MC NN-GPs with $ = 10 as the priors, where the weight and bias variance at cach layer are 2/fan_ir and 0.01 (fan_ix in is the input dimension according to (He et al. 2015)). We set the sampling distribution for extra measurement points v as the uniform distribution over the data region and leave the adoption of more complicated ones (Hafner et al., 20200) future work. The number of MC samples for estimating the expected log-likelihood (i..., U in Algorithm D is 256. We set the regularization constant À 0.05 times of the average eigenvalue of the central covariance matrices. More details are in Appendix.
5.1 Illustrative 1-D Regression
We build a regression problem with 8 data from y sin 2x + c, ~ N/,0 shown in Fig. 1 For NN-GP, we perform analytical GP regression without training DNNs. For DE-GP, DE, and rDE, we train 50 MLPs. By default, we set a = 1.
Fig. D presents the comparison on prediction with the training efficiency comparison deferred to Appendix. As shown, DE-GP delivers calibrated uncertainty estimates across sottings with only marginally addod overhcads upon DE. DE-GP is consistent with the gold standard NN-GP. Yet, DE and rDE suffer from degeneracy issue as the dimension of weights grows. We also clarify that NN-GP would face non-trivial scalability issues when handling deep architectures (Novak et al. 2018), while DE-GP bypasses them.
5.2 UCI Regression
We then assess DE-GP on 5 UCI real-valued regression problems. The used architecture is MLP with 2 hidden layers of 256 units and ReLU activation. 10 networks are trained for DE, DE-GP and other variants. For DE-GP, we tune a according to validation sets.
We perform cross validation with 5 splits. Fig. D shows the results. DE-GP surpasses or approaches the basclines across scenarios aspects of both test negative log-likelihode (NLL) and test root mean square error (RMSF). DE-GP even beats NN-GP, which is probably attributed to that the variational family specified
7

---

Published in Transactions on Machine Learning Research (08/2024)
NN-GP
DE-GP
DE
rDE
RMS
dropout
2.84
2.9
0:98
28800
2.82
0.56
2.7
-1.0
2.80
2.750
2.78
Average
0.90
2.4
2.700
-12
2.72
-1.3
2.650
Boston
Power
Wine
Kinönm
Protein
NN-GP
DE-GP
DE
rDE
RMS
MC dropout
Average Test RMSE
4.0
3.75
3.9
0.090
3.9
3:50
3.25
3.7-
0.085
3.8
3.7
3.6-
0.075
0.070
2.50
34
2:5
Boston
Power
Wine
Kin8nm
Protein
Figure 2:
Average test NLL and RMSE on UCT regression problems. The lower the better.
Test Error Ensemble Size
Test Ensemble Size
FashionMNIST MNIST Error vs. Uncertainty
DE
DE
Negative Log-Ilked le-llkeelhoodd
0.28
0C
DE:GP
Ernor uncertainty
1DE
I0E
MC dispoutt
RA15
RMS
MC dropout
0.4
DE DE-GP
Classification
2.5
SE
0.24
0.3
DE
IDE
0.22
0.2
MC dropout
0.20
IDE
6.
0.38
Ensemble size
Ensemble size
Uncertainty Threshold
Figure 3: (Left): Test error varies w.r.t. ensemble size Fashion-MNIST. (Middle): Test NLL varies w.r.t. ensemble size. (Right): Test error versus uncertainly plots for methods trained on Fashion-MNIST and tested Pashion-MNIST
on both Fashion- MNIST and MNIST. Ensemble size is 10.
by DE enjoys the beneficial inductive bias of practically sized SGD-trainod DNNs, and DE-GP can flexibly trade off between the likelihood and the prior by tuning a.
5.3 Classification FaShiOn-MNIST
We use a widened LeNet5 architecture with batch normalizations (BNs) [Toff & Szegedy 2015 for the Fashion-MNIST datasct (Xiao et al.] (017). Considering the inefficiency of NN-GP, we mainly compare DE-GP to DE, rDE, RMS, and MC dropout. We also include two other baselines: snapshot ensemble (SE) (Huang et al. 2016), which collects ensemble members from the SGD trajectory, and variant of DE that performs the aggregation in the logit space (IDE). We set a well as the regularization coefficients for rDE and RMS all as 0.1 according to validation accuracy. We augment the data log-likelihood (i.e., the first term in Eq. 8 with a trainable Lemperature to tackle oversmoothing and avoid underconfidence..
The in-distribution performance averaged over runs. Fig. (Left) & (Middle) display how ensemble size impacts the test results. We see the test error of DE-GP is lower than the baselines, and its test NLL decreases rapidly the ensemble size increases.
8

---

Published in Transactions on Machine Learning Research (08/2024)
Table 1: Test and NLL accuracy comparison on CIFAR-10.
Results are summarized over 8 trials.
ResNet-20
ResNet-56
Accuracy
NLL
Accuracy
NLL
DE-GP (3 = 0.1)
94.67=0.04%
0.16410.002
95.55=0.04%
0.148+0..003
DE-GP (3 0)
93.71=0.06%
0.196#0.001
94.24+0.07%
0.195#0.007
DE
93.43+0.08%
0.214+0.001
94.04+0.07%
0.197++0.002
TDE
94.58=0005%
0.16610.001
95.5610.06%
0.146=00.001
RMS
93. 0..0%%
0.201#0.001
94.45=0003
0.179=0.001
MC dropout
92.38+00.022
0.316+00007
93.63+0.16%
0.324+0.015
SE
92.44+0.26%
0.310+0.007
93.92=0.11%
0.285+000110
IDE
9..6%%
0.211+0.001
95.55+0.06%%
0.208
Besides, to compare the quality of uncertainty estimates, use the trained models to make prediction and quantify epistemic uncertainly for both the in-distribution test set and the oul-of-distribution (OOD) MNIST test set. All predictions on OOD data are regarded as wrong. The epistemic uncertainty is estimated by the mutual information between the prediction and the variable function:
$
I(,ylæ, v H
1 5
Σ
plul((()))
E H (oluls(())).
(11)
where H indicates Shannon entropy, with fa - g( w.) for DE, rDE, and RMS, and fa ~ ((; Wi,..,,... Wss for DE-GP. This is a naive extension of the weight uncertainty-basee mutual epistemic uncertainly. We normalize the uncertainty estimates into [0, 1]. For each threshold [0, 1], we plot the average test error for data with < 7 uncertainty in Fig. 3 (Right). We see under various uncertainty thresholds, DE-GP makes fewer mistakes than baselines, implying DE-GP can assign relatively higher uncertainty for the OOD data. We defer the performance of uncertainty-baat based OOD detection to the appendix.
5.4 Classification on CIFAR-10
Next, we apply DE-GP the real-world image classification task CIFAR-10 (Krizhevsky al. 2009). We consider the popular RosNet (He et al. 2016) architectures including ResNet-20 and ResNet-56. The ensemble size is fixed as 10. We split the data the training set, validation set, and test set of size 45000, 5000, and 10000, respectively. We set = 0.1 according to an ablation study in Appendix. We use lite ResNet-20 architecture without BNs and residual connections to set up the MC NN-GP prior kernel for both the ResNet-20 and ResNet-56-batt variational posteriors.
Ideally, the KI. divergence in Eq. 8 is enough to help DE- GP to resist over-fitting (in function space). Its effectiveness is evidenced by the above results, but we have empirically ob- served that it may lose efficacy in the CIFAR-10 + ResNets case. Specifically, we inspect how the L2 norm of weights of the NN ensemble varies w.r.1. training step. We include three more approaches into the comparison: the DE-GP equipped with an extra L2 regularization on weights with coefficient = 0.1 DE, and rDE. The results are displayed in Fig, 1 where DE-GP 0) refers to the vanilla DE-GP. The generalization perfor- mance of these four approaches can be found in Table An immediate conclusion is that the KL divergence in DE-GP's learning objective cannot cause proper regularization effects on weights, so the learned DE-GP suffers from high complexity and hence poor performance. This is probably caused by the high non-linearity of ResNets. We then advocate
L norm of weights
25000
0.11
DE GP (8
15000
IDE
10000
5000
Epoch
Figure 4: The La norm of weights varies w.r.t. training step. The models are trained on CIFAR- 10 with ResNet-20 architecture. DE-GP (3 = 0) finds solutions with high complexity and poor test. accuracy (see Table yet DE-GP (.8 0.1) settles this.
We set without explicit tuning- just make equivalent regularization coefficient on weight in rDF.

---

Published in Transactions on Machine Learning Research (08/2024)
100e0te w8th 17E000400
0.5
0.5
R.S
DE
0.4
rDE
rDE
0.3
RMS
0.3
RMS
MC dropout
MC dropout
0.2
6.
SE
0.1
8.
06
Uncertainty Threshold r
Uncertainty Threshold
Figure 5: Test error versus uncertainty plots for methods trained on CIFAR-10 and tested both CIPAR-10 and SVHN with ResNet-20 (Left) ResNet-56 (Right) architecture.
Expcctos Caltration Ertor
DE-GP DE
Expected Calbration
0.4
RMS
MC arspoct
MC dropout
SE
IDE
0.2
Skew intensity
Skew intensity
Figure 6: Expected Calibration Error on CIFAR-10 10 corruptions for models trained with ResNet-20 (Left) or
ResNet-56 (Right). We summarize the results across 19 types of skew in each box.
DE GP
DE
IDE
RMS
Random
CPAR110 Tezt Acursa
92.0
2002
Cumulative Reward
91.5
Emee eooeoooee with
1500
DE-GP
1002
90.5
rDE
500
93.0
DE-GP
DE
iDE
Uncertainty Threshold
3000
5000
Round
Figure 7: In-distribution test accuracy (Left) and error versus uncertainty plots on CIFAR-10+SVIN (Right) under weight sharing. (ResNet-20)
Figure Cumulative reward varies w.r.t. round on Covertype. Random corresponds to the Uniform algorithm. Summarized over 5 trials.
explicitly penalizing the L2 norm of the weights Σ, ||w; to guarantee the generalization performance when applying DE-GP to handling deep architectures. This extra weight-space regularization may introduce bias to the posterior inference corresponding to the imposed prior. But, if we think of it as a kind of extra prior knowledge, we can then justify it within the posterior regularization scheme (Ganchev et al. 2010 (see Appendix).
In the following, we abuse DE-GP represent DE-GP (3 0.1) if there no mislcading. Fig. shows the error versus uncertainty plots on the combination of CIFAR-10 and SVHN test sets. The results are similar to those for Fashion-MNIST.
We further test the trained methods on CIFAR-10 corruptions (Hendrycks & Dietterich 2018), challenging OOD generalization/ seneralization/rrbustess robustness benchmark for deep models. As shown in Fig. and Appendix, DE-GP reveals smaller Expected Calibration Error (ECF) Guo et al. 2017) and lower NLL at various levels of skew, reflecting its ability to make conservative predictions under corruptions.
More results for the deeper ResNet-110 architecture and the more challenging CIFAR-100 benchmark are provided in Appendix.
10

---

Published in Transactions on Machine Learning Research (08/2024)
Table 2: Ablation study on a for DE-GP (3 0.1) (using ResNet-20 on CIFAR-10).
a
0.1
0.05
0.01
0.005
Accuracy
94.67+0.09%
94.66++0.07%
94.67-00.04%
94.83+0.10%
Table 3: Ablation study the architecture of the prior MC NN-GP kernel.
DE-GP architecture \
Prior kernel architecture
ResNet-20
ResNet-56
ResNet-110
ResNet-56 (10 ensemble member) ResNet-110 (5 ensemble member)
95.50%
95.28%
95.54%
94.87%
0.20
DE-GP
0.18
Time per iteration (3)
IDB
0.16
0.18
0.10
Figure 9: Training speed comparison on illustrative regression.
Weight sharing We build a ResNet-20 with 10 classification heads and a shared feature extraction module to evaluate the methods under weight sharing. We set a larger value for a for DE-GP to induce higher magnitudes of functional inconsistency. The test accuracy (over 8 trials) and error versus uncertainty plots on CIFAR- 10 are illustrated in Fig. We exclude RMS from the comparison it assumes i.i.d. ensemble members which term
may be incompatible with weight sharing. DE-GP benefits from functional inconsistency- (see Section 4.4h, hence performs better than DE and rDE, which purely hinge on the randomness in weight.
5.5 Contextual Bandit
Finally, we apply DE-GP to the contextual bandit, important decision-making task where the uncertainty helps to guide exploration. Following (Osband et al. 2016), use DE-GP to achieve efficient exploration inspired by Thompson sampling. We reuse most of the scttings for UCI regression (see Appendix). We leverage the GenRL library to build a contextual bandit. problem, Covertype (Riquelme et al. 2018). The cumulative reward is depicted in Fig. [] As desired, DE-GP offers better uncertainty estimates and hence beats the baselines by clear margins. The potential of DE-GP more reinforcement learning and Bayesian optimization scenarios deserves future investigation.
5.6 More Analyses
Ablation study on a We have conducted an ablation study on a (using ResNet-20 on CIFAR-10). The results are presented Table 2 We can see that DE-GP not sensitive the value of a. We in practice set. a 0.1 in the CIFAR experiments. We did not use smaller as it may result in colder posteriors and in turn worse uncertainty estimates.
A blation study on the architecture of prior kernel We perform an ablation study on the architecture for defining the prior MC NN-GP kernel, with the results listed in Table Surprisingly, using the cheap ResNet-20 architecture results in DE-GP with better test accuracy. We deduce this is because a deeper prior architecture induces a more complex, black-box correlation for the function, which may lead to over-regularization.
Comparison on training cost We present the training speed comparison in Fig. As shown, DE-GP consumes only marginally added training cost than the standard DE.
11

---

Published in Transactions on Machine Learning Research (08/2024)
6 Conclusion
In this work, we address the unreliability issuc of the uncertainty of Deep Ensemble by defining Gaussian process with Deep Ensemble and training the model under the principle of functional variational inference. Doing so, we have successfully calibrated the uncertainty of the ensemble of NNs. We offer recipes to make the training feasible, and further identify some empirical characteristics of DE-GP. Our method can implemented casily and efficiently. Extensive experiments validate the effectiveness of our method. We hope this work may shed light on the development of better Bayesian deep learning approaches.
Broader Impact Statement
This work proposes a Bayosian refinement of the Deep Ensemble. Its potential positive impacts on socicty are evident: its ability to enable better uncertainty estimation while maintaining predictive performance is crucial in the industry, e.g,, automatic driving, disease analysis, and financial applications. In this scenario, the uncertainty estimates could be used to reject uncertain predictions and raise the requirement of inviting humans into the decision process. As fundamental research in machine learning, the negative consequences are not obvious. Though in theory any technique can be misused, it is not likely to happen currently.
Acknowledgments
This work was supported by NSF of China (No. 62306176), Key R&D Program of Shandong Province, China (2023CXGC010112), Natural Science Foundation of Shanghai (No. 232R1428700), and -e-Baachhan--bbede Foundation Model Fund.
References
Peter I. Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalizze margin bounds for neural networks. Advances in Neural Information Processing Systems, 30:6240 6249, 2017.
Charles Blundell, Julien Corncbisc, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pp. 1613 1622, 2015.
David R Burt, Sebastian W Ober, Adrià Garriga-Alonso, and Mark van der Wilk. Understanding variational inference in function-space. In Third Symposium on Advances in Approximate Bayesian Inference, 2020.
Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. In International Conference on Machine Learning, pp. (683-1691. PMLR, 2014.
Kamil Ciosek, Vincent Fortuin, Ryota Tomioka, Katja Hofmann, and Richard Turner. Conservative uncertainty ostimation by fitting prior networks. In International Conference on Learning Representations, 2019.
Francesco D' A'Aelolo and Vincent Fortuin. Repulsive deep ensembles are bayesian. Advances in Neural Information Processing Systems, 34, 2021.
Zhijic Deng, Hao Zhang, Xiao Yang, Yimpeng Dong, and Jun Zhu. Bayesadapter: Being bayesian, inexpensively and reliably, via bayesian fine-tuning. arXiv preprint arXiv:2010.01979, 2020.
Zhijic Deng, Xiao Yang, Shizhen Xu, Hang Su, and Jun Zhu. Libre: A practical bayesian approach to adversarial detection. In Proceedings of the IEEE/CVT Conference on Computer Vision and Pattern Recognition, pp. 972-982, June 2021.
Zhijie Deng, Feng Zhou, and Jun Zhu. Accelerated linearized laplace approximation for bayesian deep learning. In Thirty-Sixth Conference Neural Information Processing Systems, 2022. URL https //openreview net//formmiidsjftllpllte.
Michael Dusenberry, Ghassen Jerfel, Yeming Wen, Yian Ma, Jasper Snock, Katherine Heller, Balaji Lak- shminarayanan, and Dustin Tran. Efficient and scalable bayesian neural nets with rank-1 factors. In International Conference Machine Learning, pp. 2782 2792. PMI.R, 2020.
12

---

Published in Transactions on Machine Learning Research (08/2024)
Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv: 191.0777 2019.
Yarin Gal and Zoubin Chahramani. Dropout a Bayesian approximation: Representing model uncertainty in deep learning. In International Conference Machine Learning, pp. 1050-10000000 1150-1059, 2016.
Kuzman Ganchev, Joao Graça, Jennifer Gillenwater, and Ben Taskar. Posterior regularization for structured latent variable models. The Journal of Machine Learning Research, 11:2001 2049,, 2010.
Alex Graves. Practical variational inference for neural networks. In Advances Neural Information Processing Systems, pp. 2348-2356, 2011.
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. International Conference on Machine Learning, pp. 1321-1330, PMLR, 2017.
Danijar Hafner, Dustin Tran, Timothy Lillicrap, Alex Trpan, and James Davidson. Noise contrastive priors for functional uncertainty. In Uncertainty in Artificial Intelligence, pp. 905 914. PMLR, 2020.
David A Harville. Matrix algebra from statistician's perspective, 1998.
Bobby He, Balaji Lakshminarayanan, and Yee Whye Teh. Bayesian deep ensembles via the neural tangent kernel. In Advances in Neural Information Processing Systems, volume 33, 2020.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human- level performance on imagenet classification. In Proceodings of the IEEE international conference on computer vision, pp. 1026 1034, 2015.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Rocognition, pp. 770-778, 2016.
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2018.
GeofTrey Hinton and Drew Van Camp. Keeping neural networks simple by minimizing the description length the weights. In ACM Conference on Computational Learning Theory, 1993.
Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E Hoperoft, and Kilian Q Weinberger. Snapshot ensembles: Train 1, get m for free. In International Conference on Learning Representations. 2016.
Sergey loffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448-456. PMLR, 2015.
Pavel Izmailov, Wesley J Maddox, Polina Kirichenko, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Subspace inference for bayesian deep learning. In Uncertainty in Artificial Intelligence, pp. 1169 1179. PMLR, 2020.
Pavel Izmailov, Sharad Vikram, Matthew D Hoffman, and Andrew Gordon Gordon Wilson. What are bayesian neural network posteriors really like? In International Conference on Machine Learning, pp. 4629-4640. PMTR, 2021.
Yiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. In International Conference Learning Representations, 2019.
Mohammad Emtiyan Khan, Didrik Nielsen, Voot Tangkaratt, Wu Lin, Yarin Gal, and Akash Srivastava. Fast and scalable Bayesian deep learning by pertuttnnrt in adam. In International Conference on Machine Learning, pp. 2616-2625, 2018.
Mohammad Emtiyaz E Khan, Alexander Immor, Ehsan Abedi, and Macicj Korzepa. Approximate inference turns deep networks into gaussian processes. Advances in Neural Information Processing Systems, 32, 2019.
13

---

Published in Transactions on Machine Learning Research (08/2024)
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pp. 6402 6413, 2017.
Jachoon Lee, Yasaman Bahri, Roman Novak, Samuel S Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
Qiang Liu and Dilin Wang. Stein variational gradient descent: A general purpose Bayesian inference algorithm. In Advances in Neural Information Processing Systems, pp. 2378 2386, 2016.
Christos Louizos and Max Welling, Structured and efficient variational deep learning with matrix gaussian posterions. International Conference on Machine Learning, pp. 1708 1716, 2016.
Xiuyuan Lu and Benjamin Van Roy. Ensemble sampling. In Advances in Neural Information Processing Systems, 2017.
David JC MacKay. A practical Bayesian framework for backpropagation networks. Neural Computation, 4 (3):448 472, 1992.
David John Cameron Mackay. Bayesian methods for adaptive models. PhD thesis, California Institute of Technology, 1992.
Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning, In Advances in Neural Information Processing Systems, pp. 13153-13166 2019.
Alexander G de G Matthews, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Sample-then-optimizz posterior sampling for baycsian linear models. In NeurIPS Workshop Advances in Approximate Bayosian Inference, 2017.
Mohammed Ali mnmoustafa. tiny- imagenet
Tiny imagenet, 2017.
URL atrss///aagle..om//mmmpettttttt
Radford M Neal. Bayesian Learning for Neural Networks. PhD thesis, University of Toronto, 1995.
Radford M Neal. Priors for infinite networks. In Bayesian Learning for Neural Networks, pp. 29 53. Springer, 1996.
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-basod capacity control in neural networks. In Conference on Learning Theory, pp. 1376 1401. PMLR, 2015.
Behnam Neyshabur, Srinadh Bhojanapalli, David Mcallester, and Nati Srebro. Exploring generalization in deep learning. Advances in Neural Information Processing Systems, 30:5947 00-5947-5956, 2017.
Roman Novak, Lechao Xiao, Yasaman Bahri, Jaehoon Lee, Greg Yang, Jiri Hron, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2018.
Tan Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. Advances in Neural Information Processing Systems, 29:4026-4034 2016.
Tan Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. Advances in Neural Information Processing Systems, 31, 2018
Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, D Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Takshminarayanan, and Jasper Snock. Can you trust your model's uncortainty? evaluating prodictive uncertainty under dataset shift. Advances in Neural Information Processing Systems, 12:13991-14000 2019.
14

---

Published in Transactions on Machine Learning Research (08/2024)
Tim Pearce, Felix Leibfried, and Alexandra Brintrup. Uncertainty in neural networks: Approximately bayesian ensembling. In International conference on Artificial Intelligence and Statistics, pp. 234- PMTRR 2020.
Carlos Riquelme, George Tucker, and Jasper Snock. Deep bayesian bandits showdown: An empirical comparison of bayesian deep networks for thompson sampling. In International Conference on Learning Representations, 2018.
Hippolyt Ritter, Aleksandar Botev, and David Barber. scalable laplace approximation for neural net- works. In International Conference on Learning Representations, volume International Conference on Representation Learning, 2018.
Tim G. J. Rudner, Zonghao Chen, and Yarin Gal. Rethinking function-space variational inference in bayesian neural networks. In Third Symposium on Advances in Approximate Bayesian Inference, 2021. URL
Tim GJ Rudner, Zonghao Chen, Yee Whye Teh, and Yarin Gal. Tractable function-space variational inference in bayesian neural networks. Advances in Neural Information Processing Systems, 35:22686 22698, 2022.
Jiaxin Shi, Shengyang Sun, and Jun Zhu. Kernel implicit variational inference. In International Conference on Learning Representations, 2018a.
Jiaxin Shi, Shengyang Sun, and Jun Zhu. A spectral approach to gradient estimation for implicit distributions. In International Conference on Machine Learning, pp. 4644-4653. PMLR, 2018b.
Lewis Smith and Yarin Gal. Understanding measures of uncertainty for adversarial example detection. arXiv preprint arXiv:1803.08533 2018.
Shengyang Sun, Guodong Zhang, Jiaxin Shi, and Roger Grosse. Functional variational Bayesian neural networks. Tn International Conference on Learning Representations, 2019.
Ziyu Wang, Tongzheng Ren, Jun Zhu, and Bo Zhang. Function space particle optimization for Bayesian neural networks. In International Conference on Learning Reprosentations, 2019.
Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In International Conference on Machine Learning, pp. 681 688, 2011.
Andrew G Wilson and Pavel Iamailov. Bayesian deep learning and a probabilistic perspective of generalization. In Advances in Neural Information Processing Systems, volume 33, pp. 4697-4708, 2020.
Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. Deep kernel learning. In International conference Artificial Intelligence and Statistics, pp. 370-378. PMLR, 2016.
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1008.07747, 2017.
Guodong Zhang, Shengyang Sun, David Duvenand, and Roger Grosse. Noisy natural gradient as variational inference. In International Conference on Machine Learning, pp. 5847-5856, 2018.
Jun Zhu, Ning Chen, and Eric P Xing. Bayesian inference with posterior regularization and applications to infinite latent svms. The Journal of Machine Learning Research, 15(1):1799 1847, 2014.
15

---

Published in Transactions on Machine Learning Research (08/2024)
A APPENDIX
A.1 An Explanation for the Weight-space Regularization
Posterior regularization (Ganchev et al. 2010 Zhu et al., 2014) provides workaround for Bayesian approaches
to impose extra prior knowledge. We can apply posterior regularization to functional variational inference by
solving:
max P())) - DKLls(f)llp(f) s.t. (f) EQ
(12)
{(f)
Q {q( (())())))))
0} is valid set defined in terms of functional Q which delivers some statistic of interest of a function For tractable optimization, we can slack the constraint as a penalty:
<
max L' = - m (1nx))) o(f)
(13)
where 3 is a trade-off coefficient.
We next show that the extra weight-space regularization can be derived by imposing the extra prior that functions drawn from DE-GP should generalize well to the learning of DE-GP given the above paradigm.
Binary classification In the binary classification ion scenario, y E {-1,1} and S.9: : - R. We use 0-1 loss {(f(z),) 3) = 1 (f(s)((((())) to measure the classification error on one datum. We assume an underlying distribution j = fl y) supported on X' x [-1,1} for generating the training data D, based on which we can define the true risk of a function (hypothesis) f: R(J) == [ ())e))(((((())) y)) We set Re)))(()) = Byc, R(J) in the seek of posterior over functions that can generalize well.
-
By definition, hypothesis sample f q(f) = (P(m(z))k(a; x')) can be decomposed f(z)
M EM (xx) + ((x)) with ((x)) ~ GP(O, ((xx,x)), x²)). If sign(/ (xx) F y. it impossible that (g = y, sign(gM (z)) = y, and sign({(æ)) = y all hold. In other words,
{(f(z),)) S Σ +
(14)
We can further re-parameterize ((x) as ((x) 7M E (x) - m(x)) + Veo. ~ ~N0, 1), 0,.., M, which is essentially a real-valued random function symmetric around Thus, for any (a. y) 14, we have 1/2. As a result,
E Egcn Beo....esr ((((x)))) (e......
M B R(J) S &R B( Σ (((((()))))) w)) + ((00)~1111/ = [(R(g)) + 1/2.
M
(15)
Namely, the expected generalization error of the approximately posteriori functions can be bounded from above by those of the DNN basis functions. Recalling the theoretical and empirical results showing that DNNs' generalization error R(g.) can be decreased by controlling model capacity in terms of norm-based
regularization min., ||w: Neyshabur et al. 2015 2017 Bartlett et. al. 2017 Jiang et al. 2019 oblain an explanation for the extra weight-space regularization.
Multi-class Classification In the multi-class classification scenario where y E {1,2, C} and f.9: :X'' + f(x)(v') to measure prediction error where [()) denotes j-th coordinate of fxx) The distinct difference between this scenario and the binary classification scenario is that in this setting, ((x)) is a vector-valued function:
RCC we use the loss ((f()),))) v) =
M Σ VM 1=1
((x)
(() - mm())) + vdew,
(16)
where co ~ Ic) and &~ N2(,0, 1), 1, ..., ...,. M. We then make mild assumption to simplify the analysis.
'Here we assume one-dinensional outputs Q notation compactness.
16

---

Published in Transactions on Machine Learning Research (08/2024)
Assumption 1 For any (a, v) p,, the elements on the diagonal of k( x) have the same value.
This assumption implies that for any j.3' E {I,,,,
1 M
M
- mm))))) -
1
Σ
x
(17)
M
M
I.c.,
Σ - m()) = Σ (
(18)
Therefore, {(x) possesses the same variance across its output coordinates and becomes a random guess classifier. Based on this, we have Egcr)(((x)) v) (((())) = (C - 1)/C. We can then derive a similar conclusion to that in the binary classification.
The validity of Assumption
When the data dimension |.| is high and the number of training data n is finitely large, with zero probability the sampled data (x, y) ~ μ resides in the training set. Therefore, only the KL divergence lerm of the FELBO explicitly affects the predictive uncertainly at x.. Because the considered priors possess diagonal structure, it is hence reasonable to make the above assumption.
A.2 Detailed Experimental Settings
Illustrative regression. For the problem on y sin 2x + C,C (N 0.1), we randomly sample data points from [-1.5, 1.5). We add -1.2 to the target value of the rightest data point to introduce strong data noise. For optimizing the ensemble members, we use SGD optimizer with 0.9 momentum and 0.001 learning rate. The learning rate follows a cosine decay schedule. The optimization takes 1000 iterations. The extra measurement points are uniformly sampled from 2, The regularization constant À is set as le - 4 times of the average eigenvalue of the central covariance matrices.
UCI regression. We pre-process the UCI data by standard normalization. We set the variance for data noise and the weight variance for the prior kernel following (Pearee et al., (020).. The batch size for stochastic training is 256. We use an Adam optimizer to optimize for 1000 epochs. The learning rate is initialized 0.01 and decays by 0.99 every 5 epochs.
Pashion-MNIST classification. The used architecture is C3nv 3, I>-BN-ReLUUMaxxPooll (2o (64, 3, MaaeLL-MaxPool())-ineeeeee LineLnarr2G)--RLeUULnneeee
where Conv(æ, y, 2) represents a 2D convolution with x output channels, kernel size y, and padding 2. The batch size for training data is 64. We do not use extra measurement points here. We use an SGD optimizer to optimize for 24 epochs. The learning rate is initialized as 0.1 and follows cosine decay schedule. We use an Adam optimizer with 1e 3 learning rate to optimize the temperature. We use 1000 MC samples estimate the posterior predictive and the epistemic uncortaint,, because the involved computation is only the cheap softmax transformation the sampled function values.
CIFAR-10 classification. We perform data augmentation including random horizontal flip and random crop. The batch size for training data is 128. We do not use extra measurement points here. We use a SGD optimizer with 0.9 momentum to optimize for 200 epochs. The learning rate initialized as 0.1 and decays by 0.1 at 100-th and 150-th epochs. We use an Adam optimizer with le lcarning rate to optimize the lemperature. We use 1000 MC samples to estimate the posterior predictive and the epistemic uncertainly. Suggested by Ovadia et al. (2019); He et al. (2020), we train models on CIFAR-10, and test them the combination of CIFAR-10 and SVHN test sets. This is a standard benchmark for evaluating the uncertainty of OOD data.
Contextual bandit. We use MLPs with 2 hidden layers of 256 units. The batch size for training 512. We do not use extra mcasurement points here. We update the model (i.c., the agent) for 100 epochs with an Adam optimizer every 50 rounds. We set a == 1. DE, rDE, and RMS all randomly choose an ensemble member at per iteration, but method randomly draws sample from the defined Gaussian process for
17

---

Published in Transactions on Machine Learning Research (08/2024)
decision.
This is actually emulating Thompson Sampling and advocated by Bootstrapped DQN (Osband
et al. 2016 "Random" baseline corresponds to the Uniform algorithm.
A.3
More Experimental Results
We provide more results in this subsection.
A.3.1
Results of DE-GP without Using Extra Measurement Points
We depict the results of DE-GP without using extra measurement points on y = sin 2x + c,c ((0,0.2) problem Fig. T0 The results are promising.
MLPs w/o hidden layers
MLPs hidden layer
MLPs w 2 hidden layers
MLPs w 3 hidden layers
Figure 10: Results of DE-GP without using extra measurement points. The settings equivalent to those in the main text.
A.3.2 Results Regarding OOD Detection
We present the results uncertainty-bassed OOD detection in Table which correspond to the Fashion- MNIST v.s. MNIST and CIFAR-10 v.s. SVHN scenarios in Fig. (Right) and Fig. respectively. As shown, our method exhibits the best AUROC.
Table 4: Uncertainty-basee OOD detection results in terms of AUROC.
Fashion- MNNIS v.s. MNIST
CIFAR-10 v.s. SVHN (ResNet-56)
DE-GP
0.980
0.937
DE
0.922
0.876
rDE
0.907
0.931
RMS
0.918
0.889
IDE
0.921
0.934
A.3.3 More Results on CIFAR-10 Classification
We plot the negative log-likelihood and test accuracy CIFAR-10 corruptions for models trained with ResNet-20 and ResNet-56 in Fig. I1 and Fig. 12 As shown, DE-GP outperforms the baselines in the aspect of nogative log-likelihood, but yields similar test accuracy to the baselines. Recapping the results in the main text, DE-GP indeed has improved OOD robustness, but may still face problems in OOD generalization.
We then conduct experiments with the deeper ResNet-110 architecture. Due to resource constraints, we ensemble members. The other settings roughly the same as those for ResNet-56. The results offered in Fig. 13 which validate the effectiveness of DE-GP for large networks.
A.3.4 Results on CIFAR-100
We further perform experiments on the more challenging CIFAR-100 benchmark. We present the distribution test accuracy of DE-GP as well as the basclines in Table We can see that DE-GP (8 0.1) is still par with rDE.
18

---

Published in Transactions on Machine Learning Research (08/2024)
Negwiive Log. Welhood
DE-GP
DE GP
DE
Negative Log-
RMS
MC dropout
IDE
IDE
Skew intensity
Skew intensity
Figure 11: Negative log-likelihood on CIFAR-10 corruptions for models trained with ResNet-20 (Teft)
ResNet-56 (Right) architecture. We summarize the results across 19 types of skew in each box.
0.8
Accrncy
Accurccy
DE
0.6
IDE
0.6
IDE
0.4
dropout
0.4
dropout
SE
IDE
0.2
IDE
Skew intersity
Skew intensity
Figure 12: Test accuracy on CIFAR-10 corruptions for models trained with ResNet-20 (Left) or ResNet-56 (Right) architecture. We summarize the results across 19 types of skew in each box.
0.6
Eror on compres with
Expected Calloratoon
IDE
0.4
0.3
DE
0.2
rDE
0.1
RMS
0.0
0.5
0.2
Skew intensity
Uncertainty Threshold
Figure 13: (Left): Expected Calibration Error on CIFAR-10 corruptions for models trained with ResNett-10 architecture. We sunmarize the results across 19 types of skew in each box. (Right): Test error versus uncertainty plots for methods trained CIFAR-10 and tested on both CIFAR-10 and SVHN with ResNet-110 architecture. Ensemble size is fixed as 5 for these experiments.
Table 5: Test accuracy comparison on CIFAR-100.
Architecture
DE-GP (B 0.1)
DE
rDE
RMS
ResNet-20
76.59%
74.14%
76.81%
75.08%
ResNet-56
79.51%
76.46%
79.21%
76.77%
We depict the error versus uncertainty plots on the combination of CIFAR-100 and SVHN test sets in Fig. 14 It is shown that the uncertainty estimates yielded by DE-GP for OOD data are more calibrated than the baselines.
We further test the trained methods on CIFAR-100 corruptions (Hendrycks Dietterich 2018 and present the comparisons aspects of test accuracy and NLL in Fig. 15 evident that DE-GP reveals lower NLL than the baselines at various levels of skew.
19

---

Published in Transactions on Machine Learning Research (08/2024)
0.8
0.8
0.7
Eroor on exsmples with uncorbalndy
0.4
0.4
DE-GP
DE-GP
0.3-
0.3
DE
DE
0.2
rDE
rDE
RMS
RMS
1.0
0.8
0,6
0.4
0.2
1.0
0.8
0.6
0.4
0.2
Uncertainty Threshold
Uncertainty Threshold
Figure 14: Test error versus uncertainty plots for methods trained on CIFAR-100 and tested on both CIFAR-100 and SVHN with ResNet-20 (Left) or ResNet-56 (Right) architecture.
Regative livelhhes
DE-GP
DE-GP
20.0
DE
rDE RMS
RMS
Negalow
5.0-
Skew Intensity
Skew intensity
0.8
0.6
Accuracy
Accuracy
0.4
DE-GP
0.4
DE-GP
IDE
IDE
RMS
Skew intensity
Skew intensity
Figure 15: First row: test NLL on CIFAR-100 corruptions for models trained with ResNet-20 (Left) or ResNet-56 (Right) architecture. Second row: test accuracy on CIFAR-100 corruptions for models trained with ResNet-20 (Teft.) or ResNet-56 (Right) architecture. We summarize the results across 19 types of skew in each box.
A.3.5 Results on TinylmageNet
We conduct experiments on Tmt (mmmoustaaa, 2017) and here are some core results (we ensemble members with ResNet-18 architecture and perform training for 30 epochs with an SGD optimizer):
Table Empirical comparison on TinyImageNet.
Acc
NL.L
ECE
rDE
49.6%
2.10
0.023
DE-GP
49.3%
2.15
0.017
As shown, despite marginally worse accuracy and NLL, DE-GP substantially more calibrated than rDE, hence enjoying better uncertainty estimates.
20


Reviews:
[{"review_id": "BCAWcKjDRX", "reviewer": "Reviewer_LjxS", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "1. \" (i) DE and rDE collapse to a single model in the linear case (i.e., without hidden layers), because the loss surface is convex w.r.t. the model parameters;\"  This is a extreme case, I don't see any motivation from this observation. \n2. \" (ii) DE and rDE reveal minimal uncertainty in in-distribution regions, although there is severe data noise; \" what does this mean, which part of the figure show this?\n3. I can accept the hypothesis that the uncertainty brought by DE cannot well represent the bayesian inference, but why and I can not see from the toy example in figure 1 because it show an extreme case. a 2 hidden layer to fit the simple linear training data, it is obvious to overfit. Please give more detailed motivation the explanation.\n4. I don't understand the relationship between your observation and epistemic or aleatoric uncertainty, please explain.\n5. I don't understand how to directly add a small scaled identity matrix λIC in section 4.1.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The paper proposes a method to enhance the uncertainty quantification in Deep Ensemble (DE) models by incorporating functional inconsistency among ensemble members using functional variational inference (fVI). Traditional DE models suffer from unreliable uncertainty due to randomness in initialization and optimization. By characterizing functional inconsistency with empirical covariance and defining a Gaussian process, the proposed approach explicitly manages uncertainty and achieves better calibration. This method outperforms existing DE and BNN methods across various benchmarks, providing more reliable uncertainty estimates with minimal additional computational cost.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "1. Motivation not clear, maybe try a better toy example.\n2. Figure 1 should be well explained, no detailed illustration for figure 1.", "broader_impact_concerns": "The broader impact concerns include potential misuse of the improved uncertainty quantification in critical decision-making systems, such as autonomous driving or medical diagnosis, leading to over-reliance on automated systems. Additionally, the computational resources required for these methods could contribute to environmental concerns and increase the digital divide.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "6X1xM637hp", "reviewer": "Reviewer_tucJ", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strengths\n\n- Motivation for proposing DE-GP\n- Teaser figure showing that DE-GP addresses the over-confidence issue that DE has, and follows the NN-GP uncertainty\n- Extensive experiments on a small dataset shows the effectiveness of DE-GP\n- well-written paper\n\nWeakenesses\n\n- Experiments on a real dataset: Experimental results show that DE-GP works well on small datasets like MNIST or CIFAR10. One merits of Deep Ensemble over other uncertainty methods would be the scalability. In that sense, I wonder how DE-GP would work on a real dataset like CelebA or ImageNet (or TinyImageNet).\n\n- The baselines that are compared with SD-GP are quite out-dated. I was wondering if there are more recent works that are related with Deep Ensemble, and if SD-GP still outperforms those recent methods in terms of uncertainty quantification. \n\n- [A] have shown that achievements of Deep Ensemble can be replicated by a larger single model. Within the same setting, would SD-GP outperform a larger single model?\n\n[A] Deep Ensembles Work, But Are They Necessary? NeurIPS, 2022.", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The paper proposes DE-GP, a new method to quantify uncertainty in deep learning. To address the over-confidence and functional inconsistency the Deep Ensemble method has, DE-GP view each function in ensemble as a basis function. These basis functions are descrbied by a Gaussian Process. To train the model, the authors use a functional variational inference given specific prior beliefs. DE-GP is compared with standard baselines on standard benchmarks and show it's effectiveness.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "The paper is well-written and has good motivation with a solid method. Extensive experiments are done, though they are on small/toy datasets. I wonder if DE-GP works in a scaled-up setting like in CelebA or ImageNet. Also, it would be more impactful if authors compare SD-GP with more recent baseline methods.", "broader_impact_concerns": "The authors stated the broader impact.", "additional_comments": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "QdwvM085tv", "reviewer": "Reviewer_Ym7q", "summary": "", "questions": "", "limitations": "", "rating": null, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Stength:\n1. The motivation of the method is clear (i.e., prevent function space mode collapse) and the method seems natural and easy to implement (compared with some other function space Bayesian methods).\n2. The performance of the method looks ok when comapred with the baselines considered in the paper.\n3. The paper is well structured and is easy to follow.\n\nWeakness:\n1. Please consider reporting NLL for classification on in-distribution data as well (i.e., without corruptions)\n2. The performance of OOD detection tasks is typically reported for Bayesian UQ paper, but is missing in this submission.\n3. The baselines are not very strong. E.g. D’Angelo et al. 2021 is mentioned in the related work as a concurrent work but no comparison with it is done through experiments.\n\nMinor:\n1. The first sentence in the second paragraph in Section 1 \"Deep Ensemble (DE) (Lakshminarayanan et al., 2017) is an effective and practical BNN method...\" - this is arguable (as mentioned in you paper as well in the related work section). I suggest the authors consider rewording it a bit.\n2. The KL[q(f)||p(f)] seems to be intractble as the approx. posterior and prios GP are based on different kernels (it seems to be a common issue for some other fVI papers as well though).", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "paper_topic_and_main_contributions": "", "excitement": null, "reproducibility": null, "ethical_concerns": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "summary_of_contributions": "The authors propose to take functional inconsistency into account in the training stage of deep ensemble (DE) to prevent functional mode collapse by regularize the empirical GP defined by DE with a prior GP. The proposed method is evaluated over standard regression & classification, and contextual bandit benchmarks.", "claims_and_evidence_yn": "Yes", "claims_explanation": "", "audience_yn": "Yes", "audience_explanation": "", "requested_changes": "See weakness", "broader_impact_concerns": "N/A", "additional_comments": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: Reviewers mainly raised concerns regarding (1) experiments on relatively small datasets and outdated baselines, and (2) issues on discussing deep ensemble approach. The concerns are largely addressed by author feedback, specifically the authors have made a good argument that deep ensemble, despite being published in 2017, remains to be a strong baseline for uncertainty quantification in 2024.

Please incorporate your experimental results in the author feedback to the final camera ready. Also it would be useful to clarify more about making better discussions regarding the relationship between deep ensemble and (approximate) Bayesian inference. Lastly, there has been works related to FVI, e.g., https://arxiv.org/abs/2312.17199 that the authors should consider discussing and comparing.
Decision: Accept (poster)