Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    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 OtO_t, with target variance vOv_O and autocovariance ΓO(k)\Gamma_O(k). The variance of its mean over NN updates is exactly

    Var⁡(OˉN)=1N[ΓO(0)+2∑k=1N−1(1−kN)ΓO(k)].\operatorname{Var}(\bar O_N)=\frac1N\left[ \Gamma_O(0)+2\sum_{k=1}^{N-1}\left(1-\frac{k}{N}\right)\Gamma_O(k)\right].

    When the correlations are summable and the run is long compared with their decay,

    Var⁡(OˉN)≃2τint,OvON,τint,O=12+∑k=1∞ΓO(k)ΓO(0).\operatorname{Var}(\bar O_N)\simeq\frac{2\tau_{\mathrm{int},O}v_O}{N}, \qquad \tau_{\mathrm{int},O}=\frac12+\sum_{k=1}^{\infty}\frac{\Gamma_O(k)}{\Gamma_O(0)}.

    Define the variance-equivalent sample count and measured cost

    Neff(O)=vOVar⁡(Oˉ),cO=TproductionNeff(O).N_{\mathrm{eff}}^{(O)}=\frac{v_O}{\operatorname{Var}(\bar O)}, \qquad c_O=\frac{T_{\mathrm{production}}}{N_{\mathrm{eff}}^{(O)}}.

    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 T0T_0 and, over a regime where its measured variance scaling remains applicable, cost cOc_O per useful sample. The provisional cost of obtaining UU useful samples is

    TO(U)≃T0+UcO.T_O(U)\simeq T_0+Uc_O.

    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

    U∗=T0,flow−T0,conventionalcO,conventional−cO,flow.U_*= \frac{T_{0,\mathrm{flow}}-T_{0,\mathrm{conventional}}} {c_{O,\mathrm{conventional}}-c_{O,\mathrm{flow}}}.

    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 U∗U_* is misleading. Reaching a requested standard error δ\delta would require approximately U=vO/δ2U=v_O/\delta^2, 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 λϕ4/24\lambda\phi^4/24 model with λ=4\lambda=4, zero source and r=2,−1,−4r=2,-1,-4. 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 W=64,128,256W=64,128,256 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 6×10−146\times10^{-14}; that computational check does not establish equilibration or a sufficient window.

    For r=−1r=-1 and O=Q2O=Q^2, the measured production costs are:

    MethodSetup / secondsReplica estimate / μs\mu\mathrm s per useful sampleBlock-512 estimate / μs\mu\mathrm s per useful sample
    Local0.0690.069111.0111.088.388.3
    HMC0.3440.34433.833.873.373.3
    Reverse flow2.2052.20539.039.039.639.6
    Forward flow2.0812.08140.640.623.523.5

    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 r=2r=2, the primary Q2Q^2 estimates give conditional reverse-flow crossovers of about 8.7×1048.7\times10^4 useful samples against local sweeps and 6.7×1046.7\times10^4 against HMC. Forward-flow estimates are about 9.4×1049.4\times10^4 and 7.2×1047.2\times10^4. 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.

    Conditional total-cost lines include training and warmup, alongside a comparison of replica and block variance costs and a warning that hard-target crossovers are withheld.

    The cost model uses retained timings and observable-specific errors for Q2Q^2. Curves beyond the measured production length are projections. The block comparison shows estimator sensitivity. No equilibrium crossover is assigned at r=−4r=-4, where one or both methods in every conventional-versus-flow comparison fail the declared exploration diagnostics.

    Withhold a number when its assumptions fail

    At r=−4r=-4, seven local replicas, seven HMC replicas and all eight reverse-flow replicas have no sector changes. The opposite-start groups disagree strongly in QQ. 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 QQ 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 Q2Q^2 cost is about 8.1 μs8.1\,\mu\mathrm s under the replica estimate and 29.9 μs29.9\,\mu\mathrm s 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 0.0030.003 seconds per useful sample. A flow has setup cost 100 seconds and production cost 0.0010.001 seconds per useful sample. Find the crossover, compare costs at U=104U=10^4 and 10510^5, and state what changes if the flow's slope is instead 0.0040.004.

    Solution

    The equality 100+0.001U=1+0.003U100+0.001U=1+0.003U gives U∗=49,500U_*=49{,}500. At 10410^4 useful samples the flow costs 110 seconds and the conventional method 31 seconds. At 10510^5 they cost 200 and 301 seconds. With slope 0.0040.004, the flow has both greater setup and greater production cost, so it is never cheaper for U≥0U\ge0. 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 FtF_t and TtT_t. The first is a unit-variance Gaussian autoregressive process with lag coefficient a=0.2a=0.2. The second takes values ±1\pm1 with equal stationary probabilities and correlation ⟨T0Tk⟩=bk\langle T_0T_k\rangle=b^k, where b=0.99b=0.99. Find the integrated autocorrelation times of Ft2F_t^2 and TtT_t. Explain why the first measurement cannot establish sector exploration.

    Solution

    Gaussian pair contraction gives

    Cov⁡(F02,Fk2)=2a2k,Var⁡(Ft2)=2.\operatorname{Cov}(F_0^2,F_k^2)=2a^{2k}, \qquad \operatorname{Var}(F_t^2)=2.

    Thus

    τF2=12+a21−a2=1324,τT=12+b1−b=99.5.\tau_{F^2}=\frac12+\frac{a^2}{1-a^2}=\frac{13}{24}, \qquad \tau_T=\frac12+\frac b{1-b}=99.5.

    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 TT process has crossed sectors. These are stationary variance formulas; starting TT in one sector introduces a separate transient, which an error estimate from F2F^2 cannot detect.

    References

    1. 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.
    2. 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.