How Do Transformers Model Physics? Investigating the Simple Harmonic Oscillator

Autor: Subhash Kantamneni, Ziming Liu, Max Tegmark
Jazyk: angličtina
Rok vydání: 2024
Předmět:
Zdroj: Entropy, Vol 26, Iss 11, p 997 (2024)
Druh dokumentu: article
ISSN: 26110997
1099-4300
DOI: 10.3390/e26110997
Popis: How do transformers model physics? Do transformers model systems with interpretable analytical solutions or do they create an “alien physics” that is difficult for humans to decipher? We have taken a step towards demystifying this larger puzzle by investigating the simple harmonic oscillator (SHO), x¨+2γx˙+ω02x=0, one of the most fundamental systems in physics. Our goal was to identify the methods transformers use to model the SHO, and to do so we hypothesized and evaluated possible methods by analyzing the encoding of these methods’ intermediates. We developed four criteria for the use of a method within the simple test bed of linear regression, where our method was y=wx and our intermediate was w: (1) Can the intermediate be predicted from hidden states? (2) Is the intermediate’s encoding quality correlated with the model performance? (3) Can the majority of variance in hidden states be explained by the intermediate? (4) Can we intervene on hidden states to produce predictable outcomes? Armed with these two correlational (1,2), weak causal (3), and strong causal (4) criteria, we determined that transformers use known numerical methods to model the trajectories of the simple harmonic oscillator, specifically, the matrix exponential method. Our analysis framework can conveniently extend to high-dimensional linear systems and nonlinear systems, which we hope will help reveal the “world model” hidden in transformers.
Databáze: Directory of Open Access Journals
Nepřihlášeným uživatelům se plný text nezobrazuje