SGFNN is a neural network model that learns stochastic Hamiltonian systems by embedding the symplectic geometry through a stochastic generating function.
It employs an autoencoder to extract latent Gaussian variables that capture the randomness driving the system and enforce structure in the learned one-step map.
Empirical results show that SGFNN offers improved long-term prediction accuracy and better preservation of physical invariants compared to standard stochastic flow map methods.
The stochastic generating function neural network (SGFNN) is a neural network model for learning stochastic Hamiltonian systems from observational data. SGFNN preserves symplectic structure of the underlying stochastic Hamiltonian system and produces symplectic predictions. The model uses an autoencoder framework to identify the randomness of the latent system by the encoder network, and detects the stochastic generating function of the system through the decoder network based on the random variables extracted from the encoder. Symplectic predictions are then generated by the stochastic generating function (Chen et al., 19 Jul 2025).
1. Stochastic Hamiltonian setting
SGFNN is formulated for $2d$-dimensional Stratonovich stochastic Hamiltonian systems of the form
Here p,q∈Rd, and Wk, k=1,…,r, are independent standard Brownian motions. The system is Hamiltonian in the stochastic sense if there exist smooth functions H(p,q) and Hk(p,q), k=1,…,r, such that
This formulation covers additive and multiplicative noise, separable and non-separable Hamiltonians, and systems with single or multiple noises (Chen et al., 19 Jul 2025).
The solution flow φt(x0;ω), with dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.0, is symplectic almost surely. If dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.1, then
A learned or numerical one-step map dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.3 is symplectic if it satisfies the same condition. In the SGFNN construction, this property is imposed by design rather than recovered only empirically (Chen et al., 19 Jul 2025).
The examples used to instantiate the framework include a linear stochastic oscillator with additive noise, the Kubo oscillator with multiplicative noise, a non-separable stochastic Hamiltonian system with
and synchrotron oscillations with two multiplicative noises. These examples are chosen to span distinct structural regimes of stochastic Hamiltonian dynamics (Chen et al., 19 Jul 2025).
2. Stochastic generating functions and random symplectic maps
In symplectic geometry, a generating function is a scalar function whose partial derivatives define a symplectic map. For the first kind, a function dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.5 defines the map dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.6 through
In the stochastic setting, the generating function becomes a random function dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.8. If dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.9 is a smooth random map, then p,q∈Rd0 is symplectic if there exists locally a smooth random map p,q∈Rd1 such that p,q∈Rd2 is invertible almost surely and
p,q∈Rd3
This is the structural device used by SGFNN to ensure that the learned one-step map is symplectic (Chen et al., 19 Jul 2025).
For a time step p,q∈Rd4, the exact one-step solution map of an SHS is a random symplectic map p,q∈Rd5. SGFNN represents it locally by a stochastic generating function
p,q∈Rd6
where p,q∈Rd7 is a finite-dimensional latent representation of the stochastic forcing over p,q∈Rd8. The paper does not derive an explicit analytic formula for p,q∈Rd9; instead, Wk0 is treated as an unknown function to be learned (Chen et al., 19 Jul 2025).
A common terminological confusion is to read “generating function” here as a probabilistic generating function. In SGFNN, the term refers to the symplectic-geometry generating function of a random map. This suggests that the model is fundamentally a structure-preserving discretization of stochastic Hamiltonian flow rather than a generic stochastic latent-variable network.
3. Autoencoder architecture and learning objective
For a fixed time step Wk1, the training data are one-step pairs
Wk2
SGFNN assumes that for each pair there exists a latent Gaussian variable Wk3 such that the pair is generated by an implicit symplectic map induced by a stochastic generating function (Chen et al., 19 Jul 2025).
The encoder is
Wk4
The latent variable is trained to satisfy three conditions: it should be independent of Wk5, distributed as standard Gaussian, and have dimension Wk6 matching the number of effective stochastic drivers. For a batch Wk7, the distribution-matching loss is
Wk8
with
Wk9
The moment term matches central moments up to order k=1,…,r0 and penalizes cross-correlations among latent dimensions (Chen et al., 19 Jul 2025).
The decoder is the learned stochastic generating function
k=1,…,r1
For a one-step pair k=1,…,r2, the generating-function relations are
Minimizing this objective yields an encoder that outputs approximate k=1,…,r8, a decoder that approximates the stochastic generating function k=1,…,r9, and a learned symplectic one-step map H(p,q)0 (Chen et al., 19 Jul 2025).
4. Training data, optimization, and prediction
SGFNN requires only state observations sampled at equal time step H(p,q)1. In the numerical study, the training data are discrete trajectories
H(p,q)2
and the effective training set is the collection of one-step pairs H(p,q)3. The reported experiments use H(p,q)4 trajectories generated numerically by the midpoint scheme with time step H(p,q)5. Both encoder and decoder are fully connected networks with H(p,q)6 hidden layers, H(p,q)7 neurons each, and ELU activation. Optimization uses Adam with learning rate H(p,q)8. The training configuration is H(p,q)9 batches of size Hk(p,q)0 (Chen et al., 19 Jul 2025).
The method adopts the sub-sampling strategy from sFML: for each batch, the initial states Hk(p,q)1 are selected as nearest neighbors to a randomly chosen center, so that the empirical distribution of Hk(p,q)2 in the batch is non-Gaussian and the independence of Hk(p,q)3 from Hk(p,q)4 becomes more identifiable. This batching rule is part of the latent-noise identification mechanism (Chen et al., 19 Jul 2025).
After training, prediction uses only the decoder. Given Hk(p,q)5 and a new sample Hk(p,q)6, the one-step map is implicit in Hk(p,q)7: Hk(p,q)8
The paper solves this with a fixed-point iteration: Hk(p,q)9
until
k=1,…,r0
with k=1,…,r1. The predicted step is then
k=1,…,r2
Multi-step prediction is obtained by iteration in time, drawing independent k=1,…,r3 at each step (Chen et al., 19 Jul 2025).
The symplecticity guarantee is architectural. For any fixed k=1,…,r4, the map defined by the generating-function relations is symplectic provided k=1,…,r5 is invertible. Because the decoder parameterizes the stochastic generating function rather than an unconstrained flow map, the learned discrete-time dynamics are symplectic by construction (Chen et al., 19 Jul 2025).
5. Empirical behavior and comparison with stochastic flow map learning
The benchmark in the study is stochastic Flow Map Learning (sFML). sFML also uses an autoencoder, but its decoder learns a direct flow map
k=1,…,r6
with no structural constraint such as symplecticity. SGFNN instead learns the generating function k=1,…,r7, and the one-step map is recovered through symplectic relations. The reported prediction metrics at final time k=1,…,r8 are
k=1,…,r9
Across all reported systems, SGFNN achieves smaller errors than sFML, with the difference especially pronounced in long-term predictions (Chen et al., 19 Jul 2025).
and SGFNN reproduces the linear growth of the second moment up to dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.03, whereas sFML deviates. For the Kubo oscillator,
and SGFNN phase plots remain circular and radius-conserving, while sFML trajectories drift away from circles. In the non-separable and synchrotron examples, SGFNN tracks mean and standard deviation more accurately over time and yields probability density functions closer to the reference solution. In all cases, the histograms of the learned latent variablesdp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.05 match standard normal densities, which is consistent with successful extraction of the stochastic drivers (Chen et al., 19 Jul 2025).
6. Relation to adjacent stochastic neural models
SGFNN belongs to a broader family of neural models that embed structural priors from stochastic dynamics, but its defining feature is the use of a learned stochastic generating function to enforce symplecticity. This distinguishes it from several nearby lines of work.
“Stochastic Generative Flow Networks” extend GFlowNets to stochastic environments by decomposing each transition into a policy-controlled deterministic step and an environment step, together with a learned dynamics modeldp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.06 (Pan et al., 2023). That framework addresses reward-proportional sampling in stochastic DAG environments rather than learning stochastic Hamiltonian flows. “Embedding stochastic differential equations into neural networks via dual processes” constructs networks for predicting expectations of SDEs by matching neural-network Taylor coefficients to the coefficients of a dual process, and explicitly avoids input-output datasets (Sugishita et al., 2023). GFINNs encode the GENERIC formalism and obey symmetric degeneracy conditions for deterministic and stochastic dynamical systems (Zhang et al., 2021). Stochastic feedforward networks and Gaussian-process neurons study stochastic mappings, stochastic activations, or stochastic latent units, but not learned stochastic generating functions for random symplectic maps (Merkh et al., 2019, Lee et al., 2017, Urban et al., 2017).
A second recurring misconception concerns the phrase “generating function.” In SGFNN it is not a probability-generating or moment-generating function. It is the first-kind generating function of symplectic geometry, made stochastic through latent random variables. This suggests that SGFNN is best interpreted as a structure-preserving model class specialized to stochastic Hamiltonian systems, not as a general-purpose stochastic sequence model.
7. Assumptions, limitations, and extensions
The method assumes that the underlying dynamics are genuinely stochastic Hamiltonian and that the effective stochastic driving can be summarized by a finite-dimensional Gaussian latent variable dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.07. If the true system is non-Hamiltonian, dissipative, or driven by noise that is strongly non-Gaussian or highly path-dependent, the structural prior is mis-specified. Training is based on pairwise one-step data and depends on the sub-sampling strategy inherited from sFML. At inference time, every step requires solving an implicit equation for dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.08 by fixed-point iteration, which may be heavier than an explicit flow-map evaluation. The reported experiments are confined to two-dimensional phase spaces (Chen et al., 19 Jul 2025).
The paper identifies several natural directions for extension. These include more advanced parameterizations of the generating function dp=f(p,q)dt+k=1∑rσk(p,q)∘dWk(t),p(t0)=p0,dq=g(p,q)dt+k=1∑rγk(p,q)∘dWk(t),q(t0)=q0.09, such as SympNets-like constructions, theoretical analysis of generalization, extensions beyond Brownian-driven SHSs to Lévy noise or colored noise, integration with density-based approaches such as Fokker–Planck or normalizing-flow methods, and incorporation of additional physical structures such as symmetries and invariants (Chen et al., 19 Jul 2025). A plausible implication is that future SGFNN variants may be organized around richer geometric priors rather than around larger unconstrained decoders.
Within its stated domain, SGFNN provides a direct synthesis of latent-noise identification, generating-function learning, and symplectic structure preservation. Its central claim is not merely that stochastic Hamiltonian systems can be approximated by neural networks, but that the approximation can be carried out through a learned random symplectic map whose discrete-time predictions remain symplectic by construction (Chen et al., 19 Jul 2025).