cs.LGFeb 21, 2026

Transformers for dynamical systems learn transfer operators in-context

Authors: Anthony Bao, Jeffrey Lai, William Gilpin

Organizations: Department of Electrical & Computer Engineering, The University of Texas at Austin, Austin, Texas 78712, USA · The Oden Institute, The University of Texas at Austin, Austin, Texas 78712, USA · Department of Physics, The University of Texas at Austin, Austin, Texas 78712, USA

Abstract

Large-scale foundation models for scientific machine learning adapt to physical settings unseen during training, such as zero-shot transfer between turbulent scales. This phenomenon, in-context learning, challenges conventional understanding of learning and adaptation in physical systems. Here, we study in-context learning of dynamical systems in a minimal setting: we train a small two-layer, single-head transformer to forecast one dynamical system, and then evaluate its ability to forecast a different dynamical system without retraining. We discover an early tradeoff in training between in-distribution and out-of-distribution performance, which manifests as a secondary double descent phenomenon. We discover that attention-based models apply a transfer-operator forecasting strategy in-context. They (1) lift low-dimensional time series using delay embedding, to detect the system's higher-dimensional dynamical manifold, and (2) identify and forecast long-lived invariant sets that characterize the global flow on this manifold. Our results clarify the mechanism enabling large pretrained models to forecast unseen physical systems at test time without retraining, and they illustrate the unique ability of attention-based models to leverage global attractor information in service of short-term forecasts.

Figures & tables

Explore similar work

CardsList
  1. Test-Time Forecasting: Recurrent Depth Enables In-Context Dynamics Prediction

    Oct 14, 2026Jeffrey B. Lai, John Quinn, Anthony Bao +1Dynamical SystemsIn-Context Learning

  2. In-Context Learning Under Regime Change

    Apr 18, 2026Carson Dudley, Yutong Bi, Xiaofeng Liu +1TransformerDistribution Shift Detection

  3. From system models to class models: An in-context learning paradigm

    Aug 25, 2023Marco Forgione, Filippo Pura, Dario PigaMeta-LearningIn-Context Learning