Source-linked AI summary

Neural Stochastic Differential Equations: Deep Latent Gaussian Models in the Diffusion Limit

Belinda Tzen, Maxim Raginsky

arXiv:1905.09883v2cs.LGstat.ML

TL;DR

Deep latent Gaussian models require variational inference when integrating over their latent variables is intractable, motivating a continuous-time formulation. This paper develops neural SDEs with Wiener-space variational posteriors obtained through Girsanov mean shifts, and uses stochastic-flow differentiation for black-box SDE solvers. The framework supports automatic-differentiation-based inference, while scalability and solver flexibility trade off in the proposed gradient approaches.

  • Problem

    Inference in continuous-time latent diffusion models requires a tractable variational treatment, while adjoint sensitivity methods do not straightforwardly backpropagate through black-box SDE solvers.

  • Method

    The paper represents neural-SDE latent randomness with a standard Wiener process, shifts it using Girsanov-based observation-dependent drifts, and differentiates solutions through stochastic flows.

  • Results

    The framework carries out variational inference using automatic differentiation in Wiener space together with black-box SDE solvers.

  • Takeaways & Limitations

    Neural SDE inference extends DLGMs to a diffusion limit while preserving a pathwise reparameterization perspective based on Wiener-process randomness.

  • Takeaways & Limitations

    Black-box pathwise differentiation is flexible but has high computational complexity, while solve-then-differentiate generally scales better to high-dimensional problems.

Abstract

from arXiv · show

In deep latent Gaussian models, the latent variable is generated by a time-inhomogeneous Markov chain, where at each time step we pass the current state through a parametric nonlinear map, such as a feedforward neural net, and add a small independent Gaussian perturbation. This work considers the diffusion limit of such models, where the number of layers tends to infinity, while the step size and the noise variance tend to zero. The limiting latent object is an Itô diffusion process that solves a stochastic differential equation (SDE) whose drift and diffusion coefficient are implemented by neural nets. We develop a variational inference framework for these \textit{neural SDEs} via stochastic automatic differentiation in Wiener space, where the variational approximations to the posterior are obtained by Girsanov (mean-shift) transformation of the standard Wiener process and the computation of gradients is based on the theory of stochastic flows. This permits the use of black-box SDE solvers and automatic differentiation for end-to-end inference. Experimental results with synthetic data are provided.

1 Introduction

The paper develops neural SDEs as diffusion limits of deep latent Gaussian models and introduces variational inference in Wiener space. It also addresses gradient computation through black-box SDE solvers using stochastic flows and automatic differentiation.

  • 1 Introduction: Deep latent Gaussian models converge to Itô diffusion processes when layers become infinite and step sizes and noise variances vanish.The limiting drift and diffusion coefficients are implemented by neural networks.
  • 1 Introduction: Neural SDEs use the standard multidimensional Wiener process as the primitive source of all latent randomness.This is the continuous-time analogue of generating DLGMs from independent standard Gaussian vectors.
  • 1 Introduction: Variational inference is formulated through a path-space variational bound, with approximate posteriors represented by observation-dependent neural drift shifts of Wiener process.Gibbs variational principles and Girsanov’s theorem provide the bound and mean-shift representation.
  • 1 Introduction: Stochastic-flow derivatives enable automatic differentiation through the forward operation of a black-box SDE solver.The pathwise derivatives satisfy Itô SDEs whose coefficients follow from the original SDE and the multivariable chain rule.
  • 1 Introduction: Unlike neural ODEs, SDE optimization cannot directly use adjoint backpropagation through black-box solvers, motivating custom rules or forward-mode differentiation.The related-work landscape includes neural SDEs for expressive continuous-time models, jump dynamics, Gaussian-process coefficients, and noise injection.

2 Background: variational inference in Deep Latent Gaussian Models

DLGMs generate latent states through recursively composed nonlinear transformations with Gaussian perturbations and infer observations by integrating over latent variables. Because this integration is typically intractable, variational inference uses tractable approximate posterior families and reparameterized Monte Carlo gradients.

  • 2 Background: variational inference in Deep Latent Gaussian Models: DLGMs recursively update latent variables by applying parametric nonlinear transformations and adding Gaussian noise at each step.The observed variable is generated conditionally from the final latent state.
  • 2 Background: variational inference in Deep Latent Gaussian Models: The marginal likelihood integrates out all latent variables, but this integration is typically intractable.The model therefore uses an evidence lower bound derived from a variational principle.
  • 2 Background: variational inference in Deep Latent Gaussian Models: Approximate posteriors balance computational tractability against representational richness, with mean-field inference using a product of Gaussian factors.The factor means and covariance matrices are parameterized by nonlinear functions of the observation.
  • 2 Background: variational inference in Deep Latent Gaussian Models: Reparameterization expresses mean-field posterior samples using independent standard Gaussian vectors.This moves randomness into fixed primitive variables while retaining differentiable transformations.
  • 2 Background: variational inference in Deep Latent Gaussian Models: Monte Carlo expectations over the reparameterized Gaussian variables permit unbiased gradients through reverse-mode automatic differentiation.Differentiation is interchanged with expectation to obtain gradient estimates.

3 Neural Stochastic Differential Equations as DLGMs in the diffusion limit

In the diffusion limit of deep latent Gaussian models, the latent Markov chain becomes a neural Itô diffusion whose drift and diffusion are neural networks. The section develops the Föllmer-drift representation and shows that it can avoid time-varying network parameters.

  • Neural SDEs: As layers become infinite while step size and noise variance vanish, the latent variable becomes an Itô diffusion driven by neural drift and diffusion coefficients.The diffusion-limit SDE is written as dX_t = b(X_t,t)dt + σ(X_t,t)dW_t.
  • Expressiveness: Neural SDEs use a neural drift and identity diffusion to approximate target distributions whose density ratio to the standard Gaussian is efficiently represented by a neural net.The construction incurs only polynomial overhead when representing the drift relative to the neural net for the density ratio.
  • Föllmer drift: The Föllmer drift can be approximated by a neural net taking both state and time as inputs, while its weight parameters remain time-independent.This representation has complexity comparable to representing the target Radon–Nikodym derivative by a neural net.
  • Linear example: For stochastic deep linear networks, the diffusion-limit process is Gaussian and can be parameterized by matrix-valued paths for drift and diffusion.Its terminal distribution has a closed-form Gaussian law, X_1 ∼ N(m, Σ).
  • Linear example: The Föllmer drift gives the Gaussian example a more parsimonious representation with an affine state dependence and time-invariant parameters.The parameters are Σ^-1 and m rather than time-varying network parameters.

4 Variational inference with neural SDEs

Variational inference for neural SDEs is formulated on Wiener path space, where posterior measures are represented through Girsanov drift shifts. A path-space mean-field approximation then uses an observation-dependent deterministic neural drift, yielding a Gaussian process with independent increments.

  • Framework: The framework transfers the building blocks of deep latent Gaussian models to neural SDEs and exploits adaptive black-box SDE solvers.The objective is variational inference for expressive neural SDEs using path-space formulations.
  • Wiener space: All latent randomness is generated by a standard multidimensional Wiener process on the space of continuous vector-valued paths.The latent space is W = C([0,1]; R^d) equipped with Wiener measure.
  • Wiener space: Under Lipschitz continuity of the drift and diffusion in the state, the neural SDE solution is a progressively measurable mapping from Wiener paths to solution paths.At each time, the solution history depends only on the Wiener-process history up to that time.
  • Girsanov reparametrization: Girsanov’s theorem represents posterior measures absolutely continuous with respect to Wiener measure by adding adapted drift processes to the Wiener process.This converts optimization over path-space probability measures into optimization over drift processes.
  • Mean-field approximation: The path-space mean-field approximation uses an observation-dependent deterministic neural drift, producing a Gaussian process with independent increments.Unlike the discrete mean-field setup, only an additive drift controlling the mean is optimized.

5 Automatic differentiation in Wiener space

The section formulates gradient computation for neural SDE variational inference and explains why SDE adjoint methods do not directly support efficient black-box differentiation. It presents discretize-then-differentiate and pathwise stochastic-flow approaches, with differing scalability, flexibility, and storage trade-offs.

  • Gradient computation: Gradient computation targets the variational free energy with respect to model parameters θ and variational parameters β.The likelihood term is differentiated through the parameterized Itô process, assuming sufficient regularity for exchanging differentiation and integration.
  • Gradient computation: Unlike neural ODEs, neural SDEs lack an efficient straightforward adjoint procedure because adapted backward equations form forward-backward SDEs.The adjoint terminal condition depends on the entire Wiener path while solutions must remain measurable with respect to its past.
  • Discretize-then-differentiate: Discretize-then-differentiate approximates the neural SDE with an Euler recursion and backpropagates through its computation graph using reverse-mode automatic differentiation.The forward pass samples independent Gaussian increments, and the backward pass computes gradients through the resulting recursion.
  • Differentiate-then-solve: Pathwise differentiation solves auxiliary Itô SDEs for derivatives with respect to θ and β, enabling automatic differentiation through a black-box SDE solver.The construction follows stochastic-flow results and requires Lipschitz-continuity assumptions on the drift, diffusion, and relevant Jacobians.
  • Method trade-offs: The pathwise approach offers solver flexibility and lower storage overhead, whereas solve-then-differentiate generally scales better in high-dimensional problems.Forward-mode differentiation gives the pathwise method high computational complexity and limited scalability.

6 Experimental results

Experiments evaluate forward pathwise differentiation on synthetic neural SDE data under varying discretization meshes and sample sizes. Finer meshes beyond h = 1/32 provide only incremental gains, while performance deteriorates and ultimately fails as data become scarce.

  • Experimental setup: The experiments use gradient descent on synthetic data generated by numerical SDE solutions, with implementation in Julia using DiffEqFlux on a CPU.Observations are formed from independent process copies with added Gaussian perturbations at the endpoint.
  • Experimental setup: The synthetic model uses a 100-dimensional ground-truth parameter A ∈ R^10×10 and a variational approximation drift β ∈ R^10.A is randomly initialized with independent standard-normal entries, and the likelihood is Gaussian with mean x and covariance I_d.
  • Discretization: h = 1/32 marks a practical point beyond which finer discretization meshes yield only incremental improvements in this simple setting.This result suggests limited practical advantage from infinitely many layers over sufficiently deep finite-layer models such as DLGMs.
  • Sample size: Performance is reasonably robust when n ≈ d compared with n ≫ d, but worsens increasingly in the low-data regime and ultimately fails as n approaches the limiting sparse-data setting.The deterioration is reflected in the log-likelihood attained by optimized parameters.

7 Conclusion and future directions

The conclusion presents neural SDEs as the continuous-time stochastic counterpart of neural ODEs and the diffusion-limit interpretation of DLGMs. It emphasizes the inference and computational trade-offs of stochastic differentiation while identifying improved discretization and probabilistic solver connections as future directions.

  • Conclusion: Neural SDEs combine the continuous-time perspective of neural ODEs with the compositional expressive power of DLGMs.The framework treats inference in a space of measures while retaining a stochastic-process interpretation.
  • Conclusion: Stochastic optimization is not a straightforward analogue of the ODE case because path time-adaptedness complicates adjoint sensitivity methods.The paper relates discretize-then-differentiate to stochastic backpropagation and presents pathwise differentiation as a single-pass alternative with high computational complexity.
  • Future directions: Future work includes discretization schemes that better connect neural SDE computation with numerical tools for continuous-time stochastic processes.The authors also propose investigating connections between neural SDEs and probabilistic ODE solvers.
Loading 1905.09883v2…