Towards Foundation Inference Models that Learn ODEs In-Context

Maximilian Mauel, Manuel Hinz, Patrick Seifner, David Berghaus, Ramsés J. SánchezarXiv 2025 · DOI

Abstract

We introduce FIM-ODE, a pretrained Foundation Inference Model designed to estimate the underlying physics of dynamical systems zero-shot. By employing a flexible neural operator architecture rather than traditional symbolic regression, FIM-ODE learns to infer vector fields directly from sparse and noisy observations. Our model achieves superior accuracy compared to state-of-the-art symbolic models like ODEFormer, while requiring significantly fewer parameters and less training data. This work highlights the potential of neural operators as robust foundations for in-context system identification.

Introduction

In scientific disciplines ranging from meteorology to biology, understanding the mathematical rules governing a system's change over time—its Ordinary Differential Equations (ODEs)—is a fundamental challenge known as system identification. Traditional approaches often struggle with sparse or noisy data. Recent "neural symbolic regression" models, such as ODEFormer, attempt to map time-series data to mathematical equations. However, these models are prone to "hallucinating" complex global equations to fit local trajectories, leading to poor generalization in unobserved regions of the state space.

A complex vector field reconstructed by FIM-ODE using multiple observed trajectories as context.

To address these limitations, we propose FIM-ODE. Instead of forcing a symbolic representation, FIM-ODE learns the vector field as a continuous operator, providing a more robust and flexible framework for in-context learning of dynamical systems.

Methodology

FIM-ODE is built upon the Foundation Inference Model (FIM) framework, treating inference as a supervised learning task on synthetic data. The architecture integrates a Transformer with a DeepONet neural operator:

  1. Branch-net (The Observer): A Transformer encoder that processes observed time-series data (the "context") into a high-dimensional latent representation.
  2. Trunk-net (The Query): A linear map that takes a spatial coordinate $x$ as input, representing the point where the vector field's "push" is to be evaluated.
  3. Combination Network: A series of residual attention layers that use the coordinate from the Trunk-net to query the context encoded by the Branch-net.

This architecture allows the model to perform zero-shot inference on novel systems without weight updates, leveraging patterns learned during pretraining on 600,000 synthetic polynomial ODE systems.

Results and Key Insights

FIM-ODE demonstrates remarkable efficiency and robustness. Despite having only 20 million parameters (compared to ODEFormer's 86 million) and being trained on 80x less data, it significantly outperforms its symbolic counterpart in both reconstruction and generalization tasks.

Quantitative Performance

Performance is measured using $R^2$-accuracy (the percentage of estimates with $R^2 > 0.9$):

Task ODEFormer FIM-ODE
Reconstruction (Seen Data) 0.65 0.90
Generalization (Unseen Paths) 0.19 0.26

The Power of In-Context Learning

A key advantage of FIM-ODE is its ability to ingest multiple trajectories simultaneously. As the number of context trajectories increases, the model's estimate of the global vector field converges toward the ground truth physics. This qualitative improvement is evident when comparing the inferred streamlines across different context sizes.

Evolution of the predicted vector field as the number of context trajectories increases.

Discussion and Limitations

The shift from symbolic equations to neural operators is a primary driver of FIM-ODE's success. Symbolic models are constrained by specific mathematical forms, which can lead to erratic predictions far from the data. In contrast, FIM-ODE's neural operator produces smoother, more justifiable global patterns.

However, challenges remain. The model currently exhibits a polynomial bias, as it was primarily trained on polynomial vector fields. Furthermore, the "Generalization Gap" persists: while FIM-ODE improves upon the state-of-the-art, predicting behavior in entirely unobserved regions remains difficult. Future work will focus on expanding the training distribution to include trigonometric and exponential terms and benchmarking against real-world datasets like ODEBench.

Conclusion

FIM-ODE represents a significant step toward foundation models for scientific inference. By learning to infer ODEs in-context through a neural operator lens, it offers a more efficient and robust alternative to symbolic regression for identifying the laws of nature from data.

Summary updated

BibTeX
@misc{mauel2025towards,
  author = {Maximilian Mauel and Manuel Hinz and Patrick Seifner and David Berghaus and Ramsés J. Sánchez},
  title = {{Towards Foundation Inference Models that Learn ODEs In-Context}},
  year = {2025},
  eprint = {2510.12650},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.12650},
}
Figure