arXiv:2610.16578stat.MLOct 2026

Manuscript Offprint

arXiv:2610.16578

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

Dimitrije Markovic, Conor Heins, Alexander Tschantz, Christopher L. Buckley

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

1 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 (Guo et al., 2017). 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 (Guo et al., 2017) 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, 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 (Blundell et al., 2015; Izmailov et al., 2021). 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 (Kristiadi et al., 2020; Daxberger et al., 2021). 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 (Harrison et al., 2024)) or on post-hoc Laplace approximations whose uncertainty quality is bounded by the converged point estimate (Daxberger et al., 2021).

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 (Broderick et al., 2013), 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 (Harrison et al., 2024), 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 final 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.