Graph Neural ODEs: Continuous-Time Graph Dynamics

4 minute read

Published:

TL;DR: A GNN with K discrete layers applies K rounds of message passing. A Graph Neural ODE replaces this with a differential equation dH/dt = f(H, A, t). The solution H(T) after integration from t=0 to T is the output. This allows irregular timesteps, adaptive depth, and principled modelling of continuous graph dynamics.

Neural ODEs: A Quick Refresher

Standard residual network: H^{(k+1)} = H^{(k)} + f_ฮธ(H^{(k)}). This is the Euler discretisation of the ODE:

dH/dt = f_ฮธ(H(t))

Neural ODE (Chen et al., 2018): parameterise the derivative dH/dt with a neural network, and solve the ODE with any numerical integrator (RK4, dopri5). The solution H(T) is the output. Backpropagation through the integrator uses the adjoint method โ€” O(1) memory regardless of integration steps.

Graph Neural ODEs

Extend the dynamics to incorporate graph structure:

dH(t)/dt = f_ฮธ( H(t), A )

Where A is the graph adjacency (fixed or time-varying) and f_ฮธ is a GNN layer. Each โ€œstepโ€ of the ODE solver corresponds to one round of graph-aware message passing. The number of effective layers is determined by the integration horizon T and step size โ€” not a fixed hyperparameter.

CGODE (Continuous Graph Neural ODE)

dH(t)/dt = ฯƒ( ร‚ H(t) W )

This is the continuous analogue of a GCN layer. The solution H(T) has the same expressive power as a K-layer GCN, where K corresponds to the integration steps โ€” but K can be non-integer and is adaptive.

Latent Graph ODE

For trajectory prediction:

  1. Encoder: observe partial trajectories {x_i(t)} for t โˆˆ [t_0, t_obs]; encode to initial latent state z_0
  2. GNN-ODE dynamics: dz/dt = GNN(z, A) โ€” latent dynamics coupled by graph structure
  3. Decoder: decode z(t) for t > t_obs to predict future trajectories

This models physically-coupled systems (particle dynamics, multi-agent trajectories) where entities interact through the graph structure.

The physics connection: Many physical systems are naturally described by differential equations over interaction graphs โ€” Newton's laws for particle systems, diffusion equations on networks, epidemic spreading on contact graphs. Graph Neural ODEs provide a learnable version of these dynamics, useful when the exact equations are unknown but the graph structure (who interacts with whom) is known.

Continuous-Time Graph Learning (CTDG Perspective)

For continuous-time dynamic graphs where events arrive at irregular times, Graph Neural ODEs offer a natural framework:

  1. Between events: node states evolve according to dh_v/dt = f(h_v)
  2. At event (u, v, t): update h_u and h_v based on the interaction

This is the approach taken by NDCG (Neural Dynamics on Complex Graphs) and similar models. The ODE handles smooth evolution between events; the event mechanism handles discrete updates.

Advantages of the ODE Formulation

Adaptive depth: ODE solvers automatically use more steps where the dynamics are complex. This is analogous to โ€œuse more layers where neededโ€ โ€” impossible in fixed discrete architectures.

Continuous time: make predictions at any continuous time t, not just at integer layer depths.

Physical interpretability: ODE dynamics have clear physical analogues โ€” diffusion, oscillation, predator-prey dynamics.

Memory efficiency: adjoint method computes gradients with O(1) memory regardless of integration steps (vs O(K) for K-layer backprop).

Limitations

Speed: numerical ODE solvers are slower than fixed matrix multiplications. Adaptive step-size solvers can be unpredictable.

Stiffness: some graph dynamics are โ€œstiffโ€ โ€” small perturbations cause rapid changes โ€” requiring very small step sizes and slow integration.

Expressiveness: the continuous dynamics f must be chosen carefully. A simple GCN-like f(H, A) is no more expressive than discrete GCN.

Applications

  • Particle physics: learn interaction dynamics from trajectory data
  • Traffic flow: model road network congestion as a PDE
  • Epidemic modelling: SIR dynamics on contact graphs
  • Multi-agent systems: robots, pedestrians interacting through proximity graphs
  • Time-series prediction on graphs: predicting future states of coupled systems

Summary

PropertyDiscrete GNNGraph Neural ODE
DepthFixed K layersContinuous (integration time T)
TimestepInteger layersReal-valued, adaptive
Backprop memoryO(K)O(1) (adjoint method)
Time handlingDiscrete snapshotsNative continuous-time
Physical interpretationMessage passingCoupled dynamical systems

Graph Neural ODEs are not universally better than discrete GNNs โ€” they are a more natural fit for physical and temporal systems where dynamics are inherently continuous. For standard graph classification or node classification on static graphs, discrete GNNs remain preferred.

References

  • Chen, R. T. Q., Rubanova, Y., Bettencourt, J., & Duvenaud, D. (2018). Neural Ordinary Differential Equations. NeurIPS 2018 (Neural ODEs: replacing discrete residual layers with continuous ODE solvers via the adjoint method).
  • Poli, M., Massaroli, S., Park, J., Yamashita, A., Asama, H., & Park, J. (2019). Graph Neural Ordinary Differential Equations. arXiv 2019 (Graph Neural ODEs: combining ODE dynamics with GNN spatial aggregation for continuous-time graphs).
  • Rubanova, Y., Chen, R. T. Q., & Duvenaud, D. (2019). Latent ODEs for Irregularly-Sampled Time Series. NeurIPS 2019 (Latent ODEs handling irregular observation times โ€” foundational for temporal graph ODEs).