- Home
- Library
- Computational Quantum Field Theory
- Learning to Sample Field Configurations
- Scaling Learned Samplers
Scaling Learned Samplers
A learned proposal may reduce the cost of each useful measurement and still be a poor choice for a short calculation. Training has an upfront cost, and an impressive acceptance fraction need not correspond to a well-explored target. A useful comparison therefore asks how long each method takes to estimate a specified observable with a stated uncertainty.
We make that comparison for the chapter's three finite scalar targets. The measured outcomes include a conditional crossover, a case with no favorable crossover under the declared error estimator, and a strongly bimodal target for which the conventional and reverse-flow comparisons cannot be assigned equilibrium costs.
Preparation: Autocorrelation errors, action-based training and Metropolis-corrected learned proposals.
Useful samples depend on the observable
Let a stationary history measure , with target variance and autocovariance . The variance of its mean over updates is exactly
When the correlations are summable and the run is long compared with their decay,
Define the variance-equivalent sample count and measured cost
This does not count literally independent configurations. Negative correlations can improve some observables, while finite error estimates can also fluctuate below the independent-sample variance. A scalar ESS number cannot describe every measurement on the fields [2, §§2–3].
More fundamentally, these formulas do not include bias from an unequilibrated start. A chain trapped in one well may estimate a conditional mean very precisely and still miss the desired expectation. Such a failure must be diagnosed before interpreting its variance as an equilibrium efficiency.
Include setup before projecting a crossover
Suppose a method has setup cost and, over a regime where its measured variance scaling remains applicable, cost per useful sample. The provisional cost of obtaining useful samples is
For a conventional sampler, setup includes warmup. For a learned sampler it includes training and warmup, plus target-data generation when training uses exact target samples. The algebraic crossover is
A positive number is meaningful only with the appropriate slope and setup ordering. If the flow has both a larger setup and a larger production slope, there is no favorable crossover. If the denominator is poorly determined, an apparently precise is misleading. Reaching a requested standard error would require approximately , subject to the stationarity and variance assumptions above.
The same accounting applies to a reused pretrained model, but its provenance changes the question. A consumer may reasonably treat training as already paid; the project that trained and validated it cannot call that work free. Retraining or transferring to a different target introduces additional costs and validation needs.
What the finite benchmark times
The action is the fixed two-site model with , zero source and . These parameters vary the barrier at fixed volume. They do not define a continuum sequence or a measured volume-scaling law.
Each of four methods has eight replicas, 1,024 warmup updates and 8,192 retained updates: local site sweeps, HMC, and independence Metropolis using the first reverse-trained or the forward-trained map. All timings were recorded after the other workers' numerical runs had finished, with single-thread environment settings. The implementation batches eight replicas but uses a distinct RNG stream for each. These are measurements of this small implementation and local machine conditions, not portable performance constants.
Production clocks include random-number generation, proposal construction, acceptance and the five stored observables. Work counters separately retain action, force, local-difference, map and inverse-density evaluations. Counting each of those as one interchangeable operation would hide the neural overhead. Archive writing and later statistical analysis are outside the production clock.
The primary model's setup includes its fixed 4,000-step fit and mandatory monitoring. The forward fit also pays for all rejection proposals used to obtain its training data, including rejected points and the unused tail of the final batch. All three reverse starts and the forward fit are retained; the first reverse start is used without choosing the best outcome. The recorded data/training/final-validation study clock is about 26.3 seconds. It begins after reference preparation and excludes the separate deterministic checks, whose wall times were not recorded. It is therefore not the complete research effort. The companion reports the known costs and this omission explicitly.
Compare errors before comparing seconds
The primary uncertainty estimate is the standard error of eight replica means. Fixed windows and block sizes 256 and 512 are retained as sensitivity checks, without automatic tuning. The FFT covariance implementation agrees with a direct lag sum on a retained slice to below ; that computational check does not establish equilibration or a sufficient window.
For and , the measured production costs are:
| Method | Setup / seconds | Replica estimate / per useful sample | Block-512 estimate / per useful sample |
|---|---|---|---|
| Local | |||
| HMC | |||
| Reverse flow | |||
| Forward flow |
The primary estimate gives no favorable flow-versus-HMC crossover: both learned methods have larger setup and larger slope. The block estimate changes that slope ordering. This disagreement is part of the result, not a reason to select the more attractive error estimate. Only eight replica means determine the primary variance, and the blocks can retain correlations. Leave-one-replica-out ranges and prefix comparisons in the companion further display this finite-estimator uncertainty; those ranges are not confidence intervals.
At , the primary estimates give conditional reverse-flow crossovers of about useful samples against local sweeps and against HMC. Forward-flow estimates are about and . These are linear amortization estimates from measured setup and variance costs, not additional runs at the crossover lengths. The reverse-flow primary ESS itself exceeds the 65,536 stored production states: its eight-replica variance estimate is smaller than the variance of that many iid target draws, while the larger block and window estimates show its sensitivity. That makes the distinction between a variance diagnostic and a literal count particularly important.
The cost model uses retained timings and observable-specific errors for . Curves beyond the measured production length are projections. The block comparison shows estimator sensitivity. No equilibrium crossover is assigned at , where one or both methods in every conventional-versus-flow comparison fail the declared exploration diagnostics.
Withhold a number when its assumptions fail
At , seven local replicas, seven HMC replicas and all eight reverse-flow replicas have no sector changes. The opposite-start groups disagree strongly in . Their pooled even moments can look plausible, but this does not justify an equilibrium efficiency comparison. All hard-target conventional-versus-flow crossovers are therefore withheld, including comparisons with the forward flow, whose own chains do explore both wells.
The declared diagnostic flags are a zero-transition replica, a start-group difference exceeding three estimated errors, a nonpositive selected variance estimate, or a numerical proposal failure. These are cautious reporting rules, not calibrated convergence tests. Absence of a flag cannot prove that no slower unobserved mode exists. The retained histories also report prefix and early/late differences, reference discrepancies and all numerical failures.
The hard-target forward chain illustrates error-estimation uncertainty even after these checks: its cost is about under the replica estimate and under block512. It would be misleading to use the smaller number as a precise advantage over an unequilibrated baseline.
What changes when the lattice grows
A larger lattice changes more than the number of network operations. A log-density mismatch accumulated over many degrees of freedom can broaden importance weights and suppress acceptance. Long-distance modes may relax slowly even when local moments look correct. In a gauge theory, topological sectors can introduce additional obstacles; the two scalar wells here are not gauge topology. Architecture, training data, memory and force costs can all scale differently with volume or correlation length.
These considerations motivate larger studies; they do not supply a scaling exponent for the present two-site example. Transferring weights also changes no target by itself. A proposal reused at a new coupling or regulator must still be evaluated against the new action in its correction, with compatible variables, measure and proposal density. Reusing an old acceptance ratio would sample an old or otherwise incorrect target.
Summary
Measure useful work for a specified observable, include setup, and inspect the uncertainty of the error estimate that enters the comparison. The small scalar family shows conditional amortization, an estimator-sensitive no-crossover result, and failures for which equilibrium cost is not established. These are finite-model sampling results; volume and continuum claims require additional calculations.
Exercises
1. Is training worth paying for?
A conventional method has setup cost one second and production cost seconds per useful sample. A flow has setup cost 100 seconds and production cost seconds per useful sample. Find the crossover, compare costs at and , and state what changes if the flow's slope is instead .
Solution
The equality gives . At useful samples the flow costs 110 seconds and the conventional method 31 seconds. At they cost 200 and 301 seconds. With slope , the flow has both greater setup and greater production cost, so it is never cheaper for . These statements assume the useful-sample slopes are valid for the chosen observable and regime; no algebraic crossover repairs an unmeasured bias.
2. An even measurement can miss the slow sector
A stationary state contains independent processes and . The first is a unit-variance Gaussian autoregressive process with lag coefficient . The second takes values with equal stationary probabilities and correlation , where . Find the integrated autocorrelation times of and . Explain why the first measurement cannot establish sector exploration.
Solution
Gaussian pair contraction gives
Thus
The same configurations have very different effective sample counts for these observables. A precise estimate of the even fast quantity says nothing about whether the process has crossed sectors. These are stationary variance formulas; starting in one sector introduces a separate transient, which an error estimate from cannot detect.
References
- M. S. Albergo et al., “Introduction to Normalizing Flows for Lattice Field Theory,” arXiv:2101.08176v3 (2021). Full text. §§IV.6–IV.7.1 explain training, importance-weight diagnostics and independent Metropolis correction; the finite-batch warning is essential to interpreting sampler comparisons.
- U. Wolff, “Monte Carlo errors with less errors,” Computer Physics Communications 156 (2004), 143–153; erratum 176 (2007), 383, arXiv:hep-lat/0306017v4. Full text. §§2–3 and Appendix B distinguish observable-specific asymptotic errors, finite estimators, replica checks and blocking.
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.