Foundation Inference Models for Ordinary Differential Equations

Johannes R. Hübers, Maximilian Mauel, David Berghaus, Patrick Seifner, Ramses J Sanchez

TL;DR

This paper introduces FIM-ODE, a novel "foundation model" for inferring the underlying dynamics of Ordinary Differential Equations (ODEs) directly from noisy trajectory data. By pretraining on a diverse set of synthetic ODEs, FIM-ODE can perform "zero-shot" inference on new systems, significantly reducing the need for complex, system-specific training and ML expertise. This approach offers a more accessible and efficient way to model dynamical systems across various scientific domains.

What Problem Does This Paper Address?

Scientific modeling heavily relies on Ordinary Differential Equations (ODEs) to describe how systems evolve over time. However, a major challenge is inferring these ODEs from real-world data, which is often noisy and incomplete. Existing methods, such as symbolic regression, Gaussian processes, and Neural ODEs, typically require extensive expertise, complex training pipelines, or strong prior knowledge about the specific system being modeled. This makes ODE inference inaccessible to many researchers. The paper aims to bridge this gap by developing a "foundation model" that can amortize the inference process, learning general ODE inference strategies during pretraining that can be applied to new problems with minimal effort.

Methods

The core of FIM-ODE is a Foundation Inference Model (FIM) architecture, adapted for ODEs. This approach leverages amortized inference, meaning the model learns a general inference procedure during a large-scale pretraining phase, rather than optimizing for each new dataset individually.

Key methodological contributions include:

  • Pretraining Prior: FIM-ODE is pretrained on a synthetic dataset of ODEs with low-degree polynomial vector fields (up to degree 3). This simpler prior, compared to previous work, is shown to be surprisingly effective.
  • Neural Operators: The model represents the inferred vector field using neural operators. This allows for a local estimation of the vector field, which is more robust to data sparsity and can be interpreted similarly to symbolic representations (e.g., finding equilibria, Jacobians).
  • Transformer-based Architecture: The model uses a transformer-based encoder-decoder structure with attention mechanisms. The encoder processes noisy, irregularly sampled trajectories to create a context representation, and the decoder uses this representation to predict the vector field at query locations.
  • Uncertainty Weighting: A novel loss function incorporates an auxiliary head that predicts uncertainty, allowing the model to down-weight uncertain regions and focus on more reliable parts of the data.
  • Normalization Schemes: To handle systems with different scales, the model employs reversible instance normalization for spatial data and delta log centering for temporal data.

Datasets

  • Pretraining Dataset: A large synthetic dataset of 600,000 polynomial ODE systems across dimensions 1, 2, and 3. This dataset is generated by sampling vector fields from a prior distribution and simulating trajectories, which are then corrupted with noise and subsampling to mimic real-world observations.
  • Evaluation Benchmarks:
    • ODEBench: A standard benchmark for ODE inference, containing 61 ODE systems with varying vector field types (polynomial, trigonometric, rational).
  • Human Motion Capture Data (CMU Motion Capture database): Real-world trajectory data used to evaluate FIM-ODE on complex, high-dimensional dynamics.
  • Canonical Oscillators (Van der Pol and FitzHugh-Nagumo): Used to test FIM-ODE in low-data regimes and for forecasting/imputation tasks.

Key Insights and Ideas

  • Simpler Priors Can Be Powerful: Surprisingly, pretraining on a simpler prior distribution of low-degree polynomial ODEs yields strong zero-shot performance, even outperforming models trained on more complex priors. This suggests that the learned inference mechanism is more crucial than the exact nature of the pretraining data.
  • Local Estimation is Key: Representing the vector field locally using neural operators proves highly effective. This approach is more robust to noisy and sparse data and allows for interpretable analysis, unlike global symbolic representations which can struggle when the true dynamics are outside the pretraining distribution.
  • Foundation Models for Dynamics: The success of FIM-ODE demonstrates the potential of foundation models for scientific modeling tasks beyond natural language processing and vision, enabling more accessible and efficient inference of dynamical systems.
  • Zero-Shot is Viable: The model achieves strong zero-shot performance, meaning it can infer ODEs for new systems without any task-specific training, significantly reducing the barrier to entry.
  • Finetuning for Low-Data Regimes: While zero-shot performance can be sensitive in low-data scenarios, FIM-ODE's pretraining provides an excellent initialization for finetuning, enabling rapid and stable adaptation.

Key Results

  • Zero-Shot Performance: FIM-ODE matches or outperforms ODEFormer (a strong baseline) on ODEBench reconstruction tasks, despite being significantly smaller and pretrained on a simpler prior.
  • Generalization: FIM-ODE shows competitive generalization performance, particularly in lower dimensions, and demonstrates robustness to out-of-distribution vector field types.
  • Real-World Data: The model shows promising results on human motion capture data, indicating its applicability to complex, real-world dynamics.
  • Low-Data Regimes: In low-data scenarios, FIM-ODE's zero-shot performance is sensitive, but finetuning leads to substantial improvements, showcasing the value of the pretrained initialization.
  • Interpretability: The neural operator representation allows for qualitative analysis of inferred dynamics, such as identifying equilibria and stability types, similar to symbolic ODEs.

Limitations and Future Work

  • Prior Limitations: The current polynomial prior leads to non-stationary scaling, where vector field magnitudes increase with distance from the origin. This can cause trajectories to diverge rapidly, limiting the dimensionality of systems that can be effectively pretrained.
  • Dimensionality Constraint: The model's architecture is currently fixed for a maximum dimensionality, requiring padding for lower-dimensional systems.
  • Future Work:
    • Alternative Priors: Explore stationary Gaussian process-based priors to generate higher-dimensional systems that remain stable and exhibit richer dynamics.
  • Architectural Improvements: Implement axial attention mechanisms to handle variable dimensionality without hard-coding.
  • Equation Discovery: Investigate using FIM-ODE weights as regularizers for equation discovery in high-dimensional settings.
  • Text Dynamics: Apply the framework to models of evolving text representations.

Summary updated

BibTeX
@inproceedings{hubers2026foundation,
  author = {Johannes R. Hübers and Maximilian Mauel and David Berghaus and Patrick Seifner and Ramses J Sanchez},
  title = {{Foundation Inference Models for Ordinary Differential Equations}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ZBHDZDaG0h},
}
Figure