A Pretrained Model for Bayesian Filtering in Heterogeneous Dynamical Systems
Organizations: Shanghai AI Laboratory · Tsinghua University
Abstract
Filtering has not yet had its foundation-model moment: state estimation is still dominated either by online Bayesian filtering algorithms that require known dy- namics as inputs, or by learning-based neural filters trained from scratch for a single system or parametric family. The core challenge is structural heterogene- ity: 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 se- quence 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.
Figures & tables
| Method | Ours | Learning-Based Filters | Online Bayesian Filters | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FilterFM | LLMFilter | FM-UKF | MEstimator | RStateNet | ProTran | KalmanNet | RNNYYF | EnKF | PF | EnKFI | EnKFS | HubEnKF | |
| Tracking | 0.9683 | 1.9944 | 1.2556 | 2.7357 | 17.8542 | 1.5862 | 17.7382 | 18.7570 | 1.7846 | 1.7820 | 1.7858 | 1.7874 | 1.7853 |
| Pendulum | 0.0840 | 0.0891 | 0.1318 | 0.2234 | 0.2243 | 0.1095 | 0.1457 | 2.1915 | 0.0822 | 0.3266 | 0.2776 | 0.0933 | 0.0897 |
| Selkov | 0.0155 | 0.0189 | 0.0165 | 0.0264 | 0.0336 | 0.0182 | 0.1059 | 0.2291 | 0.0165 | 0.0167 | 0.1384 | 0.0217 | 0.0219 |
| Oscillator | 0.0166 | 0.0166 | 0.0171 | 0.0249 | 0.0320 | 0.0181 | 2.9264 | 0.1307 | 0.0170 | 0.0172 | 0.1313 | 0.0206 | 0.0212 |
| Hopf | 0.0156 | 0.0176 | 0.0167 | 0.0280 | 0.0304 | 0.0176 | 0.0540 | 0.1991 | 0.0164 | 0.0169 | 0.2095 | 0.0212 | 0.0216 |
Appendix figures & tables47 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Window length | Batch size | Learning rate | Maximum training epochs |
|---|---|---|---|---|
| MEstimator | 40 | 16 | 50 | |
| RStateNet | 40 | 16 | 50 | |
| ProTran | 40 | 16 | 50 | |
| KalmanNet | 40 | 1 | 50 | |
| RNNYYF | 200 | 16 | 50 | |
| LLMFilter | 40 | 1 | 10 |
| System | System type | State / Obs. Dim. | Integrator | |||
|---|---|---|---|---|---|---|
| Tracking ( Smith et al., 1962 ) | Linear target tracking | Forward Euler | ||||
| Double-Pendulum ( Levien & Tan, 1993 ) | Chaotic rigid-body mechanics | RK4 | ||||
| Selkov ( Sel’kov, 1968 ) | Biochemical glycolytic oscillation | RK4 | ||||
| Oscillator ( Brunton et al., 2016 ) | Canonical nonlinear oscillation | RK4 | ||||
| Hopf ( Hassard et al., 1981 ) | Normal-form bifurcation oscillator | RK4 | ||||
| Lorenz96 ( Lorenz, 1995 ) | Chaotic atmospheric dynamics | RK4 |
| Data source | Training | Held-out | Total |
| In-domain benchmark (14 systems) | 6,720 | 280 | 7,000 |
| Panda low-dimensional (790 systems) | 3,360 | 140 | 3,500 |
| Panda high-dimensional composites | 5,040 | 200 | 5,240 |
| Total for training domains | 15,120 | 620 | 15,740 |
| Panda zero-shot (457 systems) | 0 | 8,207 | 8,207 |
| Dataset | FilterFM | LLMFilter | FM-UKF | EnKF | PF |
|---|---|---|---|---|---|
| Tracking | 0.1063 | 1.4186 | 1.8507 | 0.5247 | 0.3518 |
| Pendulum | 0.1062 | 1.5954 | 1.8457 | 0.8383 | 0.6614 |
| Selkov | 0.1067 | 1.4057 | 1.8379 | 0.4834 | 0.3767 |
| Oscillator | 0.1089 | 1.8586 | 1.8305 | 0.7892 | 0.6796 |
| Hopf | 0.1122 | 2.2081 | 1.8338 | 0.5068 | 0.3949 |
| Lorenz96 | 0.1175 | 6.5480 | 19.0996 | 9.9052 | 4.8176 |
| Dataset | Method | OCER=1 | OCER=25 | OCER=50 | OCER=75 | OCER=100 |
|---|---|---|---|---|---|---|
| Tracking | FilterFM | |||||
| LLM-Filter | ||||||
| EnKF | ||||||
| EnKFS | ||||||
| HubEnKF | ||||||
| Selkov | FilterFM |
| Update rule | In-domain raw | High-dim raw | OOS raw | |
|---|---|---|---|---|
| Direct posterior | – | 0.2351 | 0.2428 | 1.1055 |
| Prior-to-posterior | 0.05 | 0.2317 | 0.2413 | 1.0982 |
| Prior-to-posterior | 0.20 | 0.2334 | 0.2419 | 1.1021 |
| Prior-to-posterior | 0.50 | 0.2313 | 0.2403 | 1.0953 |
| Prior-to-posterior | 1.00 | 0.2317 | 0.2390 | 1.0660 |
| Prior-to-posterior | 1.50 | 0.2321 | 0.2396 | 1.0786 |
| IC | Train trajectories | OOS normalized median | OOS normalized mean | |
|---|---|---|---|---|
| 128 | 164 | 19,101 | 0.2624 | 0.3086 |
| 64 | 328 | 19,806 | 0.2417 | 0.2804 |
| 32 | 656 | 19,672 | 0.2270 | 0.2661 |
| 16 | 1312 | 19,534 | 0.2174 | 0.2554 |
| 8 | 2623 | 19,369 | 0.2102 | 0.2479 |
| 4 | 5245 | 19,357 | 0.2050 | 0.2426 |
| Parameters | Training loss at epoch 10 | In-domain validation raw RMSE | OOS raw RMSE | |
|---|---|---|---|---|
| Mean | Median | |||
| 2.89M | 0.148945 | 0.284954 | 0.860030 | 0.218894 |
| 5.09M | 0.143718 | 0.277112 | 0.847594 | 0.216160 |
| 11.36M | 0.135006 | 0.266257 | 0.833914 | 0.213774 |
| 20.11M | 0.129503 | 0.263754 | 0.829695 | 0.212346 |
| 34.54M | 0.125071 | 0.257718 | 0.817275 | 0.210798 |
| Parameters | Hidden width | FFN hidden width | Self-attention heads | Patch-summary temporal encoding layers | Patch-level blocks | Intra-patch blocks | Prior-to-posterior state-reconstruction blocks |
|---|---|---|---|---|---|---|---|
| 2,888,007 | 96 | 384 | 4 | 2 | 3 | 2 | 1 |
| 5,091,751 | 128 | 512 | 4 | 2 | 3 | 2 | 1 |
| 11,360,871 | 192 | 768 | 4 | 2 | 3 | 2 | 1 |
| 20,112,167 | 256 | 1024 | 4 | 2 | 3 | 2 | 1 |
| 34,541,847 | 336 | 1344 | 4 | 2 | 3 | 2 | 1 |
| 51,205,431 | 336 | 1344 | 6 | 3 | 4 | 3 | 2 |
| Maximum | Training | OOS normalized RMSE | OOS raw RMSE | ||
|---|---|---|---|---|---|
| trajectories | trajectories | Mean | Median | Mean | Median |
| per system | |||||
| 1 | 20,471 | ||||
| 2 | 40,845 | ||||
| 4 | 81,239 | ||||
| 8 | 160,304 | ||||
| Patch length | Patches / window | In-domain RMSE | OOS RMSE | ||
|---|---|---|---|---|---|
| Raw | Normalized | Raw | Normalized | ||
| 1 | 200 | 0.2669 | 0.22673 | 1.1814 | 0.22043 |
| 5 | 40 | 0.2278 | 0.20818 | 1.0674 | 0.20794 |
| 10 | 20 | 0.2281 | 0.20760 | 1.0548 | 0.20802 |
| 20 | 10 | 0.2317 | 0.20948 | 1.0660 | 0.20961 |
| 40 | 5 | 0.2329 | 0.20762 | 1.0825 | 0.21087 |
| Hyperparameter | Setting |
|---|---|
| Architecture and input representation | |
| Window length | 200 |
| Patch length | 20 |
| Maximum observation / state dimension | 100 / 100 |
| Hidden width | 256 |
| Self-attention heads | 4 |
Bayesian Filtering
Bayesian filtering recursively estimates hidden states and their uncertainty from noisy, sequential observations in changing systems.
See all 60 papers