- Home
- Library
- Computational Quantum Field Theory
- Predicting Observables across Parameters
- Generalization and Distribution Shift
Generalization and Distribution Shift
A predictor can look accurate on random test points and fail in a parameter interval with no training examples. The relevant question is not merely whether a point lies inside the training cloud's convex hull, but whether the reported test risk represents where the predictor will be used. Here a paired experiment removes the central-source interval from a finite scalar response while keeping the label budget fixed.
Preparation: The two-site scalar target, its kernel baselines, and the finite-budget neural fits.
Generalization has a sampling distribution
Let denote the physical input and a deterministic observable. After training, a predictor depends on a training set and possibly on its initialization. For a declared deployment distribution , the squared-error risk is
An independent test sample estimates this expectation conditional on the trained predictor. A finite deterministic mesh instead measures a specified grid average. Neither automatically estimates risk under a different distribution .
It is also necessary to identify what is independent. If labels come from a correlated Monte Carlo history, randomly assigning adjacent configurations to training and testing does not produce independent physical information. Split by independent history or by sufficiently separated data-generating units, and propagate label uncertainty. Our labels are deterministic quadrature values, so the present experiment tests parameter sampling and training support, not decorrelation of a simulation trajectory.
The model remains the periodic two-site scalar with , input rectangle , and outputs . No lattice spacing, volume or boundary condition is an input. A test at a different geometry would therefore need a newly specified representation and reference calculation; it is not supported by this two-component input.
A paired missing-interval experiment
Five independent parameter pools are drawn with seeds SeedSequence([941025,30,k]), . Each contains iid uniform points on the rectangle. The last are reserved as an independent test set. From the first candidate points, choose two training sets:
- Random support: the first candidates.
- Missing central interval: the first candidates satisfying .
All five pools contain enough eligible candidates. The prescribed response to a shortage would be a retained design failure, not a redraw. Unused candidate labels are not queried. Both fits therefore consume reference labels, while their common test labels are an offline evaluation cost.
A point in the missing interval can lie inside the training cloud's convex hull; that geometric condition does not supply nearby training examples. At negative , it contains the sharp susceptibility peak, so the omitted region is physically consequential.
Each training set fits a Matérn kernel and the same network used previously. Kernels choose lengths by their own training-only leave-one-out scores. Networks use the same scales, weight penalty and fixed optimizer caps. The two networks within pool share the initialization SeedSequence([941025,31,k]), making the comparison paired. There is one fit per design and pool; no preferred initialization is selected.
All ten neural fits reach the -iteration limit without satisfying the requested gradient tolerance. This is part of the comparison: it measures these fixed-budget procedures, not fully optimized global minima. Test data do not trigger extra iterations.
Compare the same test region before changing the question
For every fitted model, evaluate the identical test points and their subsets: the central interval, its complement, and the rapid-response region . The following values are means of the five physical- RMSEs. The number after is the sample SD across the five parameter-pool replicates, not an uncertainty on an individual field-theory label and not a standard error of the mean.
| Predictor and training support | Whole rectangle | Central interval | Outside interval |
|---|---|---|---|
| Matérn, random | |||
| Matérn, missing interval | |||
| Neural, random | |||
| Neural, missing interval |
Two comparisons answer different questions. Contrasting random-support whole-domain error with missing-interval gap error combines a change of training support with a change of the evaluated region. Comparing the two designs on the same central test points isolates the support removal more directly. The paired increases in central-interval RMSE are for Matérn and for the network, again with SD across five paired designs. Every retained pair worsens on that region.
Each line joins the two training designs from one fixed parameter pool, evaluated on identical test points in . Both designs use labels. The neural initial weights are paired within each pool; no best run is selected.
The effect is stronger in the intersection , . Mean Matérn RMSE rises from to , and the neural value from to . Outside the central interval, changes are much smaller and some individual pairs improve. That regional structure matters more than a single claim that one split is “harder.”
The network's mean-field error also worsens in the omitted interval: its mean RMSE grows from to . Positive susceptibility predictions, a small training loss, or a smooth function across the gap do not remove this evidence of missing support.
Why a random split can be optimistic
For the uniform source distribution, the central interval has probability . A whole-domain squared risk decomposes as
The square root is applied after this mixture if reporting RMSE. Thus a low error on a common, easier region can conceal a larger local error. Moreover a random training set contains examples inside the central interval; it answers an interpolation question that differs from predicting an interval deliberately omitted during training.
There is no contradiction between an accurate random-split test and an inaccurate missing-region test. They evaluate different learned functions or different input distributions. Leave-one-out length selection also does not simulate removal of an entire interval: each omitted row usually retains nearby neighbors.
Covariate-shift corrections require assumptions. If a new input density is absolutely continuous with respect to the original density , risk can formally be rewritten using . If vanishes in a target region where , no finite importance weight supplies the missing labels. Angelopoulos and Bates, §4.5, Eqs. (33)–(37), explain how exchangeability-based uncertainty guarantees also change under covariate shift. The next uncertainty example keeps calibration and shifted testing separate.
The companion observable_shift.py --fit consumes the fixed parameter archive and retains all ten fits, their statuses and every stratum. Its default mode checks saved results. Five paired pools give concrete evidence for this function and these procedures; they do not establish a universal generalization law or certify extrapolation to a different theory.
Summary
A split should represent the physical question. Here equal label budgets and paired initializations show a large penalty for withholding the rapid-response interval. Even a gap point inside the geometric convex hull requires information absent from nearby training examples. Region-specific tests and explicit sampling distributions reveal what a global random-split score hides.
Exercises
1. Combine regional risks correctly
Suppose a target population places probability in region and in region . Derive the whole-population RMSE from the two regional RMSEs. Apply it to regional RMSEs and with . Why is averaging the two RMSEs incorrect?
Solution
Conditional expectation first combines squared errors:
The example gives and RMSE approximately . A weighted mean of RMSEs would instead be , because the square root is nonlinear. The calculation applies to one fixed predictor and one population partition. Averaging RMSEs across independently fitted models is a further summary and should not be confused with pooling all their squared errors.
2. Can importance weighting fill an empty interval?
Let training inputs have density supported outside an interval , while deployment density assigns positive probability. Explain why the identity fails. Construct two target functions indistinguishable from the training data but with different deployment risks for one fixed predictor.
Solution
The importance identity requires to be absolutely continuous with respect to . Here but , so no finite random weight on samples from represents the integral over .
Take one target everywhere and another , where is a smooth nonzero bump supported strictly inside . They agree on every possible training input. For the fixed predictor , the first deployment risk is zero while the second is
Training data alone cannot distinguish them. A physical equation, a quantitatively justified function class, or new observations inside could supply information, but those are additional inputs. Smoothness by itself, without a controlled bound, does not identify the missing response.
References
- A. N. Angelopoulos and S. Bates, A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification, arXiv:2107.07511v6 (2022), §4.5, Eqs. (33)–(37), covariate shift and the change in calibration assumptions.
- C. E. Rasmussen and C. K. I. Williams, Gaussian Processes for Machine Learning (MIT Press, 2006), chapter 5 (PDF), §5.1 and §5.4.2, model selection and leave-one-out prediction.
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.