- Home
- Library
- Computational Quantum Field Theory
- Learning to Sample Field Configurations
- Training against an Action
Training against an Action
A field theory supplies an action, but usually not a collection of independent equilibrium configurations. Can a generative model learn directly from that action? Reverse relative entropy gives such an objective. Its convenience comes with a risk: a model can concentrate in one important region and receive little information about another region it almost never visits.
We derive both training objectives and fit the same two-site scalar flow with each. At the strongest barrier, the reverse-trained models miss one well while reporting an excellent importance-weight diagnostic. This makes the distinction between a computable loss and a reliable sampler concrete.
Preparation: The density and inverse of a normalizing flow, expectations and gradients. All actions and fields below are dimensionless Euclidean quantities.
Two relative entropies ask different questions
Let be the target and an invertible flow of a parameter-independent base . Forward relative entropy is
Its parameter-dependent part is maximum likelihood on target samples. The gradient does not need , but obtaining those samples can be expensive. A finite training set also introduces ordinary sampling and generalization errors.
For reverse relative entropy, change integration variables to the base:
These identities require the relevant expectations and differentiation under the integral to exist. The present bounded affine layers and quartic action have the needed Gaussian moments for fixed finite parameters. Fresh base samples supply an unbiased stochastic gradient of this objective; the unknown is a constant. The action term favors probable fields, while the log determinant rewards the volume needed to maintain entropy. Dropping that determinant would optimize a different problem [1, §IV.6, equations (17)–(20)].
Neither a small stochastic gradient nor a finite training budget establishes a global minimum. Without a reference , even the numerical value of the unnormalized reverse loss is shifted from the true KL divergence.
Why a missing mode can be cheap
Forward KL averages over the target. A target region with appreciable probability and very small creates a large contribution. Reverse KL averages over the model; a region that the model almost never generates contributes almost no samples to its gradient.
For intuition, take a symmetric target with two well-separated, equally weighted components. A model that reproduces only one component has reverse KL approaching . Its local shape can be excellent even though its odd observables are wrong. An exactly absent target component makes forward KL infinite. Our actual flows have positive density everywhere, so the forward divergence remains finite, but it can still be large.
A fixed scalar experiment
Use , zero source and the two-site coordinates :
To define the response, add to the action and set . Then , because sign symmetry makes . Its reference values are , and , respectively. They come from refined quadrature of the finite target, not from a trained predictor.
Each map has six alternating affine layers and 396 parameters. For each target we train three reverse-KL initializations and one forward-KL initialization. The first initialization is shared between the two objectives, but their sampling streams are separate. Every fit has 4,000 Adam updates of batch size 256; the learning rate decreases from to and then at the declared steps. Adam's first- and second-moment bias corrections follow Algorithm 1 of Kingma and Ba [2, PDF p. 2]. No fit is chosen for having the best validation result. The primary reverse sampler always uses initialization zero.
All twelve fits completed their fixed budgets with finite iterates. This status does not assert optimization convergence. Separate finite-difference checks verify the actual forward and inverse backpropagation, including conditioner and Jacobian terms.
Pay for forward-training data
For this tiny model we can obtain exact independent training draws by rejection sampling. Use
Writing , , define and . The log of the unnormalized target-to-proposal ratio, apart from , is
This function is coercive in the nonnegative quadrant. Its interior Hessian has one positive eigenvalue, so an interior stationary point cannot be a maximum. Maximizing on the two axes gives the global bound
Accept a proposed point with probability . The accepted density is exactly , and the mean acceptance is . The fixed run collected 8,192 training points per target, using 65,536, 36,864 and 368,640 proposals. Counts include rejected points and the entire final batch. This source of target data is affordable in two dimensions; it is not presented as a general replacement for high-dimensional simulation. Its cost is included in the forward method's setup.
Validate on fresh draws and the target measure
After training, each map generates 16,384 new independent draws. The following table gives the first reverse fit and the forward fit; uncertainties are one standard error under the learned distribution. They are not bounds on the difference between that distribution and the target.
| Target | Reverse model | Forward model | |
|---|---|---|---|
The last reverse-model entry looks satisfactory for an even observable. Its mean field is instead , whereas the target mean is zero. The three reverse fits at this coupling yield positive-sector fractions , and in their fresh draws. Zero observed events do not prove zero model probability: for example, the one-sided 95% binomial upper bound after zero events in independent draws is .
For the first hard-target reverse fit, the estimated reverse KL is about , close to the one-component limit . Its forward KL is about . The forward-trained map covers both wells, with positive-sector fraction . Its independently integrated forward KL is about ; the fixed quadrature orders 128 and 192 differ by , which remains an explicit numerical-resolution limitation. The omitted-box-tail estimate is separate and does not certify quadrature resolution within the box.
Fixed-budget training and independent final diagnostics. All three reverse initializations at concentrate in one well; the forward fit uses separately generated exact training data. Loss completion and a reasonable even moment do not establish the target's mode weights.
Importance weights can miss the same missing region
For model draws define . A common diagnostic is
The three collapsed hard-target fits give approximately 15,644, 15,986 and 16,108 out of 16,384. Their weights vary little within the sampled well. No rare sample arrives to reveal the missing target mass. This is precisely why a high finite-sample importance-ESS estimate is not a coverage guarantee [1, §IV.6.1].
Self-normalized reweighting estimates . It is a biased ratio at finite sample size and can remain badly wrong when overlap is poor. The companion retains those estimates, their conditional delta-method errors, the largest normalized weight and the sector counts. Neither reweighting nor a loss curve erases an observed missing-mode failure.
Summary
Forward KL uses target samples; reverse KL uses the action and fresh model samples. Both gradients avoid differentiating the partition function. The actual fits show why validation needs target moments and mode-sensitive observables in addition to training losses. Continue to Metropolis-corrected proposals for the invariant transition and its finite-run limitations.
Exercises
1. Reverse KL within a Gaussian family
Let and , with . Derive the reverse KL and its minimizer. Explain why minimizing only the expected target action gives the wrong variance.
Solution
Using and the Gaussian entropy,
The derivatives give and ; the KL is then zero. The expected action alone is and decreases as . It favors concentration at the minimum rather than a thermal distribution. The entropy term , represented by the flow determinant, prevents that collapse in this exactly representable Gaussian problem.
2. Two regions and a missing probability
Two disjoint regions have target probabilities . A model has probabilities , , and the exact target conditional density inside each region. Calculate both KL divergences and the probability that model draws never visit the second region. Take carefully.
Solution
The conditional density factors cancel, leaving
The no-visit probability is . As , reverse KL approaches , forward KL diverges, and a fixed number of model draws almost surely misses the second region. At exactly zero, the model violates full target support; the equations describe the positive- limit relevant to a strongly imbalanced full-support flow. Finite data without a second-region event do not distinguish zero probability from a very small positive probability.
References
- M. S. Albergo et al., “Introduction to Normalizing Flows for Lattice Field Theory,” arXiv:2101.08176v3 (2021). Full text. §§IV.6–IV.6.1, equations (17)–(21), derive the objectives and warn about optimistic finite-batch importance ESS.
- D. P. Kingma and J. Ba, “Adam: A Method for Stochastic Optimization,” ICLR (2015), arXiv:1412.6980v9 (2017). PDF. Algorithm 1 and §2 specify the update and moment bias corrections. They do not establish convergence of the present fixed-budget nonconvex fits.
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.