How Do Transformers "Do" Physics? Investigating the Simple Harmonic Oscillator
Subhash Kantamneni, Ziming Liu, and Max Tegmark

TL;DR
This paper investigates how transformers model the simple harmonic oscillator, revealing that they use known numerical methods like the matrix exponential to predict physical trajectories, thus demystifying their internal physics modeling.
Contribution
The study develops a novel analysis framework with four criteria to identify the numerical methods transformers use, demonstrating they employ the matrix exponential method for SHO modeling.
Findings
Transformers model SHO trajectories using the matrix exponential method.
The analysis framework can be extended to complex systems.
Transformers encode interpretable numerical methods for physics modeling.
Abstract
How do transformers model physics? Do transformers model systems with interpretable analytical solutions, or do they create "alien physics" that are difficult for humans to decipher? We take a step in demystifying this larger puzzle by investigating the simple harmonic oscillator (SHO), , one of the most fundamental systems in physics. Our goal is to identify the methods transformers use to model the SHO, and to do so we hypothesize and evaluate possible methods by analyzing the encoding of these methods' intermediates. We develop four criteria for the use of a method within the simple testbed of linear regression, where our method is and our intermediate is : (1) Can the intermediate be predicted from hidden states? (2) Is the intermediate's encoding quality correlated with model performance? (3) Can the majority of variance in hidden…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsQuantum Mechanics and Applications
