- Home
- Research
- Lattice, Computation, and Machine Learning
- Benchmarking Learned Lattice Samplers
Benchmarking Learned Lattice Samplers
Does a learned lattice proposal reduce the cost of estimating a physical observable after training, correction and uncertainty are included? We train and test a small autoregressive model against an exactly enumerable Ising target. The comparison measures both a fast even observable and the much slower magnetization mode; their effective sample counts differ dramatically for the conventional chain.
Preparation: corrected learned proposals, autocorrelation errors and learned-sampling scaling.
Fix the target and disclose the training oracle
Use a periodic classical Ising lattice with spins , nearest-neighbor energy
Each of the spatial bonds is counted once. Coupling and Boltzmann constant are one. The measured observables are energy per site , magnetization and . Enumerating all states gives
In a fixed site ordering, the learned model is
Zero biases impose global spin-flip symmetry. Finite weights give full support, and ancestral sampling generates independent draws from . We fit each conditional by minimizing the exact target-weighted negative log likelihood. The trainable weights use an enumerated training oracle. This is a controlled method comparison, not a scalable data-free training scheme or a reproduction of a published scalar normalizing-flow benchmark.
Correct the proposal and test the correction
An independent proposed state is accepted with probability
The normalization cancels. Detailed balance follows because either direction has equilibrium flow . The normalization of is independently checked by exhaustive summation, and random state pairs verify the balance identity. The acceptance rule is the one in Albergo, Kanwar and Shanahan, §II.1, Eq. (6); their actual learned representation and field-theory target are different.
The trained proposal has forward relative entropy . It is close, but its exact uncorrected means are and . More independent uncorrected samples would converge to those biased values. The corrected chain's measured acceptance is .
Enumeration also gives a worst-case mixing check for this independent proposal. Write and . The probability of proposing and accepting from is . Rejection adds extra probability to stay at . Each step therefore contains an equilibrium draw of weight at least , irrespective of the initial state. After five steps the total-variation distance to is at most . Evaluating used the whole finite state space. The acceptance rate by itself would not give this bound.
Compare at the same action and with observable-specific errors
We run independent replicas, each for recorded steps. One learned step is one whole-configuration proposal; one local step is a sweep of random-site Metropolis proposals. Both methods begin from exact target-distributed states, intentionally removing burn-in from this finite efficiency experiment. This does not test how either method equilibrates an arbitrary initial state.
Standard errors are estimated from the dispersion of the independent replica means, rather than treating correlated configurations as independent. They include within-replica correlation through those means, but their own precision is limited by the number of replicas.
| Method | Mean energy per site | Mean | Standard error of |
|---|---|---|---|
| Corrected learned | 0.00286 | ||
| Local Metropolis | 0.04827 |
All displayed means are consistent with the exact target at this precision. Local updates estimate energy reasonably while crossing between magnetization sectors much more slowly. The variance-equivalent sample count, defined as exact target variance divided by the estimated variance of the overall mean, is about versus for energy, but versus for magnetization. One acceptance fraction or one effective sample count cannot characterize all observables.
Include training and the comparison's limitations
In the retained single-CPU run, enumeration took seconds, training seconds, learned production seconds and local production seconds. Proposal generation, action evaluation and density evaluation are included in learned production. These are implementation-dependent timings, not portable speedup factors; the conventional comparison is random-site Metropolis, not an optimized cluster algorithm.
Let be production time per variance-equivalent sample for observable , and let include learned setup. A projected crossover satisfies
when the denominator is positive and the measured cost–variance scaling remains valid. For energy, the retained values suggest a crossover near effective samples. It is a conditional projection from this finite run, not a measured large-volume scaling law. Enumeration itself is exponentially costly, so this training procedure cannot establish an asymptotic advantage. Indeed, at this size enumeration already provides the answer; its role is to audit the algorithms.
Current work also shows why constant acceptance should not be confused with constant total cost. Kanwar and Vega's 2026 diffusion/annealing study separates the number of intermediate updates, target refresh time and cost per lattice update, and measures their behavior toward the continuum. Its §V.4 is a useful template for a scaling claim, while its algorithm and models are not implemented here. arXiv:2610.35792v1.
A useful next experiment replaces the exact training oracle with a declared finite training set, repeats training seeds and costs, and includes a cluster baseline. Increase volume along a fixed physical scaling trajectory while monitoring both magnetization sectors. Full support proves eventual correctness; it does not guarantee affordable exploration of rare important configurations.
References
- M. S. Albergo, G. Kanwar and P. E. Shanahan, Flow-based generative models for Markov chain Monte Carlo in lattice field theory, §II.1 and §§III.2–III.3: correction, observable comparisons and the distinction between autocorrelation and update cost.
- G. Kanwar and O. Vega, Annealed sampling of diffusion models in lattice field theory, §§V.3–V.4, especially the discussion around Eq. (83): refresh, path length and total cost along a line of constant physics.
Extract the Ising sampler, trained proposal and replica results (ZIP) and run python3 examples/research/matter-computation/sampling.py. The model, fitting residuals, exact expectations, all replica means and timings are retained. The inspected Library autoregressive density and ancestral-sampling kernels are reused with sixteen spins; its nine-spin target is not reused.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.