A Practical Guide to Neural Differential Equations
A self-study guide with eight demos on neural ODEs, CDEs, SDEs, irregular observations, continuous-time generative modeling, and state-space models.
YongKyung Oh · Pusan National University
These materials were prepared for a KSC 2026 tutorial. The session was canceled, and the guide and demos are available for self-study.
Overview
Neural differential equations use neural networks to model dynamics in continuous time. This guide covers neural ODEs, CDEs, and SDEs for irregular observations, dynamical systems, and generative modeling. Eight visual demos illustrate how observation times, solvers, and model choices affect the result.
Learning a Vector Field
A Neural ODE learns how the state changes and uses a numerical solver to compute its trajectory. Solver choice, stiffness, and adjoint methods affect the cost of learning these dynamics. The two examples below show why the actual observation times matter and how a solver spends a fixed budget of field evaluations.
01Latent ODE
What changes when observations arrive unevenly?
Using the actual time gaps reduces error against this simulated signal from 0.370 to 0.023 RMSE with the same observations and update rule.
02ODE solver
Which solver spends 40 field evaluations better?
Both panels integrate the same learned oscillator field with 40 evaluations. Euler with step 0.15 drifts up to 0.62 from a tight reference solution, while RK4 with step 0.6 stays within 0.01.
Learning from Time Series
A Neural CDE interpolates the observed values into an input path that drives the hidden state. Including time as a channel preserves the actual spacing between observations. A Neural SDE adds a diffusion term, so repeated forecasts from the same last observation can follow different trajectories.
03Neural CDE
Does the direction around a loop matter?
The two loops have the same endpoints, but the accumulated signed area is +2.54 counterclockwise and −2.54 clockwise.
04Neural SDE
How wide is the forecast?
Eight of 480 Euler–Maruyama paths are shown at left. Their full ensemble gives a median and pointwise 10th–90th percentile band that widens from 0 at t = 3 to 1.51 at t = 8.
Transporting Distributions
A continuous normalizing flow (CNF) uses an invertible ODE to transform samples and track their probability density. A score-based model learns the gradient of the log density by denoising regression and generates samples by solving a reverse-time SDE or the probability-flow ODE. Flow matching trains the ODE’s velocity field by regressing against velocities along paths between source and target samples.
05Continuous normalizing flow
Where does probability density rise?
Density rises where the invertible flow compresses space, following d log p/dt = −div f (density per unit area).
06Score-based SDE
How do shapes emerge from noisy pixels?
The score of a Gaussian mixture fitted to four synthetic shapes guides the reverse drift, while Brownian increments add fresh noise.
07Conditional flow matching
How can noise form two strands?
Integrating the learned velocity turns the fixed noise cloud into two strands. Each sample’s strand label is supplied in training and sampling.
Training and Sampling
| Method | What is trained | What is solved at sampling time |
|---|---|---|
| CNF | Maximum likelihood, using the divergence of the field fθ | The ODE dz/dt = fθ(t, z) |
| Score-based SDE | Denoising regression for the score sθ | The reverse-time SDE or the probability-flow ODE |
| Flow matching | Regression on path velocities for the field vθ | The ODE dz/dt = vθ(t, z) |
A field trained by flow matching can also be used as a CNF.
State-Space Models
The training objective and the network backbone are separate choices. A state-space model is a sequence backbone. Holding each input fixed between updates, a zero-order hold, turns the linear state equation dh/dt = Ah + Bu into an exact recurrence. S4 uses structured fixed dynamics. Mamba makes parameters such as the step Δ depend on the input, so the input decides what the state keeps.
08State-space model
Can a state keep one input it has seen?
Both panels apply the same zero-order-hold update h ← e^(−Δ)h + (1 − e^(−Δ))u. With Δ fixed at 0.5, later inputs overwrite the marked value and h ends at 0.09. Choosing Δ from each input (3.0 for the marked input, 0.01 otherwise) keeps h at 0.77.
Choosing a Model
Start with the structure of the problem. An ODE can describe deterministic dynamics or transform a representation. A CDE lets the observation path drive the state. An SDE can model a distribution of possible trajectories. For generation, choose the training objective and sampler together, and choose the network backbone separately. Check the cost and accuracy of the numerical solver.
Resources
- CIKM 2025 tutorial on continuous-time modeling, for background on ODEs, CDEs, and SDEs.
- IJCAI 2025 review of neural differential equations for time series, for theory, numerical methods, and benchmarks.