APS Logo

LLMs Learn Physical Rules of Dynamical Systems: A Geometric Investigation of Emergent Algorithms

ORAL

Abstract

Modern machine learning systems, such as large language models (LLMs), are known for their emergent abilities to reason and learn from unseen data. We investigate the ability of LLMs to extrapolate the behavior of physical systems in-context, including stochastic, chaotic, continuous, and discrete systems governed by principles of physical interest. Our results demonstrate that LLMs can accurately extract the probabilistic transition rules underlying such dynamical systems, with accuracy increasing alongside the number of observed states in-context. To understand the mechanisms behind this capability, we visualize the in-context learning dynamics of LLMs using Intensive Principal Component Analysis, which uncovers unique learning trajectories distinct from traditional probabilistic modeling methods. Analysis of these trajectories reveals a deep connection between LLMs' in-context learning algorithm and kernel density estimation with adaptive kernel widths and shapes. Our results may pave the way toward an algorithmic understanding of probabilistic reasoning in LLMs.

Publication: T. J.B. Liu, N. Boullé, R. Sarfati, & C. J. Earls, LLMs learn governing principles of dynamical systems, revealing an in-context neural scaling law, EMNLP (2024)<br><br>Liu, T.J., Boull'e, N., Sarfati, R., & Earls, C.J. Density estimation with LLMs: a geometric investigation of in-context learning trajectories, (2024)

Presenters

  • Toni Jianbang Liu

    Cornell University

Authors

  • Toni Jianbang Liu

    Cornell University

  • Raphael Sarfati

    Cornell University

  • Christopher Earls

    Cornell University, Cornell university

  • Nicolas Boulle

    Imperial College London