A Practical Guide to Neural Differential Equations

A KSC 2026 tutorial on continuous-time deep learning, irregular observations, and generative modeling.

KSC 2026 Tutorial ยท YongKyung Oh (Pusan National University)

Abstract

Neural differential equations use neural networks to model dynamics in continuous time. This tutorial covers Neural ODEs, CDEs, and SDEs, with applications to irregular clinical and sensor observations, physical and biological systems, and generative modeling. Short code examples illustrate how to train and solve these models. The tutorial closes with practical guidance on choosing a model for a given application.

Foundations of Continuous-Time Models

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 how to constrain a velocity field and how to differentiate through a simulation.

Volume-Preserving Compression

Both objects compress vertically. The one on the right expands sideways. Its velocity field has zero divergence, so it keeps its volume while changing shape.

Designing a Target Shape

A learned ODE predicts deformation under two pressure inputs. Gradients through the numerical solution guide the choice of pressures that bring the object closer to the target shape.

Irregular Observations and Uncertainty

A Neural CDE can include the actual observation times in its interpolated input path. A Neural SDE adds a stochastic term, so the same initial state can lead to different trajectories.

Reading the Direction of a Path

Both paths start and end at the same point. They travel around the loop in opposite directions, and the Neural CDE accumulates hidden states with opposite signs. Neural CDEs for irregular time series

Forecasting a Range of Outcomes

All Neural SDE paths start at the last observed value. Each uses different Brownian increments. The shaded band spans the 10th to 90th percentiles at each forecast time.

From Continuous Dynamics to Generative Models

A state-space model separates hidden dynamics from the mechanism that produces observations. For continuous-time generation, one can learn dynamics that take noise to a sample. The examples compare density tracking, velocity learning, and stochastic sampling.

How a Flow Changes Density

A continuous normalizing flow (CNF) integrates an invertible ODE and tracks log density through the negative divergence of its velocity field. The right panel shows how density rises where the flow compresses space. Continuous density estimation with FFJORD

Learning a Velocity Field

The point cloud winds into two strands as the solver integrates a learned velocity field. Flow matching trains the field against velocities along paths between noise and target samples. The strand label is given during training and sampling. Flow Matching for Generative Modeling

From Noise to Shapes

The pixels start as noise. As the solver steps through the reverse-time SDE, outlines become visible. A Gaussian mixture fitted to simple shapes supplies the score. The score guides the drift, and Brownian increments keep sampling stochastic. Score-based generative modeling

Sampling a 3D Surface

A reverse-time SDE evolves 24 shape coordinates from noise. Decoding each state gives an implicit surface. The panel on the left shows the decoded starting state. On the right, the ears and tail stabilize as the Brownian updates shrink.

What the Solver Integrates

Method State update Density Noise
Score-based SDE Reverse-time drift and diffusion The score gives the gradient of log density Initial noise and Brownian increments
CNF Invertible ODE Integrates the negative divergence Random starting samples in this example
Flow matching ODE with a learned velocity field Density can be tracked through the resulting CNF Random starting samples in this example

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 check the cost and accuracy of the numerical solver.

Resources