# Sampling the XY model with an attention-based neural network

arXiv: https://arxiv.org/abs/2610.23783 · HTML: https://mlsanity.com/paper/2610.23783/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 20 of its 35 references that are in the map.
- Submitted 16 Oct 2026.

## Builds on (most cited first, 20 of 20)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [Flow-based generative models for Markov chain Monte Carlo in lattice field theory](https://mlsanity.com/paper/1904.12072/) (2019)
- [Normalizing Flows on Tori and Spheres](https://mlsanity.com/paper/2002.02428/) (2020)
- [Solving Statistical Mechanics Using Variational Autoregressive Networks](https://mlsanity.com/paper/1809.10606/) (2018)
- [Learning Lattice Quantum Field Theories with Equivariant Continuous Flows](https://mlsanity.com/paper/2207.00283/) (2022)
- [Detecting and Mitigating Mode-Collapse for Flow-based Sampling of Lattice Field Theories](https://mlsanity.com/paper/2302.14082/) (2023)
- [Advances in machine-learning-based sampling motivated by lattice quantum chromodynamics](https://mlsanity.com/paper/2309.01156/) (2023)
- [Gradients should stay on Path: Better Estimators of the Reverse- and Forward KL Divergence for Normalizing Flows](https://mlsanity.com/paper/2207.08219/) (2022)
- [Hierarchical autoregressive neural networks for statistical systems](https://mlsanity.com/paper/2203.10989/) (2022)
- [Analysis of autocorrelation times in Neural Markov Chain Monte Carlo simulations](https://mlsanity.com/paper/2111.10189/) (2021)
- [The autoregressive neural network architecture of the Boltzmann distribution of pairwise interacting spins systems](https://mlsanity.com/paper/2302.08347/) (2023)
- [Multilevel Generative Samplers for Investigating Critical Phenomena](https://mlsanity.com/paper/2503.08918/) (2025)
- [AdvNF: Reducing Mode Collapse in Conditional Normalising Flows using Adversarial Learning](https://mlsanity.com/paper/2401.15948/) (2024)
- [Simulating first-order phase transition with hierarchical autoregressive networks](https://mlsanity.com/paper/2212.04955/) (2022)
- [Mutual information of spin systems from autoregressive neural networks](https://mlsanity.com/paper/2304.13412/) (2023)
- [Hierarchical autoregressive neural networks in three-dimensional statistical system](https://mlsanity.com/paper/2503.08610/) (2025)
- [IsingFormer: Augmenting Parallel Tempering With Learned Proposals](https://mlsanity.com/paper/2509.23043/) (2025)
- [Training normalizing flows with computationally intensive target probability distributions](https://mlsanity.com/paper/2308.13294/) (2023)
- [NeuMC -- a package for neural sampling for lattice field theories](https://mlsanity.com/paper/2503.11482/) (2025)
- [Variational Autoregressive Networks with probability priors](https://mlsanity.com/paper/2605.16020/) (2026)

## Abstract (arXiv)

We present a transformer-based variational autoregressive network for sampling lattice systems with continuous degrees of freedom and apply it to the two-dimensional XY model near the Berezinskii-Kosterlitz-Thouless transition. The architecture is combined with physics-informed ingredients: locality-informed attention and approximate probabilities. The resulting sampler significantly outperforms existing neural samplers. We train the model on lattices up to 96×96, verify with a mode-dropping estimator that no parts of the configuration space are missed, and reproduce the energy, magnetization and helicity modulus obtained with the traditional Markov Chain Monte Carlo algorithm.
