CS Paper Radar

Sampling the XY model with an attention-based neural network

Piotr Białas, Christian D. Morales, Tomasz Stebel, Dawid Zapolski

cs.LG cond-mat.dis-nncond-mat.stat-mechhep-lat ·submitted 2026-10-16 17:16 UTC · v1

Abstract

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\times96$, 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.

Comment
19 pages, 6 figures

Closest papers

Nearest neighbours by meaning across the whole index.

Discrete Diffusion Models via Evolving Variational Autoregressive Networks

cs.LG cond-mat.dis-nnstat.ML ·2026-09-23 ·Kewen Pan, Ying Tang
similarity 0.64
Abstract

Conventional score-based diffusion models learn scores without representing normalized densities, whereas tractable normalized models support both sampling and direct likelihood evaluation. A recent tensor-network approach provides such a representation but is largely restricted to low-dimensional lattices. Here we introduce a discrete diffusion model that parameterizes normalized probability distributions using variational autoregressive networks. Explicit Markov jump operators govern the forward noising and reverse denoising dynamics, extending discrete diffusion models with normalized distributions to spin systems on higher-dimensional lattices. We apply this framework to the two- and three-dimensional Ising models across ordered, critical, and disordered regimes, accurately computing thermodynamic quantities including free energy, energy, and magnetization. We further integrate the framework with Monte Carlo sampling, using adaptive diffusion steps to maintain high acceptance rates even at low temperatures while enhancing sample diversity. These results establish a neural-network framework for the discrete diffusion model with normalized probability distributions.

0.17

Quenched Ensemble Sampling

cs.LG stat.MLstat.CO ·2026-09-14 ·David Yallup
similarity 0.62
Abstract · 27 pages, 8 figures

Some of the sharpest challenges in sampling from the energy functions of physical systems arise at phase transitions, where the density of states changes abruptly and many sampling algorithms stall. Nested sampling is a particle method that traverses the density of states under a hard energy constraint and is known to be robust to such transitions, but its application in high dimension is limited by the difficulty of sampling under that constraint. In this work we introduce Quenched Ensemble Sampling, which generalises the hard constraint to a family of repulsive potentials at the energy boundary. This preserves the quenched path of monotonically decreasing energy while making the constrained target amenable to scalable gradient-based kernels. We demonstrate on synthetic models of phase transitions that our method estimates the marginal likelihood and draws posterior samples across a first-order transition where popular alternatives such as tempering fail. We apply the procedure to marginal likelihood estimation in Bayesian neural networks, enabling model comparison between network architectures. Finally, in a high-dimensional continuous lattice field theory, we show that this method traverses a first-order transition and estimates the partition function.

0.35

FrOGS: Discrete Neural Sampler for Independent Alloy Configurations Across Chemical Conditions

cs.LG cond-mat.mtrl-scicond-mat.stat-mech ·2026-09-01 ·Kyucheol Min, Elyssa Hofgard, Tess Smidt
published similarity 0.62
Abstract · Accepted as a Spotlight at the AI4Mat Workshop at NeurIPS 2026

Predicting the thermodynamic properties of an alloy requires sampling its configurations across many chemical conditions and recovering free energies on a common absolute scale. Markov chain Monte Carlo (MCMC) is the standard tool, but it requires separate simulations at different conditions, and auxiliary free-energy methods such as thermodynamic integration are used to place results on a common absolute scale. Modern discrete neural samplers typically use reverse KL divergence as the objective and can be mode-seeking or biased. We present Free energy Offering Generative Sampler (FrOGS), a hybrid discrete neural sampler that couples an autoregressive model to a continuous-time Markov chain (CTMC) to be trained jointly under a single shared loss. FrOGS draws i.i.d. configurations, returns an unbiased estimate of the partition function, and gives consistent estimates of thermodynamic observables. We train a single model across a wide range of chemical conditions to produce estimates on a common absolute free-energy scale. FrOGS matches exact finite-size results on the 2D Ising model and reference phase diagrams for AgPd and CuAu, without mode collapse. We additionally compare to SEGAL, a published autoregressive baseline, and find that only FrOGS recovers the stability range of the CuAu$_3$ phase.

0.51

Fixed-point neural samplers on discrete spaces

cs.LG ·2026-10-01 ·Jiajun He, Denis Blessing, Mouyang Cheng, Yuanqi Du, Carles Domingo-Enrich
similarity 0.56
Abstract

Sampling from discrete, unnormalized distributions without access to data is a challenging problem. Neural samplers offer a promising approach by training generative models from density evaluations directly. However, existing discrete neural samplers are prone to mode collapse, come without convergence guarantees when trained via fixed-point iterations, and are often tied to a specific reference process such as masked or uniform diffusion. In this work, we introduce Discrete Gibbs Iterative Neural Sampler, a fixed-point neural sampler that addresses these limitations, enabling efficient, scalable learning, substantially reducing mode collapse in practice. Besides masked diffusion, the framework also extends to transport between arbitrary distributions. DIG-IN mitigates mode collapse on Ising and Potts models and scales to amortized sampling with up to 2,500 sites, recovers alloy phase diagrams, and learns to sample biomolecular Boltzmann distributions from energy alone. Its transport formulation accurately estimates solvation and conformational free energies. As a maximum-entropy RL policy, DIG-IN outperforms the Gaussian, diffusion, and flow policies we compare against across 20 continuous-control tasks.

0.41

On the Statistical Mechanics of Attention

cs.LG cond-mat.dis-nncond-mat.stat-mechcs.AI+1 ·2026-10-12 ·Jerry Yao-Chieh Hu, Yu-An Chen, Maojiang Su, Han Liu
similarity 0.56
Abstract

We revisit the statistical mechanics of Transformer attention via modern Hopfield models. We present a free-energy formalism to characterize parameter regimes and critical thresholds for robust attention inference. The resulting free-energy landscape incorporates randomness in query states and attention weights. Attention then emerges as the equation of motion of the corresponding statistical-mechanical system (i.e., modern Hopfield model) through the standard free-energy minimization principle. This allows us to identify first-order phase transitions in attention between glassy and robust-inference phases. We further extend to attentions with stochastic queries and keys. Together, our results provide a rigorous statistical-mechanics framework for characterizing phase structure and inference reliability across a family of Transformer attention mechanisms.

0.17

Evaluating generative samplers for lattice field theory by scale

cs.LG hep-lat ·2026-11-08 ·Satoshi Iso, Lingxiao Wang
similarity 0.55
Abstract · 27 pages, 11 figures, comments are welcome!

Generative samplers for lattice field theory are commonly evaluated by their effective sample size (ESS). We show that a small global ESS need not imply inaccurate long-distance observables: errors spread over many short-distance modes can dominate this diagnostic. We introduce a scale-resolved diagnostic based on the overlap between coarse-grained model and target distributions. At the lattice cutoff, this overlap determines the asymptotic ESS fraction; lower cutoffs isolate long-wavelength errors. In the exactly solvable free theory, two samplers with comparable ESS yield a $32\%$ bias and no bias in the susceptibility, respectively. In two-dimensional $φ^4$ theory near criticality, trained diffusion samplers show the same separation of scales: their path-weight ESS fraction falls rapidly over the volumes studied, while low moments of the magnetization remain close to their target values. Varying the reference parameters substantially changes infrared observables, with little effect on the log-weight variance. Given the target magnetization distribution, a marginal Metropolis test maintains an acceptance rate of order one in our tests. Combined with exact local updates, it reduces the remaining mismatch, although residual bias remains at finite relaxation length. In the free field, uniformly bounded relative errors in the proposal mode variances give a volume-independent bound on the number of updates needed for a prescribed accuracy of the chain's stationary mode variances at fixed correlation length. The target marginal must be supplied or computed separately; estimating it from the samplers' own weights can inherit the poor global overlap.

0.22

Gradient-estimator design overcomes trainability barriers in neural-network-based variational optimization

cs.LG cond-mat.dis-nncond-mat.str-elphysics.chem-ph+1 ·2026-09-16 ·Yi-Ran Xue, Rui Wang, Baigeng Wang, Chenan Wei
similarity 0.54
Abstract · 10 pages, 4 figures; partially supersedes arXiv:2606.13912

Neural networks provide expressive representations for scientific computing. However, even sufficiently expressive networks can suffer training failure in weak-gradient regimes, limiting their practical use in quantum many-body physics and ab initio quantum chemistry. Here we derive an unbiased direct gradient estimator and introduce the adaptive minimum-variance phase (AMVP) estimator for neural-network variational optimization. By improving the signal-to-noise ratio of weak gradients, these methods enable reliable scientific calculations where training previously failed, while substantially reducing computational cost. The framework enables compact networks to outperform larger and fine-tuned default standard-estimator models with over an order of magnitude less GPU time on correlated flux models, and ultimately exceed the density matrix renormalization group (DMRG) accuracy. It further achieves chemical accuracy in N$_2$ bond breaking and, for the first time, in heavy-element I$_2$ with explicit spin-orbit coupling. These results demonstrate that gradient-estimator design expands the capabilities of neural-network variational methods for accurate scientific computing.

0.36

Neural Renormalization Group Flow for Percolation

cs.LG cond-mat.dis-nn ·2026-08-27 ·Anaclara Alvez, Luca Camagna, Sergio Chibbaro, Cyril Furtlehner, François Landes +2 more
similarity 0.53
Abstract · 7 pages, 5 figures

Machine learning offers a possible route to data-driven real-space renormalization when the relevant observables are nonlocal and difficult to prescribe explicitly. We explore this idea for two-dimensional site percolation developping a supervised, scale-shared neural architecture. The model recursively applies the same learned coarse-graining rule across scales, producing a latent field from which the crossing probability is predicted, while a corresponding fine-graining decoder reconstructs the largest-cluster mask. Trained only on small lattices, the model extrapolates to substantially larger systems, recovers the spanning cluster with high fidelity, and produces observables obeying the expected finite-size scaling near the critical point. We observe that to get such performance it is key that the learned latent representation exhibits critical fluctuations and scale-dependent flows consistent with the renormalization-group structure of percolation.

0.38