Related Experiment Video
Updated: Jul 5, 2026

An Experimental Platform to Study the Closed-loop Performance of Brain-machine Interfaces
Published on: March 10, 2011
Testing the spin-bath view of self-attention: A Hamiltonian analysis of GPT-2 transformer
Satadeep Bhattacharjee1, Seung-Cheol Lee2
1Indo-Korea Science and Technology Center (IKST), Bangalore, India.
Abstract:
The recently proposed physics-based framework by Huo and Johnson [arXiv:2504.04600]. models the attention mechanism of large language models as an interacting two-body spin system, offering a first-principles explanation for phenomena like repetition and bias. Building on this hypothesis, we extract the complete query-key weight matrices from a production-grade GPT-2 model and derive the corresponding effective Hamiltonian for every attention head. From these Hamiltonians we obtain analytic phase boundary and logit gap criteria that predict which token should dominate the next-token distribution for a given context. A systematic evaluation on 144 heads across 20 factual-recall prompts reveals a strong negative correlation between the theoretical logit gaps and the model's empirical token rankings (r≈-0.70, p<10^{-3}). Targeted ablations further show that suppressing the heads most aligned with the spin-bath predictions induces the anticipated shifts in output probabilities, confirming a causal link rather than a coincidental association. Taken together, our findings provide the first strong empirical evidence for the spin-bath analogy in a production-grade model. In this work, we utilize the context-field lens, which provides physics-grounded interpretability and motivates the development of novel generative models bridging theoretical condensed-matter physics and artificial intelligence.
Related Concept Videos
Gyroscope
Spin–Spin Coupling Constant: Overview
Qualitatively, any spin plus-half nucleus polarizes the spins of its electrons to the minus-half state. Consequently, the paired electron in the hydrogen–carbon bond must have a...
Spin–Spin Coupling: Two-Bond Coupling (Geminal Coupling)
The central atom need not be NMR-active because its electrons are affected by the electron polarization of the spin-active atoms. However, spin information is transmitted less effectively than in one-bond coupling, and 2J values are usually weaker than 1J values. The energy of...
Energy Losses in Transformers
There are four main reasons for energy losses in transformers.
The first cause can be the high resistance of the copper windings...
Three-Winding Transformers
In the per-unit equivalent circuit of a grounded Y-Y three-phase...
Multimachine Stability
In analyzing the system, the nodal equations represent the relationship between bus voltages, machine voltages, and machine currents. The nodal equation is given by:

