Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Uncertainty and Active Learning

    An uncertainty band is useful only when its meaning survives comparison with known errors. A Gaussian-process variance, variation among five neural initializations, and an error from numerical quadrature are different quantities. This example calibrates the first two against independent scalar-response labels, then asks where to spend a fixed budget of new reference calculations.

    Preparation: The common scalar reference, conditional GP variance, and the missing-region experiment.

    Three sources of uncertainty that should not be merged

    The observable is χ(r,J)>0\chi(r,J)>0 in the same two-site periodic model, with λ=4\lambda=4. Work with y=log⁡χy=\log\chi. The reference is deterministic quadrature with separate tail, refinement and identity checks. Its tiny numerical error is not the explanation for the visible learned-prediction errors.

    For the frozen Matérn model, let μ(x)\mu(x) and s(x)s(x) be its posterior mean and latent SD in physical log-susceptibility units. Both are three times the corresponding scaled-output quantities. The usual interval μ±1.64485s\mu\pm1.64485s is a 90% Gaussian interval conditional on the assumed kernel, nugget and selected hyperparameters. Those assumptions are not established facts about the deterministic scalar response.

    For the five frozen neural networks, use the average and sample SD of their log⁡χ^\log\widehat\chi values. The interval mean ±1.64485\pm1.64485 SD is heuristic. The networks share their training labels, architecture and loss; five initializations are not independent measurements of the physical susceptibility and are not automatically posterior samples. The mean in log space corresponds to a geometric mean of physical susceptibility predictions.

    Variation in a finite test set is yet another uncertainty. Once the predictor and interval are fixed, independent random inputs can estimate their coverage under a declared input distribution. This estimates a property of the predictor; it does not turn its error band into a field-theory confidence interval.

    Calibrate a fixed predictor with independent labels

    Reserve 128128 iid uniform parameter points on the full rectangle for calibration and a separate 512512 iid points for testing. Their seeds are respectively SeedSequence([941025,40]) and SeedSequence([941025,41]). Neither set trains the model or selects its length scales or stopping iteration.

    For either predictor, define a fixed positive scale u(x)=max⁡(s(x),10−8)u(x)=\max(s(x),10^{-8}). The calibration scores are

    Si=∣yi−μ(xi)∣u(xi).S_i=\frac{|y_i-\mu(x_i)|}{u(x_i)}.

    Sort the 128128 scores and take their 117117th value:

    k=⌈(128+1)(1−0.1)⌉=117,q=S(117).k=\left\lceil(128+1)(1-0.1)\right\rceil=117, \qquad q=S_{(117)}.

    The split-conformal band is

    μ(x)−q u(x)≤y(x)≤μ(x)+q u(x).\mu(x)-q\,u(x)\leq y(x)\leq\mu(x)+q\,u(x).

    Exponentiating both endpoints produces a positive band for χ\chi. Monotonicity of the exponential preserves the coverage event. This normalized-residual construction and its assumptions are given in Angelopoulos–Bates, §1.1, Theorem 1, and §2.3, Eqs. (9)–(11).

    Conditional on an independently trained estimator, exchangeability of calibration and future test examples gives a marginal rank guarantee. With continuous scores the coverage probability is 117/129≃0.90698117/129\simeq0.90698; ties can make it larger. This probability averages over calibration and a new test example. It does not assert 90% coverage at every parameter point, in every subregion, or for every realized calibration set. The theorem concerns the declared numerical label function; the reference-error controls support its interpretation as the physical response separately.

    The retained scale factors are q=0.19274q=0.19274 for the GP and q=2.10249q=2.10249 for the neural ensemble. The GP bands shrink substantially; the neural bands widen. The held-out results are:

    Predictor and intervalUniform test coveredCentral-source shift coveredUniform mean log-width
    GP, raw Gaussian 90%512/512512/512512/512512/5120.035220.03522
    GP, conformal469/512469/512451/512451/5120.004130.00413
    Ensemble, raw heuristic427/512427/512428/512428/5120.010910.01091
    Ensemble, conformal465/512465/512462/512462/5120.013950.01395

    On the uniform test, conformal coverage is 0.91600.9160 for the GP and 0.90820.9082 for the ensemble. The conditional binomial plug-in standard errors are 0.01230.0123 and 0.01280.0128. The raw GP's observed coverage of one does not establish perfect coverage: its exact two-sided 95% binomial interval is approximately [0.9928,1][0.9928,1], whereas the plug-in standard error degenerates to zero. Exact binomial intervals are retained for every row.

    The shifted set has 512512 new inputs uniform in r∈[−4,4]r\in[-4,4], J∈[−0.2,0.2]J\in[-0.2,0.2], using seed SeedSequence([941025,42]). The same calibrated bands are applied without refitting. GP conformal coverage becomes 0.88090.8809, while the ensemble gives 0.90230.9023. Neither value inherits the original exchangeability guarantee. Angelopoulos–Bates, §4.5, distinguishes covariate-shift corrections from unchanged calibration; no weighted correction is implemented here.

    Select new reference calculations without consulting their answers

    Now restrict to the rapid-response slice r=−4r=-4 and learn log⁡χ(J)\log\chi(J). This is a new query-budget experiment. The algorithm receives only its own queried labels, not the previously calculated primary grid or the offline evaluation curve.

    All designs start at J=−0.6J=-0.6, −0.3-0.3, 00, 0.30.3 and 0.60.6, and receive 3333 oracle calls total, including those five. The selectable candidate set has 12011201 equally spaced sources. After each acquisition, fit a one-output Matérn 5/25/2 model to log⁡χ/3\log\chi/3, with nugget 10−810^{-8} and length chosen by training-only leave-one-out error from

    ℓ∈{0.05,0.1,0.2,0.4,0.8,1.6}.\ell\in\{0.05,0.1,0.2,0.4,0.8,1.6\}.

    Lengths refer to x=J/0.6x=J/0.6. Three designs are compared:

    1. A nested nearly uniform grid at counts 55, 99, 1717 and 3333.
    2. Maximum current latent variance s2(x)s^2(x) among unqueried candidates.
    3. Curvature-weighted variance
    a(x)=s2(x)[1+4c(x)],c(x)=∣μ′′(x)∣max⁡(1,max⁡x′ candidate∣μ′′(x′)∣).a(x)=s^2(x)[1+4c(x)],\qquad c(x)=\frac{|\mu''(x)|}{\max(1,\max_{x'\text{ candidate}}|\mu''(x')|)}.

    The curvature in this formula is the derivative of the posterior mean of the scaled target log⁡χ/3\log\chi/3 with respect to scaled xx. Its units and normalization are part of the heuristic. For a single Matérn factor, with a0=5/ℓa_0=\sqrt5/\ell and t=a0∣x−xi∣t=a_0|x-x_i|,

    d2dx2[(1+t+t2/3)e−t]=−a023(1+t−t2)e−t.\frac{d^2}{dx^2}\left[(1+t+t^2/3)e^{-t}\right] =-\frac{a_0^2}{3}(1+t-t^2)e^{-t}.

    Multiplying these derivatives by the fitted kernel coefficients gives μ′′\mu''. A finite-difference control checks the formula. It uses no unqueried target curvature.

    Exact score ties choose the lower source; length ties choose the larger length. The grid uses nearest candidate indices, with half-index ties toward lower JJ. An exactly equally spaced 33-point grid would have some half-indices on the 1201-point candidate set, so this rounding is explicit. It preserves nesting, gives 33 unique queries, and moves a point by at most 0.00050.0005. All queried points remain disjoint from the 12001200 midpoint test sources.

    These acquisition rules are simpler than integrated optimal design. Cohn, Ghahramani and Jordan, §§1–2.1, pp. 130–132 (PDF), derive a bias–variance decomposition and an integrated variance criterion under stated modeling assumptions. Their optimality claim is not a property of the two heuristics above. In particular, reducing assumed variance does not remove systematic predictor bias.

    Equal-budget outcomes and their limits

    The offline 12001200-point reference grid supplies evaluation only. At 33 queries the whole-interval errors are:

    DesignRMSE in log⁡χ\log\chiRMSE in χ\chiMaximum error in log⁡χ\log\chi
    Nested nearly uniform grid2.06×10−52.06\times10^{-5}6.69×10−66.69\times10^{-6}1.13×10−41.13\times10^{-4}
    Maximum variance6.94×10−66.94\times10^{-6}2.71×10−62.71\times10^{-6}4.32×10−54.32\times10^{-5}
    Curvature-weighted variance5.04×10−65.04\times10^{-6}2.02×10−62.02\times10^{-6}3.53×10−53.53\times10^{-5}

    All three policies select ℓ=1.6\ell=1.6 at every retained checkpoint in this particular run. At 33 calls the adaptive rules improve whole-interval error, but there is no pointwise dominance. In the central region ∣J∣<0.15|J|<0.15, the nine-point grid has log-error RMSE 4.33×10−44.33\times10^{-4}, slightly below maximum variance's 4.37×10−44.37\times10^{-4}. At 17 points the same ordering persists: 7.20×10−67.20\times10^{-6} versus 7.25×10−67.25\times10^{-6}. Those losses remain in the record.

    Actual sequential query positions and log susceptibility errors for equal-budget grid, variance and curvature-weighted variance designs.

    The query positions and errors are outputs of three deterministic policies. Each uses 3333 reference calls including the same five initial points; offline test labels do not enter acquisition. Error curves use the retained checkpoints, and the displayed query positions are the actual selected sources.

    Mean assumed log-susceptibility SD at the final checkpoint is about 4.1×10−44.1\times10^{-4} to 4.3×10−44.3\times10^{-4}, much larger than the corresponding observed RMS errors. Even after successful point selection, the numerical GP variance is not an empirically exact error bar.

    At a fixed kernel, adding an observation subtracts a positive-semidefinite covariance term, as derived in the baseline exercise. If length scales are reselected, that monotonicity is not a theorem about the new model. Here the length remains unchanged, but the distinction matters for applying the algorithm elsewhere.

    The three designs are deterministic, not three independent Monte Carlo replicas. Across them the charged training budget is 9999 calls, even where a cached reference value can be reused after a query has been selected. There are 5555 additional unique reference evaluations beyond the original shared archive; all pass the same order-192192 to order-256256 gate. The companion active_observables.py --run reproduces the calibration and query decisions. Its default mode reads saved results without new queries or fits.

    Summary

    A model's internal spread must be interpreted under its assumptions and tested against independent labels. Split conformal calibration gives a precise marginal rank statement, not pointwise or automatic shift coverage. Sequential querying can improve a fixed-budget approximation, but a variance-based score need not track bias or outperform a grid in every region.

    Exercises

    1. Prove the finite-rank coverage statement

    Assume the estimator and positive scale are fixed independently of nn exchangeable calibration examples and one future example. For continuous scores, take q=S(k)q=S_{(k)} from the calibration set. Derive the coverage probability for k=⌈(n+1)(1−α)⌉≤nk=\lceil(n+1)(1-\alpha)\rceil\leq n, and explain the effect of ties.

    Solution

    By exchangeability and continuity, the future score's rank among all n+1n+1 scores is uniform on 1,…,n+11,\ldots,n+1. It is at most the calibration kkth score exactly when its full-sample rank is at most kk. Hence

    Pr⁡{Snew≤S(k)}=kn+1≥1−α.\Pr\{S_{\rm new}\leq S_{(k)}\}=\frac{k}{n+1}\geq1-\alpha.

    For n=128n=128, α=0.1\alpha=0.1, this is 117/129117/129. With ties, accepting equality gives a conservative lower bound rather than the continuous-score equality. If the requested rank exceeds nn, an infinite band is needed for the corresponding universal construction.

    The probability includes calibration randomness. Conditioning on a particular realized calibration set can give a different future coverage. Conditioning on the physical input xx changes the rank argument if the score distribution varies with the input. The fixed-estimator assumption is why training and calibration cannot be casually reused in this proof.

    2. What does decreasing posterior variance fail to prove?

    Give a counterexample to the claim that small GP variance guarantees small bias. Then explain, with an explicit squared-exponential example, how a refitted length can increase variance despite an additional observation.

    Solution

    Take zero observed values and a smooth true function that vanishes at all observed points but has a nonzero bump between them. A zero-mean GP predicts zero there. Increasing the bump's amplitude increases its error without changing any training data or the kernel posterior variance. A variance bound becomes an error statement only with additional assumptions about the function or probability law.

    For the second claim, use a unit-amplitude squared-exponential kernel and noiseless observation at x=0x=0. At test point x=1x=1, length ℓ=10\ell=10 gives

    s2(1)=1−e−1/100≃0.00995.s^2(1)=1-e^{-1/100}\simeq0.00995.

    Add an observation at x=−1x=-1 but change the fitted length to ℓ=0.1\ell=0.1. Correlations from x=1x=1 to the two observed points are e−50e^{-50} and e−200e^{-200}; their mutual correlation is e−50e^{-50}. The new variance is therefore nearly one, much larger than before. This compares two different priors. Holding the original length fixed would instead give the usual nonnegative variance reduction.

    References

    • A. N. Angelopoulos and S. Bates, A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification, arXiv:2107.07511v6 (2022), §1.1/Theorem 1, §2.3/Eqs. (9)–(11), and §4.5.
    • D. A. Cohn, Z. Ghahramani and M. I. Jordan, “Active Learning with Statistical Models,” Journal of Artificial Intelligence Research 4 (1996), 129–145, §§1–2.1 (author-hosted PDF).
    • C. E. Rasmussen and C. K. I. Williams, Gaussian Processes for Machine Learning (MIT Press, 2006), chapter 2 (PDF), conditional Gaussian prediction, and chapter 5 (PDF), fixed-model leave-one-out formulas.

    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.