Accelerating Monte Carlo Bayesian Inference via Approximating Predictive Uncertainty over Simplex

Yufei Cui, Wuguannan Yao, Qiao Li, Antoni B. Chan, Chun Jason XuearXiv 2019 · DOI

Abstract

Estimating the predictive uncertainty of a Bayesian learning model is critical in various decision-making problems, e.g., reinforcement learning, detecting adversarial attack, self-driving car. As the model posterior is almost always intractable, most efforts were made on finding an accurate approximation the true posterior. Even though a decent estimation of the model posterior is obtained, another approximation is required to compute the predictive distribution over the desired output. A common accurate solution is to use Monte Carlo (MC) integration. However, it needs to maintain a large number of samples, evaluate the model repeatedly and average multiple model outputs. In many real-world cases, this is computationally prohibitive. In this work, assuming that the exact posterior or a decent approximation is obtained, we propose a generic framework to approximate the output probability distribution induced by model posterior with a parameterized model and in an amortized fashion. The aim is to approximate the true uncertainty of a specific Bayesian model, meanwhile alleviating the heavy workload of MC integration at testing time. The proposed method is universally applicable to Bayesian classification models that allow for posterior sampling. Theoretically, we show that the idea of amortization incurs no additional costs on approximation performance. Empirical results validate the strong practical performance of our approach.

Introduction

In high-stakes fields like autonomous driving or medical diagnosis, knowing when a model is unsure is as important as the prediction itself. Bayesian Neural Networks (BNNs) provide this by treating model weights as distributions rather than fixed points. However, to obtain a prediction, one typically performs Monte Carlo (MC) integration: sampling the weights $S$ times, running the model $S$ times, and averaging the results. This process is computationally expensive and storage-heavy, making it impractical for real-time applications on edge devices.

Previous attempts to speed this up, such as Bayesian Knowledge Distillation, often collapsed the rich distribution of outputs into a single average point, losing critical information about the model's internal "disagreement" or uncertainty. This paper introduces One-Pass Uncertainty (OPU), a framework that trains a "student" model to mimic the entire distribution of a Bayesian "teacher" in a single forward pass, achieving a massive speedup while maintaining high-quality uncertainty metrics.

The One-Pass Uncertainty (OPU) Framework

Instead of performing MC integration at test time, OPU moves the heavy lifting to the training phase. The core idea is to model the induced distribution of class probabilities over the simplex—the mathematical space where all probabilities sum to 1. When a Bayesian teacher is sampled multiple times, it produces a "cloud" of points on this simplex representing its uncertainty.

The OPU framework (left) and empirical examples of MC estimates of the induced distribution over the simplex (right).

The OPU student model is a single, deterministic neural network trained to predict the parameters of a Dirichlet distribution that fits this cloud. The student is disentangled into two components:

  1. Prediction Model (PM): Predicts the expected class probabilities (the "mean").
  2. Concentration Model (CM): Predicts how "tight" or "spread out" the distribution is (the "confidence").

To ensure the student accurately matches the teacher, the authors compare several probability distance measures, finding that Maximum Mean Discrepancy (MMD) is theoretically superior to standard KL divergence. MMD avoids the "under-confidence" issues common with KL when the teacher's distribution is complex, providing a more stable and accurate fit for the "push-forward" measures generated by Bayesian models.

Empirical Results and Efficiency

The framework was evaluated across several standard benchmarks, including MNIST, EMNIST, and out-of-domain (OOD) detection tasks using Omniglot and SEMEION. A key finding is that "amortization is free": using a single global model to approximate these distributions does not inherently hurt performance compared to fitting a distribution to each point individually.

Performance comparison on MNIST and OOD detection tasks. OPU models achieve near-perfect AUROC for OOD detection while providing a massive speedup in test time.

As shown in the results, OPU achieved approximately a 500x speedup compared to standard MC integration (using 500 samples) because it requires only one model evaluation instead of 500. Furthermore, OPU-MMD achieved near-perfect AUROC (100.0) for detecting out-of-domain samples on the MNIST/Omniglot task, significantly outperforming previous distillation methods like BDK.

Conclusion

OPU provides a universally applicable method for accelerating Bayesian classification models. By modeling the distribution on the simplex, it captures rich "distributional uncertainty," allowing the model to distinguish between data uncertainty (tough calls) and knowledge uncertainty (unseen data). This approach enables the deployment of robust Bayesian uncertainty estimation on resource-constrained devices without the prohibitive cost of Monte Carlo sampling.

Summary updated

BibTeX
@misc{cui2019accelerating,
  author = {Yufei Cui and Wuguannan Yao and Qiao Li and Antoni B. Chan and Chun Jason Xue},
  title = {{Accelerating Monte Carlo Bayesian Inference via Approximating Predictive Uncertainty over Simplex}},
  year = {2019},
  eprint = {1905.12194},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.12194},
}
Figure