Transformers as Implicit State Estimators: In-Context Learning in Dynamical Systems
Not on the map. Why?
Abstract (arXiv)
Predicting the behavior of a dynamical system from noisy observations of its past outputs is a classical problem encountered across engineering and science. For linear systems with Gaussian inputs, the Kalman filter -- the best linear minimum mean-square error estimator of the state trajectory -- is optimal in the Bayesian sense. For nonlinear systems, Bayesian filtering is typically approached using suboptimal heuristics such as the Extended Kalman Filter (EKF), or numerical methods such as particle filtering (PF). In this work, we show that transformers, employed in an in-context learning (ICL) setting, can implicitly infer hidden states in order to predict the outputs of a wide family of dynamical systems, without test-time gradient updates or explicit knowledge of the system model. Specifically, when provided with a short context of past input-output pairs and, optionally, system parameters, a frozen transformer accurately predicts the current output. In linear-Gaussian regimes, its predictions closely match those of the Kalman filter; in nonlinear regimes, its performance approaches that of EKF and PF. Moreover, prediction accuracy degrades gracefully when key parameters, such as the state-transition matrix, are withheld from the context, demonstrating robustness and implicit parameter inference. These findings suggest that transformer in-context learning provides a flexible, non-parametric alternative for output prediction in dynamical systems, grounded in implicit latent-state estimation.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 19 of its 29 references that are in the map. First posted on arXiv 21 Oct 2024.
Builds on
19 of 29 references.
References · 19
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2016Gaussian Error Linear Units (GELUs)cited by 3,431
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
7 more
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
- 2015Deep Kalman Filterscited by 163
- 2021KalmanNet: Neural Network Aided Kalman Filtering for Partially Known Dynamicscited by 128
- 2019Learning and Evaluating General Linguistic Intelligencecited by 78
- 2023Double Descent Demystified: Identifying, Interpreting & Ablating the Sources of a Deep Learning Puzzlecited by 36
- 2024Understanding the differences in Foundation Models: Attention, State Space Models, and Recurrent Neural Networkscited by 26
- 2023Can a Transformer Represent a Kalman Filter?cited by 20
Built on by
Citing papers per year: 2025: 1.
1 paper.