Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Learned Spectral Reconstruction

    A network can return two sharp peaks because every spectrum it is allowed to return has two sharp peaks. That may be useful when the family is justified, but the picture alone does not establish that the observations resolve those features. We need held-out errors, conventional estimators using the same observations, and tests outside the training assumptions.

    This article trains an actual small neural network on the chapter's continuous positive spectra. It predicts two parameters, from which a positive normalized spectrum is constructed. We compare its six smeared observables with direct linear smearing, a frozen regularization rule and a matched-family Bayesian calculation. Three fixed training starts, all stopping failures and several distribution shifts remain part of the result.

    Preparation. Ill-conditioned inversion, fixed spectral targets, and the distinction between a posterior mean and a plug-in prediction. The automatic-differentiation page explains reverse accumulation; here the finite network's vectorized derivative is written explicitly and checked.

    The training family is part of the estimator

    The benchmark has

    s(E;d,w)=wpb(E;2−d/2)+(1−w)pb(E;2+d/2),pb(E;μ)=(1−∣E−μ∣/b)+b,(1)s(E;d,w)=w p_b(E;2-d/2)+(1-w)p_b(E;2+d/2), \qquad p_b(E;\mu)=\frac{(1-|E-\mu|/b)_+}{b}, \tag{1}

    with b=0.2b=0.2, d∈[0.4,1.6]d\in[0.4,1.6], w∈[0.2,0.8]w\in[0.2,0.8]. Each density is continuous, nonnegative, normalized and supported in [0,4][0,4]. The reconstruction uses all four properties as prior information.

    Training parameters are drawn independently from the uniform distribution on that rectangle. At the sixteen fixed times ti=0.15it_i=0.15i, the exact continuous Laplace transform is

    Ci(d,w)=sinhc⁡2(0.1ti)[we−(2−d/2)ti+(1−w)e−(2+d/2)ti].(2)C_i(d,w)=\operatorname{sinhc}^2(0.1t_i) \left[we^{-(2-d/2)t_i}+(1-w)e^{-(2+d/2)t_i}\right]. \tag{2}

    Observations satisfy y∣d,w∼N(C(d,w),Σ)y\mid d,w\sim\mathcal N(C(d,w),\Sigma), where the known covariance is

    Σij=δ2Cref,iCref,j(12e−∣i−j∣/2+12δij),δ=0.01.(3)\Sigma_{ij}=\delta^2C_{{\rm ref},i}C_{{\rm ref},j} \left(\tfrac12e^{-|i-j|/2}+\tfrac12\delta_{ij}\right), \qquad \delta=0.01. \tag{3}

    The reference curve is fixed at (d,w)=(1.2,0.6)(d,w)=(1.2,0.6), independent of fitted parameters. Gaussian observations are not clipped if an entry becomes negative. The generator does not discretize a spectrum onto the reconstruction bins used by the conventional baseline.

    Separate arrays contain 8,192 training, 2,048 validation, 1,024 calibration and 2,048 nominal test observations. Parameter and noise streams are independent, and the same saved test arrays feed every method. Validation reports generalization; it does not select a new architecture, seed or regularization strength after the final test. The calibration array is reserved for interval construction.

    The distinction between a network predicting parameters and one predicting a whole discretized function is developed in Kades et al., §III.1. Their spectral family and networks differ from this compact Laplace example. We implement the stated model rather than claiming to reproduce their numerical study.

    An actual 306-parameter network

    Write Σ=LLT\Sigma=LL^T. First whiten each observation, then standardize each whitened coordinate using only training means mim_i and standard deviations aia_i:

    xi=(L−1y)i−miai.(4)x_i=\frac{(L^{-1}y)_i-m_i}{a_i}. \tag{4}

    No test mean or test variance enters this transformation. The frozen map is also used on shifted observations. A changed covariance does not silently retrain the input normalization.

    The network is

    h=tanh⁡(W1x+b1),u=sigmoid⁡(W2h+b2),d^=0.4+1.2u1,w^=0.2+0.6u2.(5)h=\tanh(W_1x+b_1),\qquad u=\operatorname{sigmoid}(W_2h+b_2), \qquad \widehat d=0.4+1.2u_1, \quad \widehat w=0.2+0.6u_2. \tag{5}

    There are sixteen hidden units: 16×16+16+2×16+2=30616\times16+16+2\times16+2=306 trainable entries. Substitution of (d^,w^)(\widehat d,\widehat w) into (1) guarantees positivity and normalization. It also guarantees two triangles of width 0.2. No likelihood comparison is needed for the network to draw that width; it is built into its output.

    The targets for training are the linearly scaled parameters utrueu_{\rm true}. With all trainable entries collected into θ\theta, minimize

    L(θ)=12Ntrain∑r=1Ntrain∑a=12[ua(xr;θ)−utrue,ra]2+10−6306∑k=1306θk2.(6)\mathcal L(\theta)=\frac{1}{2N_{\rm train}} \sum_{r=1}^{N_{\rm train}}\sum_{a=1}^{2} [u_a(x_r;\theta)-u_{{\rm true},ra}]^2 +\frac{10^{-6}}{306}\sum_{k=1}^{306}\theta_k^2. \tag{6}

    The small quadratic penalty includes biases. For one training batch, the output adjoint is the scaled error multiplied by u(1−u)u(1-u); multiplication by W2TW_2^T and 1−h21-h^2 propagates it through the hidden layer. The companion implements these matrix operations directly, including all shared contributions, and compares the directional derivative with centered finite differences on a fixed sixteen-observation batch.

    The three starts use Glorot-uniform weight matrices and zero biases with separate fixed seeds. Full-batch L-BFGS-B has maxiter=500, maxfun=1500, gradient target 10−710^{-7} and relative objective tolerance 10−1210^{-12}. A hard objective wrapper prevents exceeding the evaluation budget. No extra steps are added because a fit stops inconveniently.

    StartObjective/gradient evaluationsFinal training objectiveValidation MSEGradient infinity normStop
    05288.012×10−48.012\times10^{-4}8.020×10−48.020\times10^{-4}3.48×10−53.48\times10^{-5}500 iterations
    15337.940×10−47.940\times10^{-4}7.962×10−47.962\times10^{-4}3.76×10−53.76\times10^{-5}500 iterations
    25307.973×10−47.973\times10^{-4}8.063×10−48.063\times10^{-4}1.57×10−51.57\times10^{-5}500 iterations

    All three miss the requested gradient target. The held-out tests below use the predictions at those stopping points.

    Compare the same observables, not different definitions of success

    For the six normalized Gaussian windows ΔE∗,σ\Delta_{E_*,\sigma} from the smearing page, define

    Sa(d,w)=∫04dE Δa(E)s(E;d,w),E∗=1.5,2,2.5,σ=0.2,0.5.(7)S_a(d,w)=\int_0^4dE\,\Delta_a(E)s(E;d,w), \qquad E_*=1.5,2,2.5, \quad \sigma=0.2,0.5. \tag{7}

    The target order is width-major. All methods are evaluated against the exact continuous integrals, computed from Gaussian primitives on the two linear halves of each triangle. These are broadened densities with inverse-energy units, not probabilities.

    The network returns the plug-in prediction Sa(d^,w^)S_a(\widehat d,\widehat w). The matched uniform-prior Bayesian comparator returns

    S‾a(y)=E[Sa(d,w)∣y],(8)\overline S_a(y)=\mathbb E[S_a(d,w)\mid y], \tag{8}

    not Sa(E[d∣y],E[w∣y])S_a(\mathbb E[d\mid y],\mathbb E[w\mid y]). Because SaS_a is nonlinear in the parameters, the two expressions differ. Under the matched generating prior, (8) minimizes expected squared error for that particular target. Likewise, an ideal parameter-MSE predictor returns conditional mean parameters; it does not automatically minimize squared error for every nonlinear observable.

    The direct-smearing baseline uses S^a=qaTy\widehat S_a=q_a^Ty, with the fixed α=1\alpha=1 class-bound criterion. It makes the broader assumption of a positive mixture with component widths at least 0.2, rather than exactly the two-triangle family. Its larger error can therefore reflect weaker prior information, not a defective implementation. The regularized baseline uses the same frozen GCV rule as the preceding chapter article, with an 80-bin density and no positivity clipping. Its selected regularization can fail badly for spectral targets even when its predicted correlator is close to the observations.

    Parameter errors are reported only when the truth actually belongs to the trained family. For other spectra, we compare the same six SaS_a and the decoded spectrum's forward prediction. The whitened true-forward error uses the actual known time points and covariance to score the returned spectrum. A separate data residual keeps the frozen decoder's nominal times but weights the difference from the observations with the actual covariance, known to this controlled benchmark. This diagnostic weighting does not inform the network or change its predictions; only the conventional baselines receive actual metadata in the informed comparisons. The two residuals are not interchanged to conceal a metadata error.

    For a concrete comparison, take the broad target (E∗,σ)=(2.5,0.5)(E_*,\sigma)=(2.5,0.5). The following errors use all 2,048 nominal tests and exactly the same continuous target for every method. The quoted standard error estimates the finite-test uncertainty in RMSE by the delta method; it does not include training randomness, quadrature bias or model misspecification.

    EstimatorRMSERMSE standard errorMedian absolute error
    Network, start 00.007140.000150.00407
    Uniform-family posterior mean0.006390.000140.00327
    Direct smearing, fixed α=1\alpha=10.17200.00270.1187
    Tikhonov with frozen GCV20052010.1011

    The GCV median and RMSE tell very different stories. Most errors are modest compared with the large RMSE, but occasional severe underregularization produces enormous spectral-target errors. The rule was frozen before these tests; no outlier is removed and no replacement regularization parameter is selected using the truth. This is a failure of this particular prediction-oriented selection rule for this target, not a comparison against optimally tuned regularization. The posterior and network use much stronger family information than the linear estimators.

    The Bayesian implementation analytically integrates the weight at fixed separation and then quadratures the separation, as derived in the Bayesian article. All 5,120 nominal, shifted and metadata-control cases use 1,024 nodes, compared with 512 nodes. The first sixteen cases in each of the seven groups also have a predetermined 2,048-node check. No precision increase is triggered by an inconvenient result. One broadened-peak observation misses the mean-refinement tolerance 10−6max⁡(1,∣S‾a∣)10^{-6}\max(1,|\overline S_a|), with maximum target change 6.27×10−66.27\times10^{-6}; it remains in the summaries. All returned means are finite. Numerical integration error is thus checked separately from the finite-test errors in the table, without claiming uniform convergence of every output.

    Calibrating an interval is a different operation from training

    Three initialization seeds do not define a posterior distribution. Instead, for each frozen fit and each target separately, use the 1,024 independent calibration residuals

    rj=∣Sa,j−S^a(yj)∣.(9)r_j=|S_{a,j}-\widehat S_a(y_j)|. \tag{9}

    Let r(974)r_{(974)} be their 974th smallest value, since

    ⌈(1024+1) 0.95⌉=974.(10)\left\lceil(1024+1)\,0.95\right\rceil=974. \tag{10}

    The reported interval is S^a(y)±r(974)\widehat S_a(y)\pm r_{(974)}. Conditional on a fixed trained map, exchangeability of the calibration pairs and a new nominal pair gives marginal coverage at least 95%. The rank argument and split construction are given in Lei et al., §2, Eq. (2), and §2.2, Algorithm 2 and Theorem 2 (PDF).

    There are three limits to this statement. The probability averages over the calibration sample as well as a new target and noise; it is not a guarantee conditional on every realized calibration threshold. It is marginal over the generating parameter distribution, not a guarantee for each fixed spectrum. Finally, six separately calibrated intervals do not constitute a simultaneous 95% six-target band. Nonrandomized ties make the rank inequality conservative, and distribution shift can invalidate exchangeability altogether.

    For start zero, the full nominal test coverages run from 0.935 to 0.951 across the six targets. The 2,048 test observations estimate the coverage of this realized calibration rule; finite-test fluctuations and calibration randomness must not be confused. Bayesian interval comparisons use the same fixed first 512 nominal tests and first 128 observations of each shifted group, while the larger network-only coverage summary remains separately labeled.

    Posterior quantiles are harder to integrate than means here. Among those 1,280 observations, 130 have at least one endpoint whose 512-to-1,024-node change exceeds 10−4max⁡(1,∣endpoint∣)10^{-4}\max(1,|\text{endpoint}|). The nominal group's largest change is 0.00151. Even the predetermined fine controls retain changes as large as 0.000457 in the third-peak group and 0.000258 with misspecified times. All these intervals remain in the coverage counts below, so those counts describe the fixed numerical procedure, including its unresolved quantile error. They are not certified evaluations of the exact posterior's coverage. The stored results retain the endpoint changes, failure flags and finite-count Wilson intervals instead of treating an observed zero or complete coverage as certainty.

    Four changes that were absent from training

    Each shift has 512 newly generated observations with fixed, separate streams. No network is retrained.

    1. Broader peaks. The two triangular widths become 0.4. Centers and latent weights are still generated from the same ranges, but this truth is outside the network's fixed-width output family.
    2. A third peak. The spectrum is 0.85s(E;d,w)+0.15p0.3(E;3.5)0.85s(E;d,w)+0.15p_{0.3}(E;3.5). There is no true two-parameter label for the full spectrum that the network returns.
    3. Changed sampling times. Actual times are 1.05ti1.05t_i, while the network keeps its nominal input interpretation. The actual covariance remains the original nominal-reference Σ(0.01)\Sigma(0.01); noise is not recomputed from the changed mean. Conventional methods are run with both actual and deliberately misspecified nominal times.
    4. Larger noise. Actual covariance is Σ(0.03)\Sigma(0.03). Conventional methods receive either this actual covariance or the explicitly misspecified nominal one. The network and its calibration thresholds remain frozen at the training configuration.

    The time shift is a calibration error, not a finite-temperature kernel. An actual thermal correlator would require a specified thermal spectral representation, including its normalization and Bose or Fermi factors. The noise shift changes the observation law, not the underlying spectrum.

    For the broad target centered at 2.5, start zero has nominal RMSE 0.00714. The third-peak shift raises it to 0.1331, and none of the 512 shifted truths lie inside its nominally calibrated interval. A zero count is evidence of a severe failure in this sample, not proof that the population coverage is exactly zero. All three starts show the same qualitative problem, and all their values are retained.

    Broader peaks are a subtler test. At target (E∗,σ)=(2,0.5)(E_*,\sigma)=(2,0.5), start zero's nominal RMSE is 0.01467 and its shifted RMSE is 0.02829; coverage drops from 0.935 to 0.580. The spectrum still looks like two plausible peaks, because the output layer always imposes that form. Shape appearance is therefore a poor substitute for target errors.

    Known time or covariance changes can be supplied to the conventional estimator without changing its data. The frozen network has no time or covariance input, so its predictions are identical in the paired “nominal metadata” and “informed conventional baseline” comparisons. That is a property of this estimator, not an impossibility theorem for networks that explicitly condition on such information.

    The same broad target centered at 2.5 makes these comparisons explicit. RMSE uses every observation in each group. Interval hits use the matched subsets: 512 nominal observations and 128 in every other row. “Posterior” means the uniform two-triangle family, even when that family is false.

    Observation and assumed metadataNetwork RMSEPosterior RMSENetwork interval hitsPosterior interval hits
    Nominal0.007140.00639478/512491/512
    Broader peaks0.008740.00800117/12898/128
    Third peak0.13310.13360/1280/128
    Changed times, nominal metadata0.057560.058673/1280/128
    Changed times, actual metadata0.057560.007353/128118/128
    Larger noise, nominal metadata0.017270.0167688/12863/128
    Larger noise, actual metadata0.017270.0157088/128124/128

    Supplying the correct times largely repairs the posterior target error in this example; supplying the correct covariance especially changes its interval width and coverage. Neither correction repairs an incorrect spectral family. For the third peak, the network and posterior both miss every truth in the matched interval subset for this target. The broader direct-smearing class still includes all three peaks, although its protected intervals are substantially wider. Their coverage claim also requires the actual kernel and covariance, so it must not be carried over to the deliberately misspecified metadata rows.

    Nominal target errors for four estimators, and matched-subset interval coverage under spectral and observation shifts. The frozen GCV rule has large tail errors; family and metadata changes reduce nominally calibrated coverage.

    The upper panel compares the same six continuous target integrals on all 2,048 nominal tests; its logarithmic scale retains the GCV failures. The lower panel uses the broad target (2.5,0.5)(2.5,0.5) and matched interval subsets, with 95% Wilson intervals for finite-test counts. Network start zero is shown; all three starts are retained. Posterior quantile-refinement failures are included, as described above. The class-bound smearing intervals require correct kernel and covariance assumptions; open markers identify the two deliberately misspecified cases where that guarantee does not apply.

    The companion retains every trained model, split definition, target prediction and numerical comparison. Independent streams generate the training, validation, calibration, nominal-test and shifted observations once; cached predictions and posterior quadratures are then shared across summaries. The study is a controlled positive Laplace benchmark, not a trained reconstruction of a QCD spectral function or evidence that finite Euclidean data determine a unique sharp spectrum.

    Summary

    A learned reconstruction is a map together with a training family, observation model and loss. In this example, the imposed positive two-peak structure makes nominal target prediction accurate, while broader shapes, an extra peak and calibration shifts expose its limits. A matched-prior posterior mean is a meaningful squared-loss baseline, and a direct smeared estimator provides a comparison with weaker structural assumptions. Calibration supplies a stated marginal guarantee under exchangeability; it does not establish physical resolution or protect against arbitrary shifts.

    Exercises

    1. Which mean does squared loss learn?

    For a scalar target ZZ and observation YY, minimize E[(f(Y)−Z)2]\mathbb E[(f(Y)-Z)^2] over measurable predictors. Then explain why applying a nonlinear function gg to a conditional-mean parameter need not give the squared-loss optimum for g(Z)g(Z).

    Solution

    Conditioning on Y=yY=y gives

    E[(f(y)−Z)2∣y]=[f(y)−E(Z∣y)]2+Var⁡(Z∣y).\mathbb E[(f(y)-Z)^2\mid y] =[f(y)-\mathbb E(Z\mid y)]^2+\operatorname{Var}(Z\mid y).

    The second term is independent of ff, so f∗(y)=E(Z∣y)f_*(y)=\mathbb E(Z\mid y). For the transformed target the same argument instead gives E[g(Z)∣y]\mathbb E[g(Z)\mid y].

    For example, take g(Z)=Z2g(Z)=Z^2. Then

    E[Z2∣y]=[E(Z∣y)]2+Var⁡(Z∣y).\mathbb E[Z^2\mid y] =[\mathbb E(Z\mid y)]^2+\operatorname{Var}(Z\mid y).

    The plug-in square omits the posterior variance. In the spectral example, Sa(d,w)S_a(d,w) is affine in ww at fixed dd but nonlinear in dd. A Bayesian target calculation must integrate the actual SaS_a, and a parameter network's plug-in target should be evaluated on its own merits. Finite architectures, penalties and incomplete optimization further separate the trained map from the unrestricted ideal predictor.

    2. A narrow output family and a rank guarantee

    Suppose a learned estimator always outputs a density in a fixed two-peak family, while a true positive spectrum outside that family has the same finite Euclidean data. Can a small data residual distinguish them? Derive the split-calibration coverage bound for one scalar target with nn calibration scores and explain why it does not resolve this ambiguity after a distribution shift.

    Solution

    The positive-null construction provides distinct positive spectra with identical specified moments. A method restricted to one family can return only its permitted member, regardless of the alternative truth. Equal data imply equal residuals; a small residual cannot certify which underlying density generated them. A particular smeared target may nevertheless agree across both densities, which is why target-specific comparisons are useful.

    Freeze the fitted prediction rule, and let R1,…,Rn,Rn+1R_1,\ldots,R_n,R_{n+1} be exchangeable absolute residuals. With no ties, the rank of Rn+1R_{n+1} is uniform among 1,…,n+11,\ldots,n+1. For k=⌈(n+1)(1−α)⌉≤nk=\lceil(n+1)(1-\alpha)\rceil\leq n,

    Pr⁡{Rn+1≤R(k)}=kn+1≥1−α,\Pr\{R_{n+1}\leq R_{(k)}\}=\frac{k}{n+1}\geq1-\alpha,

    where R(k)R_{(k)} is taken from the calibration sample. With ties, using a closed interval gives the conservative inequality. If k=n+1k=n+1, a universally valid construction uses an infinite threshold.

    This probability includes the calibration and new pair. It does not promise the same coverage for a fixed realized threshold, every input value, or all six targets simultaneously. An out-of-family spectral distribution, changed times or changed noise need not produce exchangeable new residuals with the nominal calibration residuals. The rank proof then supplies no shifted coverage guarantee and does not choose between the indistinguishable spectra.

    References

    • L. Kades, J. M. Pawlowski, A. Rothkopf, M. Scherzer, J. M. Urban, S. J. Wetzel, N. Wink and F. P. G. Ziegler, “Spectral Reconstruction with Deep Neural Networks,” Physical Review D 102, 096001 (2020), arXiv:1905.04305v2. See §III.1 for output representations, §III.2 for training and loss, and Appendices B–C for matched priors and training distributions. This article uses a different, fully specified finite benchmark.
    • J. Lei, M. G'Sell, A. Rinaldo, R. J. Tibshirani and L. Wasserman, “Distribution-Free Predictive Inference for Regression,” Journal of the American Statistical Association 113, 1094–1111 (2018), author PDF. See §2, Eq. (2); §2.2, Algorithm 2 and Theorem 2; and Remark 7 for unequal splits.

    Further reading

    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.