betaFeedback

WorksMathematics

Variational Filtering for Bayesian Last Layers with an Independent Binary Probit Surrogate

Abstract

Modern deep classifiers trained by gradient descent need many passes over the data to become accurate, and even then are not always well calibrated; post-hoc temperature scaling corrects calibration after training but cannot influence training-time accuracy or convergence. We propose a variational filtering algorithm for the last layer of deep classifiers, whose parameters are treated as the latent state of a linear-Gaussian state-space model. Each mini-batch is assimilated by an exact prediction step followed by a closed-form variational update, made conjugate by an independent binary probit (IBProbit) surrogate for the categorical likelihood. The filter's process noise stabilises the updates under feature drift and keeps the predictive distribution from collapsing to a point estimate, allowing the same procedure to be used for linear probing on a frozen backbone and for full-network fine-tuning. We evaluate on DINOv3 backbones against two baselines tuned under an identical protocol: AdamW with cross-entropy and post-hoc temperature scaling, and Variational Bayesian Last Layers (VBLL). As a linear probe on frozen features, IBProbit attains the best accuracy and negative log-likelihood on all five downstream tasks at the largest backbone, and on two of the five at the smallest. In out-of-distribution detection with CIFAR probes on the largest backbone, IBProbit reduces the false-positive rate at 95% true-positive rate by a factor of 1.4 to 3.2 relative to the better of the two baselines, on all three dataset pairs. When the whole network is fine-tuned on ImageNet-1k, IBProbit reaches the final performance of the cross-entropy baseline in half the wall-clock time.

Introduction

Modern deep neural networks, despite achieving remarkable predictive accuracy, are often weakly calibrated, as their confidence scores do not reliably reflect the true probability of correctness [12]. This matters in safety-critical applications such as medical diagnosis, autonomous driving, and financial decision-making, where downstream decisions depend on predicted probabilities, and not just the correctness of the predicted labels. Temperature scaling [12] is the standard post-hoc correction and is a strong in-distribution baseline, but it is a one-parameter correction applied after training on a separate validation split; it cannot influence the learned features,

Preprint. and it offers no mechanism to keep a model calibrated during training or fine-tuning, where the feature distribution is itself shifting.

Bayesian approaches to deep learning offer a principled alternative, replacing a point estimate of the weights with a distribution and propagating the associated uncertainty into predictions [5, 15]. Full Bayesian inference over all network parameters remains computationally prohibitive at scale. The “Bayesian last-layer” (BLL) paradigm is a practical compromise: only the final classification layer is treated probabilistically, while the feature extractor remains deterministic [18, 8]. This preserves the representational power of large pretrained backbones while adding meaningful epistemic uncertainty at a small fraction of the compute cost. Existing sampling-free BLL methods either rely on softmax-bound ELBOs that still require gradient-based head optimization (VBLL [13]) or on post-hoc Laplace approximations whose uncertainty quality is bounded by the converged point estimate [8].

We build on Wojnowicz et al. [2022], who introduce categorical-from-binary (CB) likelihoods: categorical models whose likelihood is lower-bounded by a product of KK independent per-class binary likelihoods evaluated at the one-hot encoding of the label, so that this independent binary (IB) model can serve as a tractable surrogate for posterior inference. The surrogate model admits a conjugate Gaussian update that we can solve in closed form via coordinate-ascent variational inference (CAVI), with no gradient-based optimization of the classification head. We extend this approach in two ways that are relevant in practice. First, we turn the batch update into a variational filter: the head is the latent state of a linear-Gaussian state-space model, and each mini-batch is one exact prediction step followed by a closed-form variational update. The process noise of the prediction step serves two purposes at once — it tracks changes in the optimal head as the backbone is fine-tuned, and it counteracts covariance contraction as evidence accumulates; enabling a well calibrated posterior predictive data likelihood. Other approaches, like streaming variational Bayes [7], accumulate evidence without discounting it. Here, instead we introduce a single scalar hyper-parameter that sets a covariance floor for arbitrarily long training. In addition, we exploit the fact that the independent-probit likelihood induces a precision matrix that is shared across all KK classes, so two Cholesky factorisations per batch (not per CAVI step) serve all KK class-conditional updates, and the TT-iteration CAVI inner loop itself reduces to matrix multiplications with no further matrix solves or inversions.

Concretely, we ask: can a closed-form variational filter over the last-layer weights (i) match an extensively trained cross-entropy and temperature-scaling baseline on both accuracy and calibration in fewer epochs, (ii) surpass the leading sampling-free Bayesian last-layer alternative on the same backbone, and (iii) scale to ImageNet-scale probing on modern self-supervised backbones? Our contributions are: (i) a variational filtering algorithm for the last layer, pairing a Kalman-style prediction step with a closed-form CAVI update under the independent binary probit (IBProbit) surrogate; (ii) a parallel-in-KK, Cholesky-preconditioned inner loop accelerated by parameter expansion (Algorithm 1); (iii) a comparison under a matched training protocol against AdamW+cross-entropy with temperature scaling and against Variational Bayesian Last Layers [13], where IBProbit leads on accuracy and NLL at every task at the largest backbone, and on more tasks as the backbone size increases; (iv) out-of-distribution detection with CIFAR-10 and CIFAR-100 probes on the largest backbone, where IBProbit has the lowest false-positive rate at 95% true-positive rate on all three dataset pairs (lower than the better baseline by a factor of about three on CIFAR-10 vs SVHN) and loses no in-distribution accuracy; and (v) full-network fine-tuning of DINOv3-Huge on ImageNet-1k, where IBProbit reaches the same accuracy, NLL and Brier score of the cross-entropy baseline in half the wall-clock time, and VBLL does not reach them within the same budget.

Code and scripts to reproduce all results are released at the following GitHub repository https://github.com/dimarkov/bllarse.

Related Work

Calibration of deep classifiers. Post-hoc temperature scaling [12] is a strong in-distribution baseline but, being applied after training, cannot influence training-time convergence or accuracy. Training-time alternatives reshape the loss — focal loss [Mukhoti et al., 2020], mixup [Thulasidasan et al., 2019] — and recent architecture-driven gains in calibration are uneven and architecture-specific [24]. We instead replace the softmax likelihood with a categorical-from-binary probit likelihood [Wojnowicz et al., 2022] and infer the last-layer weights through its independent binary surrogate.

Bayesian Last Layers. Treating only the final layer as Bayesian is a long-established compromise: a single Bayesian layer fixes overconfidence far from training data [18], and an additional infinite-feature GP extension is needed for cubic-rate asymptotic calibration [19]. For classification, Variational Bayesian Last Layers (VBLL) [13] keep the categorical likelihood tractable via a double-Jensen log-sum-exp lower bound on the ELBO; for regression, Fiedler and Lucia Fiedler and Lucia [ [10] proposes a related Bayesian last-layer method via a reformulated marginal likelihood. We differ in two ways. First, we bound a different quantity: instead of keeping the softmax and bounding its ELBO, we change the likelihood to a categorical-from-binary probit and lower-bound it by its independent binary probit surrogate [Wojnowicz et al., 2022], whose ELBO is maximized by a closed-form conjugate update rather than by gradient steps. Second, we apply this update as a recursive Bayesian filter over a drifting head.

Filtering the last layer. Streaming variational Bayes [7] updates a variational posterior recursively over the data, with a static parameter, so its precision accumulates without bound; adding dynamics to the parameter yields a filter. Closest to our work, Titsias et al. Titsias et al. [2024] place a state-space model over the last-layer weights and track it with a Kalman filter whose covariance is, as here, shared across classes. They handle classification by replacing the softmax with a Gaussian likelihood on the one-hot labels, and predict by Monte Carlo through the exact softmax with a gradient-fitted calibration parameter. Our update keeps a non-Gaussian probit observation model and solves it variationally: it has the same form as theirs, with the Albert–Chib expectations in place of the one-hot targets, and its predictive is closed-form. We also target a different regime, calibration under standard probing and fine-tuning rather than online continual learning.

Other uncertainty-quantification approaches. Whole-network UQ methods — deep ensembles [20], MC Dropout [11], SWAG [23] — are more expressive but substantially more expensive at train and inference time, and their absolute calibration still degrades under shift, with deep ensembles among the most robust but still imperfect [Snoek et al., 2019]; post-hoc Laplace approximations [8] avoid that cost but, being a Gaussian centered at the trained MAP, inherit any pathologies of the converged point estimate. Harrison et al. Harrison et al. [ [13] found variational last-layer methods competitive with these baselines at a fraction of the compute, so we focus our direct comparison on the VBLL family.

Pólya-Gamma augmentation. Pólya-Gamma augmentation [Polson et al., 2013] yields conjugate Gaussian updates for logistic regression, and stick-breaking variants [21] extend it to multinomial outcomes. We implement both for reference, but each CAVI iteration requires a full (D+1)×(D+1)(D+1) \times(D+1) inversion per class — meaning that the per-sample auxiliary variables break the shared-precision structure. This makes runtime linearly dependent on the number of classes, and orders of magnitude slower than the update for the independent binary probit surrogate [Wojnowicz et al., 2022], whose precision is shared across classes and whose inversion can be moved outside the CAVI iterations (Algorithm 1). The trade-off is that stick-breaking Pólya-Gamma is conjugate for a genuine categorical likelihood, at the cost of an imposed class ordering, whereas the independent binary surrogate is order-invariant but only bounds its categorical likelihood.

Deep Kernel Learning. Deep Kernel Learning [Wilson et al., 2016] pairs a deep feature extractor with a Gaussian-Process head; the original work uses KISS-GP / inducing-point approximations to avoid the cubic cost of exact GPs, at the expense of additional approximation and tuning overhead. Our method can be interpreted as a variational approximation to DKL under specific assumptions: marginalizing the last-layer weights under our Gaussian posterior induces a linear kernel on the (neural) features, and the independent binary probit surrogate, whose covariance is shared across classes, admits closed-form updates that scale linearly in both NN and KK.

Methods

The method is a variational filter over the last-layer weights. § 3.2 gives its observation model, § 3.3 its update step, § 3.4 its dynamics and prediction step, and § 3.5 its predictive.

Problem Setting

Consider a classification problem with KK classes. Given an image ii and features x=h(i,θ)∈RDx = h(i, \theta) \in\mathbb{R}^{D} produced by a neural-network backbone hh, we seek to model the class-predictive probabilities p(y=k∣x)p(y = k \mid x) for k∈{1,…,K}k \in\{1, \ldots, K\}. In standard practice, this is achieved via a linear layer followed by softmax:

p(y=k∣x,w)=exp⁡(wk⊤[x;1])∑j=1Kexp⁡(wj⊤[x;1]),(1)p(y = k \mid x, \mathbf{w}) = \frac{\exp(\mathbf{w}_k^\top[x;1])}{\sum_{j=1}^{K} \exp(\mathbf{w}_j^\top[x;1])}, \tag*{(1)}

where wk∈RD+1\mathbf{w}_k \in\mathbb{R}^{D+1} are the weights projecting features to class kk. Training proceeds by minimizing the cross-entropy loss with respect to parameters w\mathbf{w}, in the case of linear probing, or with respect to both last layer and network parameters θ\theta, in the case of full-network training and fine-tuning.

Independent Binary Probit Model

Following Wojnowicz et al. [2022], we replace the softmax likelihood with a categorical-from-binary (CB) probit likelihood and perform inference through its independent binary (IB) probit surrogate. We pad the input features with a constant to absorb the bias, writing x~=[x;1]∈RD+1\tilde{x} = [x;1] \in\mathbb{R}^{D+1} and d=D+1d = D + 1 for its dimension. The surrogate treats the KK entries of the one-hot label vector zz, with zk=δy,kz_k = \delta_{y,k}, as independent binary probit observations,

pIB(z∣x~,W)=∏k=1KΦ(wk⊤x~)zk(1−Φ(wk⊤x~))1−zk,(2)p_{\mathrm{IB}}(z \mid\tilde{x}, W) = \prod_{k=1}^{K} \Phi(\mathbf{w}_k^\top\tilde{x})^{z_k} \left(1 - \Phi(\mathbf{w}_k^\top\tilde{x})\right)^{1-z_k}, \tag*{(2)}

where Φ(⋅)\Phi(\cdot) denotes the standard normal cumulative distribution function (CDF). The surrogate is not a categorical model, because it also assigns probability to label vectors with no active class or with several. The categorical likelihood is the CB model obtained by conditioning the surrogate on exactly one active class, which Wojnowicz et al. [2022] call the categorical-from-binary-via-conditioning (CBC) model:

pCB(y=k∣x~,W)=ρ(wk⊤x~)∑j=1Kρ(wj⊤x~),ρ(a)=Φ(a)Φ(−a).(3)p_{\mathrm{CB}}(y = k \mid\tilde{x}, W) = \frac{\rho(\mathbf{w}_k^\top\tilde{x})}{\sum_{j=1}^{K} \rho(\mathbf{w}_j^\top\tilde{x})}, \qquad\rho(a) = \frac{\Phi(a)}{\Phi(-a)}. \tag*{(3)}

It satisfies pCB(y∣x~,W)>pIB(z∣x~,W)p_{\mathrm{CB}}(y \mid\tilde{x}, W) > p_{\mathrm{IB}}(z \mid\tilde{x}, W) for every label, so the evidence lower bound of the surrogate is also a lower bound on the marginal likelihood of the categorical model (Appendix § 8.§ 1). We therefore infer the posterior over WW with the surrogate (§ 3.3) and use (3) for the training loss and for prediction (§ 3.6).

We place a Gaussian prior on the weight matrix W=[w1,…,wK]∈R(D+1)×KW = [\mathbf{w}_1, \ldots, \mathbf{w}_K] \in\mathbb{R}^{(D+1)\times K} in its general conjugate form — a product of multivariate normals whose covariance is shared across classes:

p(W)=∏k=1KN(wk∣μk0,Σ0),Λ0=Σ0−1,η0,k=Λ0μk0.(4)p(W) = \prod_{k=1}^{K} \mathcal{N}(\mathbf{w}_k \mid\mu_k^0, \Sigma_0), \qquad\Lambda_0 = \Sigma_0^{-1}, \qquad\eta_{0,k} = \Lambda_0 \mu_k^0. \tag*{(4)}

At initialisation we take μk0=0\mu_k^0 = 0 and Σ0=I\Sigma_0 = I, but we keep the prior general because the filtering recursion of § 3.4 replaces it at every batch with the predicted posterior.

The Variational Update: CAVI with Parameter Expansion

Variational posterior. We approximate the intractable posterior p(W∣D)p(W \mid\mathcal{D}), where D={(in,yn)}n=1N\mathcal{D} = \{(i_n, y_n)\}_{n=1}^{N} denotes a dataset, by the same family as (4),

q(W)=∏k=1KN(wk∣μk,Σ),μk∈RD+1,Σ∈R(D+1)×(D+1).(5)q(W) = \prod_{k=1}^{K} \mathcal{N}(\mathbf{w}_k \mid\mu_k, \Sigma), \qquad\mu_k \in\mathbb{R}^{D+1}, \quad\Sigma\in\mathbb{R}^{(D+1)\times(D+1)}. \tag*{(5)}

The shared Σ\Sigma is a consequence of the independent-probit likelihood rather than a particular choice of the variational approximation: the quadratic term in wkw_k is driven by x~nx~nT\tilde{x}_n\tilde{x}_n^{\mathsf{T}} and does not depend on kk, so every class posterior inherits the same precision and only the first natural parameter differs by class.

Augmented ELBO. The independent binary probit admits an Albert–Chib augmentation [2] with auxiliary variables z~nk∼N(wkTx~n,1)\tilde{z}_{nk} \sim\mathcal{N}(w_k^{\mathsf{T}}\tilde{x}_n, 1) and observation rule znk=1[z~nk>0]z_{nk} = 1[\tilde{z}_{nk} > 0]. Under the mean-field factorization q(W,Z~)=q(W)∏n,kq(z~nk)q(W,\widetilde{Z}) = q(W)\prod_{n,k}q(\tilde{z}_{nk}), the evidence lower bound is

L(q)=Eq[log⁡p(Z∣Z~)+log⁡p(Z~∣W,X~)+log⁡p(W)−log⁡q(W,Z~)],(6)\mathcal{L}(q) = \mathbb{E}_q\left[\log p(Z \mid\widetilde{Z}) + \log p(\widetilde{Z} \mid W,\widetilde{X}) + \log p(W) - \log q(W,\widetilde{Z})\right], \tag*{(6)}

where Z=(znk)Z = (z_{nk}) is the one-hot label matrix. We maximize (6) by coordinate ascent over the two factors: q(Z~)q(\widetilde{Z}) is updated with q(W)q(W) held fixed, and then q(W)q(W) with q(Z~)q(\widetilde{Z}) held fixed. For a model with these two factors, coordinate-ascent variational inference (CAVI) and variational Bayesian expectation maximization (VB-EM; [3]) are the same algorithm: the update of q(Z~)q(\widetilde{Z}) is the E-step and the update of q(W)q(W) is the M-step. We call the algorithm CAVI, following Wojnowicz et al. [2022], and its two updates the E-step and the M-step. Both updates are available in closed form (Appendix § 8.§ 2), so no gradient-based optimization of the head is required.

E-step. Holding q(W)q(W) fixed, q(z~nk)q(\tilde{z}_{nk}) is the Albert–Chib truncated normal at 0 [Wojnowicz et al., 2022] with mean

Eq[z~nk]=ank+znkϕ(ank)Φ(ank)−(1−znk)ϕ(ank)Φ(−ank),ank=μkTx~n,(7)\mathbb{E}_q[\tilde{z}_{nk}] = a_{nk} + z_{nk}\frac{\phi(a_{nk})}{\Phi(a_{nk})} - (1-z_{nk})\frac{\phi(a_{nk})}{\Phi(-a_{nk})}, \qquad a_{nk} = \mu_k^{\mathsf{T}}\tilde{x}_n, \tag*{(7)}

where ϕ(⋅)\phi(\cdot) is the standard normal PDF and znk=δyn,kz_{nk} = \delta_{y_n,k}. The inverse Mills ratios ϕ(a)Φ(a)\frac{\phi(a)}{\Phi(a)} and ϕ(a)Φ(−a)\frac{\phi(a)}{\Phi(-a)} are evaluated in log-space, exp⁡{log⁡ϕ(a)−log⁡Φ(±a)}\exp\{\log\phi(a)-\log\Phi(\pm a)\}, for stability in the tails of Φ\Phi. This is a coordinate update, so it uses the plain posterior mean μkTx~n\mu_k^{\mathsf{T}}\tilde{x}_n; marginalising over q(wk)q(w_k) is a separate operation performed at prediction time (see § 3.5).

M-step. Holding q(Z~)q(\widetilde{Z}) fixed, q(wk)q(w_k) is Gaussian with natural parameters

Λ=Λ0+X~TX~,ηk=η0,k+X~TEq[z~:k],(8)\Lambda= \Lambda_0 + \widetilde{X}^{\mathsf{T}}\widetilde{X}, \qquad\eta_k = \eta_{0,k} + \widetilde{X}^{\mathsf{T}}\mathbb{E}_q[\tilde{z}_{:k}], \tag*{(8)}

where X~∈RN×(D+1)\widetilde{X} \in\mathbb{R}^{N \times(D+1)} stacks the rows x~nT\tilde{x}_n^{\mathsf{T}} and ηk=Λμk=Σ−1μk\eta_k = \Lambda\mu_k = \Sigma^{-1}\mu_k. The variational posterior has exactly the form of the prior (4), which is the closure property § 3.4 relies on. The precision Λ\Lambda is shared across classes, so all KK class-conditional means update in parallel as a single matrix operation and one Cholesky factorization is used for all KK classes.

Parameter expansion. Plain CAVI alternates (7) and (8) and converges slowly along one direction: the overall scale of the class scores. The mean-field factorization removes the correlation between WW and Z~\widetilde{Z} that is present in the true posterior, so each alternation changes the scale only slightly. Parameter-expanded variational Bayes [Qi and Jaakkola, 2007] (hereafter, PX) accelerates convergence in this direction. It adds a scale parameter ν>0\nu> 0 to the model, which multiplies the prior mean of WW by ν\nu, and the prior covariance of WW and the variance of the auxiliary variables by ν2\nu^2. The expanded model assigns the same probability to the labels for every ν\nu and is the original model at ν=1\nu= 1, but the ELBO of a given qq depends on ν\nu. Each inner iteration therefore also maximizes the ELBO over ν\nu, which has a closed-form solution, and then returns to the original model by rescaling WW and Z~\widetilde{Z} by 1/ν1/\nu (Appendix A.3). Writing bk=X~TEq[z~:k]b_k = \widetilde{X}^{\mathsf{T}}\mathbb{E}_q[\tilde{z}_{:k}] for the data term of (8), the resulting update divides this term by ν\nu,

ηk←η0,k+bk/ν,NKν2+c1ν−c2=0,(9)\eta_k \leftarrow\eta_{0,k} + b_k/\nu, \qquad NK\nu^2 + c_1\nu- c_2 = 0, \tag*{(9)}

where ν\nu is the positive root of the quadratic equation, NN is the number of rows of X~\widetilde{X}, and c1c_1 and c2c_2 are formed from quantities already computed in the E-step and the M-step. At a fixed point of plain CAVI c2−c1=NKc_2-c_1=NK, so ν=1\nu=1 and (9) is the ordinary M-step: PX converges to the same solution as plain CAVI in fewer inner iterations. The precision Λ\Lambda is not changed by the expansion, and the inner-iteration count TT trades compute for closer convergence to that fixed point.

Variational Filtering: the Prior Between Batches

Running CAVI over the full dataset is impractical when the backbone drifts across epochs (full-network fine-tuning) or when NN is very large (ImageNet-scale). We therefore process the data in mini-batches BmB_m of size BB. Since the posterior of § 3.3 has the same form as the prior (4), the same update can be applied to each batch, and it only remains to choose the prior parameters (η0,Λ0)(\boldsymbol{\eta}_0,\boldsymbol{\Lambda}_0) for batch mm.

We make this choice by treating the head as the latent state of a linear-Gaussian state-space model whose dynamics are a random walk with independent (per-direction) process noise,

Wm=Wm−1+Ξm,Ξm∼∏k=1KN(0,Q),Q=qI.(10)W_m = W_{m-1} + \Xi_m,\qquad\Xi_m \sim\prod_{k=1}^{K}\mathcal{N}(0,Q),\qquad Q=qI. \tag*{(10)}

This is a modelling assumption rather than a numerical stabilisation technique, and it has two independent motivations. The first is drift: under full-network fine-tuning the features x=h(i,θ)\boldsymbol{x}=h(i,\theta) change at every step, so the optimal last layer drifts, and qq sets the rate of this drift.

The second is calibration, and it applies even when the backbone is frozen and there is no drift to track. A recursion without process noise accumulates precision without bound, so Σm→0\boldsymbol{\Sigma}_m\to0 and the moderated predictive of § 3.5 collapses onto posterior expectation μ\boldsymbol{\mu}: confidence then grows with the quantity of data the head has seen rather than with the evidence bearing on any particular input, which is the failure mode that a Bayesian treatment is intended to avoid. Process noise instead imposes a lower bound on the posterior covariance, Σ∗≈q/λ\boldsymbol{\Sigma}^{*}\approx\sqrt{q/\lambda} in the scalar reduction with per-batch data precision λ\lambda — the geometric mean of the process noise and the inverse data precision rather than qq itself (Appendix § 8.§ 4) — so the moderation term remains non-negligible for arbitrarily long training. Calibration is therefore one of the two motivations for the filtering formulation, and not only a consequence of it.

Propagating the previous posterior through (10) increases its covariance and leaves its mean unchanged, so the prior for batch mm is

Σmpred=Σm−1+Q,Λmpred=(Σmpred)−1,ηm,kpred=Λmpredμm−1,k,(11)\boldsymbol{\Sigma}^{\mathrm{pred}}_m=\boldsymbol{\Sigma}_{m-1}+Q,\qquad\boldsymbol{\Lambda}^{\mathrm{pred}}_m=\left(\boldsymbol{\Sigma}^{\mathrm{pred}}_m\right)^{-1},\qquad\boldsymbol{\eta}^{\mathrm{pred}}_{m,k}=\boldsymbol{\Lambda}^{\mathrm{pred}}_m\boldsymbol{\mu}_{m-1,k}, \tag*{(11)}

and the update is the CAVI/PX step of § 3.3 run with (Λ0,η0)←(Λmpred,ηmpred)(\Lambda_0,\eta_0)\leftarrow(\Lambda^{\mathrm{pred}}_m,\eta^{\mathrm{pred}}_m). The prediction step is exact, as in a Kalman filter. The update step is not, because the probit observation is non-Gaussian; it is the variational update of § 3.3, which returns a posterior in the family (4). We call the resulting recursion a variational filter. Since QQ does not depend on the class, the precision remains shared across the KK classes and the only added cost is the second Cholesky factorization, for Σmpred\boldsymbol{\Sigma}^{\mathrm{pred}}_m.

Setting the process noise. The process noise qq of (10) is the one hyperparameter of the head. We parametrize it as

q=α2B,(12)q=\frac{\alpha^2}{B}, \tag*{(12)}

where α\alpha is the effective learning rate of the head. At the steady state of the filter the posterior mean is an exponentially weighted average of the estimates from the individual mini-batches, in which the newest mini-batch has approximately the weight λq\sqrt{\lambda q} (Appendix § 8.§ 4). For features of unit scale per coordinate λ≈B\lambda\approx B, so this weight is α\alpha, and a mini-batch influences the posterior mean over approximately 1/α1/\alpha filtering steps. The features used in the experiments are not normalised, so there α\alpha equals this weight only up to the scale of the features, and qq is selected directly by the hyperparameter search (Appendices § 10 and § 11.§ 2). The appropriate value depends on the number of training steps MM: Appendix § 11.§ 3 derives the rule α∝M−1\alpha\propto M^{-1}, that is, q∝M−2q\propto M^{-2}, from the steady state of the filter and reports a measurement that is consistent with it.

The Posterior Predictive

For the independent binary probit the required expectation is closed-form [4 Appendix A.5]; the relevant measure is the one-step-ahead predictive wk∼N(μk,Σpred)\boldsymbol{w}_k\sim\mathcal{N}(\boldsymbol{\mu}_k,\boldsymbol{\Sigma}^{\mathrm{pred}}) of (11), and because Σ\boldsymbol{\Sigma} and QQ are both shared across classes the result is a single class-independent rescaling of the class scores:

EN(μk,Σpred)[Φ(wkTx~)]=Φ(μkTx~s(x~)),s(x~)=1+q∥x~∥2+x~TΣx~.(13)\mathbb{E}_{\mathcal{N}(\boldsymbol{\mu}_k,\boldsymbol{\Sigma}^{\mathrm{pred}})}\left[\Phi\left(\boldsymbol{w}_k^{\mathsf{T}}\widetilde{\boldsymbol{x}}\right)\right]=\Phi\left(\frac{\boldsymbol{\mu}_k^{\mathsf{T}}\widetilde{\boldsymbol{x}}}{s(\widetilde{\boldsymbol{x}})}\right),\qquad s(\widetilde{\boldsymbol{x}})=\sqrt{1+q\lVert\widetilde{\boldsymbol{x}}\rVert^2+\widetilde{\boldsymbol{x}}^{\mathsf{T}}\boldsymbol{\Sigma}\widetilde{\boldsymbol{x}}}. \tag*{(13)}

Algorithm 1 Variational filtering for the Independent-Binary-Probit last layer

Require: Features {xn=h(in)}\{x_n = h(i_n)\}, labels {yn}\{y_n\}, batch size BB, inner iterations TT, process noise qq from (12)

Ensure: η\eta, Λ\Lambda

  1. μ←0\mu\leftarrow0, Σ←I\Sigma\leftarrow I, Q←qIQ \leftarrow qI

  2. for each mini-batch BmB_m do

  3. X~m←[[xn;1]]n∈Bm\widetilde{X}_m \leftarrow[[x_n;1]]_{n\in B_m}; Zm←one-hot⁡({yn})Z_m \leftarrow\operatorname{one-hot}(\{y_n\})

  4. Σpred,Λpred,ηpred←(11)\Sigma^{\mathrm{pred}},\Lambda^{\mathrm{pred}},\eta^{\mathrm{pred}} \leftarrow(11) ▷ PREDICT: first Cholesky

  5. Λ←Λpred+X~mTX~m\Lambda\leftarrow\Lambda^{\mathrm{pred}}+\widetilde{X}_m^{\mathsf{T}}\widetilde{X}_m ▷ (8) with Λ0=Λpred\Lambda_0=\Lambda^{\mathrm{pred}}; second Cholesky

  6. η←ηpred\eta\leftarrow\eta^{\mathrm{pred}}

  7. for t=0,…,T−1t=0,\ldots,T-1 do ▷ UPDATE: PX-CAVI, all KK classes in parallel

  8. b←X~mTEq[Z~]b \leftarrow\widetilde{X}_m^{\mathsf{T}}\mathbb{E}_{q}[\widetilde{Z}] ▷ E-step (7) at μ=Λ−1η\mu=\Lambda^{-1}\eta

  9. η←ηpred+b/ν\eta\leftarrow\eta^{\mathrm{pred}}+b/\nu ▷ scale ν\nu from (9)

  10. end for

  11. μ←Λ−1η\mu\leftarrow\Lambda^{-1}\eta; Σ←Λ−1\Sigma\leftarrow\Lambda^{-1}

  12. end for

The denominator s(x~)s(\widetilde{x}) is an input-dependent temperature: one scalar per input, larger for inputs lying in feature directions the posterior does not constrain, and constant only in the degenerate case—which is precisely temperature scaling [12]. A predictive evaluated at the posterior mean discards ss entirely, so temperature scaling is the constant-ss special case of (13), and the two differ only where ss varies across inputs.

The epistemic term x~TΣx~\widetilde{x}^{\mathsf{T}}\Sigma\widetilde{x} enters the predictive in both regimes. Away from the training distribution it increases, ss increases with it, and confidence decreases (see the detection results in §4, which are explained by this mechanism). In distribution it does not vanish, which is the benefit of the filtering formulation: without process noise Σ→0\Sigma\to0 and s→1s \to1, so the predictive degenerates to the plug-in estimate at μ\mu and confidence grows with the amount of data seen. The floor Σ∗≈q/λ\Sigma^{*}\approx\sqrt{q/\lambda} of §3.4 prevents ss from collapsing to one as data accumulates; Appendix § 8.§ 4 derives it, and Appendix § 10 reports the detection result obtained when qq is at the lower bound of its search range. The additive term q∥x~∥2q\lVert\widetilde{x}\rVert^2 is the direct contribution of the process noise to the predictive variance; its size relative to the epistemic term depends on the selected qq and on the scale of the features.

Each mini-batch is one variational filtering step, and every quantity in Algorithm 1 is updated by a closed-form conjugate step: the head has no learning rate, no weight decay, and no gradient-based optimization of any kind. The one free scalar is the process noise qq of (12). Backbone gradients are taken through (13) alone (Appendix § 11.§ 1), and the cost of a filtering step is given in Appendix § 8.§ 6.

Loss Function

The variational filter of §3.4 supplies the filtering posterior over the last-layer weights, but training the backbone still requires a differentiable scalar loss, and evaluation requires class probabilities. For both we use the categorical likelihood (3), evaluated at the moderated class scores of (13). Writing ak(x~)=μkTx~/s(x~)a_k(\widetilde{x})=\mu_k^{\mathsf{T}}\widetilde{x}/s(\widetilde{x}), the predictive class probabilities and the loss are

p(y=k∣x~)=ρ(ak(x~))∑j=1Kρ(aj(x~)),LCBC=−ln⁡p(y∣x~),(14)p(y=k\mid\widetilde{x})=\frac{\rho(a_k(\widetilde{x}))}{\sum_{j=1}^{K}\rho(a_j(\widetilde{x}))},\qquad\mathcal{L}_{\mathrm{CBC}}=-\ln p(y\mid\widetilde{x}), \tag*{(14)}

with ρ(a)=Φ(a)/Φ(−a)\rho(a)=\Phi(a)/\Phi(-a) as in (3). All experiments in this paper use this loss, both for training the backbone and for evaluation.

In the loss and in the predictive class probabilities we replace Φ\Phi by the cubic GELU-style approximation [14],

Φ(x)≈σ(22π(x+0.044715x3)),(15)\Phi(x)\approx\sigma\left(2\sqrt{\frac{2}{\pi}}\left(x+0.044715x^3\right)\right), \tag*{(15)}

where σ(⋅)\sigma(\cdot) is the logistic function. Under this approximation ln⁡ρ(a)=22/π(a+0.044715a3)\ln\rho(a)=2\sqrt{2/\pi}\left(a+0.044715a^3\right) exactly, so (14) is a softmax cross-entropy on a cubic transformed score. All reported metrics are computed with this approximation; the CAVI inner loop uses the exact Φ\Phi and ϕ\phi in log-space.

Results

Every experiment below uses DINOv3 backbones [Siméoni et al., 2025] and compares three heads under one training protocol: AdamW with cross-entropy and post-hoc temperature scaling (CE+TS), Variational Bayesian Last Layers (VBLL, Harrison et al., [13]), and IBProbit, the variational filter of § 3.4. We report accuracy (↑\uparrow), NLL (↓\downarrow) and Brier score (↓\downarrow).

Note that the cross-entropy baseline is always shown with temperature scaling. TS is the strongest low-cost calibration baseline: it fits a single parameter post-hoc on the same validation split used for model selection, so it adds only marginal cost to tuning the CE+TS variant. In addition, each training method’s hyper-parameters are tuned independently per dataset under a shared step budget and a single objective (Appendix § 10). The backbones, datasets, baselines, metrics and compute resources are described in Appendix § 9. We first study the head in isolation on frozen features (§ 4.1, § 4.2), then jointly with the backbone (§ 4.3).

Linear probing on frozen DINOv3 features

Frozen features isolate the head: there are no backbone gradients, and any difference between training methods is attributable to the last layer alone. Every method is trained on the same cached features for the same budget of 30,000 steps and is scored at the evaluation with the lowest validation NLL (Appendix § 10); for IBProbit a step is one filtering step on a mini-batch, so the filter makes repeated passes over the training data. We probe four backbone sizes — DINOv3 Small, Base, Large, Huge — on five downstream tasks with training sets of 1.0K to 75.8K images and 37 to 196 classes, with ten seeds per setting (Figure 1).

Figure 1. Linear probing on frozen DINOv3 features across backbone scale. Columns are the five downstream tasks; rows are accuracy (↑\uparrow), NLL (↓\downarrow) and Brier score (↓\downarrow); the xx-axis is the backbone size (Small, Base, Large, Huge). Points show the mean over ten seeds and error bars ±1\pm1 standard deviation. AdamW+CE is shown without and with temperature scaling (TS); the temperature is fit on the same validation split used for model selection. A black ring marks a setting in which the validation optimum of at least one seed fell in the last 10% of the step budget, so that the plotted value is a lower bound (Appendix § 10). Every method is tuned independently per dataset under one shared 30,000-step budget, at DINOv3-Huge only; the other three backbone sizes use the configuration tuned at Huge (Appendix § 10), so points left of Huge are not separately optimized for any method.

At DINOv3-Huge, IBProbit attains the best accuracy and the best NLL (Brier) on all five tasks. The margin is largest on Stanford Cars, the task with the most classes: 0.9286 accuracy against 0.8837 for CE+TS and 0.8819 for VBLL, with NLL 0.2572 against 0.3723 and 0.3881. On Oxford Pets the accuracy gap is +1.7pp over both baselines and NLL falls from 0.214 (CE+TS) and 0.217 (VBLL) to 0.171. The accuracies of CE+TS and VBLL are within 0.4pp of each other on every task at this backbone size, and VBLL does not have a lower NLL than CE+TS on any of them. This indicates that a variational last layer trained by gradient descent improves little on a well-tuned linear probe with a fitted temperature, whereas a variationally filtered probit head does improve on it.

The number of tasks on which IBProbit leads increases with backbone size. At DINOv3-Small the results are mixed: IBProbit has the lowest NLL on Flowers-102 and Stanford Cars but trails CE+TS in NLL on Oxford Pets (0.4639 vs 0.4366), Food-101 (0.4079 vs 0.3866) and DTD (0.6222 vs 0.5954). It also trails CE+TS in NLL on three tasks at DINOv3-Base, on two at DINOv3-Large, and on one at DINOv3-Huge (29× more parameters than Small). The margin itself does not increase on every task: on Stanford Cars it is largest at DINOv3-Small. We do not attribute the trend with backbone size to the predictive variance. The factor s(x~)s(\tilde{x}) of (13) rescales all class scores of an input by the same positive number and therefore leaves the predicted class unchanged, so the accuracy differences in Figure 1 are differences between the fitted mean weights. We report this trend explicitly because the opposite would have been the more common result, and because it is relevant to whether the added complexity of the method is justified at the scales used in practice.

One caveat concerns cost, because §4.3 reaches the opposite conclusion at ImageNet scale. IBProbit’s uncertainty state is a single covariance shared across classes — d(d+1)/2d(d+1)/2 parameters, independent of the class count — against KdKd for VBLL’s per-class diagonal; the two are equal at K=(d+1)/2K=(d+1)/2, which is 193, 385, 513 and 641 across the four backbone sizes. Every task here has K≤196K\le196, so in neither of these twenty settings is it IBProbit that has the larger head: for VBLL’s at Stanford Cars on Huge, and 17× at Oxford Pets, where a shared 1281 × 1281 covariance is compared with 37 per-class diagonals. The absolute quantities are negligible either way (3.1 MB at the largest), but the accuracy and NLL gains above are obtained with a larger head and the KK-independence argued in §4.3 is a many-class property that does not apply in the probing regime.

Out-of-distribution detection from frozen features

In-distribution calibration does not determine behaviour under shift, so we evaluate separately whether probes trained under the same protocol separate in- from out-of-distribution inputs. We use three pairs at DINOv3-Huge: CIFAR-10 vs SVHN and CIFAR-100 vs SVHN (far-OOD), and CIFAR-10 vs

CIFAR-100 (near-OOD, the harder of the two CIFAR-10 pairs). CIFAR appears here as in-distribution data on a frozen ViT — chosen because SVHN and the CIFAR-10/100 split provide a clear contrast between far and near OOD on identical features.

Every condition is scored with maximum softmax probability (MSP), and we report AUROC and FPR at 95% TPR. For IBProbit this choice does not discard the uncertainty estimate: the moderated predictive rescales the logits by a class-independent factor s(x~)s(\tilde{x}), which acts as a per-input temperature, so its MSP is a monotone function of the epistemic term x~⊤Σpredx~\tilde{x}^{\top}\Sigma_{\mathrm{pred}}\tilde{x}. An MSP advantage under shift is therefore indirect evidence that the epistemic term is informative.

IBProbit leads on all three pairs and both metrics (Figure 2). The largest difference is on CIFAR-10 vs SVHN, where FPR@95 falls to 0.0081 ±\pm 0.0007 against 0.0318 ±\pm 0.0062 for CE+TS and 0.0258 ±\pm 0.0036 for VBLL — a factor of three below the better baseline, on identical features and an identical evaluation set. On near-OOD the ordering is preserved with a smaller margin (0.0163 against 0.0374 and 0.0261), and on CIFAR-100 vs SVHN, hardest for every method, IBProbit still leads (0.1788 against 0.2763 and 0.2563). IBProbit also has the highest in-distribution accuracy on both datasets, exceeding the next best method by 0.001 on CIFAR-10 and 0.003 on CIFAR-100, so the improved detection does not come at the cost of accuracy. Its in-distribution NLL is the lowest of the three methods on CIFAR-10 but the highest on CIFAR-100 (0.203, compared with 0.188 for CE+TS and 0.193 for VBLL).

Figure 2. Out-of-distribution detection from frozen DINOv3-Huge features, scored by maximum softmax probability. Columns are the three ID/OOD pairs, far-OOD for the two pairs with SVHN and near-OOD for CIFAR-10 vs CIFAR-100; rows are AUROC (↑) and FPR at 95% TPR (↓). Points show the mean over ten seeds with ±1 standard deviation. AdamW+CE is shown with temperature scaling fit on the in-distribution validation split — the same operating point reported in Figure 1 — and the single fitted temperature is applied to both the ID and the OOD logits, as it would be at deployment.

Full-network fine-tuning on ImageNet-1k

Probing keeps the features fixed. A more demanding test is whether the filter still helps when the backbone changes during training, which is the regime its process noise was introduced for. We therefore fine-tune DINOv3-Huge end to end on ImageNet-1k for two epochs (2.6M samples), five seeds per method, with all three heads under an identical training protocol. Hyperparameters are tuned at the reported backbone, on the 399,872-sample budget fixed by the tuning protocol (781 steps at batch 512), and transferred to the reported duration by the AdamW SDE scaling rule [Mlodozeniec et al., 2025]; the process noise of IBProbit is transferred by the rule q∝M−2q \propto M^{-2}, where MM is the number of training steps. The training step, the search and the transfer are described in Appendix § 11.

Sample efficiency. IBProbit has a large advantage early in training (Figure 3). At 66K samples it reaches 0.839 accuracy against 0.825 for CE+TS and 0.800 for VBLL, with NLL 0.63 against 0.72 and 1.09; at the first evaluation, 33K samples, the NLL gap is wider still — 0.80 against 1.09 and 1.65. This is the regime the filter is designed for: each batch is assimilated in one closed-form filtering step, so the head is usable long before a gradient-trained head has converged.

Figure 3. Full-network fine-tuning of DINOv3-Huge on ImageNet-1k: metrics on the held-out 80% of the ImageNet validation split against samples seen (log scale). Lines show the mean over five seeds, and bands the range between the smallest and the largest value across seeds. The dashed vertical line marks the 399,872-sample budget the hyperparameters were selected at; results to the right of it lie beyond the budget used for tuning, for every method equally. Accuracy, NLL and Brier are shown; NLL and Brier are proper scoring rules and support the calibration claim, whereas ECE depends on the choice of binning. Brier is the multiclass definition over the full predictive vector. Raw AdamW+CE is omitted: CE+TS is the baseline being compared against, and in the accuracy panel the two coincide exactly.

A further result, not available from probing, is that the advantage persists throughout training. IBProbit stays below both baselines on NLL and Brier and above them on accuracy for the whole trajectory, and it is still ahead at the endpoint (Table 1), on every metric in distribution and under shift. Two of the margins are within about one standard deviation, both over VBLL under shift: NLL, 0.6960 ± 0.0108 against 0.7036 ± 0.0097, and accuracy, 0.8395 ± 0.0015 against 0.8373 ± 0.0025. For the other metrics the gap to the better baseline is between two and ten times the larger of the two standard deviations.

MetricAdamW+CE+TSVBLLIBProbit
In distribution
Accuracy ↑0.8880 ± 0.00110.8866 ± 0.00040.8904 ± 0.0007
NLL ↓0.3891 ± 0.00150.4034 ± 0.00100.3744 ± 0.0010
Brier ↓0.1669 ± 0.00080.1693 ± 0.00060.1628 ± 0.0003
Under shift (mean of four sets)
Accuracy ↑0.8323 ± 0.00170.8373 ± 0.00250.8395 ± 0.0015
NLL ↓0.7194 ± 0.00740.7036 ± 0.00970.6960 ± 0.0108
Brier ↓0.2478 ± 0.00240.2422 ± 0.00260.2349 ± 0.0024
AUROC ↑0.6617 ± 0.00230.6557 ± 0.01040.6774 ± 0.0040

Table 1. Fine-tuning endpoint at 2.56M samples, the largest evaluation present in every run. Mean ± standard deviation over five seeds. The rows under shift average ImageNet-R, -A, -V2 and -Sketch; AUROC is maximum-softmax-probability detection against the in-distribution split at the same step, with the in-distribution reference restricted to the covered classes on the two masked sets. ECE is omitted for the reason given in Figure 3’s caption; Brier is the multiclass definition over the full predictive vector.

Cost to reach a target performance. Fixing a target performance and measuring the cost to reach it makes the comparison concrete (Figure 5). We take as the target the performance that cross-entropy with temperature scaling, the baseline with the better in-distribution results, has at the end of its two-epoch run: the mean over seeds of its accuracy, NLL and Brier score at the final evaluation, which are the values in Table 1. For the other two methods we measure the amount of training after which a run first meets all three.

Figure 5. Training needed to reach the final performance of cross-entropy with temperature scaling (CE+TS), in wall-clock hours (left) and in epochs (right). The target is the mean over the five CE+TS seeds of the accuracy, NLL and Brier score at the end of the two-epoch run (Table 1). The target is joint: a run reaches it at the first evaluation at which all three metrics are at or better than the target. The CE+TS bar is the length of its own runs. For IBProbit the bar shows the mean over the five seeds and circles the individual seeds; all five reach the target, and the number above the bar is the speed-up relative to CE+TS. No VBLL run reaches the target within two epochs, so VBLL is right-censored: the hatched bar with an arrow marks the length of its runs, which is a lower bound. Time is measured from the first evaluation of each run. The times of CE+TS and IBProbit include the evaluation of the shift sets during training, which the VBLL runs delegate to a separate process.

Every IBProbit run reaches the target. On average it does so after 8.7 hours and 0.95 epochs, compared with the 17.4 hours and two epochs for which the cross-entropy runs were trained. This is a speed-up of 2.0×\times in wall-clock time and 2.1×\times in samples; across the five seeds the speed-up in wall-clock time ranges from 1.7×\times to 2.3×\times. No VBLL run reaches the target within its two epochs, which took 18.1 hours, so VBLL is right-censored in the figure. The lowest NLL of any VBLL run at any evaluation is 0.399, compared with the target of 0.389.

The comparison cannot be made in the opposite direction, because neither baseline reaches the performance of IBProbit. Neither the five cross-entropy runs nor the five VBLL runs reach, within the full two-epoch budget, what IBProbit attains after one epoch, jointly on accuracy, NLL and Brier. The shortfall is in calibration rather than in accuracy: every cross-entropy run passes the accuracy that IBProbit has after one epoch at some point in its trajectory, but none reaches an NLL below 0.3872 or a Brier score below 0.1659, compared with 0.3758 and 0.1648 for IBProbit after one epoch.

We do not report peak training memory. At this backbone size the methods’ activations dominate and the measurement cannot resolve the head: the state stored by the two Bayesian heads differs by under 2 MB, a few thousandths of a percent of the peak, and the allocator statistics available in the two frameworks are not defined identically. The head-state comparison below is analytical for that reason.

In addition to the K×dK \times d mean of any linear head, IBProbit adds one covariance shared across classes — d(d+1)/2d(d + 1)/2 parameters, independent of KK — while VBLL in its diagonal parameterization adds a per-class diagonal, KdKd, growing linearly in the class count. At DINOv3-Huge (d=1281d = 1281) the two are equal at K≈641K \approx641: on ImageNet-1k IBProbit’s head has 0.82M uncertainty parameters against VBLL’s 1.28M, 36% fewer, while on the small-KK probing tasks the ordering reverses (0.82M against 0.25M at Stanford Cars’ K=196K = 196; see § 4.1). Richer VBLL parameterizations only widen the gap in the many-class regime: low rank costs KdrKdr and full covariance Kd2Kd^2, both of which retain the linear-in-KK scaling that the shared covariance removes.

Behaviour under shift. Scoring the same trajectory on ImageNet-R, -A, -V2 and -Sketch reproduces the ordering on three of the four sets (Figure 4). On ImageNet-R and -A IBProbit has the best accuracy, NLL and Brier score for almost the entire run. On ImageNet-V2 it has the best accuracy throughout and the best NLL in the first half of the run, after which the three methods are close. On ImageNet-Sketch the three methods are close in accuracy and Brier score, and IBProbit has the highest NLL at the endpoint (1.33, against 1.29 for CE+TS and 1.25 for VBLL). Table 1 gives the endpoint averaged over the four sets.

Figure 4. The same fine-tuning trajectories scored under distribution shift. Columns are the four shift sets; rows are accuracy, NLL, Brier score and the AUROC of maximum-softmax-probability detection against the in-distribution split. Lines, bands and the dashed vertical line are as in Figure 3, and markers show the individual evaluations. ImageNet-R and -A cover 200 of the 1000 classes and are evaluated with a subset mask; ImageNet-V2 and -Sketch span all 1000 and are not masked. Every method is fit in distribution and then evaluated under shift; in particular the single temperature of the CE baseline is fitted on the in-distribution validation split and applied unchanged to the shifted logits, never refitted on the shifted set. The shift sets are scored at every second evaluation of the trajectory, so these panels contain fewer points than Figure 3.

The fourth row scores the same predictives as a detector, by maximum softmax probability, against the in-distribution split at the same step — the score used in § 4.2, so that the two settings are evaluated with the same score. Because ImageNet-R and -A cover 200 of the 1000 classes, the in-distribution reference for those columns is restricted to the same classes and to the images whose label falls in them; comparing a 200-class maximum against a 1000-class one would measure the class count rather than the shift. IBProbit detects best at the first evaluation on all four sets, which is consistent with the sample-efficiency result, and it still leads at the endpoint on three of the four; cross-entropy overtakes it only on ImageNet-R (0.673 against 0.663). On ImageNet-V2 no method detects the shift much above chance, which is expected for a re-collection of the same classes.

One feature of this row requires an explanation. On ImageNet-R, and to a smaller extent on ImageNet-A and -Sketch, detection quality peaks partway through training and then falls for every method — on ImageNet-R cross-entropy loses 0.059 AUROC from its own peak, IBProbit 0.073, VBLL 0.028 — while the accuracy, NLL and Brier rows above are stable or improving over the same period. Detection and calibration therefore diverge under continued fine-tuning. This is a consequence of fitting the in-distribution task more closely and is not specific to any head: a model that becomes more confident on ImageNet also becomes more confident on ImageNet-R, and cross-entropy, which has no posterior covariance, shows the effect as strongly as the Bayesian methods. We therefore do not interpret it as evidence about the covariance floor of § 3.4.

Limitations

One hyperparameter does not transfer across training durations. The process noise qq has to be rescaled when the training duration changes; if it is left unchanged, it degrades the head late in training, and this can be mistaken for a property of the method. We give a rule for it in Appendix D.3, derived from the steady state of the filter, but its exponent is measured on one backbone and we have not established it across widths. A search run at a short budget and scored by the best value anywhere on its curve will also prefer configurations whose validation loss is low early and then degrades, for the same reason; our fine-tuning searches score the end of the trajectory instead. Both are properties of tuning any method with a forgetting rate against a truncated budget rather than of this head alone, but we encountered both in our experiments and therefore report them.

The head’s memory advantage is structural, not measurable end-to-end. IBProbit’s uncertainty state is KK-independent and smaller than VBLL’s diagonal once K>(d+1)/2K > (d + 1)/2, but at $d = 1281 that advantage is under 2 MB, which no end-to-end training measurement can resolve: backbone activations dominate the peak at this backbone size, and the two frameworks’ allocator statistics are not defined identically, so we do not report peak memory at all. Isolating the head’s footprint would need a measurement designed for it, which we have not made. The KK-independence claim is also stated at the diagonal parameterization we ran; against full-covariance VBLL the gap widens, but we did not train that variant and do not report it.

Model assumptions. The posterior covariance shared across classes is what makes the CAVI inner loop linear in the class count, but it offers no per-class adaptive capacity, so severe class imbalance may under-regularize minority classes. The class-independence assumption inherited from Wojnowicz et al. [2022] did not degrade calibration on any task we evaluated, but may be more restrictive under strong inter-class structure such as hierarchical labels.

Scope of the tuning. Probing configurations were searched at DINOv3-Huge only and applied unchanged at the three smaller backbones, whose features have different dimension; the fine-tuning configurations were searched at DINOv3-Huge on a budget of 0.4M samples, about a third of an epoch, and transferred to two epochs (Appendix § 11). Both limitations apply symmetrically to all three methods, so they affect the absolute numbers rather than the comparison, but the points for the smaller backbones in Figure 1 should not be interpreted as the best achievable result of any method.

What the detection result does and does not show. Figure 2 scores MSP, which for IBProbit is a monotone function of the epistemic term rather than a direct measurement of it. The result is therefore evidence that the term is informative, not a measurement of its magnitude. The probing runs also store a single evaluation each, so § 4.1 and § 4.2 contain no trajectories: no detection-versus-compute curve and no endpoint-penalty analysis are available there, only at fine-tuning scale.

Calibration is not safety. Better-calibrated probabilities reduce undetected over-confidence where downstream actions depend on probability thresholds, but they do not address fairness, bias, or adversarial robustness, and a well-calibrated classifier can still be systematically wrong on populations under-represented at training time.

Conclusion

We presented a variational filtering algorithm for the Bayesian last layer, built on the independent binary probit (IBProbit) surrogate of Wojnowicz et al. [2022]. By replacing the softmax with a categorical-from-binary probit likelihood and performing inference through its independent binary probit surrogate, we derived efficient closed-form variational filtering updates. This distinguishes our method from recent approaches like VBLL, which keep the softmax, bound it, and rely on gradient-based optimization. Our experiments on DINOv3 backbones demonstrate that an IBProbit based last layer provides a computationally efficient way to obtain well-calibrated deep networks. The closed-form nature of our updates makes this approach particularly attractive for one-shot adaptation and scenarios where gradient-based tuning of the uncertainty mechanism is undesirable. In practice, the method can replace a standard linear probe without further changes to the training pipeline: the head has no learning rate or weight decay and needs no post-hoc calibration step. With the largest backbone it gave higher accuracy and lower negative log-likelihood than both baselines on all five probing tasks, and under full-network fine-tuning on ImageNet-1k it remained better than both on accuracy, negative log-likelihood and Brier score after two epochs. Its uncertainty state is a single covariance matrix shared across classes, so its size does not grow with the number of classes.

Better-calibrated probabilities reduce the risk of undetected over-confidence in high-stakes applications where downstream actions depend on probability thresholds. However, they do not address fairness, bias, or adversarial robustness, and should not be interpreted as a safety certification — a well-calibrated classifier can still be systematically wrong on populations under-represented at training time.

A natural extension of the presented approach would be a fully end-to-end Bayesian treatment of deep learning that combines the IBProbit head with the IVON optimizer [Shen et al., 2024], or the more recent EVON optimizer [25] for variational inference on the backbone weights.

Acknowledgments

The authors gratefully acknowledge the computing time granted on the high-performance computers Raven (NVIDIA A100) and Viper (AMD Instinct MI300A) at the Max Planck Computing and Data Facility (MPCDF), and thank the MPCDF support staff for their assistance.

Derivations

This appendix derives the results that §3.2–§3.5 state without proof: the lower bound of §3.2 (Appendix A.1), the two updates of §3.3 (Appendix A.2), the parameter expansion (Appendix A.3), the steady state of the filter of §3.4 (Appendix A.4), the predictive of §3.5 (Appendix A.5) and the cost of a filtering step (Appendix A.6). Throughout, d=D+1d = D + 1 is the dimension of the padded feature x~\tilde{x}, the matrix X~∈RN×d\tilde{\mathbf{X}} \in\mathbb{R}^{N \times d} contains the features of the data being assimilated, which in the filter is one mini-batch (N=BN = B), and ank=μkTx~na_{nk} = \boldsymbol{\mu}_k^\mathsf{T}\tilde{x}_n are the class scores at the posterior mean.

The categorical likelihood and its lower bound

Let ak=wkTx~a_k = \mathbf{w}_k^\mathsf{T}\tilde{x} and let eke_k denote the one-hot vector of class kk. Because 1−Φ(a)=Φ(−a)1 - \Phi(a) = \Phi(-a) and ρ(a)=Φ(a)/Φ(−a)\rho(a) = \Phi(a)/\Phi(-a), the surrogate (2) assigns to this vector the probability

pIB(ek∣x~,W)=Φ(ak)∏j≠kΦ(−aj)=ρ(ak)∏j=1KΦ(−aj).(16)p_{\mathrm{IB}}(e_k \mid\tilde{x}, \mathbf{W}) = \Phi(a_k)\prod_{j \ne k}\Phi(-a_j) = \rho(a_k)\prod_{j=1}^{K}\Phi(-a_j). \tag*{(16)}

The probability that exactly one class is active is therefore P1=∑jpIB(ej∣x~,W)=∏iΦ(−ai)∑jρ(aj)P_1 = \sum_j p_{\mathrm{IB}}(e_j \mid\tilde{x}, W) = \prod_i \Phi(-a_i)\sum_j \rho(a_j), and conditioning the surrogate on this event gives

pCB(y=k∣x~,W)=pIB(ek∣x~,W)P1=ρ(ak)∑jρ(aj).(17)p_{\mathrm{CB}}(y = k \mid\tilde{x}, W) = \frac{p_{\mathrm{IB}}(e_k \mid\tilde{x}, W)}{P_1} = \frac{\rho(a_k)}{\sum_j \rho(a_j)}. \tag*{(17)}

which is (3). Since P1<1P_1 < 1, we have pCB(y=k∣x~,W)>pIB(ek∣x~,W)p_{\mathrm{CB}}(y = k \mid\tilde{x}, W) > p_{\mathrm{IB}}(e_k \mid\tilde{x}, W) for every class and every WW. The inequality is preserved by the product over the data and by the expectation over the prior p(W)p(W). The marginal likelihood of the categorical model is therefore larger than that of the surrogate, and the ELBO (6) of the surrogate is a lower bound on both.

The E-step and the M-step

Augmented model. With the auxiliary variables of § 3.3, the joint distribution of the labels, the auxiliary variables and the weights is

p(Z,Z~,W)=p(Z∣Z~)∏n,kN(z~nk∣wk⊤x~n,1)∏kN(wk∣μk0,Σ0),(18)p(Z, \tilde{Z}, W) = p(Z \mid\tilde{Z}) \prod_{n,k} \mathcal{N}(\tilde{z}_{nk} \mid w_k^\top\tilde{x}_n, 1) \prod_k \mathcal{N}(w_k \mid\mu_k^0, \Sigma_0), \tag*{(18)}

where p(Z∣Z~)p(Z \mid\tilde{Z}) is one if every z~nk\tilde{z}_{nk} has the sign prescribed by its label (z~nk>0\tilde{z}_{nk} > 0 for znk=1z_{nk} = 1 and z~nk≤0\tilde{z}_{nk} \le0 for znk=0z_{nk} = 0) and zero otherwise. Integrating out z~nk\tilde{z}_{nk} returns the surrogate (2), because Pr⁡(z~nk>0∣wk)=Φ(wk⊤x~n)\Pr(\tilde{z}_{nk} > 0 \mid w_k) = \Phi(w_k^\top\tilde{x}_n). Coordinate ascent on the ELBO (6) sets the logarithm of each factor of qq to the expectation of log⁡p(Z,Z~,W)\log p(Z, \tilde{Z}, W) under the other factor, up to an additive constant [4].

E-step. On the half-line prescribed by the label, the terms of (18) that contain z~nk\tilde{z}_{nk} give

log⁡q(z~nk)=−12Eq(wk)[(z~nk−wk⊤x~n)2]+const=−12(z~nk−ank)2+const,(19)\log q(\tilde{z}_{nk}) = -\frac{1}{2}\mathbb{E}_{q(w_k)}\left[(\tilde{z}_{nk} - w_k^\top\tilde{x}_n)^2\right] + \mathrm{const} = -\frac{1}{2}(\tilde{z}_{nk} - a_{nk})^2 + \mathrm{const}, \tag*{(19)}

because the expectation equals (z~nk−ank)2+x~n⊤Σx~n(\tilde{z}_{nk} - a_{nk})^2 + \tilde{x}_n^\top\Sigma\tilde{x}_n and its second term does not depend on z~nk\tilde{z}_{nk}. The factor q(z~nk)q(\tilde{z}_{nk}) is therefore a normal distribution with mean anka_{nk} and unit variance, truncated to (0,∞)(0, \infty) if znk=1z_{nk} = 1 and to (−∞,0](-\infty, 0] if znk=0z_{nk} = 0. The posterior covariance Σ\Sigma does not enter it, which is why the E-step uses the scores at the posterior mean. The first two moments of this truncated normal distribution are

Eq[z~nk]=ank+znkϕ(ank)Φ(ank)−(1−znk)ϕ(ank)Φ(−ank),Eq[z~nk2]=1+ankEq[z~nk].(20)\mathbb{E}_q[\tilde{z}_{nk}] = a_{nk} + z_{nk}\frac{\phi(a_{nk})}{\Phi(a_{nk})} - (1-z_{nk})\frac{\phi(a_{nk})}{\Phi(-a_{nk})}, \qquad\mathbb{E}_q[\tilde{z}_{nk}^2] = 1 + a_{nk}\mathbb{E}_q[\tilde{z}_{nk}]. \tag*{(20)}

The first is (7). The second is required by the parameter expansion of Appendix § 8.§ 3.

M-step. The terms of (18) that contain wkw_k give

log⁡q(wk)=−12∑nEq[(z~nk−wk⊤x~n)2]−12(wk−μk0)⊤Λ0(wk−μk0)+const=−12wk⊤(Λ0+X~⊤X~)wk+wk⊤(η0,k+X~⊤Eq[z~:k])+const,(21)\begin{aligned} \log q(w_k) = -\frac{1}{2}\sum_n \mathbb{E}_q[(\tilde{z}_{nk} - w_k^\top\tilde{x}_n)^2] - \frac{1}{2}(w_k-\mu_k^0)^\top\Lambda_0(w_k-\mu_k^0) + \mathrm{const} \\ &= -\frac{1}{2}w_k^\top(\Lambda_0 + \tilde{X}^\top\tilde{X})w_k + w_k^\top(\eta_{0,k} + \tilde{X}^\top\mathbb{E}_q[\tilde{z}_{:k}]) + \mathrm{const}, \tag*{(21)} \end{aligned}

where z~:k\tilde{z}_{:k} is the kk-th column of Z~\tilde{Z}. This is the logarithm of a normal density with the natural parameters (8). The precision Λ=Λ0+X~⊤X~\Lambda= \Lambda_0 + \tilde{X}^\top\tilde{X} depends neither on the class nor on q(Z~)q(\tilde{Z}). It is therefore computed once per batch, and only the means change during the inner iterations.

Relation to the Kalman filter. Substituting Λ0=Λ−X~⊤X~\Lambda_0 = \Lambda- \tilde{X}^\top\tilde{X} into μk=Λ−1ηk\mu_k = \Lambda^{-1}\eta_k gives the M-step in the form

μk=μk0+ΣX~⊤(Eq[z~:k]−X~μk0).(22)\mu_k = \mu_k^0 + \Sigma\tilde{X}^\top(\mathbb{E}_q[\tilde{z}_{:k}] - \tilde{X}\mu_k^0). \tag*{(22)}

This is the update of a Kalman filter with observation matrix X~\tilde{X}, unit observation noise and gain ΣX~⊤\Sigma\tilde{X}^\top, in which the expected auxiliary variables take the place of the observations. In a linear-Gaussian model the observations are given and (22) is applied once. Here Eq[z~:k]\mathbb{E}_q[\tilde{z}_{:k}] depends on μk\mu_k through (20), so the E-step and (22) are iterated.

Value of the bound and its maximizer. After an E-step, the ELBO (6) evaluates to

L(q)=∑n,klog⁡Φ((2znk−1)ank)−K2∑nx~nTΣx~n−∑kKL⁡(q(wk)∥p(wk)).(23)\mathcal{L}(q)=\sum_{n,k}\log\Phi\left((2z_{nk}-1)a_{nk}\right)-\frac{K}{2}\sum_n\tilde{x}_n^{\mathsf{T}}\Sigma\tilde{x}_n-\sum_k\operatorname{KL}\left(q(w_k)\mathbin{\|}p(w_k)\right). \tag*{(23)}

The first term is the log-likelihood of the surrogate at the posterior mean, the second is a penalty for the posterior variance of the scores, and the third is the divergence from the prior. With Σ=Λ−1\Sigma=\Lambda^{-1} fixed, (23) depends on the means only through ∑n,klog⁡Φ((2znk−1)μkTx~n)−12∑k(μk−μk0)TΛ0(μk−μk0)\sum_{n,k}\log\Phi\left((2z_{nk}-1)\mu_k^{\mathsf{T}}\tilde{x}_n\right)-\frac{1}{2}\sum_k(\mu_k-\mu_k^0)^{\mathsf{T}}\Lambda_0(\mu_k-\mu_k^0), which is strictly concave because log⁡Φ\log\Phi is concave. The inner iterations therefore have a single fixed point, and the mean at this fixed point is the maximum-a-posteriori estimate of the KK probit regressions under the prior (4). The number of inner iterations TT determines how closely this estimate is approached at each batch.

Parameter expansion

Parameter expansion adds a scale parameter ν\nu to the model, which makes the ELBO a function of ν\nu, and maximizes the ELBO over ν\nu in every inner iteration. The update (9), the quadratic equation for ν\nu and its coefficients c1c_1 and c2c_2 all follow from this maximization, as shown below.

Why plain CAVI is slow. In the exact posterior the overall scale of WW and the overall scale of Z~\widetilde{Z} are coupled, because z~nk\widetilde{z}_{nk} has mean wkTx~nw_k^{\mathsf{T}}\widetilde{x}_n. The factorization q(W)q(Z~)q(W)q(\widetilde{Z}) does not represent this coupling. The E-step computes q(Z~)q(\widetilde{Z}) for the current scale of WW and the M-step computes q(W)q(W) for the current scale of Z~\widetilde{Z}, so the common scale changes by a small amount per iteration. Parameter-expanded variational Bayes [Qi and Jaakkola, 2007] introduces a parameter that changes both scales together and optimizes it in every iteration.

Expanded model. For ν>0\nu>0 we define the model pνp_\nu by

pν(wk)=N(wk∣νμk0,ν2Σ0),pν(z~nk∣wk)=N(z~nk∣wkTx~n,ν2),(24)p_\nu(w_k)=\mathcal{N}\left(w_k\mid\nu\mu_k^0,\nu^2\Sigma_0\right),\qquad p_\nu(\widetilde{z}_{nk}\mid w_k)=\mathcal{N}\left(\widetilde{z}_{nk}\mid w_k^{\mathsf{T}}\widetilde{x}_n,\nu^2\right), \tag*{(24)}

with the observation rule znk=1[z~nk>0]z_{nk}=1[\widetilde{z}_{nk}>0] unchanged. It is the original model at ν=1\nu=1. For any other value it is the original model in rescaled variables: if (W,Z~)(W,\widetilde{Z}) is distributed according to the original model, then (νW,νZ~)(\nu W,\nu\widetilde{Z}) is distributed according to pνp_\nu. The labels depend only on the signs of the auxiliary variables, which the rescaling does not change, so pν(Z)=p(Z)p_\nu(Z)=p(Z) for every ν\nu. The parameter ν\nu therefore does not change the marginal likelihood of the labels.

Expanded ELBO. The ELBO of the expanded model,

L(q,ν)=Eq[log⁡p(Z∣Z~)+log⁡pν(Z~∣W)+log⁡pν(W)−log⁡q(W,Z~)]≤log⁡p(Z),(25)\mathcal{L}(q,\nu)=\mathbb{E}_q\left[\log p(Z\mid\widetilde{Z})+\log p_\nu(\widetilde{Z}\mid W)+\log p_\nu(W)-\log q(W,\widetilde{Z})\right]\leq\log p(Z), \tag*{(25)}

is a lower bound on the same marginal likelihood for every ν\nu, and it equals (6) at ν=1\nu=1. For a given qq it does depend on ν\nu, so it can be increased by maximizing over ν\nu in addition to the two factors of qq. Let q(Z~)q(\widetilde{Z}) be the result of the E-step and let q(wk)=N(mk,S)q(w_k)=\mathcal{N}(m_k,S). The terms of (25) that depend on ν\nu, on the means mkm_k or on the covariance SS are

L=−(N+d)Klog⁡ν+K2log⁡∣S∣−K2ν2tr⁡(ΛS)−12ν2R(ν,m)+const,(26)\mathcal{L}=-(N+d)K\log\nu+\frac{K}{2}\log\lvert S\rvert-\frac{K}{2\nu^2}\operatorname{tr}(\Lambda S)-\frac{1}{2\nu^2}R(\nu,m)+\text{const}, \tag*{(26)}
R(ν,m)=∑n,kEq[(z~nk−mkTx~n)2]+∑k(mk−νμk0)TΛ0(mk−νμk0),(27)R(\nu,m)=\sum_{n,k}\mathbb{E}_q\left[(\widetilde{z}_{nk}-m_k^{\mathsf{T}}\widetilde{x}_n)^2\right]+\sum_k(m_k-\nu\mu_k^0)^{\mathsf{T}}\Lambda_0(m_k-\nu\mu_k^0), \tag*{(27)}

where Λ=Λ0+X~TX~\Lambda=\Lambda_0+\widetilde{X}^{\mathsf{T}}\widetilde{X} as in (8) and the expectation in (27) is over q(z~nk)q(\widetilde{z}_{nk}) only. The first term of RR comes from the likelihood of the auxiliary variables and the second from the prior. We maximize (26) over its three arguments in turn.

Covariance. The maximizer of (26) over SS is S=ν2Λ−1S=\nu^2\Lambda^{-1}, whatever the means. With this covariance the trace term is the constant Kd/2Kd/2 and K2log⁡∣S∣=Kdlog⁡ν+const\frac{K}{2}\log\lvert S\rvert=Kd\log\nu+\text{const}, so that

L(ν,m)=−NKlog⁡ν−12ν2R(ν,m)+const.(28)\mathcal{L}(\nu,m)=-NK\log\nu-\frac{1}{2\nu^2}R(\nu,m)+\text{const}. \tag*{(28)}

Means. For a given ν\nu, R(ν,m)R(\nu,\mathbf{m}) is quadratic in mkm_k, and (28) is maximized by

mk(ν)=Λ−1(νη0,k+bk),bk=X~TEq[z~:k].(29)m_k(\nu)=\Lambda^{-1}(\nu\eta_{0,k}+b_k),\qquad b_k=\widetilde{X}^{\mathsf{T}}\mathbb{E}_q[\widetilde{z}_{:k}]. \tag*{(29)}

At ν=1\nu=1 this is the plain M-step (8). We denote its mean by μ^k=Λ−1(η0,k+bk)\hat{\mu}_k=\Lambda^{-1}(\eta_{0,k}+b_k).

Scale. Expanding the second term of (27) in powers of ν\nu shows that, for given means, (28) is −NKlog⁡ν+c1/ν−c2/(2ν2)-NK\log\nu+c_1/\nu-c_2/(2\nu^2) up to a constant, with

c1=∑kη0,kTmk,c2=∑n,kEq[(z~nk−mkTx~n)2]+∑kmkTΛ0mk.(30)c_1=\sum_k\eta_{0,k}^{\mathsf{T}}m_k,\qquad c_2=\sum_{n,k}\mathbb{E}_q[(\widetilde{z}_{nk}-m_k^{\mathsf{T}}\widetilde{x}_n)^2]+\sum_km_k^{\mathsf{T}}\Lambda_0m_k. \tag*{(30)}

Its derivative with respect to ν\nu is −(NKν2+c1ν−c2)/ν3-(NK\nu^2+c_1\nu-c_2)/\nu^3. Setting the derivative to zero gives the quadratic equation of (9), NKν2+c1ν−c2=0NK\nu^2+c_1\nu-c_2=0. Since c2>0c_2>0, the equation has exactly one positive root,

ν=−c1+c12+4NKc22NK,(31)\nu=\frac{-c_1+\sqrt{c_1^2+4NKc_2}}{2NK}, \tag*{(31)}

and this root is the maximizer, because the derivative is positive below it and negative above it.

One inner iteration. Each inner iteration of Algorithm 1 starts from the original model, ν=1\nu=1, with the current mean μ\mu, and performs the following steps.

  1. E-step. Compute the moments (20) of q(Z~)q(\widetilde{Z}) at the scores ank=μkTx~na_{nk}=\mu_k^{\mathsf{T}}\widetilde{x}_n, and the data term bkb_k.

  1. Means at ν=1\nu=1. Set mk=μ^km_k=\hat{\mu}_k, the mean of the plain M-step.

  1. Scale. Set ν\nu to the root (31), with c1c_1 and c2c_2 evaluated at mk=μ^km_k=\hat{\mu}_k.

  1. Means at the new ν\nu. Set mk=Λ−1(νη0,k+bk)m_k=\Lambda^{-1}(\nu\eta_{0,k}+b_k) by (29). The covariance is ν2Λ−1\nu^2\Lambda^{-1}.

  1. Reduction. Return to the original model by the change of variables (W,Z~)→(W/ν,Z~/ν)(W,\widetilde{Z})\to(W/\nu,\widetilde{Z}/\nu), which maps pνp_\nu to p1p_1 and divides the means by ν\nu and the covariance by ν2\nu^2:

q(wk)=N(Λ−1(η0,k+bk/ν),Λ−1).(32)q(w_k)=\mathcal{N}\left(\Lambda^{-1}(\eta_{0,k}+b_k/\nu),\Lambda^{-1}\right). \tag*{(32)}

The result (32) is the update (9): the first natural parameter is ηk=η0,k+bk/ν\eta_k=\eta_{0,k}+b_k/\nu and the precision Λ\Lambda is unchanged. In comparison with the plain M-step, the only difference is that the data term bkb_k is divided by ν\nu. Step 1 is line 8 of Algorithm 1, and steps 2 to 5 together are line 9.

The bound does not decrease. Steps 2 to 4 each maximize (28) over one of its arguments, so none of them decreases the bound. Step 5 leaves the value of the bound unchanged, because a change of variables applied to both the model and qq does not change the divergence between them. The reduction also rescales q(Z~)q(\widetilde{Z}), which the E-step of the next iteration replaces by the optimal factor, again without decreasing the bound. The ELBO (6) of the original model therefore does not decrease from one inner iteration to the next, and after each iteration it is at least as large as it would be after the plain M-step from the same q(Z~)q(\widetilde{Z}).

Fixed point. At a fixed point of plain CAVI the M-step returns the mean at which the E-step was evaluated, μ^k=μk\hat{\mu}_k=\mu_k. By (20), Eq[(z~nk−ank)2]=1−ank(Eq[z~nk]−ank)\mathbb{E}_q[(\widetilde{z}_{nk}-a_{nk})^2]=1-a_{nk}(\mathbb{E}_q[\widetilde{z}_{nk}]-a_{nk}), and summing over nn and kk gives NK−∑kμkT(bk−X~TX~μk)NK-\sum_k\mu_k^{\mathsf{T}}(b_k-\widetilde{X}^{\mathsf{T}}\widetilde{X}\mu_k). The M-step (8) gives bk−X~TX~μk=Λ0μk−η0,kb_k-\widetilde{X}^{\mathsf{T}}\widetilde{X}\mu_k=\Lambda_0\mu_k-\eta_{0,k}. Substituting both into (30) gives

c2−c1=NK,(33)c_2-c_1=NK, \tag*{(33)}

so ν=1\nu=1 solves the quadratic equation and the iteration leaves the fixed point unchanged. Conversely, at a fixed point of the PX iteration none of the steps increases the bound, so step 2 leaves the means unchanged and the point is a fixed point of plain CAVI. The two algorithms therefore have the same fixed point, which by Appendix § 8.§ 2 is unique, and they differ only in the number of iterations needed to approach it. Away from the fixed point ν≠1\nu\ne1 in general.

Form used in the implementation. With η^k=η0,k+bk\hat{\boldsymbol{\eta}}_k=\boldsymbol{\eta}_{0,k}+\boldsymbol{b}_k and the scores a^nk=μ^kTx~n\hat{a}_{nk}=\hat{\boldsymbol{\mu}}_k^{\mathsf{T}}\tilde{\boldsymbol{x}}_n of the plain M-step, the coefficients (30) at mk=μ^k\boldsymbol{m}_k=\hat{\boldsymbol{\mu}}_k are

c1=∑k⟨Λ−1η0,k,η^k⟩,c_1=\sum_k\langle\boldsymbol{\Lambda}^{-1}\boldsymbol{\eta}_{0,k},\hat{\boldsymbol{\eta}}_k\rangle,
c2=∑n,k(Eq[z~nk2]−2Eq[z~nk]a^nk+a^nk2)+∑k⟨η^k,Λ−1Λ0Λ−1η^k⟩(34)c_2=\sum_{n,k}\left(\mathbb{E}_q[\tilde{z}_{nk}^{2}]-2\mathbb{E}_q[\tilde{z}_{nk}]\hat{a}_{nk}+\hat{a}_{nk}^{2}\right)+\sum_k\langle\hat{\boldsymbol{\eta}}_k,\boldsymbol{\Lambda}^{-1}\boldsymbol{\Lambda}_0\boldsymbol{\Lambda}^{-1}\hat{\boldsymbol{\eta}}_k\rangle \tag*{(34)}

with Eq[z~nk2]\mathbb{E}_q[\tilde{z}_{nk}^{2}] from (20). The matrices Λ−1η0\boldsymbol{\Lambda}^{-1}\boldsymbol{\eta}_0 and Λ−1Λ0Λ−1\boldsymbol{\Lambda}^{-1}\boldsymbol{\Lambda}_0\boldsymbol{\Lambda}^{-1} do not change during the inner iterations. They are computed once per batch from the Cholesky factorization of Λ\boldsymbol{\Lambda} that the M-step already requires, so each inner iteration consists of matrix multiplications only.

The filtering recursion and its steady state

Prediction step. Let wm−1,k∼N(μm−1,k,Σm−1)\boldsymbol{w}_{m-1,k}\sim\mathcal{N}(\boldsymbol{\mu}_{m-1,k},\boldsymbol{\Sigma}_{m-1}) and wm,k=wm−1,k+ξm,k\boldsymbol{w}_{m,k}=\boldsymbol{w}_{m-1,k}+\boldsymbol{\xi}_{m,k}, where ξm,k∼N(0,Q)\boldsymbol{\xi}_{m,k}\sim\mathcal{N}(\boldsymbol{0},\boldsymbol{Q}) is independent of wm−1,k\boldsymbol{w}_{m-1,k}. Then wm,k∼N(μm−1,k,Σm−1+Q)\boldsymbol{w}_{m,k}\sim\mathcal{N}(\boldsymbol{\mu}_{m-1,k},\boldsymbol{\Sigma}_{m-1}+\boldsymbol{Q}), which is (11). This step involves no approximation. Because Q\boldsymbol{Q} is the same for every class, the predicted covariance is again shared across classes, and the predicted distribution has the form of the prior (4) that the update of Appendix A.2 requires.

Covariance recursion. Combining (11) with the precision of (8) gives

Σm=[(Σm−1+qI)−1+X~mTX~m]−1.(35)\boldsymbol{\Sigma}_m=\left[(\boldsymbol{\Sigma}_{m-1}+q\boldsymbol{I})^{-1}+\tilde{\boldsymbol{X}}_m^{\mathsf{T}}\tilde{\boldsymbol{X}}_m\right]^{-1}. \tag*{(35)}

The covariance depends on the features only, and not on the labels or on the inner iterations. To analyse the recursion we consider the case in which every batch has the same Gram matrix, X~mTX~m=G\tilde{\boldsymbol{X}}_m^{\mathsf{T}}\tilde{\boldsymbol{X}}_m=\boldsymbol{G}. Starting from Σ0=I\boldsymbol{\Sigma}_0=\boldsymbol{I}, the matrix Σm\boldsymbol{\Sigma}_m then has the eigenvectors of G\boldsymbol{G} for every mm, and each of its eigenvalues follows the scalar recursion

Σm=[(Σm−1+q)−1+λ]−1,(36)\Sigma_m=\left[(\Sigma_{m-1}+q)^{-1}+\lambda\right]^{-1}, \tag*{(36)}

where λ\lambda is the corresponding eigenvalue of G\boldsymbol{G}, that is, the precision that one batch contributes in that direction. We refer to (36) as the scalar reduction. For batches that differ from one another it describes the average behaviour of the filter, with λ\lambda the average precision per batch, and the statements below hold in this approximate sense.

Without process noise. For q=0q=0 and Σ0=1\Sigma_0=1, (36) gives Σm=(1+mλ)−1\Sigma_m=(1+m\lambda)^{-1}, which decreases to zero as the number of batches increases.

Lower bound on the covariance. For q>0q>0 the recursion converges to the positive solution of

λΣ∗2+λqΣ∗−q=0,\lambda\Sigma^{*2}+\lambda q\Sigma^*-q=0,
Σ∗=q2(1+4λq−1)≈{q/λ,λq≪1,1/λ,λq≫1.(37)\Sigma^*=\frac{q}{2}\left(\sqrt{1+\frac{4}{\lambda q}}-1\right)\approx \begin{cases} \sqrt{q/\lambda}, & \lambda q\ll1,\\ 1/\lambda, & \lambda q\gg1. \end{cases} \tag*{(37)}

In the first regime the limit is the geometric mean of the process noise qq and the variance 1/λ1/\lambda of the estimate from a single batch, and not qq itself. In the second regime the process noise is so large that the previous posterior contributes no information in this direction, and the posterior is that of the current batch alone.

Gain and memory. In the scalar reduction, the update (22) with the prior mean μm−1\mu_{m-1} of the prediction step reads

μm=(1−gm)μm−1+gmbmλ,gm=λΣm,(38)\mu_m=(1-g_m)\mu_{m-1}+g_m\frac{b_m}{\lambda},\qquad g_m=\lambda\Sigma_m, \tag*{(38)}

where bmb_m is the data term of batch mm and bm/λb_m/\lambda is the estimate that this batch alone would give. At the steady state the weight of the newest batch is g∗=λΣ∗≈λqg^*=\lambda\Sigma^*\approx\sqrt{\lambda q} for λq≪1\lambda q\ll1, and the data term of a batch that was assimilated jj steps earlier enters the mean with the weight g∗(1−g∗)jg^*(1-g^*)^j. The number of filtering steps over which a batch influences the posterior mean is therefore

τ=1g∗≈1λq.(39)\tau=\frac{1}{g^*}\approx\frac{1}{\sqrt{\lambda q}}. \tag*{(39)}

The process noise thus determines both the lower bound (37) on the posterior covariance and the memory (39) of the filter.

The effective learning rate. The gain gmg_m in (38) is the learning rate of the mean: each batch moves the mean by the fraction gmg_m of its distance to the estimate of that batch. The precision that a batch of BB inputs contributes is λ=Bc\lambda= Bc, where cc is the second moment of the features in the direction considered. With the parametrization q=α2/Bq = \alpha^2/B of (12),

g∗≈λq=αc,τ≈1αc.(40)g^* \approx\sqrt{\lambda q} = \alpha\sqrt{c}, \qquad\tau\approx\frac{1}{\alpha\sqrt{c}} . \tag*{(40)}

For features of unit scale per coordinate c=1c = 1 in every direction, so α\alpha is the steady-state gain itself and 1/α1/\alpha is the memory of the filter in steps, which is why we call α\alpha the effective learning rate of the head. For the features used in the experiments, which are not normalised (Appendix § 9), cc differs between directions, and α\alpha is the gain up to the factor c\sqrt{c}. Appendix § 11.§ 3 uses (39) to derive how qq has to change with the number of training steps.

The posterior predictive

Expectation of the probit function. Let u∼N(uˉ,σu2)u \sim\mathcal{N}(\bar{u}, \sigma_u^2) and let ϵ∼N(0,1)\epsilon\sim\mathcal{N}(0,1) be independent of uu. Then Φ(u)=Pr⁡(ϵ≤u∣u)\Phi(u) = \Pr(\epsilon\le u \mid u), and

E[Φ(u)]=Pr⁡(ϵ−u≤0)=Φ(uˉ1+σu2),(41)\mathbb{E}[\Phi(u)] = \Pr(\epsilon-u \le0) = \Phi\left(\frac{\bar{u}}{\sqrt{1+\sigma_u^2}}\right), \tag*{(41)}

because ϵ−u∼N(−uˉ,1+σu2)\epsilon-u \sim\mathcal{N}(-\bar{u},1+\sigma_u^2). This identity is exact.

Moderated scores. A new input x~\tilde{x} is scored by the head one transition after its last update, so the weights have the predicted distribution wk∼N(μk,Σ+Q)w_k \sim\mathcal{N}(\mu_k,\Sigma+Q) of (11). The score u=wk⊤x~u = w_k^\top\tilde{x} is then normally distributed with mean μk⊤x~\mu_k^\top\tilde{x} and variance x~⊤(Σ+Q)x~=x~⊤Σx~+q∥x~∥2\tilde{x}^\top(\Sigma+Q)\tilde{x} = \tilde{x}^\top\Sigma\tilde{x} + q\lVert\tilde{x}\rVert^2, and (41) gives (13). Neither Σ\Sigma nor QQ depends on the class, so s(x~)s(\tilde{x}) is one positive number per input. Dividing all KK scores by it does not change their order, and hence does not change the predicted class. It changes only the confidence of the prediction.

Class probabilities. The factor q(W)q(W) and the transition (10) are both independent across classes. Under the predictive distribution of the surrogate, the KK binary variables of an input are therefore independent, with probabilities Φ(ak(x~))\Phi(a_k(\tilde{x})), where ak(x~)=μk⊤x~/s(x~)a_k(\tilde{x}) = \mu_k^\top\tilde{x}/s(\tilde{x}). Conditioning this distribution on exactly one active class, as in Appendix § 8.§ 1, gives the class probabilities (14). They are the predictive distribution of the surrogate conditioned on one active class. They are not the expectation of (3) under q(W)q(W), which has no closed form.

Computational cost of a filtering step

One filtering step on a batch of BB inputs consists of the following operations. The prediction step factorizes Σm−1+Q\Sigma_{m-1}+Q and solves for Λmpred\Lambda_m^{\mathrm{pred}} and ηmpred\eta_m^{\mathrm{pred}}, at a cost of O(d3+d2K)O(d^3+d^2K). The update forms Λm=Λmpred+X~m⊤X~m\Lambda_m=\Lambda_m^{\mathrm{pred}}+\tilde{X}_m^\top\tilde{X}_m, factorizes it, and computes X~mΛm−1\tilde{X}_m\Lambda_m^{-1} and the two constant matrices of (34), at a cost of O(Bd2+d3+d2K)O(Bd^2+d^3+d^2K). Each of the TT inner iterations then computes the scores X~mΛm−1η\tilde{X}_m\Lambda_m^{-1}\eta, the data term and the coefficients c1c_1 and c2c_2 by matrix multiplications, at a cost of O(BdK+d2K)O(BdK+d^2K), of which the second term is due to the parameter expansion. Finally μm\mu_m and Σm\Sigma_m are obtained from the factorization of Λm\Lambda_m. The total cost of a step is

O(d3+Bd2+T(BdK+d2K)),(42)O\left(d^3+Bd^2+T(BdK+d^2K)\right), \tag*{(42)}

with two Cholesky factorizations per batch, whose cost depends neither on TT nor on KK, and an inner loop that is linear in KK.

The state of the head consists of the means, with KdKd entries as in any linear head, and the shared covariance, with d(d+1)/2d(d+1)/2 distinct entries for any number of classes. A per-class diagonal covariance, as in the diagonal parameterization of VBLL, has KdKd entries, and a per-class factorization of rank rr has KdrKdr.

Experimental setup

This appendix describes what is common to all experiments. The protocols of the probing and detection experiments and of the fine-tuning experiment are given in Appendices § 10 and § 11.

Backbones and features. All experiments use DINOv3 [Siméoni et al., 2025], in the four sizes ViT-S+/16, ViT-B/16, ViT-L/16 and ViT-H+/16, which we refer to as Small, Base, Large and Huge and which produce features of dimension D=384D = 384, 768, 1024 and 1280. The feature xx is the mean of the patch tokens of the final layer. The features are used as the backbone produces them, without normalisation; for DINOv3-Huge their mean square per coordinate is between 0.01 and 0.06 on the probing datasets.

Datasets. The probing experiments (§ 4.1) use Oxford Pets, Food-101, Flowers-102, Stanford Cars and DTD, and the detection experiments (§ 4.2) use CIFAR-10, CIFAR-100 and SVHN. For these experiments the features are extracted once per backbone and dataset, from images resized to 512×512512 \times512 pixels for the five probing datasets and to 224×224224 \times224 pixels for CIFAR-10/100 and SVHN, and stored. Every method therefore receives identical inputs, and none can benefit from different preprocessing. The fine-tuning experiment (§ 4.3) trains ViT-H+/16 end to end on ImageNet-1k [9] at 224×224224 \times224 pixels, without data augmentation, and evaluates under shift on ImageNet-R, -A, -V2 and -Sketch.

Methods. IBProbit is the head of § 3.3–§ 3.6. Every run uses the parameter expansion of § 3.3, the loss (14) with the approximation (15), the initial state μ=0\mu= 0, Σ=I\Sigma= I, and a process noise Q=qIQ = qI that is constant during a run. Its hyperparameters are the process noise qq, the number of inner iterations TT and the batch size. AdamW+CE is a linear layer trained with the cross-entropy loss, and CE+TS applies to it a single temperature that is fitted on the validation set after training. VBLL is the classification head of Harrison et al. [2024] in its diagonal parameterization. Its predictive is the Monte Carlo estimate of the expected softmax, with 200 samples in the probing experiments and 20 in fine-tuning.

Optimization and implementation. The gradient-trained heads (AdamW+CE and VBLL) and, in fine-tuning, the backbone are trained with AdamW [17, 22] at a constant learning rate. The cross-entropy and IBProbit experiments use JAX [6] with Equinox [16]; the VBLL experiments use the PyTorch implementation of Harrison et al. [2024]. In probing all methods read the same stored features; in fine-tuning the VBLL runs use a PyTorch implementation of the same pretrained backbone with the same pooled feature.

Metrics and seeds. We report the accuracy, the negative log-likelihood (NLL) and the multiclass Brier score, which is computed over the full predictive vector. Detection is scored by the maximum softmax probability, for which we report the AUROC and the false-positive rate at a true-positive rate of 95%. Test-set numbers are averaged over seeds: ten for the linear-probing and detection experiments (§ 4.1, § 4.2) and five for full-network fine-tuning (§ 4.3). Figures 1 and 2 show the seed mean with error bars of ±1\pm1 standard deviation; in Figures 3 and 4 the bands are the range across seeds.

Compute resources. The reported linear-probing and detection runs (§ 4.1, § 4.2: 690 runs across three methods, four backbone sizes, seven datasets and ten seeds) total approximately 250 GPU-hours on NVIDIA A100s. The reported full-network fine-tuning runs (§ 4.3: three methods ×\times five seeds ×\times two epochs of ImageNet-1k on DINOv3-Huge) total approximately 280 GPU-hours on the same hardware, 18–19 hours per run, plus roughly 40 GPU-hours for the separate workers that score the checkpoints of the PyTorch runs on the shift sets. The hyperparameter searches behind both cost substantially more than the reported runs: 21 studies of roughly 100 completed trials each for probing, and approximately 930 GPU-hours for the three DINOv3-Huge fine-tuning studies whose configurations are reported (Appendix D.2). The project as a whole cost considerably more again, through the DINOv3-Large studies, the process-noise measurements of Appendix D.3, preliminary exploration, abandoned configurations and earlier algorithm variants.

Linear probing and detection: protocol, tuning and final runs

Figures 1 and 2 compare three heads, so the comparison is only as reliable as the tuning of the two baselines. This appendix describes the protocol of these experiments in the order in which it is carried out: the training procedure, the data splits and the budget, then the hyperparameter search, the final runs behind every plotted point, and the caveats that apply to the figures. One protocol is applied identically to every method. The fine-tuning experiment of § 4.3 was tuned separately and is described in Appendix D.

Training procedure. Each method is trained on the stored features of the training split of a dataset. AdamW+CE and VBLL take one AdamW step per mini-batch. IBProbit takes one filtering step per mini-batch (Algorithm 1), which requires no gradient computation. The filter makes repeated passes over the training data, and its posterior is carried from one pass to the next without a reset.

Data splits. Training uses the full training split. A fixed 10% of the held-out split of each dataset, the same for every method and seed, is the validation set: it is used to select the evaluation at which a run is scored, to score the search trials and to fit the temperature. All reported numbers are computed on the remaining 90%. For Flowers-102 the training split is the official one of 1,020 images and the held-out split is the union of the official validation and test sets.

Budget and evaluation. Every run of every method has the same budget of 30,000 steps, expressed as whole epochs at that run’s batch size, so two configurations with different batch sizes receive the same number of updates rather than the same number of passes. The validation NLL is evaluated on a grid that is uniform in the number of training samples, with the same interval for every batch size of a dataset. A run is scored at the evaluation with the lowest validation NLL.

Search spaces. Each method is searched over its own hyperparameters. AdamW+CE: learning rate [10−3,3×10−2][10^{-3}, 3 \times10^{-2}] and weight decay [10−5,10−1][10^{-5}, 10^{-1}], both log-uniform, plus batch size over a per-dataset set of powers of two. VBLL adds its three variational hyperparameters — KL ratio [10−7,10−2][10^{-7}, 10^{-2}], prior scale [10−1,103][10^{-1}, 10^{3}], Wishart scale [10−3,101][10^{-3}, 10^{1}], all log-uniform — for six searched dimensions, the largest of the three. IBProbit has neither a learning rate nor a weight decay, because the head is updated in closed form and the backbone is frozen; it is searched over qq (log-uniform in [10−6,10−1][10^{-6}, 10^{-1}]), the number of inner iterations T∈{32,64,128,192}T \in\{32, 64, 128, 192\}, and batch size. Temperature scaling is not searched — it is fit post hoc on the validation split, so CE+TS uses none of the CE search budget and improves the baseline at no additional search cost.

Objective, and the smoothing window. A trial scores the lowest mean validation NLL over any two consecutive evaluations, rather than the single lowest value. Each trial is run twice, neither of which is among the ten reported ones, and its score is the mean over the two. The width of the window affects which configurations are selected. On a trajectory that does not converge, the single-point minimum reflects the amplitude of the noise rather than the level reached, and the search favours configurations whose validation loss oscillates strongly enough to reach low values: on Oxford Pets the unsmoothed objective selected a CE learning rate of 0.0182 whose late-phase standard deviation is 0.53×0.53\times its own median, over a configuration 13× more stable and 0.032 better on test NLL.

Only methods with a learning rate can benefit from this, so the bias is not symmetric across the methods being compared. A window that is too wide has a different undesired effect, on IBProbit. We measured both by repeating the entire search at each width. Widths 1 and 2 select the same operating point for IBProbit (within 0.003 NLL at every task and 0.005 FPR@95 at every pair), while width 5 selects qq at its lower search bound, 1.0×10−61.0 \times10^{-6} — confirmed on an independent search seed — and increases FPR@95 by a factor of three on CIFAR-10 vs SVHN. Conversely the gradient-trained methods need width ≥2\ge2 to avoid the selection of noisy minima described above. Width 2 is the only setting satisfying both, and it is applied uniformly to all three methods; no method is tuned under an objective of its own.

Search procedure and depth. Each (method, dataset) study is a separate Optuna ([1]) TPE search run by four parallel workers against a shared journal, with a median pruner (20 startup trials, 10 warmup evaluations). In addition, a trial is stopped early after 40 consecutive evaluations without relative improvement. Workers stop once the study holds 100 completed trials, counting across workers, so the search depth is fixed in advance and does not depend on how many trials the pruner stopped. Of the 21 studies, 17 reached that target. Four stopped short — IBProbit on Oxford Pets (73 completed) and Stanford Cars (86), CE (79) and VBLL (89) on CIFAR-10 — because prune rates in those studies reach 83–93% and the per-worker trial limit was reached first.

We report the shortfall instead of adding trials: in the two CIFAR-10 studies a further 600 trials yielded only nine additional completions, which indicates a converged study rather than one with too few trials. Table 2 lists every selected configuration.

Table 2: Selected configurations, one per (method, dataset), tuned at DINOv3-Huge and applied at every backbone size. epochs restates the shared 30,000-step budget at that entry’s batch size and is not an independent hyperparameter. The final column is the number of completed trials the study reached. IBProbit has no learning rate or weight decay: its head update is closed-form.

AdamW + cross-entropy (+ post-hoc temperature scaling)
Datasetbatchlearning rateweight decayepochstrials
Oxford Pets640.003952.64×10−52.64 \times10^{-5}527102
Food-1015120.001130.000223205100
Flowers-1022560.0210.0016810000103
Stanford Cars640.001011.6×10−51.6 \times10^{-5}237102
DTD640.002170.00103518100
CIFAR-105120.01460.07231079
CIFAR-1005120.001670.000132310101
IBProbit
DatasetbatchqqTTepochstrials
Oxford Pets10240.001391921000073
Food-10110241.93×10−61.93 \times10^{-6}64411103
Flowers-1022569.52×10−59.52 \times10^{-5}3210000103
Stanford Cars2562.58×10−52.58 \times10^{-5}19296886
DTD640.00101192518102
CIFAR-10640.0057712839102
CIFAR-1001280.0005293277102
VBLL (diagonal parameterization)
Datasetbatchlrweight decayKL ratioprior scaleWishart scaletrials
Oxford Pets1280.01597.61×10−57.61 \times10^{-5}2.36×10−72.36 \times10^{-7}1.450.546101
Food-1011280.001270.0005661.15×10−61.15 \times10^{-6}0.1030.00555100
Flowers-102640.02950.005973.81×10−73.81 \times10^{-7}11.10.371102
Stanford Cars640.00340.0001261.42×10−71.42 \times10^{-7}12.60.0201100
DTD640.00720.03771.67×10−51.67 \times10^{-5}16.50.0463103
CIFAR-1010240.01420.002540.003960.1240.37189
CIFAR-1005120.001790.07759.85×10−69.85 \times10^{-6}6.166.94102

Table 2.

Final runs. Reported numbers come from new runs at the selected configuration, never from the search trials. Each final run uses the full 30,000-step budget, without the early stopping of the search, and is scored at the evaluation with the lowest validation NLL. At DINOv3-Huge this evaluation falls, for IBProbit, after a median of 13 (DTD) to 686 (Flowers-102) passes over the training data. Figure 1 is 3 methods ×\times 4 backbone sizes ×\times 5 tasks ×\times 10 seeds = 600 runs, all of which completed. The figure uses 598 of them: one seed each of CE on Food-101 and of IBProbit on Flowers-102 at DINOv3-Base was excluded by the analysis script, which carried over an exclusion list from an earlier campaign in which these two runs had failed, so those two settings have nine seeds. Figure 2 is 3 methods ×\times 3 pairs ×\times 10 seeds = 90 runs, all of which completed.

Caveats. There are three, all of which affect how the figures should be interpreted. Only DINOv3-Huge was tuned. The other three backbone sizes use the configuration tuned at Huge, and the backbones produce 384/768/1024/1280-dimensional features, so a configuration optimal at one is not guaranteed optimal at another; the non-Huge points in Figure 1 are therefore not separately optimized for any method, which is a limitation applying equally to all three. 69 of the 598 runs are budget-truncated, meaning their validation optimum falls in the last 10% of the step budget and the plotted point is a lower bound; these concentrate at DINOv3-Small and on Food-101, and the figure marks them. The IBProbit configuration on Oxford Pets is close to a region where training diverges: 30 of the 600 trials in that study produced a non-finite validation NLL at every evaluation, all at batch 1024 with T=192T = 192, which is also the setting of the selected configuration. The selected configuration itself completed in all ten reported seeds, but roughly one trial in nine with these settings fails.

Full-network fine-tuning: procedure, tuning and transfer

This appendix describes the fine-tuning experiment of § 4.3 in the order in which it is carried out: the training step (Appendix § 11.§ 1), the hyperparameter search at a short training duration (Appendix § 11.§ 2), the transfer of the selected hyperparameters to the reported duration, which includes the scaling law for the process noise and its empirical validation (Appendix § 11.§ 3), and the final runs (Appendix § 11.§ 4). We write MM for the number of training steps of a run. For IBProbit every training step contains one filtering step, so MM is also the number of filtering steps.

Training procedure

Common settings. All three methods fine-tune all weights of DINOv3-Huge on ImageNet-1k with AdamW at a constant learning rate. The batch size is 512, reached by accumulating the gradients of micro-batches of 16 images (32 for VBLL). Layer-wise learning-rate decay reduces the learning rate by a constant factor from each of the 32 blocks of the backbone to the block below it, such that the learning rate of the input embedding is 0.75120.75^{12} times that of the last block. The backbone is evaluated in bfloat16 precision, and the weights, the optimizer state and the head are kept in float32.

The training step of IBProbit. One training step on a batch Bm\mathcal{B}_m consists of three operations.

  1. Loss and gradient. The backbone computes the features of the batch, and the loss ((14)) is evaluated with the head of the previous step, (μm−1,Σm−1)(\boldsymbol{\mu}_{m-1}, \boldsymbol{\Sigma}_{m-1}). The gradient of the loss is taken with respect to the weights of the backbone only. It passes through the features into both the class scores μmTx~\boldsymbol{\mu}_m^\mathsf{T}\tilde{x} and the factor s(x~)\mathsf{s}(\tilde{x}) of ((13)), and the head is a constant in this computation.

  1. Backbone step. AdamW updates the backbone with the gradient averaged over the batch.

  1. Head step. The features computed in the first operation, together with the labels, are assimilated by one filtering step of Algorithm 1 on the whole batch of 512, which gives (μm,Σm)(\boldsymbol{\mu}_m, \boldsymbol{\Sigma}_m).

The loss of a batch is thus evaluated before the head has assimilated that batch. In the first step the head is in its initial state μ=0\boldsymbol{\mu} = 0, for which the loss does not depend on the features, so only the head step is performed. The head is not reset between epochs: the process noise discounts the evidence obtained from features that earlier states of the backbone produced.

The training step of the baselines. For AdamW+CE and VBLL the head is trained jointly with the backbone by the same AdamW steps. The learning rate of the head is a multiple of that of the backbone, and this multiple is a searched hyperparameter.

Data splits. A fixed partition of 10,000 images, 20% of the official ImageNet validation set, is the validation set of this experiment: it is used to score the search trials and to fit the temperature of CE+TS. The remaining 40,000 images are the test set on which every figure and table reports.

Hyperparameter search

Search setting. Each method is tuned at the reported backbone, DINOv3-Huge, at a short training duration: Ms=781M_s = 781 steps (399,872 samples, about a third of an epoch), with the validation NLL evaluated every 2,048 samples. Each study is a TPE search with a median pruner, and each trial uses one seed, which is not among the reported ones.

Search spaces. The searched coordinates are chosen to be invariant under the transfer to the reported duration (Appendix § 11.§ 3), so that the selected values remain valid after the transfer. Learning rate and weight decay are searched per batch\sqrt{\text{batch}}, and the AdamW moment decays as the products (1−βi)M(1-\beta_i)M, which we call horizons, with the β1\beta_1-horizon in [39, 312] and the β2\beta_2-horizon in [0.4,40][0.4, 40]. At batch 512 the learning-rate search range is [10−6,10−3][10^{-6}, 10^{-3}] for every method, and the weight-decay search range is [10−6,10−3][10^{-6}, 10^{-3}] for cross-entropy, [10−5,10−2][10^{-5}, 10^{-2}] for VBLL and [10−5,10−1][10^{-5}, 10^{-1}] for IBProbit. Cross-entropy and VBLL also search the head’s learning rate as a multiple of the backbone’s, [5,104][5, 10^{4}]; VBLL adds its KL ratio [10−7,10−2][10^{-7}, 10^{-2}] and prior scale [10−3,103][10^{-3}, 10^{3}]. IBProbit has no head learning rate. It searches q∈[10−7,10−2]q \in[10^{-7}, 10^{-2}] with the number of inner iterations fixed at T=256T = 256, since at a value of qq appropriate for the training duration 128 and 256 inner iterations gave validation NLL within 0.001 of each other (DINOv3-Large, 781 steps, one seed).

Objective. Every reported configuration is the trial with the lowest mean validation NLL over its last five evaluations. A trial is also stopped when its validation NLL has not improved by a relative 10−410^{-4} over 20 consecutive evaluations; such a trial counts as completed and is scored on its last five evaluations. Scoring the end of the trajectory rather than its minimum is important for a method with a forgetting rate: a search that scores the minimum of a truncated curve prefers configurations whose validation loss is low early and then degrades, which selects a process noise that is too large (Appendix § 11.§ 3). The IBProbit study was run under this objective directly, with pruning deferred to 30% of the run, and completed 52 trials. The cross-entropy and VBLL studies were run earlier with pruning after ten evaluations and completed 61 and 59 trials; their reported configurations are selected by applying the same objective to those completed trials. Both searches had converged — among their near-best trials every cross-entropy coordinate lies within a factor 2.1 and every VBLL coordinate within 1.4 — so rerunning them at IBProbit’s smaller completion target would have given the baselines a weaker search, not a fairer one.

Transfer to the reported training duration

The search is run at Ms=781M_s = 781 steps and the reported runs at Mr=5,004M_r = 5{,}004 steps, which is two epochs, at the same batch size. Hyperparameters whose appropriate value depends on the number of steps have to be converted from one duration to the other. We first state the two rules that we use, and then report the measurements that test the second of them.

AdamW hyperparameters. For the hyperparameters of AdamW we use the scaling rule derived from its stochastic-differential-equation limit [Mlodozeniec et al., 2025]. The learning rate and the weight decay are multiplied by Ms/Mr\sqrt{M_s/M_r}. The moment decays are set such that the horizons (1−βi)M(1-\beta_i)M are unchanged, which keeps the averaging window 1/(1−βi)1/(1-\beta_i) of each moment estimate at a fixed fraction of the run. The ratio of the head and backbone learning rates is unchanged.

Process noise: the scaling law. The rule for AdamW does not cover the process noise qq, whose appropriate value also depends on the number of steps. By (39), a batch influences the posterior mean of the head over τ≈(λq)−1/2\tau\approx(\lambda q)^{-1/2} filtering steps, where λ\lambda is the precision that one batch contributes. We require that τ\tau is the same fraction of the run at both durations. This is the requirement that the rule above places on the averaging windows of AdamW, applied to the head. At a fixed batch size λ\lambda does not change, so τ/M\tau/M is unchanged if and only if

q∝M−2,that is,qr=qs(MsMr)2.(43)q \propto M^{-2}, \qquad\text{that is,} \qquad q_r = q_s\left(\frac{M_s}{M_r}\right)^2. \tag*{(43)}

In terms of the effective learning rate α\alpha of (12), the law is α∝M−1\alpha\propto M^{-1}: the effective learning rate of the head is inversely proportional to the number of steps. For the reported runs, (43) gives qr=5.98×10−5×(781/5004)2=1.46×10−6q_r = 5.98 \times10^{-5} \times(781/5004)^2 = 1.46 \times10^{-6} (Table 3). The exponent is a consequence of the steady state of the filter and is not fitted to data.

Empirical validation. We tested (43) by measuring the best value of qq at three training durations. On DINOv3-Large we evaluated seven values of qq, six from 1.29×10−71.29 \times10^{-7} to 1.29×10−21.29 \times10^{-2}, one decade apart, and 4.09×10−34.09 \times10^{-3}, at M=781M = 781, 2502 and 5004 steps, with one seed per setting. All other hyperparameters were those of the tuned configuration, transferred to each duration by the rule for AdamW above, so that only the number of steps and qq varied. The best value on this grid decreases by one decade from 781 to 2502 steps and by one further decade from 2502 to 5004 steps:

steps MM78125025004
best qq1.29×10−41.29 \times10^{-4}1.29×10−51.29 \times10^{-5}1.29×10−61.29 \times10^{-6}

Table 3.

Fitting q∝M−pq \propto M^{-p} to the first interval gives p=1.98p = 1.98. The second interval is consistent with p=2p = 2 within the resolution of the grid: p=2p = 2 predicts 3.2×10−63.2 \times10^{-6} at M=5004M = 5004, between the grid values 1.29×10−61.29 \times10^{-6}, which has the lowest test NLL (0.4212), and 1.29×10−51.29 \times10^{-5} (0.4256). An exponent p=1p = 1 fits less well: it predicts 4.03×10−54.03 \times10^{-5} at M=2502M = 2502, between the grid values 1.29×10−51.29 \times10^{-5} and 1.29×10−41.29 \times10^{-4}, and at the latter the test NLL is 0.011 higher than at the optimum (0.4374 against 0.4267).

Effect of a value that is too large. When qq is roughly two decades above the value appropriate for the training duration, the in-distribution NLL reaches its minimum near half the budget and increases for the remainder. Below the appropriate value the curve descends monotonically to its final evaluation instead. This is why qq cannot be transferred unchanged from the short duration of the search, and why the search scores the end of the trajectory (Appendix § 11.§ 2).

Test on a second backbone. We applied (43) to a backbone on which it was not measured: DINOv3-Huge, at a matched budget, with the same tuned trial and only qq rescaled. The rescaling reduces the rise of the validation NLL past its minimum by 65% and improves the test NLL at the validation-optimal evaluation from 0.3935 to 0.3761, and at the end of training from 0.4045 to 0.3760 (one seed).

Limits. The derivation of (43) uses the scalar reduction of Appendix § 8.§ 4 in the regime λq≪1\lambda q \ll1 and assumes a fixed batch size. The exponent is measured at one backbone size. The rise of the validation NLL that remains at DINOv3-Huge is consistent either with a starting value of qq that was selected under an objective that scores the minimum of a truncated curve, or with a dependence of the exponent on the width of the backbone that we have not identified, and the two are not separated by the experiments reported here.

Final runs

Table 3 gives the values selected by the search and the values after the transfer. Each method is run with the transferred values for five seeds, 15 runs in all. Validation and test metrics are computed every 32,768 samples, which gives 78 evaluations per run, and the shift sets are scored at every second evaluation. Cross-entropy and IBProbit evaluate the shift sets in the training process; VBLL writes checkpoints that a separate worker scores, which is why its compute is accounted separately in Appendix § 9. All 15 runs completed with every scheduled evaluation present.

Wall-clock time and memory. The wall-clock comparison of Figure 5 is made on fixed hardware with an identical training protocol across methods. It remains dependent on the implementation (matrix-multiplication dispatch, mixed precision, Cholesky kernel, just-in-time compilation) and should be interpreted as a comparison between these implementations rather than between the methods in general. We do not report peak memory for the fine-tuning runs. At d=1281d = 1281 and K=1000K = 1000 the states of the two Bayesian heads (Appendix § 8.§ 6) differ by less than 2 MB, which a measurement of the peak memory of end-to-end training cannot resolve, because the activations of the backbone dominate the peak. A comparison across frameworks would in addition have to match XLA’s peak_bytes_in_use against PyTorch’s max_memory_reserved, statistics that are defined differently enough that the choice between max_memory_reserved and max_memory_allocated alone changes the PyTorch result by several GiB, which is more than the differences being compared.

AdamW+CEVBLLIBProbit
Selected at 781 steps
completed trials615952
learning rate / B\sqrt{B}4.27×10−64.27 \times10^{-6}6.34×10−66.34 \times10^{-6}6.13×10−66.13 \times10^{-6}
weight decay / B\sqrt{B}1.60×10−71.60 \times10^{-7}2.92×10−42.92 \times10^{-4}1.81×10−51.81 \times10^{-5}
β1\beta_1-horizon / β2\beta_2-horizon95.9 / 0.8790.7 / 2.1584.5 / 10.7
head / backbone learning rate29.7479—
KL ratio / prior scale—5.68×10−45.68 \times10^{-4} / 533—
process noise qq——5.98×10−55.98 \times10^{-5}
As run at 5,004 steps
learning rate3.81×10−53.81 \times10^{-5}5.67×10−55.67 \times10^{-5}5.48×10−55.48 \times10^{-5}
head learning rate1.13×10−31.13 \times10^{-3}2.72×10−22.72 \times10^{-2}—
weight decay1.43×10−61.43 \times10^{-6}2.61×10−32.61 \times10^{-3}1.62×10−41.62 \times10^{-4}
β1\beta_1 / β2\beta_20.9808 / 0.99980.9819 / 0.99960.9831 / 0.9979
process noise qq / inner iterations TT——1.46×10−61.46 \times10^{-6} / 256

Table 3 (PDF p. 29). Selected fine-tuning configurations at DINOv3-Huge. The upper rows are the values the search selected at 781 steps; the lower rows are what each run of Figure 3–Figure 5 and Table 1 actually used at 5,004 steps, after the transfer of Appendix § 11.§ 3. Every run uses batch size B=512B = 512, a constant learning rate and the same layer-wise decay.

References

  1. [1]Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 2623–2631, 2019.arxiv.org/abs/1907.10902
  2. [2]James H. Albert and Siddhartha Chib. Bayesian analysis of binary and polychotomous response data. Journal of the American Statistical Association, 88(422):669–679, 1993.DOI
  3. [3]Matthew J. Beal. Variational algorithms for approximate Bayesian inference. PhD thesis, Gatsby Computational Neuroscience Unit, University College London, 2003.
  4. [4]Christopher M. Bishop. Pattern Recognition and Machine Learning. Springer, 2006.
  5. [5]Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1613–1622, Lille, France, 07–09 Jul 2015. PMLR. URL https://proceedings.mlr.press/v37/blundell15.html.
  6. [6]James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
  7. [7]Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C. Wilson, and Michael I. Jordan. Streaming variational Bayes. In Advances in Neural Information Processing Systems, 2013.arxiv.org/abs/1307.6769
  8. [8]Erik Daxberger, Agustinus Kristiadi, Alexander Immer, Runa Eschenhagen, Matthias Bauer, and Philipp Hennig. Laplace redux — effortless Bayesian deep learning. In Advances in Neural Information Processing Systems, 2021.arxiv.org/abs/2106.14806
  9. [9]Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, 2009.
  10. [10]Felix Fiedler and Sergio Lucia. Improved uncertainty quantification for neural networks with Bayesian last layer. IEEE Access, 2023. arXiv:2302.10975.DOI
  11. [11]Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In International Conference on Machine Learning, 2016.arxiv.org/abs/1506.02142
  12. [12]Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1321–1330. PMLR, 06–11 Aug 2017. URL https://proceedings.mlr.press/v70/guo17a.html.arxiv.org/abs/1706.04599
  13. [13]James Harrison, John Willes, and Jasper Snoek. Variational Bayesian last layers. In International Conference on Learning Representations, 2024.arxiv.org/abs/2404.11599
  14. [14]Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (GELUs). arXiv preprint arXiv:1606.08415, 2016.
  15. [15]Pavel Izmailov, Sharad Vikram, Matthew D Hoffman, and Andrew Gordon Gordon Wilson. What are bayesian neural network posteriors really like? In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 4629–4640. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/izmailov21a.html.arxiv.org/abs/2104.14421
  16. [16]Patrick Kidger and Cristian Garcia. Equinox: neural networks in JAX via callable PyTrees and filtered transformations. arXiv preprint arXiv:2111.00254, 2021.arxiv.org/abs/2111.00254
  17. [17]Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.arxiv.org/abs/1412.6980
  18. [18]Augustinus Kristiadi, Matthias Hein, and Philipp Hennig. Being Bayesian, even just a bit, fixes overconfidence in ReLU networks. In International Conference on Machine Learning, pages 5436–5446. PMLR, 2020.arxiv.org/abs/2002.10118
  19. [19]Augustinus Kristiadi, Matthias Hein, and Philipp Hennig. An infinite-feature extension for Bayesian ReLU nets that fixes their asymptotic overconfidence. In Advances in Neural Information Processing Systems, 2021.arxiv.org/abs/2010.02709
  20. [20]Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, 2017.arxiv.org/abs/1612.01474
  21. [21]Scott Linderman, Matthew J. Johnson, and Ryan P. Adams. Dependent multinomial models made easy: Stick-breaking with the Pólya-Gamma augmentation. In Advances in Neural Information Processing Systems, 2015.arxiv.org/abs/1506.05843
  22. [22]Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
  23. [23]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, 2019.arxiv.org/abs/1902.02476
  24. [24]Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai, Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neural networks. In Advances in Neural Information Processing Systems, 2021.arxiv.org/abs/2106.07998
  25. [25]Adrian Robert Minut, Nico Daheim, Marco Miani, Mohammad Emtiyaz Khan, Wu Lin, and Thomas Möllenhoff. Soap-bubbles: Structured weight uncertainty for neural networks. arXiv preprint arXiv:2606.23357, 2026.arxiv.org/abs/2606.23357

Paper details

vlnc:W_z3x38p5w
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents