Activation-Space Uncertainty Quantification for Pretrained Networks
Richard BergnaStefan DepewegSergio Calvo OrdoñezJonathan PlenkÁlvaro CarteaJose Miguel Hernández-Lobato
Introduces Gaussian Process Activations, a post-hoc method that enables single-pass, closed-form uncertainty quantification for pretrained vision and language models while strictly preserving their original predictions without retraining or sampling.
Deploying modern pre-trained deep neural networks in risk-sensitive domains requires reliable uncertainty estimation so that systems know when they are likely to be wrong or encountering unfamiliar data. However, existing uncertainty quantification techniques often require costly model retraining, multiple forward passes at test time, or computationally expensive second-order calculations that do not scale well to modern large-scale architectures. Many existing post-hoc methods also alter the base model’s original predictions or struggle when output dimensions become very large.
The article introduces and evaluates Gaussian Process Activations (GAPA), a post-hoc framework designed to provide reliable, single-pass uncertainty estimates for frozen, pre-trained neural networks without altering their baseline point predictions. The objective is to demonstrate that shifting uncertainty modeling from the model's weights to its internal hidden activation space can yield accurate epistemic uncertainty and out-of-distribution detection with minimal computational overhead.
The proposed approach replaces standard deterministic activation functions with Gaussian process modules whose posterior mean exactly matches the original activation function, guaranteeing that the pre-trained network's base outputs remain completely unchanged. To ensure high scalability, GAPA caches training-set activations during a single offline pass, compresses them into representative summary points using clustering techniques, and retrieves only a small local neighborhood of nearest points during evaluation. Uncertainty is then propagated forward analytically through the network layers in a single pass using closed-form variance rules, completely avoiding Monte Carlo sampling, backpropagation, and curvature matrix inversions. The authors evaluate this approach across regression tasks, image classification on standard vision benchmarks, biomedical image segmentation, and large language modeling.
The key findings indicate that GAPA consistently delivers high-quality uncertainty estimates with fast inference speeds. Across regression benchmarks, GAPA achieved the lowest negative log-likelihood and best quantile calibration compared to established baselines. In image classification, GAPA achieved top-tier out-of-distribution detection performance (for instance, an out-of-distribution area under the ROC curve of 0.953 on ResNet-56) while matching the baseline classifier's accuracy and executing in just 3.30 seconds—drastically faster than competitive Bayesian alternatives that require hundreds to thousands of seconds. In large language modeling experiments on LLaMA-3.2-3B, GAPA successfully separated in-distribution from shifted text distributions, outperforming global logit-scaling bounds and conventional last-layer methods.
These results demonstrate that reliable uncertainty quantification can be integrated into high-stakes production pipelines without incurring prohibitive latency, compute costs, or prediction drift. Organizations can safeguard deployment reliability and detect unfamiliar operational environments across diverse modalities without modifying or re-tuning frozen base models.
Moving forward, practitioners should consider activation-space uncertainty modeling as a scalable alternative to sampling-based ensembles or complex weight-space Bayesian methods, selecting moderate inducing points (such as k-means compression) and local neighborhood sizes to balance accuracy with memory. The primary limitation of the method is the memory required to store the cached activation index for large architectures. Additional work is recommended to explore hierarchical indexing schemes and structured inter-neuron dependencies to further reduce storage requirements while maintaining high uncertainty fidelity.
- Paper: A Simple Approach to Improve Single-Model Deep Uncertainty via Distance-Awareness, Jeremiah Zhe Liu et al. (2023). Read this first to understand the distance-aware Gaussian-process approach to single-model uncertainty that GAPA’s activation-space design contrasts with and seeks to scale.
No sufficiently relevant recommendations were found.
