Inference-Aware Training with Run-by-Run Random Nuisance Parameters

Precision experiments rarely suffer one systematic shift that applies to all their data. A detector's energy scale drifts a little from one run period to the next, and its response differs from one module to another. In practice, analysts handle this in one of two crude ways. They can treat the shift as a single global nuisance parameter, which assumes every run is miscalibrated identically. Or they can give each run its own nuisance parameter with a hand-chosen prior width, which ignores that the runs share a common spread. Linear mixed-effects models, the statistician's standard tool for grouped data, offer a middle path. Each run gets its own shift, but all shifts are drawn from a shared distribution whose width is learned from the data, so that runs with few events borrow strength from the rest. This is called partial pooling.

This proposal puts that mixed-effects structure inside the training loss of an inference-aware neural network. Such a network learns its summary features by directly minimizing the expected uncertainty on the physics parameter, rather than by maximizing classification accuracy. The claim is that when systematics vary across groups, the features a network should learn are different from those that are optimal under a single global shift. The size of the difference is predictable. It is governed by how the between-run spread of the systematic compares with the per-run statistical error. That ratio is exactly the quantity that decides whether a measurement is statistics-limited or systematics-limited.

Core Claim and Mechanism

The method this builds on is INFERNO, as applied in Application of Inferno to a Top Pair Cross Section Measurement with CMS Open Data. That work makes the analysis histogram differentiable using soft binning. It trains the network to minimize the expected variance of the signal strength $\mu$, read off from the inverse Fisher information (the curvature of the expected likelihood). It propagates the jet energy scale systematic by interpolating between its ±1σ shape variations. This reduced the uncertainty on $\mu$ from 10–11% to 9%, and the correlation with the jet energy scale from −0.42 to −0.10. The jet energy scale, however, is one global scalar. The file notes this explicitly as a gap: there is no hierarchical or run-dependent structure.

We replace the global nuisance with group-level shifts $\alpha_g$, one for each of $G$ run periods. These are tied by a Gaussian hyperprior with mean $\bar\alpha$ and width $\tau$. The expected penalized log-likelihood is

$$ \ell(\mu,\bar\alpha,\alpha_{1..G}) = \sum_{g=1}^{G}\sum_{b}\Big[n_{gb}\log\nu_{gb}(\mu,\alpha_g)-\nu_{gb}(\mu,\alpha_g)\Big] - \sum_{g}\frac{(\alpha_g-\bar\alpha)^2}{2\tau^2} - \frac{\bar\alpha^2}{2}. $$

Here $n_{gb}$ and $\nu_{gb}$ are the observed and expected counts in soft bin $b$ of group $g$. The training loss is $[H^{-1}]_{\mu\mu}$, where $H$ is the negative expected Hessian of $\ell$. This is a Laplace-style stand-in for marginalizing the random effects.

The Hessian has an arrowhead shape: $\mu$ and $\bar\alpha$ couple to everything, while each $\alpha_g$ couples only to its own group. A Schur complement therefore gives the loss and its gradient in time linear in $G$. This borrows the block-structure trick that Hamiltonian Monte Carlo Inference of Marginalized Linear Mixed-Effects Models uses, via the Woodbury identity, to marginalize Gaussian random effects in linear time. That paper's exact result holds only for Gaussian observations. Our bins are Poisson, so we accept the Laplace approximation and test its adequacy directly.

The mechanism gives a concrete, falsifiable prediction. A network trained on the global loss is rewarded for features whose response to the shift is common across the whole dataset. The hierarchical loss instead rewards features that let each run's shift be constrained from that run's own data, and these are only worth having when $\tau$ is comparable to or larger than the per-run statistical resolution. The gap should therefore vanish in both limits. As $\tau\to 0$ the problem reduces to global INFERNO. As $\tau$ becomes large with few events per run, it approaches no pooling. The gap should peak in between.

Research Program

We would build the hierarchical loss as a drop-in change to the existing INFERNO pipeline. We keep its 8-feature τ+jets selection on CMS Open Data at 7 TeV, so that every comparison isolates the change in the nuisance structure.

The CMS 2011 simulation does not come with labelled run-to-run calibration drift. We therefore construct a semi-synthetic benchmark. We split the simulation into $G$ pseudo-run periods, ranging from 4 to 64. We inject per-run jet energy scale shifts drawn from $\mathcal{N}(0,\tau_{\text{true}}^2)$ using the same morphing machinery. We also vary the events per run so that some runs are low-occupancy. This mirrors the low-statistics channels that destabilize multi-parameter fits in rare-decay analyses such as Aubert et al..

The final measurement is a profile fit that also estimates $\tau$ from the data. The systematic width is then measured rather than set by hand. During training, $\tau$ is held at a nominal value. We study what happens when that nominal value is wrong, by factors of 0.5 to 2, because a loss tuned to the wrong spread is the most likely way this method fails in practice.

A second testbed checks that the idea is not specific to collider physics. The sbi_lens weak-lensing simulator from Simulation-Based Inference Benchmark for Weak Lensing Cosmology produces LSST Year 10–like maps in 5 redshift bins. We divide each map into sky patches and give each patch its own multiplicative shear-calibration random effect. We then replace that paper's compression network, trained by variational mutual-information maximization, with one trained on the hierarchical Fisher loss.

The weak-lensing paper reports that conditioning on noisy simulator gradients did not help. This constrains our design: we use only expected-count derivatives with respect to the nuisance parameters, never per-realization latent gradients.

Relation to Prior Work

Two lines of work put grouped structure into neural models, but neither does so for measurement. Mixed-effects transformers for hierarchical adaptation pools context-specific prefix parameters of a language model toward a shared prior and gains most with 10–100 samples per group. Natural Language Inference with Mixed Effects adds annotator intercepts and slopes on top of a frozen encoder. That second paper finds the slopes add little, which the authors attribute to the frozen features.

Both papers optimize predictive likelihood, and neither touches a parameter-of-interest variance. Our setting tests a version of their open question. A per-run shift that reshapes the feature distribution is effectively a group-specific slope. Here the encoder is trained end to end against the pooled likelihood, so if group-specific structure is learnable anywhere, it should be learnable in this setup.

Doubly Mixed-Effects Gaussian Process Regression shows that building the variance split into the model structure makes the components identifiable. Benchmarking Uncertainty Disentanglement: Specialized Uncertainties for Specialized Tasks finds that post-hoc aleatoric/epistemic decompositions are rank-correlated at ≥0.78 on ImageNet. Together these motivate our choice to separate statistical from systematic error through the likelihood's grouping structure, not through a decomposition formula.

Multilevel neural simulation-based inference treats simulator bias as fixed differences between discrete fidelity levels. We instead treat calibration bias as a random draw for each run. Solving Simulation Systematics in and with AI/ML warns that networks trained on simulation absorb unmodeled detector artifacts. This is part of why we keep the systematic in an explicit, parametric likelihood rather than learning a free-form correction from simulation to data.

Baselines

The naive reference point is a cross-entropy classifier whose output is histogrammed and profiled with one global jet energy scale nuisance. On the original single-shift setup, the INFERNO paper reports a 10–11% uncertainty on $\mu$ for this baseline. We rerun it on the grouped benchmark. It is the procedure most analyses would actually use.

The strongest existing method is global INFERNO. The cited paper reports a 9% uncertainty on $\mu$, a jet energy scale uncertainty of 0.602, and a μ–JES correlation of −0.10 on Asimov data. Asimov data is the idealized dataset in which each bin contains exactly its expected count. We first reproduce those numbers in the $G=1$ case to validate our code. We then train global INFERNO on the grouped data with its single nuisance width set conservatively, at the RMS of the total shift.

The fairness protocol is the same for every method. All methods share the same simulation samples, network architecture, soft-binning temperature, number of bins, and a fixed budget of hyperparameter trials. All final intervals come from the same profile-likelihood code.

The key ablation is global INFERNO followed by a hierarchical final fit. This uses the same network as global INFERNO but profiles per-run shifts with the shared, data-estimated width only at inference time. It isolates whether the gain comes from training features under the hierarchical loss or merely from fitting the hierarchical model. We also include no-pooling and complete-pooling versions of the hierarchical loss itself.

Beating the baselines means two things across pseudo-experiments drawn at the true spread. First, the method must achieve a smaller median 68% interval on $\mu$ than every baseline. Second, its frequentist coverage must stay within two percentage points of nominal. The coverage condition matters: a global nuisance that is too narrow can look precise while undercovering, and we count that as a loss, not a win.

Why not just…?

Why not just give each run its own independent nuisance parameter with a fixed prior, as analyses already do? This is the no-pooling baseline, and it is a genuine competitor when runs are well populated. Its weaknesses are that the prior width is set by hand and that low-occupancy runs gain nothing from the others. The mixed-effects transformer results show that no pooling degrades sharply with 10–100 samples per group. Our sweep over events per run will show where, if anywhere, partial pooling beats this baseline in collider statistics. If it never does at realistic occupancies, we will report that.

Why not just widen the single global nuisance to cover the run-to-run spread? A widened global shift still assumes all runs move together. It therefore cannot use the internal consistency between runs, and it either over-penalizes features or misstates coverage. Whether the cost is small or large depends on $\tau$. The coverage-versus-width curves against the true $\tau$ settle this directly.

Why not just train ordinary INFERNO and put the hierarchy only in the final fit? This is the most serious threat. It is plausible that the network's features barely change and that all the gain comes from the fit. The ablation described above tests exactly this. If it matches the full method across $\tau$ and $G$, the contribution reduces to a fitting recommendation and we will say so. We expect a training-time gain only in the intermediate-$\tau$ regime predicted above.

Why not just run full Bayesian sampling with a non-centered parameterization? That is a choice of final inference engine, not of what the network learns, so it is complementary to this proposal. The marginalized-HMC paper also reports that non-centered forms can leave divergent transitions where marginalization removes them. We will therefore use marginalized sampling as a cross-check on the profile intervals.

Decisive Checks

We will run four checks, in this order.

The first check is whether the gain over global INFERNO, plotted against $\tau_{\text{true}}$ divided by the per-run statistical resolution, rises and then falls as the mechanism predicts. A flat or monotone curve would falsify the explanation even if some gain appears.

The second check is whether the hierarchical loss beats the hierarchy-only-at-fit ablation in the intermediate regime.

The third check is whether coverage holds when the training-time $\tau$ is wrong by a factor of two. We will also check whether the Laplace approximation's coverage error grows in runs with few events. If it does, that would point to the non-Gaussian extension the marginalized-HMC paper leaves open.

The fourth check is whether the same pattern appears on the weak-lensing patch benchmark, where no reported result exists yet for patch-level calibration effects. That would indicate the result reflects grouped systematics in general rather than a quirk of one collider analysis.