Self-attention is a Dyson equation for many-body machine learning

Jarvist Moore FrostarXiv 2026 · arXiv

TL;DR

This paper demonstrates that self-attention in machine learning is mathematically equivalent to the Dyson equation in many-body physics. While simple sum-pooling (like DeepSets) acts as a limited mean-field approximation, self-attention provides the two-body "self-energy" necessary to capture the complex, non-local correlations found in quantum systems.

What Problem Does This Paper Address?

In the world of machine learning for physics, there is a curious divide. Architectures using simple symmetric sum-pooling (like DeepSets) are incredibly accurate at predicting ground-state energies (interatomic potentials). However, they fail miserably when trying to model correlated wavefunctions or excited states.

The author tackles the fundamental question: Why is attention so "unreasonably effective" compared to sum-pooling? The challenge is that sum-pooling is "nearsighted"—it averages interactions into a single global vector, which effectively erases the specific, non-local pairwise correlations that define complex quantum matter.

Methods

The author recasts the standard "Query-Key-Value" database abstraction of self-attention into the Dirac bra-ket notation of many-body physics.

Key technical mappings include:

  • DeepSets as Hartree Mean-Field: The author proves that sum-pooling corresponds to a mean-field (Hartree) model where every particle experiences an identical background potential.
  • Self-Attention as Dyson Iteration: Self-attention is mapped to a discrete two-body Dyson equation. In this view, the residual skip connection acts as the "bare" propagator ($G_0$), the attention kernel (softmax) acts as the two-body "self-energy" ($\Sigma$), and stacking multiple layers performs a "resummation" of the Dyson series.
  • Jacobian Analysis: The paper analyzes the off-diagonal Jacobian—a measure of how one particle's state responds to another's position. DeepSets suffers from a $O(1/N)$ "Jacobian collapse," meaning local interactions are diluted as the system size $N$ grows. Self-attention maintains $O(1)$ sensitivity.

Datasets

The primary benchmark is a synthetic but physically rigorous target: the "Fractal Strawberry." * This is a hydrodynamic backflow wavefunction designed to model fermionic quantum criticality. * It features a nodal surface that undergoes a topological transition into a scale-invariant fractal. * The model uses $N=6$ spin-polarized fermions in 2D. This dataset is unique because it embodies infinite-order many-body criticality, providing a high-bar test for a model's expressive power.

Key Insights and Ideas

  • Attention is All You Need (Because Physics is Pairwise): Most physical Hamiltonians (like the Coulomb interaction) are governed by pairwise interactions. Foundational theorems (Löwdin and Galitskii-Migdal) guarantee that a two-body propagator is sufficient to determine exact energetics. Self-attention naturally mirrors this pairwise structure.
  • The Softmax Secret: The exponential Boltzmann factor in the softmax kernel is essential. Expanding this exponential generates all powers of the two-body vertex, providing a "full-rank" kernel that simple linear attention cannot match.
  • Depth as Renormalization: Stacking attention layers isn't just adding parameters; it's performing a "skeleton expansion" (a self-consistent dressing of particles). Each layer turns bare coordinates into "quasiparticles" that account for the surrounding environment.
  • The "Squashed Strawberry" Pathology: Sum-pooling acts as a hard ultraviolet cutoff. It "blurs" sharp local gradients, trapping the model in a trivial mean-field state rather than allowing it to reach the complex fractal attractor.

Key Results

The paper compares a width-matched DeepSets model against a self-attention (PsiFormer-inspired) model:

  • Qualitative Recovery: DeepSets collapsed the fractal nodal surface into a smooth, featureless "squashed strawberry." Self-attention successfully recovered the nested fractal pockets.
FIG. 2. The reference fractal backflow determinant which we used for fitting, r0 = 0.2 and a = 1 (strongly fractal). Visualised for N = 6 by holding 5 particles stationary (yellow dots) on a ring of radius 1.5 and then using the sixth particle as a probe (red/blue: determinant sign; brightness: |det|0.07, nodes in black). In this open-boundary model, the nested fractal pockets emerge from phase-space folding across the two intentionally coarse RK4 steps (∆s = 0.5) that integrate the singular 1/r3
  • Quantitative Accuracy: When a probe particle approached another, the exact velocity Jacobian norm reached 123. Self-attention reproduced this within 1.6% (125), whereas DeepSets saturated at a mere ~8.
  • Convergence: Self-attention achieved an $L_1$ loss of 0.17, while DeepSets stalled at ~1.0.
  • Scaling: The $O(N^2)$ cost of attention is not a flaw, but the "irreducible cost" of modeling unscreened pairwise interactions when nearsightedness fails.

Limitations and Future Work

  • Computational Cost: The $O(N^2)$ scaling remains a hurdle for very large systems. The author suggests that sparse and hierarchical attention mechanisms could be developed by drawing analogies to fast-multipole methods in computational physics.
  • Non-local Operators: The next frontier is applying these insights to reconstruct non-local quantum operators directly, such as multi-state companion Hamiltonians for excited-state crossings.
  • Time-Domain Extension: The author briefly notes that replacing spatial indices with time steps could extend this framework to open quantum systems, where self-attention would act as a non-Markovian memory kernel.

Summary updated

Abstract

Why does symmetric sum-pooling (DeepSets) predict ground-state potentials to sub-meV accuracy, yet fail for correlated wavefunctions and excited states? Sum-pooling is a mean-field (Hartree) model: its $O(1/N)$ off-diagonal Jacobian suffices for nearsighted ground-state energies, but erases nonlocal two-body correlations. We show that self-attention is a real-space Dyson iteration whose Boltzmann (softmax) kernel acts as a two-body self-energy. Because physical Hamiltonians act pairwise, Löwdin's 2-RDM theorem and the Galitskii--Migdal relation guarantee that iterating a two-body propagator captures the full energetics of correlated matter. When fitting a fractal backflow determinant, DeepSets blurs the nodal surface onto a mean-field envelope, whereas self-attention recovers the fractal attractor. Seen through this lens, the unreasonable effectiveness of attention is not an accident; in a universe built from pairwise interactions, two-body attention is all you need.
BibTeX
@misc{frost2026self,
  author = {Jarvist Moore Frost},
  title = {{Self-attention is a Dyson equation for many-body machine learning}},
  year = {2026},
  eprint = {2611.21398},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21398},
}
Figure