Revisiting the Equivalence of Bayesian Neural Networks and Gaussian Processes: On the Importance of Learning Activations

Marcin Sendera, Amin Sorkhei, Tomasz Kuśmierczyk · DOI

Abstract

Gaussian Processes (GPs) provide a convenient framework for specifying function-space priors, making them a natural choice for modeling uncertainty. In contrast, Bayesian Neural Networks (BNNs) offer greater scalability and extendability but lack the advantageous properties of GPs. This motivates the development of BNNs capable of replicating GP-like behavior. However, existing solutions are either limited to specific GP kernels or rely on heuristics. We demonstrate that trainable activations are crucial for effective mapping of GP priors to wide BNNs. Specifically, we leverage the closed-form 2-Wasserstein distance for efficient gradient-based optimization of reparameterized priors and activations. Beyond learned activations, we also introduce trainable periodic activations that ensure global stationarity by design, and functional priors conditioned on GP hyperparameters to allow efficient model selection. Empirically, our method consistently outperforms existing approaches or matches performance of the heuristic methods, while offering stronger theoretical foundations.

Introduction

Gaussian Processes (GPs) are the gold standard for uncertainty modeling because they allow practitioners to specify priors directly in function space—encoding properties like smoothness or periodicity. However, GPs scale poorly with large datasets ($O(N^3)$). Bayesian Neural Networks (BNNs) are much more scalable, but their priors are typically defined over weights, which is unintuitive and does not easily translate to desired functional behavior.

While theoretical results show that infinitely wide BNNs converge to GPs, matching a finite BNN to a specific GP kernel is notoriously difficult. This paper demonstrates that learning trainable activation functions alongside weight priors is the key to bridging this gap. By optimizing these components, the authors enable shallow BNNs to replicate complex GP kernels with high fidelity.

Methodology

The authors propose a framework for Prior Mapping and Posterior Learning to "transfer" GP priors into BNNs without sacrificing scalability or theoretical soundness.

Schematic view of the proposed approach, showing the mapping from GP priors to BNN priors followed by posterior learning.

Joint Optimization of Priors and Activations

Instead of just tuning weight variances, the framework parameterizes the activation function $\phi$. The set of parameters $\lambda$ (weight/bias variances and activation parameters) is optimized to minimize the divergence between the BNN output distribution and a target GP.

2-Wasserstein Distance

The authors leverage the closed-form 2-Wasserstein distance for Multivariate Gaussians as an efficient, differentiable loss function for this optimization. This allows for principled gradient-based updates to the BNN parameters to match the target functional prior.

Trainable Periodic Activations

To capture global properties like stationarity—common in GP kernels but rare in standard BNNs—the authors introduce activations based on Fourier series. This ensures the BNN maintains consistent uncertainty behavior across the entire input space, preventing overconfidence in out-of-distribution regions.

Experiments and Results

The method was evaluated on synthetic benchmarks, standard UCI regression tasks, and the large-scale HouseElectric dataset (~2 million rows).

High-Fidelity Prior Matching

Qualitative results show that the proposed method captures the functional behavior of ground-truth GP priors much more accurately than standard Gaussian or Normalizing Flow (N-F) priors. As shown in the 1D regression visualization, the learned BNN priors and posteriors closely mimic the GP "ground truth."

Visual comparison of 1D priors and posteriors. The proposed method (ours) captures the functional behavior of the GP ground truth more accurately than Gaussian or Normalizing Flow (N-F) priors.

Scalability and Performance

On the HouseElectric dataset, the method outperformed Stochastic Variational GPs (SVGP), demonstrating that BNNs with transferred priors can be a superior alternative for large-scale Bayesian modeling. Furthermore, on UCI regression tasks, a single-layer BNN using the proposed method matched or exceeded the performance of deep BNN baselines in terms of RMSE and Negative Log-Likelihood (NLL).

Conclusion

This research demonstrates that activation functions are the "missing link" in matching BNNs to GP priors. By treating activations as learnable parameters, practitioners can leverage the scalability of BNNs while retaining the intuitive prior specification of GPs. Future work includes extending the framework to multi-output settings and exploring conditioning on input data to improve robustness against input range shifts.

Summary updated

BibTeX
@inproceedings{sendera2025revisiting,
  author = {Marcin Sendera and Amin Sorkhei and Tomasz Kuśmierczyk},
  title = {{Revisiting the Equivalence of Bayesian Neural Networks and Gaussian Processes: On the Importance of Learning Activations}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=AligBAsYWE},
}
Figure