Differential Bayesian Neural Nets

Andreas Look, Melih KandemirarXiv 2019

Abstract

Neural Ordinary Differential Equations (N-ODEs) provide a powerful framework for modeling continuous-time dynamical systems but often lack reliable uncertainty quantification. We present Differential Bayesian Neural Nets (DBNNs), which transform N-ODEs into fully Bayesian Stochastic Differential Equations (SDEs). By parameterizing both the drift and diffusion terms with Bayesian Neural Networks, DBNNs offer significantly improved uncertainty calibration and stability across time-series and regression benchmarks.

Introduction

Neural Ordinary Differential Equations (N-ODEs) treat data transformations as continuous flows, effectively acting as infinite-depth Residual Networks. Despite their elegance, standard N-ODEs are deterministic and fail to quantify predictive uncertainty. Existing Bayesian extensions often rely on heuristics like fixed-rate dropout or computationally expensive Gaussian Processes, which frequently result in poorly calibrated uncertainty—the model may remain overconfident even in regions far from the training data.

Methods: From ODEs to Bayesian SDEs

The DBNN framework replaces the deterministic ODE with a Stochastic Differential Equation (SDE) to model the transformation of an input $x$ into an output $y$ over a "flow time" $T$.

The model consists of two primary components:

  1. Drift Term ($\mu$): A Bayesian Neural Network (BNN) that captures the underlying deterministic direction of the system.
  2. Diffusion Term ($\sigma$): A second BNN that models the inherent noise or stochasticity.

To perform inference, the authors employ Stochastic Gradient Langevin Dynamics (SGLD) to sample from the posterior distribution of the network weights. The continuous path is approximated using Euler-Maruyama discretization, allowing the model to learn a distribution of possible trajectories rather than a single point estimate.

Key Insights and Results

The integration of fully Bayesian drift and diffusion terms leads to several critical advantages:

  • Improved Calibration: In synthetic tasks such as modeling a noisy sigmoid function, DBNNs demonstrate superior uncertainty quantification. Unlike baseline Neural SDEs (N-SDEs), which may show constant uncertainty, DBNNs correctly exhibit increased variance in data-sparse regions (extrapolation).
Comparison of DBNN and N-SDE on a noisy sigmoid task. DBNN captures the increasing uncertainty in extrapolation regions where training points are absent.
  • Path Realism: For time-series data like the Vasicek model, DBNNs produce "wobbly" sample paths that reflect the true stochastic nature of the process, whereas previous methods often produced overly smooth, unrepresentative trajectories.
  • Benchmark Performance: On standard UCI regression benchmarks, the DBNN variant using a Cholesky decomposition for the diffusion term achieved the best test log-likelihood in 5 out of 8 datasets, outperforming both standard BNNs and non-Bayesian SDE models.
  • Numerical Stability: The authors observed that DBNNs are more robust to high noise levels during training compared to deterministic counterparts, which often fail to converge under similar conditions.

Conclusion

Differential Bayesian Neural Nets provide a principled approach to uncertainty in continuous-time models. By treating both drift and diffusion as Bayesian components, the framework achieves better calibration and stability. While the computational cost of SDE integration remains a challenge, the improved reliability makes DBNNs a compelling choice for safety-critical applications in time-series analysis and regression.

Summary updated

BibTeX
@misc{look2019differential,
  author = {Andreas Look and Melih Kandemir},
  title = {{Differential Bayesian Neural Nets}},
  year = {2019},
  eprint = {1912.00796},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.00796},
}
Figure