Transformer-Based Neural-Network Quantum States
- Transformer-based neural-network quantum states are advanced representations that map discrete quantum configurations into amplitudes, phases, or probability distributions using transformer architectures.
- They employ diverse paradigms such as autoregressive models, log-amplitude formulations, and POVM-based approaches to address quantum circuits, open systems, and electronic structure problems.
- Scalable optimization with variational Monte Carlo, natural-gradient methods, and explicit symmetry enforcement enhances accuracy and interpretability while overcoming rugged loss landscapes.
Searching arXiv for recent and foundational papers on transformer-based neural-network quantum states. Transformer-based neural-network quantum states (NQS) are representations of many-body wave functions or density operators in which a Transformer maps discrete configurations, patch tokens, occupation strings, or informationally complete POVM outcomes to amplitudes, phases, determinants, or probability distributions. Within this umbrella, reported constructions include autoregressive wave functions with exact sampling, Vision-Transformer and patch-based log-amplitude ansätze optimized by variational Monte Carlo (VMC), probabilistic POVM formulations for unitary and Liouvillian dynamics, and fermionic architectures in which self-attention predicts backflow-inspired orbitals or corrections to a reference state (Carrasquilla et al., 2019, Luo et al., 2020, Zhang et al., 2022, Rende et al., 2 Mar 2026). The resulting models have been used for quantum circuits, open systems, frustrated spin models, ab initio chemistry, impurity models, lattice gauge theory, anyonic chains, and correlated spin-fermion lattice models.
1. Representational paradigms
A central line of work represents the wave function autoregressively. In the gauge-invariant and anyonic constructions, the state is written as
which is exactly normalizable and exactly sampleable in one forward pass (Luo et al., 2021). The multi-purpose Transformer Quantum State extends this factorization by conditioning on physical parameters , with amplitude obtained from conditional probabilities and phase from an additive phase head; this is the basis for pretraining on families of Hamiltonians rather than a single instance (Zhang et al., 2022). In electronic-structure settings, an analogous decomposition is used with and , optionally combined with a reference state of weight (Sobral et al., 2024). In ab initio quantum chemistry, the amplitude squared is modeled autoregressively by Transformer decoder layers, while the phase is provided by a separate MLP (Wu et al., 2023).
A second line of work models directly rather than through normalized conditionals. Vision-Transformer-based ansätze for long-range Ising chains output a real logarithmic amplitude and define , so that Born-rule sampling proceeds by Metropolis-Hastings on ratios (Roca-Jerat et al., 2024). Deep ViT encoder states for frustrated two-dimensional magnets and the convolutional transformer wave function similarly map a spin configuration to a complex or amplitude-plus-phase log-wave-function representation, again coupled to Monte Carlo sampling and local-energy evaluation rather than exact ancestral sampling (Rende et al., 2023, Chen et al., 13 Mar 2025). A related complex-valued ViT ansatz for impurity models computes through Transformer encoder blocks followed by a aggregation (Cao et al., 2024).
A third line begins not from a wave function in the computational basis but from an informationally complete POVM representation. Carrasquilla et al. map an 0-qubit state 1 to
2
where 3, and show that a local unitary induces a local quasi-stochastic update of 4 (Carrasquilla et al., 2019). The open-system extension maps the Lindblad equation to a linear system of ODEs for 5, enabling Transformer-based simulation of mixed-state dynamics and steady states in the POVM basis (Luo et al., 2020).
Fermionic models also motivate determinant-based formulations. In the Ancilla Layer Model study, the Transformer acts on composite local tokens and outputs spin-configuration-dependent single-particle orbitals 6, while the many-body amplitude is a Slater determinant 7 (Rende et al., 2 Mar 2026). This places transformer NQS at the intersection of autoregressive neural wave functions, direct log-amplitude models, and backflow-Slater constructions rather than in a single canonical form.
2. Architectural patterns
Reported architectures span encoder-only, decoder-only, autoregressive, and ViT-style designs. The multi-purpose TQS uses an encoder-only transformer with one-hot or scaled one-hot inputs for spins and physical parameters, sinusoidal positional encodings for spin positions, learned positional embeddings for parameter tokens, causal masking, and two output heads for conditional probabilities and phase increments (Zhang et al., 2022). The exact circuit-simulation approach uses an autoregressive Transformer encoder with just one layer, 8 heads, 9, residual connections, LayerNorm, and a final linear layer plus softmax producing 0, with 1 (Carrasquilla et al., 2019). For open systems, the causal Transformer is stacked with 2, 3, 4, and positional vectors that may be sinusoidal or learned (Luo et al., 2020).
Patch-based and ViT-style tokenizations dominate in two-dimensional lattice problems. Deep ViT NQS for the 5-6 Heisenberg model partition an 7 lattice into non-overlapping 8 patches, project each patch into a 9-dimensional token, process the resulting sequence by 0 encoder layers with multi-head factored attention and feed-forward networks, and collapse the final token sequence to a complex 1 through a 2 output head (Rende et al., 2023). The thermodynamic-limit study likewise uses patch embeddings, 3 Transformer layers, 4 heads, 5, and a scalar complex readout 6 with 7 (Viteritti et al., 2 Feb 2026). In impurity models, each occupation-number configuration is reshaped into a binary image with 8 horizontal patches, embedded into 9, and processed by standard MHSA and MLP blocks with learned positional encodings (Cao et al., 2024).
Several studies modify attention to encode lattice structure directly. The long-range Ising-chain ViT imposes circulant attention matrices and cyclic symmetrization instead of explicit positional encodings, thereby enforcing periodic translational invariance (Roca-Jerat et al., 2024). The composite spin-fermion ansatz for the Ancilla Layer Model uses a factored site-only attention matrix with a learned or analytic distance-decay bias 0, no query/key projections on content, 1 self-attention layers, 2, 3, and a feed-forward width 4 with GELU activations (Rende et al., 2 Mar 2026). The Spatial Attention mechanism inserts a learned inverse length scale 5 into each attention head through the factor 6, where 7 is Euclidean patch distance (Viteritti et al., 2 Feb 2026). The scaling-law study uses the same distance-dependent kernel as the defining structural bias of the transformer Ansatz (Rende et al., 1 Jun 2026).
Hybrid convolution-attention variants have also appeared. The convolutional transformer wave function stacks Vis-Transformer-style blocks of the form Norm 8 ConvUnit 9 MHSA 0 IRFFN, with 1 depthwise convolutions, 2 pointwise convolutions, relative positional encoding 3, and a final pair-complex activation that yields 4 and 5 (Chen et al., 13 Mar 2025). In electronic systems, a decoder-only Transformer with depth 6, embedding dimension 7, and 8 heads is used to parameterize corrections around a reference state, and in the largest reported runs the values were 9, 0, and 1 (Sobral et al., 2024).
3. Optimization and training algorithms
The dominant optimization principle is VMC energy minimization. Across spin, fermionic, and chemistry settings, the loss is
2
with gradients obtained from the log-derivative trick or from stochastic reconfiguration (SR) (Zhang et al., 2022, Roca-Jerat et al., 2024, Rende et al., 2 Mar 2026). For exact-sampling autoregressive states, Monte Carlo does not require a Markov chain: samples are drawn token by token from the normalized conditional distributions (Luo et al., 2021). In non-autoregressive log-amplitude models, sampling typically uses Metropolis-Hastings with local spin updates, global magnetization reversals, or problem-specific moves (Chen et al., 13 Mar 2025). Ab initio chemistry combines autoregressive sampling with a data-centric parallelization scheme, heuristic parallel batch autoregressive sampling, CUDA local-energy kernels, and AdamW parameter updates (Wu et al., 2023).
SR and related natural-gradient methods have become central for large-scale transformer NQS. The large-scale ViT work derives the exact identity
3
which replaces inversion of the 4 covariance matrix by inversion of a 5 matrix and makes SR practical for 6 real parameters on the 7 square-lattice 8-9 Heisenberg model (Rende et al., 2023). The thermodynamic-limit and scaling-law studies use SR with MARCH or SPRING, 0 samples per step, and diagonal shift 1 (Viteritti et al., 2 Feb 2026, Rende et al., 1 Jun 2026). In the physics-informed electronic-state framework, 2 is optimized with SOAP rather than ADAM, while the single scalar 3 is updated by SGD (Sobral et al., 2024).
Several transformer NQS depart from direct VMC. In the exact circuit-simulation approach, training is gate by gate: after applying the quasi-stochastic matrix 4 to the current modeled distribution, a fresh Transformer is fitted by minimizing the reverse KL divergence
5
with gradients estimated from exact samples and updates performed by Adam (Carrasquilla et al., 2019). For open systems, the Liouvillian can be treated either dynamically, through a forward-backward trapezoid update and the loss 6, or variationally, through the steady-state objective 7, optimized by ADAM (Luo et al., 2020). Impurity models employ a subspace-expansion scheme rather than Metropolis: an active subspace 8 of the 9 most probable bit strings is iteratively enlarged by all Hamiltonian-connected states, truncated, and then used for SR in the restricted space (Cao et al., 2024).
Pretraining has been introduced to address difficult optimization landscapes. In the hybrid numerical/experimental framework, a patched autoregressive transformer is first optimized by a data-driven loss
0
which combines computational-basis snapshots with correlations from a second measurement basis, and only then refined by Hamiltonian-driven VMC (Lange et al., 2024). This two-stage procedure was designed to improve access to the sign structure and to accelerate convergence in two-dimensional systems.
4. Symmetry, inductive bias, and interpretability
A persistent theme is that physical symmetry is usually enforced explicitly. In gauge theories and anyonic chains, local constraints are built into the autoregressive generation process by a binary mask 1 that zeros out gauge-violating or fusion-forbidden next tokens before local renormalization (Luo et al., 2021). This construction guarantees that every sampled prefix remains in the physical Hilbert space, and it yields exact representations for ground and excited states of the 2D and 3D toric codes and the X-cube fracton model (Luo et al., 2021). In open-system simulations on two-dimensional lattices, autoregressive ordering breaks geometric symmetries, so translational and rotational symmetry are partially restored by averaging over up to eight snake-like orderings, producing a String State ansatz (Luo et al., 2020). In frustrated spin systems, exact lattice symmetries are often imposed by explicit projection,
2
with 3 taken as translations and point-group operations such as 4 or 5 (Viteritti et al., 2 Feb 2026). Symmetry projection over translations, point-group operations, and spin parity is also used in deep ViT NQS for the square-lattice 6-7 model (Rende et al., 2023).
Inductive biases are likewise encoded directly into the architecture or basis. The long-range ViT imposes circulant attention and cyclic-shift symmetrization, rather than relying on learned positional structure, to respect periodic translational invariance (Roca-Jerat et al., 2024). The Spatial Attention mechanism introduces a single learned length scale 8 per head per layer, so that long-range patch coupling is suppressed at initialization and correlations are built up from short to long range (Viteritti et al., 2 Feb 2026). The convolutional transformer wave function places a depthwise convolution before attention and an inverted-residual feed-forward block after attention, explicitly combining short-range and global couplings (Chen et al., 13 Mar 2025). In the Ancilla Layer Model, each local state 9 is compressed to an integer token 0, allowing self-attention to operate naturally on a composite local Hilbert space of dimension 1 (Rende et al., 2 Mar 2026).
Interpretability has been pursued most directly through basis design. Sobral, Perle, and Scheurer construct a physics-informed second-quantized basis around either a Hartree-Fock or strong-coupling reference state and write
2
In this setting, the single scalar 3 is an interpretable measure of how product-like the ground state is, low-order excitations 4 carry 5 of the probability in the HF basis, and PCA of the hidden representation orders configurations by excitation class (Sobral et al., 2024). Reported results indicate that symmetry and interpretability generally arise from masks, projections, distance biases, or basis engineering rather than from generic self-attention alone. A related issue concerns sign structure: while some architectures use explicit phase heads or complex 6, the large-scale triangular-lattice study found that the overlap with the classical three-sublattice sign and the Huse-Elser sign rule decays exponentially in 7, which indicates an intrinsically non-local sign structure (Viteritti et al., 2 Feb 2026).
5. Applications and benchmarked performance
Transformer NQS have been benchmarked on both exact-probabilistic and variational tasks. In quantum-circuit simulation, Carrasquilla et al. simulated GHZ and linear graph-state circuits up to 8 qubits and a 9-qubit VQE circuit for the transverse-field Ising model. Small 00-qubit circuits converged to machine precision, with fidelity approaching 01 and KL divergence approaching 02; for GHZ and graph circuits up to 03 qubits, the classical fidelity 04 dropped roughly linearly in 05, reaching 06 at 07 with 08 and improving if 09 (Carrasquilla et al., 2019). In open systems, the probabilistic Transformer closely tracked exact QuTiP results for 1D Heisenberg dynamics up to 10, matched 11 accuracy in 12 2D Heisenberg steady states with symmetry-averaged String States, and outperformed RBM-MCMC on the 13-site 1D TFIM fixed point in the regime 14 (Luo et al., 2020).
In spin models, the range of systems is broader. The long-range Ising-chain ViT computed the full phase diagram for chain lengths up to 15, obtained 16, 17, 18 on the ferromagnetic side and 19, 20, 21 on the antiferromagnetic side at 22, and achieved 23-scores typically 24, while an RBM under a fixed 25 min training budget remained near 26 close to criticality (Roca-Jerat et al., 2024). For the 27 square-lattice 28-29 Heisenberg model at 30, the deep ViT optimized with large-scale SR reached 31 after 32 SR steps, a reported state-of-the-art variational energy for this benchmark (Rende et al., 2023). The Spatial Attention study extended VMC simulations of the triangular-lattice Heisenberg antiferromagnet to clusters up to 33, obtained 34 and 35, and also reported state-of-the-art energies for a 36-37 Heisenberg model on a 38 square lattice (Viteritti et al., 2 Feb 2026). The convolutional transformer wave function matched or slightly improved upon CNN(GELU) on the 39 40-41 model at equal cost, reached 42 and 43 on the 44 problem after 45 MinSR steps, and remained accurate in real-time dynamics of the 2D TFIM up to 46 on 47 and 48 on 49 (Chen et al., 13 Mar 2025).
Gauge, anyonic, and composite spin-fermion models form another major application area. The gauge-invariant and anyonic autoregressive framework reproduced 50 for the 51 toric code up to sampling noise, reached 52 for the 53D 54 quantum link model on 55 unit cells, matched tensor-network results up to 56 cells, identified the 2D 57 gauge-theory transition near 58, and extracted 59 for the 60 anyonic chain (Luo et al., 2021). For the Ancilla Layer Model, the backflow-Slater Transformer kept the relative energy error below 61 on a 62-site chain at doping 63 for 64 up to 65, and it characterized LL, LL66, and LE phases through structure factors, spin gaps, and central charges (Rende et al., 2 Mar 2026).
Electronic-structure and impurity problems have provided a distinct benchmark suite. The NNQS-Transformer for ab initio quantum chemistry matched or slightly outperformed NAQS on seven STO-3G molecules between 67 and 68 qubits, achieved chemical accuracy for BeH69 and average error to the FCI complete-basis limit below 70 Ha for H71 in 72- and 73-qubit bases, and demonstrated strong scaling with efficiency 74 from 75 to 76 GPUs for a 77-qubit benzene problem (Wu et al., 2023). The physics-informed Transformer for electronic quantum states recovered ED energies with relative error 78 across 79 and 80, required only 81 distinct configurations after convergence for 82, and converged in 83 epochs on a single NVIDIA H100 in a few hours (Sobral et al., 2024). In impurity models, the ViT-NQS reached subspace relative errors of 84, 85, and 86 for 87 in the single-orbital Anderson model, achieved MPS-level accuracy in the three-orbital Anderson model with 88 parameters instead of 89, and reproduced core-level X-ray absorption spectra through a restricted excitation space (Cao et al., 2024).
6. Scaling behavior, limitations, and open questions
A recent line of work formulates scaling laws for transformer NQS in terms of the 90-score,
91
and the total training compute 92. For transformer wave functions on square and triangular lattices up to 93, the reported scaling law is
94
with data collapse after rescaling the compute axis as 95 (Rende et al., 1 Jun 2026).
| Hamiltonian | 96 | 97 |
|---|---|---|
| Square Heisenberg (98) | 99 | 00 |
| Square 01-02 (03) | 04 | 05 |
| Triangular Heisenberg (06) | 07 | 08 |
| Triangular 09-10 (11) | 12 | 13 |
Because 14 in all reported cases, the study interprets the transformer Ansatz as size-consistent for the systems considered, and the decrease of 15 with frustration is presented as a quantitative measure of representational difficulty (Rende et al., 1 Jun 2026). This establishes scaling laws as a benchmarking framework for transformer-based variational states rather than only a description of isolated numerical experiments.
At the same time, recurrent limitations remain visible across the literature. Self-attention in its naive form scales as 16 in the number of tokens, which is explicitly identified as a bottleneck in convolutional transformer wave functions and motivates approximate attention or hybrid conv-transformer designs for larger lattices (Chen et al., 13 Mar 2025). In chemistry, Hamiltonian evaluation remains 17 in the worst case and heuristic batch-autoregressive sampling can suffer from load imbalance at very large scale (Wu et al., 2023). Near criticality, the physics-informed electronic-state approach requires larger 18 and larger networks to resolve many excitation classes, making sampling the bottleneck (Sobral et al., 2024). In open systems, one-dimensional autoregressive orderings break two-dimensional lattice symmetries unless additional string averaging is introduced (Luo et al., 2020). Hybrid pretraining was proposed precisely because direct Hamiltonian optimization can face a rugged and complicated loss landscape in expressive transformer NQS (Lange et al., 2024).
Open directions named in the cited work include real-space topological models, excited states, spin and gauge symmetries, approximate or sparse attention for larger lattices, mixed-state and dynamics pretraining, and extensions to higher-dimensional fermionic problems (Sobral et al., 2024, Zhang et al., 2022). Taken together, the existing literature presents transformer-based NQS not as a single ansatz but as a methodological family whose practical success depends on the interaction between representation, symmetry handling, optimization algorithm, and the physical basis in which the model is defined.