Neural BSDE and DGM Formulation
This page describes the theory of the neural BSDE and deep HJB (DGM) methods. Measured results are in the empirical results section.
The BSDE formulation
For a forward process \(X_t\) and a terminal condition \(g\), the value process \(Y_t\) and its martingale integrand \(Z_t\) satisfy the backward equation
\[ dY_t = -f(t, X_t, Y_t, Z_t)\, dt + Z_t\, dW_t, \qquad Y_T = g(X_T). \]
A deterministic value function \(V(t, x)\) is recovered when \(Y_t = V(t, X_t)\) and \(Z_t = \sigma(t, X_t)\, \nabla V(t, X_t)\), but the neural method does not require solving for \(V\) on a grid. It simulates \(M\) forward paths and learns the functional relationship directly.
Deep BSDE method
The deep BSDE method (Han, Jentzen, E 2018) parameterizes the unknown initial value \(Y_0\) and the \(Z\) process (and, in a controlled problem, the policy) as neural networks. The forward pass simulates the SDE under the current parameters, accumulates the backward equation, and compares the reconstructed terminal value against \(g(X_T)\). Training minimizes the mean squared terminal matching error.
The key implementation detail for performance is that the whole time march is
a single compiled, device-resident program. jax.lax.scan runs the sequential
backward pass without a Python loop, and the loss plus optimizer step are
fused so the host reads only a scalar.
Network architectures
The Z network is a feedforward Mlp with a selectable activation. The
choice is exposed rather than hard-coded because it changes both
representational capacity and whether a second derivative exists for a
residual-based method.
| Activation | Smoothness | Second derivative | Suited for |
|---|---|---|---|
softplus | smooth | non-trivial | smooth values; standard DGM choice |
tanh | smooth, bounded | non-trivial | bounded values, kinks at boundaries |
relu | piecewise linear | none | kinked values; cannot drive a DGM residual |
Adaptive activation functions (a tanh with learnable per-unit scale and
shift) and partition-of-unity/local-basis networks are refinements that trade
smoothness for kink capture; they are discussed further on the
jump processes page and are not yet implemented.
Deep HJB (DGM) method
A closely related method parameterizes \(V(t, x)\) directly and minimizes the HJB or PDE residual
\[ d_t V + \sup_u \big\lbrace f(t,x,u) + \mathcal{L}^u V \big\rbrace \]
using first and second spatial derivatives obtained by automatic
differentiation. This is the mesh-free complement to the finite-difference
path. The diffusion-term helpers (the spatial Hessian diagonal and the
\(\tfrac{1}{2}\operatorname{tr}(\sigma\sigma^\top \nabla^2 V)\) term) exist in
neural_solver/dgm.py, and neural_solver/dgm.py::train_dgm trains a value
network against the residual.
Two residuals are implemented in neural_solver/loss.py:
black_scholes_residualfor the linear Black-Scholes PDE \(V_t + r s V_s + \tfrac12 \sigma^2 s^2 V_{ss} - r V = 0\);jump_lq_residualfor the jump-LQ PIDE, including the jump operator \(\lambda[V(x+\xi) - V(x)]\) and the analytic control \(u = \tfrac{b}{2r} V_x\).
Each residual is checked by substituting its closed-form solution (which must annihilate it to float32 tolerance), then the trained value network is compared against the closed form. On CPU the DGM path recovers the Black-Scholes call to ~1.1% and the jump-LQ value to ~1.3% relative error.