In the Deep BSDE Solver framework, the control process Z satisfies Z_t = (partial Y / partial X)(t, X_t) * a(t, X_t), where a is the diffusion coefficient of the forward SDE. Since each Z_n is parametrised by a neural network phi_n^rho, the gradient of the value function with respect to the risk factors can be recovered by multiplying the network output by the inverse of the diffusion matrix a(t, X_t). This provides first-order sensitivities (Delta, hedge ratios) as a direct by-product of the BSDE solution, with no additional computation required.

Second-order sensitivities (Gamma) are also accessible because feedforward neural networks are compositions of simple differentiable functions. For a network with L layers, weight matrices W_l, and ReLU activation, the Jacobian of Z with respect to X takes the explicit form: dZ/dX = W_L * diag(ReLU’(A_{L-1}(…))) * … * diag(ReLU’(A_1(X))) * W_1. Since ReLU’(x) = sgn(ReLU(x)), the Jacobian is piecewise constant and can be computed efficiently by standard automatic differentiation. The Hessian of Y then follows from differentiating the relation Z = (dY/dX) * a.

This feature is particularly valuable for xVA risk management. The Deep xVA Solver - A Neural Network Based Counterparty Credit Risk Management Framework applies this to obtain hedge ratios both for clean portfolio values (from Algorithm 1) and for the valuation adjustments themselves (from Algorithm 3). The availability of sensitivities is also critical for computing initial margin under the ISDA SIMM methodology, which requires portfolio-level sensitivities to all risk factors.

Key Details

  • First-order sensitivities: delta_i = Z_i / sigma_i(t, S_t) for each risk factor i
  • The explicit Jacobian formula avoids finite-difference approximation and works in arbitrary dimension
  • ReLU activation yields piecewise linear networks, so second derivatives of Z are zero almost everywhere (higher-order smoothness requires smoother activations)
  • Sensitivities are computed pathwise, enabling their use in exposure simulation and risk measure computation
  • No nested simulation or bump-and-revalue is needed, unlike traditional XVA sensitivity approaches

method