arXiv:2610.40437cs.LGOct 2026

Manuscript Offprint

arXiv:2610.40437

A Pretrained Model for Bayesian Filtering in Heterogeneous Dynamical Systems

Ke Fan, Wen Wu, Haitao Su, Yilin Wang, Yuan Zhou, Chao Zhang

ABSTRACT

Filtering has not yet had its foundation-model moment: state estimation is still dominated either by online Bayesian filtering algorithms that require known dynamics as inputs, or by learning-based neural filters trained from scratch for a single system or parametric family. The core challenge is structural heterogeneity: dynamical systems differ in their governing dynamics, physical scales, and noise levels, precluding a shared representation space for a reusable filter. To bridge this gap, we introduce FilterFM, the first pretrained model for Bayesian filtering that estimates latent states across heterogeneous dynamical systems with a single checkpoint. FilterFM employs a hierarchical two-level observation sequence encoder and a prior-to-posterior state-reconstruction module that together handle varying observation and state dimensions across heterogeneous systems, while modeling state uncertainty via quantile prediction. Trained on a mixture of heterogeneous filtering tasks, FilterFM exhibits superior in-domain performance, delivering significant gains in estimation accuracy, runtime efficiency, and noise robustness compared to existing baselines. Beyond in-domain performance, it marks the first model to successfully enable zero-shot filtering on unseen dynamics, bridging the generalization gap in state estimation. Furthermore, we uncover clear scaling behaviors in foundation-model-based Bayesian filtering, which combined with comprehensive component ablation studies, validate the structural optimality of our design and broaden the generalization scope for this research field.

1 INTRODUCTION

Bayesian filtering serves as a basic tool for state estimation in robotics (Barfoot, 2024), navigation (Ko & Fox, 2009), atmospheric science (Hickman et al., 2025), chemical process monitoring (Wang & Chiang, 2019), and many other scientific domains (Zhang et al., 2024; Course & Nair, 2023). Although foundation models have reshaped multi-modal modeling and time-series forecasting, filtering still lacks a foundation-model paradigm shift. Classical methods from Gaussian filters (Li et al., 2015; Ito & Xiong, 2000; Cao et al., 2026), particle filters (Godsill, 2019) to PDE-based filters (Wang et al., 2025; Yau & Niu, 2025) instantiate a predict-then-update recursion, their strong performances usually depend on exactly known system-specific transition models, observation mappings, and noise assumptions. Learning-based filters reduce this modeling burden by training neural estimators from trajectories (Revach et al., 2022; Dahal et al., 2024), but they are still typically tied to one specific dynamical system (Ji et al., 2022), or to a parametric family sharing the same underlying dynamics (Holtmann et al., 2025). This raises a natural foundation-model question:

Can one model learn to filter across heterogeneous dynamical systems?

The challenges lie in structural heterogeneity rather than data scale alone: dynamical systems differ in their governing equations (Brunton et al., 2016), observation processes, physical units, and noise levels (Zheng et al., 2025), so a reusable filter cannot rely on a fixed state-observation interface. Existing foundation-inspired attempts only partially address this issue. LLMFilter (Liu et al., 2025)

∗^{*}This work is done when Ke Fan is an intern in Shanghai AI Laboratory.

†^{\dagger}The corresponding author.

Figure

Figure 1: Generalization scopes of FilterFM, LLMFilter, and FM-UKF. LLMFilter trains on one system at a time and transfers across datasets at fixed state dimension N via System-as-Prompt. FM-UKF learns dynamics across parameter settings within one system family and uses a UKF with a known observation model. FilterFM is pretrained on a corpus of heterogeneous systems and evaluated on unseen systems using the same checkpoint without fine-tuning.

adapts a frozen LLM with system prompts, but remains trained on single datasets and flattens time and variable channels into tokens with unclear semantics. FM-UKF (Holtmann et al., 2025) inserts a time-series foundation model into a Bayesian filtering pipeline, but still requires a specified observation map and is evaluated mainly within one parametric family.

To fill this research gap, we introduce FilterFM, a transformer-based pretrained model for Bayesian filtering. Unlike LLMFilter and FM-UKF, FilterFM is pretrained across heterogeneous systems with varying dynamics and dimensions and is able to generalize to unseen systems with a single checkpoint. Figure 1 compares the three approaches' training and generalization scopes across datasets, system parameters, and state dimensions. Our model consists of a hierarchical two-level causal observation sequence encoder coupled with a prior-to-posterior state-reconstruction module. The encoder's design is motivated by two requirements: high-dimensional systems make dense attention over all time-variable pairs inefficient, and Bayesian filtering needs the current observation to update posterior rather than just coarse patch summaries. Accordingly, patch-level blocks compress completed patches into causal history memory, while intra-patch-level blocks preserve local evidence at each time step through cross-scale conditioning. This design retains the per-step resolution that Bayesian filtering requires for real-time correction based on the current observation. Within each scale, causal temporal attention first models each variable's temporal dependence. The resulting features are summarized into compact prototype memory and exchanged across variables through a gated reassembly router (Liu et al., 2026c). The state-reconstruction module then performs the filtering update: it first reads the shifted local memory to form a prior, then incorporates current observation to obtain a posterior, and decodes the posterior into the latent state estimate. Also to the best of our knowledge, FilterFM is the first model to support uncertainty estimation for Bayesian filtering, decoding multiple posterior quantiles to provide both a median state estimate and predictive uncertainty intervals.

To train FilterFM, we build a training dataset containing approximately 15K training trajectories, with about 45% from filtering numerical examples commonly used in previous literatures (Liu et al., 2025), 20% from synthetic low-dimensional chaotic systems (Lai et al., 2026), and 35% from high-dimensional composites formed by concatenating and orthogonally mixing low-dimensional trajectories. The resulting corpus spans system dimensions from 2 to 100, exposing the model to both standard filtering regimes and broad dimensional variation. On in-domain evaluations, FilterFM delivers strong gains along three practical axes: it achieves the lowest average raw-space RMSE for state-estimation accuracy, runs substantially faster than all compared baselines, and remains consistently more robust than LLMFilter and robust online Bayesian filters under observation-noise misspecification. Beyond in-domain performance, FilterFM demonstrates zero-shot filtering on unseen heterogeneous systems. FilterFM exhibits foundation-model-style scaling behavior: broader system coverage at an approximately matched training-data budget, more trajectories per system at fixed system diversity, and greater model capacity each improve generalization to unseen dynamics.

Our contributions are summarized as follows:

• We propose FilterFM, a pretrained model for Bayesian filtering built on a hierarchical two-level causal encoder and a prior-to-posterior state-reconstruction module. The model enables a single checkpoint to filter across heterogeneous dynamical systems with varying dimensions and, to our knowledge, is the first Bayesian filtering model to introduce quantile prediction, providing both point estimates and predictive uncertainty intervals.

• We curate a heterogeneous training corpus spanning diverse dynamics and dimensions, and establish a comprehensive evaluation showing FilterFM’s advantages in state-estimation accuracy, runtime efficiency, and robustness to observation-noise misspecification, together with the first demonstration of zero-shot filtering on unseen heterogeneous systems.

• We investigate whether scaling pretraining can improve generalization to unseen dynamical systems. This is the first systematic study of scaling behavior in Bayesian filtering across training-system diversity, training-trajectory coverage, and model capacity. Our results provide evidence that expanding pretraining can improve a single model’s ability to estimate states across heterogeneous dynamics.

References (35)