Papers
Topics
Authors
Recent
Search
2000 character limit reached

Sampling Parallelism for Fast and Efficient Bayesian Learning

Published 6 Apr 2026 in cs.LG, cs.AI, and cs.DC | (2604.04736v1)

Abstract: Machine learning models, and deep neural networks in particular, are increasingly deployed in risk-sensitive domains such as healthcare, environmental forecasting, and finance, where reliable quantification of predictive uncertainty is essential. However, many uncertainty quantification (UQ) methods remain difficult to apply due to their substantial computational cost. Sampling-based Bayesian learning approaches, such as Bayesian neural networks (BNNs), are particularly expensive since drawing and evaluating multiple parameter samples rapidly exhausts memory and compute resources. These constraints have limited the accessibility and exploration of Bayesian techniques thus far. To address these challenges, we introduce sampling parallelism, a simple yet powerful parallelization strategy that targets the primary bottleneck of sampling-based Bayesian learning: the samples themselves. By distributing sample evaluations across multiple GPUs, our method reduces memory pressure and training time without requiring architectural changes or extensive hyperparameter tuning. We detail the methodology and evaluate its performance on a few example tasks and architectures, comparing against distributed data parallelism (DDP) as a baseline. We further demonstrate that sampling parallelism is complementary to existing strategies by implementing a hybrid approach that combines sample and data parallelism. Our experiments show near-perfect scaling when the sample number is scaled proportionally to the computational resources, confirming that sample evaluations parallelize cleanly. Although DDP achieves better raw speedups under scaling with constant workload, sampling parallelism has a notable advantage: by applying independent stochastic augmentations to the same batch on each GPU, it increases augmentation diversity and thus reduces the number of epochs required for convergence.

Summary

  • The paper introduces a parallelization paradigm, sampling parallelism, that distributes Bayesian neural network sample computations across GPUs for enhanced efficiency.
  • It demonstrates near-linear scaling with Bayesian Vision Transformers on CIFAR-10 and improved convergence via independent per-GPU data augmentations.
  • The approach complements traditional DDP and model parallelism, reducing computational penalties for uncertainty quantification in high-dimensional settings.

Sampling Parallelism for Efficient Bayesian Neural Network Training

Introduction

Sampling-based Bayesian neural networks (BNNs), including methods such as mean-field variational inference and Monte Carlo Dropout (MCD), are fundamental tools for uncertainty quantification (UQ) in deep learning. Their adoption in risk-sensitive high-stakes settings—e.g., weather prediction, healthcare, and finance—remains limited due to their extreme computational and memory demands, especially when scaling to modern architectures with billions of parameters. The paper "Sampling Parallelism for Fast and Efficient Bayesian Learning" (2604.04736) introduces a dedicated parallelization paradigm, sampling parallelism, targeting the unique computational bottleneck of Bayesian sampling: simultaneous evaluation of model parameter samples. Sampling parallelism distributes sample computations across GPUs, enabling substantial efficiency improvements with minimal algorithmic changes and facilitating application of BNNs to previously infeasible large-scale tasks.

Methodology and Algorithmic Design

Sampling parallelism explicitly targets the dimensionality imposed by sampling in BNNs and related UQ methods. Let SS denote the total number of parameter samples per batch. Sampling parallelism distributes subsets of these SS samples evenly across PP GPUs, with each device handling S/PS/P samples and performing both forward and backward passes independently. Synchronization of gradients is then performed via an allreduce operation, ensuring model consistency across replicas.

This approach incurs no changes to model architecture or core training semantics, in contrast with model parallelism or distributed data parallelism (DDP)—the latter is orthogonal and can be hybridized with sampling parallelism for even larger configurations. Notably, sampling parallelism enables each GPU to apply unique stochastic augmentations to the replicated data mini-batch, increasing augmentation diversity and improving convergence.

Experimental Validation

Vision Transformers on CIFAR-10

Experiments with a Bayesian Vision Transformer (ViT) architecture on CIFAR-10 serve as the primary large-model testbed. Proportional-sample scaling—where both GPU count and sample number are scaled—delivers near-perfect linear efficiency, demonstrating that the sampling axis is nearly embarrassingly parallel provided the per-GPU workload is sufficiently large. Figure 1

Figure 1: Speed-up (fixed-sample scaling, top) and efficiency (proportional-sample scaling, bottom) of Bayesian ViT training, comparing different parallelization strategies over GPU counts and sampling configurations.

In the fixed-sample regime, DDP achieves superior raw speedups largely due to more efficient data sharding and loading, while sampling parallelism exhibits sublinear scaling as all GPUs redundantly load identical batches. However, when applying stochastic data augmentations independently per GPU, sampling parallelism yields measurably faster convergence per epoch relative to DDP, due to increased effective data variety. Figure 2

Figure 2: Bayesian ViT accuracy as a function of training epochs, stratified by batch size, sample count, and parallelization type.

The augmentation diversity available in sampling parallelism leads to improved convergence speed (fewer epochs to fixed accuracy). When comparing accuracy as a function of wall-clock time, the time to target accuracy is competitive with, and occasionally better than, DDP and hybrid strategies. Figure 3

Figure 3: Comparative convergence speed for sampling parallelism under two augmentation regimes: uniform (all GPUs see identical augmentations) vs. stochastic (each GPU applies unique augmentations).

In uncertainty estimation quality, sampling parallelism displays clear reductions in negative log-likelihood and mean absolute calibration error relative to DDP for matched batch/sample configurations. Figure 4

Figure 4: Progression of negative log likelihood during Bayesian ViT training on CIFAR-10, comparing parallelization methods and batch sizes.

MLP Forecasting on Time-Series Data

When applied to a smaller-scale MLP for time-series forecasting (ENTSO-E load data), sampling parallelism is feasible but its efficiency declines rapidly with increasing GPU count due to communication as a fixed overhead. In this regime, DDP and hybrid strategies are preferable unless sample-per-GPU ratios are high. Figure 5

Figure 5: Speedup and proportional-sample scaling efficiency for MCD-based Bayesian MLPs on ENTSO-E data, highlighting inefficiencies at small network scale.

SWIN Transformer for Data-Driven Weather Forecasting

Sampling parallelism becomes essential for overparameterized models and large example sizes—exemplified by a Bayesian SWIN Transformer for ERA5-based atmospheric dynamics modeling. Here, data and model sizes reach memory-exhaustion boundaries; DDP is incapable of training with the desired number of samples due to memory limitations. Sampling parallelism, scaling the sample count with GPU count, enables previously infeasible Bayesian training at efficiency exceeding 80% for up to 8 GPUs. Figure 6

Figure 6

Figure 6

Figure 6

Figure 6

Figure 6

Figure 6: Architecture diagram for SWIN transformer applied to spatio-temporal weather forecasting.

Figure 7

Figure 7: Scaling efficiency for Bayesian SWIN Transformer with proportional samples equal to twice the GPU count—enabling scalable Bayesian learning for high-dimensional regression tasks.

Theoretical and Practical Implications

The results demonstrate that sample dimension parallelism constitutes a third high-leverage axis for distributed Bayesian deep learning, complementary to both data and model parallelism. For fixed data and model designs, it amortizes the Bayesian computational penalty, making BNNs and related UQ posteriors feasible in high-risk, large-data settings.

Hybridization with DDP is effective for further scaling. However, communication overheads remain non-negligible for low-complexity (small) networks or minimal sample counts. Augmentation diversity via per-GPU stochasticity presents a nontrivial benefit, opening research on new forms of data-efficient training and regularization.

The requirement for careful loss function design—especially for non-linearly aggregated uncertainty metrics—poses a methodological caveat, demanding loss-specific communication (e.g., aggregation of higher-order sample statistics across GPUs). For the majority of Bayesian objectives (e.g., simple gradient-averaged ELBO), the introduced approximation is empirically validated to perform robustly.

Future Directions

The presented methodology invites several practical and theoretical developments:

  • Automated frameworks for handling loss function exactness and communication for a broader class of Bayesian/UQ objectives.
  • Systematic integration with sharded and tensor model parallelism for ultra-large models.
  • Investigation into downstream effects of sample-parallel augmentation diversity on generalization, calibration, and adversarial robustness.
  • Application to generative modeling and MCMC- or ensemble-based Bayesian inference for further empirical validation.

Conclusion

Sampling parallelism directly addresses the core obstacle to practical Bayesian learning in deep neural networks by offloading distributed sample evaluations to modern accelerator infrastructures. The approach enables uncertainty-aware large-scale modeling at memory and time scales previously inaccessible, augments the toolkit for distributed training, and improves empirical performance in terms of both training speed and UQ fidelity. Its utility is most pronounced as data/model size increases and its benefits become more substantial when hybridized with classical parallelism approaches. This paradigm is poised for adoption in foundational risk-aware AI applications and provides a straightforward path for broadening the reach of Bayesian methodologies in high-dimensional neural architectures.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.