every part builds on the one before. New to the topic? Start at part 01.
From the mathematics of change to neural networks that learn dynamics
A cup of coffee cooling, or the temperature outside changing throughout the day are picture perfect examples of ODEs. An Ordinary Differential Equation is simply a formal way of describing how something changes, without necessarily knowing what that something looks like at every point in time.
Let's say you have some unknown function
where
Notice, how the rate of change
Take bacteria growing in a dish. The more bacteria there are right now, the faster the colony grows. This is captured by one of the simplest ODEs:
where
Not always. Sometimes the rate of change of a system depends only on its current state, not on what time it is. These are called autonomous systems, and they simplify to:
where
Take a cup of coffee cooling in a room. The rate at which it cools depends entirely on how hot it currently is — not on whether it's 2pm or 3pm.
Contrast that with outdoor temperature. Even if the outdoor temperature happened to be identical at two different times of day, the rate of change would be different — because at 6am the sun is rising and heating things up, while at 8pm it's cooling down. The time of day itself carries information that the current temperature alone doesn't capture. That requires the full
The question is, if knowing the current state tells you everything you need to predict what happens next, or if the time itself adds extra information. If yes to the latter, you need
This is a critical point. An ODE like
Each one has a derivative equal to itself. The ODE alone can't tell you which solution describes your actual system — it only tells you the direction of change at each point, not where you start.
To pin down a unique solution, you need an initial condition: the value of
where
The ODE is essentially a map that tells you "go left here, go right there." But a map without a starting location is useless — you need to know where you are before the map can guide you anywhere. The initial condition is your GPS pin.
A solution to an ODE is therefore a function that satisfies two things simultaneously: it passes through the initial condition
If you've studied calculus, you'll recognise this intuitively: when you differentiate
In theory, you solve an ODE by integrating. In practice, most ODEs that appear in the real world have no clean analytical solution — you can't write down a nice closed-form formula for
The idea is that if you know where you are right now and you know the direction the function is heading, take a small step in that direction. Then repeat from your new position.
where
You can think of
The Euler method has a known weakness: it only looks at the direction at the very start of each step. If the direction changes significantly within that step, you accumulate error quickly. A more accurate alternative is the Runge-Kutta method (RK4), which evaluates the direction at four intermediate points within a single step and takes a weighted average before committing to a move.
where
So far we've assumed that
This is exactly what Neural ODEs do. The idea is to replace the known function
where
The network does not predict the next state directly. It predicts the rate of change at the current state and time. You then use a numerical integrator — Euler, RK4, or any other — to step forward through time and reconstruct the full trajectory.
Given a dataset of time series — say, temperature measurements recorded every hour for a year — you train the network by asking it to produce trajectories that match the observed data. You provide an initial condition (the temperature at some starting time
At inference time, the network is called many times during a single prediction. Each call takes the current state
In practice,
In a diffusion or flow model, a neural network also learns a direction field over time, and you also integrate through time. But "time" here doesn't represent physical time moving forward in the real world. Instead, it represents a denoising process: starting from pure Gaussian noise and gradually flowing toward a clean data sample. The network learns, at every point in this process, which direction to nudge the current noisy sample to make it slightly more data-like.
The key difference from a classical Neural ODE is what the state
ODEs are powerful, but they carry a fundamental limitation: the unknown function
But most real physical systems are not spatially uniform. Temperature doesn't just vary over time — it varies across space too. A room isn't the same temperature everywhere. Sound doesn't arrive everywhere at once — it spreads outward from a source as a wave, with some regions affected before others. To describe systems that vary across both space and time simultaneously, ODEs are no longer sufficient, which is where Partial Differential Equations (PDEs) come into play.