## Calibrating Bayesian Generative Machine Learning for Bayesiamplification

## S. Bieringer 𝑎 S. Diefenbacher 𝑏 G. Kasieczka 𝑎 M. Trabs 𝑐

- 𝑎 Institut für Experimentalphysik, Universität Hamburg, Luruper Chaussee 149, 22761 Hamburg, Germany
- 𝑏 Physics Division, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA
- 𝑐 Department of Mathematics, Karlsruhe Institute of Technology, Englerstr. 2, 76131 Karlsruhe, Germany

E-mail:

sebastian.guido.bieringer@uni-hamburg.de

Abstract: Recently, combinations of generative and Bayesian deep learning have been introduced in particle physics for both fast detector simulation and inference tasks. These neural networks aim to quantify the uncertainty on the generated distribution originating from limited training statistics. The interpretation of a distribution-wide uncertainty however remains ill-defined. We show a clear scheme for quantifying the calibration of Bayesian generative machine learning models. For a Continuous Normalizing Flow applied to a low-dimensional toy example, we evaluate the calibration of Bayesian uncertainties from either a mean-field Gaussian weight posterior, or Monte Carlo sampling network weights, to gauge their behaviour on unsteady distribution edges. Well calibrated uncertainties can then be used to roughly estimate the number of uncorrelated truth samples that are equivalent to the generated sample and clearly indicate data amplification for smooth features of the distribution.

Keywords: Bayesian Neural Networks, Generative Neural Networks, Data Amplification, Fast Detector Simulation

## Contents

| 1   | Introduction                          | Introduction                                          |   1 |
|-----|---------------------------------------|-------------------------------------------------------|-----|
| 2   | Bayesian Neural Networks              | Bayesian Neural Networks                              |   2 |
| 3   | Bayesian Continuous Normalizing Flows | Bayesian Continuous Normalizing Flows                 |   3 |
|     | 3.1                                   | Variational Inference Bayes                           |   4 |
|     | 3.2                                   | Markov Chain Monte Carlo                              |   5 |
| 4   | Toy Setup                             | Toy Setup                                             |   6 |
|     | 4.1                                   | Gamma Function Ring                                   |   6 |
|     | 4.2                                   | Hyperparameter Choices                                |   7 |
|     | 4.3                                   | Quantiles                                             |   7 |
| 5   | Calibration                           | Calibration                                           |   8 |
|     | 5.1                                   | Scaling with the Number of Quantiles                  |   9 |
|     | 5.2                                   | Calibration at Sharp Features in Radial Direction     |  11 |
| 6   | Bayesiamplification                   | Bayesiamplification                                   |  12 |
|     | 6.1                                   | Checking Amplification with Jensen-Shannon Divergence |  14 |
| 7   | Conclusion                            | Conclusion                                            |  15 |

## 1 Introduction

The upcoming high-luminosity runs of the LHC will push the quantitative frontier of data taking to over 25-times its current rates. To ensure precision gains from such high statistics, this increase in experimental data needs to be met by an equal amount of simulation. The required computational power is predicted to outgrow the increase in budget in the coming years [1, 2]. One solution to this predicament is the augmentation of the expensive, Monte Carlo-based, simulation chain with generative machine learning. A special focus is often put on the costly detector simulation [3, 4].

This approach is only viable under the assumption that the generated data is not statistically limited to the size of the simulated training data. Previous studies have shown, for both toy data [5] and calorimeter images [6], that samples generated with generative neural networks can surpass the training statistics due to powerful interpolation abilities of the network in data space. These studies rely on comparing a distance measure between histograms of generated data and true hold-out data to the distance between smaller, statistically limited sets of Monte Carlo data and the hold-out set. The phenomenon of a generative model surpassing the precision of its training set is also known as amplification. While interesting in theory and crucial for the pursuit of the amplification approach,

these studies can not be performed in experimental applications as they rely on large validation sets multiple orders of magnitude bigger than the training data.

Recently, generative architectures employing Bayesian network weight posteriors have been applied to event generation [7] allowing the generation of sets of data with a corresponding uncertainty on the generated data distribution. In the limit of large generated sets, this uncertainty is entirely based in the statistical limitations of the training data. For well calibrated uncertainty predictions, this raises the question whether an estimate of statistical power of the generated data can be formed from the uncertainty prediction itself. In this paper,

- · we introduce a technique for quantifying the calibration of Bayesian uncertainties on generative neural networks based on the mean coverage of the prediction.
- · We then develop an estimate of the number of simulated truth events matching the generated set in statistical power and validate this estimate.

For applications where the uncertainty calibration can be ensured, for example by evaluating on a validation region, this approach gives an inherent quantification of the significance of a generated set.

In Bayesian neural networks (BNNs) and beyond, calibrating uncertainty quantification is crucial for correct application of the prediction results [8]. While we prefer the uncertainties to align perfectly with the prediction error, overconfident predictions will lead to inflated significance values and false discoveries. Underconfident predictions on the other hand will obscure findings, but not lead to false results and can thus be tolerated to small extend.

Bayesian generative machine learning is inherently different from other BNNs in particle physics applications such as regression [9] or classification [10, 11]. Notably, in generative modeling, a low density region of data cannot be understood as low training statistics, but rather as a feature of the data that has to reproduced by the network. The uncertainty estimate thus behaves similarly to a low-dimensional, parameterized fit [12] introducing high error estimates at steep features of the data distribution or whenever the function class induced by the network architecture is not sufficient to reproduce the data. In a subsequent study of the quality of event generators [13], the authors also connect low uncertainty to good performance of the posterior mean in terms of a classifier test, but find that the weight distribution of a classifier is more sensitive to diverse failure modes than the Bayesian uncertainty.

In Section 2, we will explain the basic concepts of BNNs, while the connection to generative machine learning will be made in Section 3. We introduce the toy data, as well as the employed binning in Section 4 and use them to evaluate the calibration of two different classes of BNNs in Section 5. The idea of employing the Bayesian uncertainties for amplification is developed and deployed in Section 6, before we conclude in Section 7.

## 2 Bayesian Neural Networks

In contrast to traditional, frequentist deep neural networks, in a Bayesian phrasing of deep learning, a distribution on the network weights is applied. This distribution encodes the belief in the occurrence

of the weight configuration 𝜃 . This, so called posterior distribution

$$\pi ( \theta | \mathcal { D } ) = \frac { \pi ( \mathcal { D } | \theta ) \, \pi ( \theta ) } { \pi ( \mathcal { D } ) }$$

is formed from our prior beliefs 𝜋 𝜃 ( ) and the likelihood 𝜋 (D| 𝜃 ) of the data D under the model. While the likelihood gives the probability of the data given its modelling through the network and thus encodes the data inherent distribution (aleatoric uncertainty), the posterior distribution provides the uncertainty due to a lack of data (epistemic uncertainty) [14].

Multiple methods of accessing the posterior distribution exist. For a broad overview over the existing techniques, we refer the readers to [8, 14-16]. They can mostly be classified as either approximating or sampling the posterior.

One popular option is approximating the posterior as an uncorrelated Gaussian distribution by learning a mean and a standard deviation per network weight. These parameters of the approximation are then inferred with (stochastic) variational inference. This technique is also referred to as 'Bayesby-Backprop' [17] or within High-Energy Physics often understood as 'Bayesian Neural Networks'. We will refer to it as 'Variational Inference Bayes'(VIB).

For sampling the posterior, Markov Chain Monte Carlo (MCMC) methods are employed, with full Hamiltonian Monte Carlo (HMC) often considered the gold-standard [18]. To adapt this class of methods to the large datasets and high dimensional parameter spaces of deep learning stochastic and gradient-based chains have been developed. Most notably among them are stochastic gradient HMC [19] and its variations. Due to its easy application to different machine learning tasks and great performance on previous generative applications [20], we use AdamMCMC [21] as one instance of MCMC-based Bayesian inference of network weights.

With access to the posterior distribution of a neural network 𝑓 𝜃 ( 𝑥 ) = 𝑦 , we can generate the network prediction as the posterior mean prediction and its uncertainty prediction as

$$\hat { y } = \int d \theta \, \pi ( \theta | \mathcal { D } ) \, f _ { \theta } ( x ) \quad \text{and} \quad \sigma _ { \hat { y } } ^ { 2 } = \int d \theta \, \pi ( \theta | \mathcal { D } ) \, \left [ f _ { \theta } ( x ) - \hat { y } \right ] ^ { 2 }. \quad \quad ( 2. 2 )$$

Here, the integration is approximated as a summation over an ensemble of network weights obtained from the posterior directly via sampling or from its approximation.

For generative machine learning, a per-sample uncertainty cannot be evaluated due to the unsupervised setup of the problem. We thus generate sets of data with every network weight instance in the ensemble, calculate histograms for each set and report the mean and standard deviation per bin over all sets. This allows us to compare against the expected truth values in each histogram bin.

## 3 Bayesian Continuous Normalizing Flows

Generative models of various flavours have been applied for fast simulation of detector effects [3, 4]. Meanwhile, Normalizing Flows, both block-based [22] and continuous [23], can be connected to Bayesian machine learning straight-forwardly, as the log-likelihood of the model is accessible. Due to the recent success of diffusion-style models in detector emulation [24-29] and their high data efficiency, we combine both and concentrate on Continuous Normalizing Flows (CNF) in this study.

Let 𝑥 ∈ R 𝑑 be a point in the data set D . Following [30] , we first introduce the flow mapping 𝜙 𝑡 : [ 0 1 , ] × R 𝑑 → R 𝑑 parameterized by a time parameter 𝑡 ∈ [ 0 1 . In analogy to the application , ] of multiple blocks in a coupling-block flow [22], the change of the flow mapping between target and latent space is determined by an ordinary differential equation (ODE)

$$\frac { d } { d t } \phi _ { t } ( x ) = v _ { t } ( \phi _ { t } ( x ) ), \quad \phi _ { 0 } ( x ) = x,$$

through a time dependent vector-field 𝑣 𝑡 : [ 0 1 , ] × R 𝑑 → R 𝑑 . For Diffusion Models this differential equation is promoted to a stochastic differential equation through the addition of time-dependent noise. For both cases, the vector-field is approximated using a deep neural network

$$\tilde { v } _ { t } ( \cdot, \theta ) \approx v _ { t }.$$

By convention, the flow is constructed to model latent data from a standard Gaussian at 𝑡 = 0 and detector/toy data at 𝑡 = 1. This defines the the boundaries of the probability path induced by the flow mapping

$$p _ { t } ( x ) = p _ { 0 } \left ( \phi _ { t } ^ { - 1 } ( x ) \right ) \det \left ( \frac { \partial \phi _ { t } ^ { - 1 } ( x ) } { \partial x } \right ).$$

To circumvent solving the ODE to calculate the likelihood of the input data during training, we employ Conditional Flow Matching (CFM) [30]. Instead of the arduous ODE solving, the CFM loss objective matches the neural network predictions ˜ 𝑣 𝑡 ( 𝑥 ; 𝜃 ) to an analytical solution 𝑢 𝑡 , by minimizing their respective mean-squared distance

$$\mathcal { L } _ { \text{CFM} } ( \theta ) = \mathbb { E } _ { t, q ( x _ { 1 } ), p _ { t } ( x | x _ { 1 } ) } \left \| u _ { t } ( x | x _ { 1 } ) - \tilde { v } _ { t } ( x ; \theta ) \right ) \right \| ^ { 2 }.$$

The expectation value is calculated by sampling 𝑡 ∼ U( 0 1 , , ) 𝑥 1 ∼ 𝑞 and 𝑥 ∼ 𝑝 𝑡 (·| 𝑥 1 ) , with 𝑞 the probability distribution of the detector/toy data. An efficient and powerful choice of 𝑢 𝑡 is the optimal transport path [30]. By applying a Gaussian conditional probability path the CFM loss objective reduces to

$$\mathcal { L } _ { \text{CFM} } ( \theta ) = \mathbb { E } _ { t, q ( x _ { 1 } ), p ( x _ { 0 } ) } \left \| \left ( x _ { 1 } - ( 1 - \sigma _ { \min } ) x _ { 0 } \right ) - \tilde { v } _ { t } ( \sigma _ { t } x _ { 0 } + \mu _ { t } ; \theta ) ) \right \| ^ { 2 }.$$

Here, we use the conventions 𝜇 𝑡 = 𝑡𝑥 1 and 𝜎 𝑡 = 1 - ( 1 -𝜎 min ) 𝑡 , as well as the Gaussian latent distribution 𝑝 𝑥 ( 0 ) = N( 0 1 , ) and a small parameter 𝜎 min, that mimics the noise level of the training data.

## 3.1 Variational Inference Bayes

The parameters of an approximation ˜ 𝜋 𝜃 ( ) of the posterior distribution 𝜋 𝜃 ( |D) can be inferred, by minimizing their Kullback-Leibler (KL) divergence using stochastic gradient descent methods [17]. As the posterior is not analytically accessible, Bayes' theorem (2.1) is employed to rewrite the KL divergence in terms of the log-likelihood and the distance to the prior

$$\mathcal { L } _ { V I B } = D _ { K L } \left [ \, \tilde { \pi } ( \theta ), \pi \, ( \theta | \mathcal { D } ) \right ] = - \, \int d \theta \, \tilde { \pi } ( \theta ) \, \log \pi \, ( \mathcal { D } | \theta ) + D _ { K L } \left [ \, \tilde { \pi } ( \theta ), \pi ( \theta ) \right ] + \, \text{ constant.} \, \left ( 3. 5 \right )$$

The log-likelihood of the data under the CNF can be directly employed here. However, calculating the log-likelihood of a CNF is costly as the ODE (3.1) needs to be solved for every point in the

training data. The authors of [7] thus propose, to substitute the log-likelihood with the CFM loss (3.4) and attribute for the difference by a tunable factor 𝑘

$$\mathcal { L } _ { \text{VIB} - \text{CFM} } = \mathbb { E } _ { \tilde { \pi } ( \theta ) } \mathcal { L } _ { \text{CFM} } + k D _ { \text{KL} } \left [ \, \tilde { \pi } ( \theta ), \pi ( \theta ) \right ].$$

Similar to changing the width of the prior 𝜋 𝜃 ( ) , varying 𝑘 adjusts the balance of the CFM-loss to the prior and thus both the bias and variance of the predicted distributions. Trainings at low values of 𝑘 produce better fits at smaller uncertainties, while higher values impact the fit performance by imposing higher smoothness at the trade-off of higher estimated uncertainties. In our experience, promoting a CFM model to a BNN this way increases the training time considerably, due to the low impact and thus slow convergence of the KL-loss term. Possible ways to mitigate this include initiating the prior distribution and the variational parameters from the a pretrained deterministic neural network [31].

## 3.2 Markov Chain Monte Carlo

A competing approach to variational inference-based Bayesian deep learning is MCMC sampling. Our approach to MCMC sampling for neural networks, AdamMCMC [21], uses the independence of the sampled invariant distribution to the starting point to initiate the sampling from CFM-trained model parameters 𝜃 0. This drastically reduces the optimization time over the joint optimization of Section 3.1, and makes employing the costly log-likelihood for the consequent uncertainty quantification feasible.

For every step of the chain, the ODE (3.1) is solved to determine the negative log-likelihood L NLL of the data to construct a chain drawn from a proposal distribution around an Adam [32] step

$$\tilde { \theta } _ { i + 1 } = \text{Adam} ( \theta _ { i }, \mathcal { L } _ { \text{NLL} } ( \theta _ { i } ) ).$$

In combination with a proposal distribution that is elongated in the direction of the step

$$\tau _ { i } \sim q ( \cdot | \theta _ { i } ) = \mathcal { N } ( \tilde { \theta } _ { i + 1 }, \sigma ^ { 2 } 1 + \sigma _ { \Delta } ( \tilde { \theta } _ { i + 1 } - \theta _ { i } ) ( \tilde { \theta } _ { i + 1 } - \theta _ { i } ) ^ { \top } ),$$

this algorithm handles high dimensional sampling for neural networks very efficiently and results in a high acceptance rate in a subsequent stochastic Metropolis-Hastings (MH) correction with acceptance probability

$$\alpha = \frac { \exp \left ( - \lambda \mathcal { L } _ { N L L } ( \tau _ { i } ) \right ) q ( \theta _ { i } | \tau _ { i } ) } { \exp \left ( - \lambda \mathcal { L } _ { N L L } ( \theta _ { i } ) \right ) q ( \tau _ { i } | \theta _ { i } ) }$$

for a large range of noise parameter settings. If the added noise 𝜎 is low, the results remain close to the stochastic optimization without error estimates close to zero, but if the noise levels are high, the random walk through parameter space dominates and the algorithm does not converge to a sensible parameter values. This behaviour is masked by diminishing acceptance probabilities for very low and very high 𝜎 [21].

Both the inverse temperature parameter 𝜆 and the noise parameter 𝜎 tune the predicted uncertainties. In theory small 𝜆 and high 𝜎 will result in high error estimates, albeit in practice the dependence on the inverse temperatures is very weak. We thus limit ourselves to adapting the noise parameter to align the generated uncertainties.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-c8b70eb3-7dcc-4aa0-8b9f-0336bc3ea8a7.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-c59baae2-aee0-4ea5-bcf1-0c2be1ba7047.jpg)

Occurence

Figure 1 . Left: Histogram of one training data set (10 , 000 points). The data follows a ring structure with a sharp edge at 𝑟 = 4 and a long tail to higher radii. Mid: Marginal distribution of the training data in radial direction. Right: 5 × 5 quantiles generated from a data set of 10 𝑀 points and filled with the training data. The quantiles are constructed with equal probability of the truth data to fall into every quantiles.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-c102f9d3-8b88-4626-92f6-d899d198a088.jpg)

After an initial burn-in period, which can be skipped when initializing from a pretrained model, repeatedly saving the network parameters after gaps of length 𝑙 ensures approximately independent parameter samples. The set of sampled parameters

$$\Theta _ { \text{MCMC} } = \{ \theta ^ { ( 1 ) }, \dots, \theta ^ { ( n _ { \text{MCMC} } ) } \} \coloneqq \{ \theta _ { 1 \cdot l }, \dots, \theta _ { n _ { \text{MCMC} } \cdot l } \}$$

follows the tempered posterior distribution, due to Bayes' theorem and the resulting proportionality

$$\tilde { \pi } _ { \lambda } ( \theta | \mathcal { D } ) \in \exp \left ( - \lambda \mathcal { L } _ { \text{NULL} } ( \theta ) \right ) \pi ( \theta ).$$

## 4 Toy Setup

## 4.1 Gamma Function Ring

Similar to previous studies on data amplification [5], we employ the CNF on a low-dimensional ring distribution. Generative Architectures often struggle with changes in the topology between latent space, typically Normal distributed, and data space [33]. The ring structure reflects this 'topological worst case'. A generalization of the results from a similar, topologically complicated, but lowdimensional toy to high-dimensional, simulated, and topologically less problematic calorimeter images was performed in [6]. In this paper, we focus on the calibration of generative uncertainties and draw a connection to data amplification. We thus limit the study to two dimensions for illustrative purposes and to reduce computational costs. Nevertheless, the calibration can be executed analogously for higher dimensional distributions. We generate samples from a ring distribution with an unsteady edge at a radius of 𝑟 = 4, by sampling in spherical coordinates from

$$\phi \sim \text{uniform} ( 0, 2 \pi ) \quad \text{and} \quad r - 4 \sim \Gamma ( \alpha, \beta )$$

with parameters 𝛼 = 𝛽 = 2 for the Gamma distribution. Per training, we use an independent sample of 𝑁 = 10 000 points. Before passing the data to the CNF, we transform into Cartesian coordinates , to obtain the ring shape shown in Figure 1. This construction allows us to estimate the behaviour of the uncertainties at distribution edges and simultaneously prevents divergences of the probability distribution in ( 𝑥, 𝑦 ) = ( 0 0 . , )

## 4.2 Hyperparameter Choices

Due to the low dimensionality of the toy example, we do not need to employ complicated architectures to obtain a good approximation of the vector-field ˜ 𝑣 𝑡 (· , 𝜃 ) . Based on a small grid search, a Multi-Layer Perceptron with 3 layers of 32 nodes and ELU activation is sufficient to reproduce the training data well. Each of the 3 layers takes the time variable 𝑡 as an additional input. The neural network part of the CNF thus totals a mere 2498 parameters.

When parameterizing the weight posterior approximation ˜ 𝜋 𝜃 ( ) as an uncorrelated Normal distribution, as is standard in VIB [17], the number of parameters consequently doubles. For VIB we train using the Adam optimizer [32] at a learning rate of 10 -3 for up to 250k epochs of 10 batches of 1000 datapoints each. To prevent overfitting, we evaluate the model at the earliest epoch after convergence of the KL-loss term. This point depends on the choice of 𝑘 and varies between 75k for 𝑘 = 50 and 250k for 𝑘 = 1. We do 5 runs each for multiple values of 𝑘 ∈ [ 1 5 10 50 , , , ] to regulate the uncertainty quantification. For this range of 𝑘 we have previously found sensible density estimation and optimization convergence trough performing a log-linearly spaced scan in 𝑘 ∈ [ 10 -4 , 10 5 ] ) with only one run per parameter choice.

For the AdamMCMC sampling, we start the chain from a pretrained model. The model is first optimized for 2500 epochs ( Adam with learning rate of 10 -3 ) using only the CFM-loss (3.4). For the deterministic model, this is enough to converge. We then run the sampling at a the same learning rate as the optimization with 𝜎 Δ ≈ 50 and 𝜆 = 1 0. This choice of . 𝜎 Δ ensures high acceptance rates, while the choice of 𝜆 reflects sampling from the untempered posterior distribution, as per (3.11). We add a sample to the collection at intervals of 100 epochs, to ensure the independence of the sampled weights. To adjust the calibration, we scan the noise value at four points 𝜎 ∈ [ 0 01 0 05 0 1 0 5 . . , . , . , . ] This parameter span is based on a log-linearly spaced scan in 𝜎 ∈ [ 10 -4 , 10 ). ] Once again, we calculate 5 chains per noise parameter setting.

## 4.3 Quantiles

As in Reference [5], we evaluate the generated data in histogram bins of equal probability mass. We will refer to these bins as quantiles 𝑄 𝑗 , their count as 𝑞 𝑗 and the set of all quantiles as Q = { 𝑄 , ..., 𝑄 1 𝑛 𝑄 } . To construct bins with the same expected occupancy, we use spherical coordinates. In angular direction, the space can simply be divided into linearly spaced quantiles, while in radial direction we use the quantiles of a 10M generated truth dataset to gauge the boundaries of the quantiles. To guaranty even population, we always choose the same number of quantiles in both dimensions. Figure 1 illustrates the construction and occupancy for 5 × 5 quantiles in Cartesian coordinates.

For correlated data, quantiles can be constructed by iteratively dividing a truth set into sets of equal size [6]. The binning is however not relevant for the discussion of calibration and analogous arguments can be made for arbitrary histograms. The advantage of quantiles over other binning schemes is the clear definition of the number of bins without an offset by an arbitrary amount of insignificant bins in the sparsely or unpopulated areas of the data space. This allows us to show the behaviour of calibration and amplification over the number of bins in Section 5 and 6.

## 5 Calibration

To align the uncertainty quantification, for AdamMCMC we generate 10M points from the CNF for the 𝑛 MCMC = 10 parameter samples in 𝚯 MCMC. We obtain a set of points G ( 𝑖 ) per parameter sample 𝜃 ( 𝑖 ) , with the corresponding count

$$g _ { j } ^ { ( i ) } = \# \{ x ^ { \prime } \in Q _ { j } \ | \ x ^ { \prime } \in { \mathbf G } ^ { ( i ) } \}$$

in quantile 𝑄 𝑗 . Each count corresponding to a parameter sample thus constitutes one drawing of a random variable 𝐺 𝑗 whose distribution is induced by the posterior.

Analogously, for VIB we draw a set 𝚯 VIB of parameters from the posterior approximation ˜ 𝜋 𝜃 ( ) , generate 10M samples from each and calculate the quantile counts to generate drawings of 𝐺 𝑗 . As the training cost does not depend on the number of draws for VIB, we use 𝑛 VIB = 50 samples for better accuracy.

Using the quantile values 𝑔 ( 𝑖 ) 𝑗 , we approximate the cumulative distribution function (CDF)

$$\hat { F } _ { G _ { j }, \Theta } \left ( g _ { j } \right ) \approx F _ { G _ { j } } \left ( g _ { j } \right ) = P \left ( G _ { j } \leq g _ { j } \right ),$$

from its empirical counterpart using linear interpolation. We leave the set 𝚯 general, without a subscript, for now. From the approximated CDF, we construct symmetric confidence intervals for a given confidence level 𝑐 from its inversion

$$I _ { j, \Theta } ( c ) = \left [ \hat { F } _ { G _ { j }, \Theta } ^ { - 1 } \left ( 0. 5 - \frac { c } { 2 } \right ), \hat { F } _ { G _ { j }, \Theta } ^ { - 1 } \left ( 0. 5 + \frac { c } { 2 } \right ) \right ].$$

The chosen confidence level 𝑐 corresponds to the expected or nominal coverage .

To evaluate the observed coverage, we draw 5 different training sets from the Gamma ring distribution and calculate a VIB- and AdamMCMC -CNF ensemble each

$$\Theta _ { \text{MCMC} } ^ { s } \text{ and } \Theta _ { \text{VIB} } ^ { s } \text{ for } s \in \{ 1,.., 5 \}.$$

For every model, we construct a confidence interval and evaluate the number of intervals containing the expected count of the truth distribution, i.e. 1 / 𝑛 𝑄 . The ratio of models with an interval containing the truth value over the total number of models gives the empirical coverage per bin

$$\hat { c } _ { j } = \frac { \# \left \{ 1 / n _ { Q } \in I _ { j, \Theta ^ { s } } ( c ) \ | \ s \in \{ 1,.., 5 \} \right \} } { 5 },$$

where we again keep the subscript on the set of parameters unspecified. For one quantile this coverage estimate is very coarse as it can only take on one of six values. Since we want to check the agreement of nominal and empirical coverage for multiple nominal coverage values, we report the mean empirical coverage

$$\bar { c } = \left \langle \hat { c } _ { j } \right \rangle _ { j \in \{ 1, \dots, n _ { Q } \} }$$

over all quantiles. The range of possible mean values is big enough to compare to a fine spacing in nominal coverage.

This also allows us to judge the agreement of nominal and empirical coverage in the full data space in a single figure. However, it also introduces the possibility for over- and underconfident areas to cancel each other out. This issue will be treated in more detial in Section 5.1 and 5.2.

Figure 2 shows the mean empirical coverage over all quantiles for 50 values of the nominal coverage linearly spaced between 0 and 1 and over three different numbers of quantiles. For a well calibrated uncertainty estimation, the empirical estimate closely follows the nominal coverage and the resulting curve is close to the diagonal of the plot. For Figure 2 we can see that high noise levels in the MCMC chain lead to overestimated errors and a prediction that is underconfident on average. Inversely, low noise levels lead to overconfident predictions. From our chosen grid, 𝜎 = 0 1 shows . the best agreement.

It further becomes apparent that the calibration depends on the number of quantiles. For lower numbers of quantiles, the fluctuations in the generated distribution average out and both the mean prediction and error estimation are more precise, while for higher numbers of quantiles good calibration becomes challenging while limited to 10 posterior samples.

For VIB in Figure 3, where we evaluate 50 posterior samples, calibration seems to improve for high 𝑛 𝑄 . While at lower numbers only a very small prior trade-off 𝑘 leads to overconfident intervals and larger values result in underconfident predictions, at higher numbers of quantiles previously underconfident predictions appear well calibrated.

## 5.1 Scaling with the Number of Quantiles

To further investigate the calibration of our Bayesian generative neural networks, we pick the seemingly best calibrated parameter settings for both methods. For AdamMCMC this is 𝜎 = 0 1 and . for VIB 𝑘 = 10. We generate 𝑛 MCMC = 𝑛 VIB = 50 samples from the posterior for both methods now and evaluate the scaling with the number of quantiles in more detail.

As we do not want to evaluate one calibration plot for each quantile, we reduce the diagonal calibration plots by calculating the mean (absolute) deviation between empirical and nominal coverage

$$\text{MD} & = \langle \bar { c } - c \rangle _ { c \in [ 0, 1 ] } \quad \text{and} \quad \text{MAD} & = \langle | \bar { c } - c | \rangle _ { c \in [ 0, 1 ] }$$

Figure 2 . Mean empirical coverage for confidence intervals calculated from 10 samples of the Bayesian weight posterior drawn with AdamMCMC using 4 different hyperparameter settings. Higher 𝜎 will generally result in larger uncertainties. The empirical coverage is calculated from 5 independent runs and averaged over all quantiles. The panels show a clear dependence of the calibration on the number of quantiles increasing from left to right.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-5bceebd9-a4c5-4753-973b-acbef5f37a6f.jpg)

Figure 3 . Mean empirical coverage for confidence intervals calculated from 50 drawings from the VIB approximation of the Bayesian weight posterior with 4 different hyperparameter settings. Larger 𝑘 increases the dependence of the fit on the prior. The empirical coverage is calculated from 5 independent runs and averaged over all quantiles. The panels again show a clear dependence of the calibration on the number of quantiles increasing from left to right.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-3cb925cb-88da-456d-b01b-808632bf7735.jpg)

wherethemeanempiricalcoverage still depends on the nominal coverage ¯ 𝑐 = ¯ 𝑐 ( 𝑐 ) . Thecomposition of the mean on the quantiles, the absolute value, and the mean on the nominal coverage allows for under- and overestimation in individual quantiles to cancel out.

To gauge this we promote the index over all quantiles 𝑗 to a tuple of indices ( 𝑗 𝑟 , 𝑗 𝜙 ) . We write ˆ 𝑐 ( 𝑗 𝑟 , 𝑗 𝜙 ) for the empirical coverage in the 𝑗 𝑟 -th radial and 𝑗 𝜙 -th angular bin. By limiting the average over the empirical coverage (5.4) to one of the dimensions

$$\bar { c } _ { j _ { r } } = \left \langle \hat { c } _ { ( j _ { r }, j _ { \phi } ) } \right \rangle _ { j _ { \phi } } \quad \text{and} \quad \bar { c } _ { j _ { \phi } } = \left \langle \hat { c } _ { ( j _ { r }, j _ { \phi } ) } \right \rangle _ { j _ { r } }$$

we construct marginal coverage distributions in the remaining directions. We can then again calculate the mean absolute deviation to the nominal coverage and suspend the average in the remaining direction until the very end

$$\text{MAD} _ { r } = \left \langle \left \langle | \bar { c } _ { j _ { r } } - c | \right \rangle _ { c \in [ 0, 1 ] } \right \rangle _ { j _ { r } } \quad \text{and} \quad \text{MAD} _ { \phi } = \left \langle \left \langle | \bar { c } _ { j _ { \phi } } - c | \right \rangle _ { c \in [ 0, 1 ] } \right \rangle _ { j _ { \phi } }$$

By switching the order, only quantile counts in direction of the first mean (5.6) can even out. When starting out with the average in the angular dimension, we end up with an estimate where the fluctuations in the radial direction are preserved in the absolute mean and vice versa.

The left panel of Figure 4 shows the dependence of the three different coverage deviation averages on the number of quantiles. To keep the effect of statistic fluctuations per bin to a minimum, we generate sets of 1000 · 𝑛 𝑄 artificial points with the CNFs and evaluate between 2 × 2 and 200 × 200 quantiles.

Wefind a clear dependence of the coverage means on the number of quantiles. At low numbers, the mean prediction averages over large areas of the data space increasing the quality of the mean prediction. The uncertainty estimation is thus underconfident for both methods and the mean absolute deviations are high and do not depend on the order of averaging. For low numbers of quantiles, calibration is much better,i.e. the absolute deviation is closer to 0. While for AdamMCMC we

200x200 Quantiles

Figure 4 . Left: Mean absolute deviation between the nominal and the empirical coverage (5 runs) for 50 posterior samples from both, VIB at 𝑘 = 10 and AdamMCMC at 𝜎 = 0 1. . The panel shows a strong dependence on the number of quantiles. From evaluating the calibration plots for all numbers of quantiles individually, we know both methods are undercertain at low numbers. With increasing 𝑛 𝑄 , the calibration mean exhibits a strong dependence on the order of the absolute and average operations. When only the overand underdensities along radial or angular dimension can cancel out, the mean calibration of the VIB-CNFs drastically decreases. Right: Difference between nominal and empirical coverage (mean over angular direction) for the radial direction of 200 quantiles. Values below 0 indicate overcertainty, while values above indicate undercertain predictions. While the predictions of the AdamMCMC -CNFs are well calibrated to slightly undercertain along the radius, the prediction of the VIB-CNFs starts out overcertain due to the oversmoothing caused by the strong prior dependence. When averaging over all radii, the VIB-CNF predictions cancel exactly and the BNN seems well calibrated.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-d87a1154-5ffa-48ee-9e83-81de1bf6cbe6.jpg)

cannot see big changes depending on the averaging order. This indicates a calibration independent of the dimension. At the same time, we find large discrepancies for VIB. This variation can be understood from the marginal calibrations.

## 5.2 Calibration at Sharp Features in Radial Direction

The right panel of Figure 4 displays the the marginal empirical coverage in radial direction ¯ 𝑐 𝑟 for 200 × 200 quantiles and both BNN methods. We can see a distinct difference in the uncertainty quantification.

While the VIB prediction seems very well calibrated in total, in the radial direction, the VIB underestimates its bias for the steeply rising part of the data distribution between 𝑟 ∈ [ 4 0 5 0 . . , . ] For the same interval, the MCMC prediction is well calibrated and less underconfident than for higher radii. For 𝑟 &gt; 5 both models slightly overestimate the uncertainty and show very similar calibration.

In terms of absolute uncertainty, both methods actually predict very similar results. However, the mean prediction of the VIB-CNF is strongly biased by the prior KL-loss term, resulting in large underpopulation of the generated density due to oversmoothing for 𝑟 &lt; 4 5 and a corresponding . overpopulation in 𝑟 ∈ [ 4 5 5 0 . . , . ] We have tested the predictions for 𝑘 = 50 and the behaviour is magnified at higher values of 𝑘 . For lower values ( 𝑘 = 5), the oversmoothing is reduced to the area below 𝑟 = 4 3 at the cost of an overestimated tail. . The AdamMCMC -CNF shows signs of oversmoothing as well, but only very close to the start of the radial distribution.

## 6 Bayesiamplification

Based on the previous discussion of both the total and marginal calibration, we can confidently say that our AdamMCMC -CNF is well calibrated, albeit slightly underconfident for some areas of data space and small numbers of bins. It is, however, important to note that truth information was needed to evaluate the calibration of the BNN. In a practical application, this would require either a validation region or a large hold-out set, the latter of which would partially defeat the purpose of data amplification in fast detector simulation. However, for applications with validations regions, such as generative anomaly detection [34, 35], precision improvements through data amplification can be realized.

With a well calibrated BNN, we can try and develop a measure of the statistical power of the generated set from the uncertainties. We do so by relating the uncertainty to the statistics of an uncorrelated set of points T from the truth distribution. For 𝑛 bins arbitrary bins, we expect the count in the 𝑗 -th bin to be approximately Poisson distributed with mean and variance 𝑡 𝑗 . For the same bin, the set of 𝑛 MCMC = 50 AdamMCMC -CNF posterior samples gives a mean prediction

$$\bar { g } _ { j } = \left \langle g _ { j } ^ { ( i ) } \right \rangle _ { i \in \{ 1, \dots, n _ { M C M C } \} } \text{ and variance } \sigma _ { \bar { g } _ { j } } ^ { 2 } = \left \langle \left ( g _ { j } ^ { ( i ) } - \bar { g } _ { j } \right ) ^ { 2 } \right \rangle _ { i \in \{ 1, \dots, n _ { M C M C } \} }.$$

We will now use the posterior mean and variance to construct an estimator ˆ 𝑡 𝑗 of the Poisson equivalent to the per-bin predictions. Using only the mean ˆ 𝑡 𝑗 : = ¯ 𝑔 𝑗 , the equivalent will simply be the generated statistics. Thereby, we would disregard the correlations in the generated data through limited training data completely.

Byinstead equating the variance of the BNN to that of the equivalent uncorrelated set ˆ 𝑡 𝑗 : = 𝜎 2 ¯ 𝑔 𝑗 , we would introduce an unwanted dependence on the uncertainty prediction. Overestimated uncertainties would lead to an overestimation of the statistical power.

As we do not want to overestimate the generative performance, we aim to have undercertain predictions to lead to an underestimation of the uncorrelated equivalent. Such a behaviour can be constructed using the coefficient of variation

$$\frac { 1 } { \sqrt { \hat { t } _ { j } } } \coloneqq \frac { \sigma _ { \tilde { g } _ { j } } } { \bar { g } _ { j } } \quad \Longleftrightarrow \quad \hat { t } _ { j } = \frac { \bar { g } _ { j } ^ { 2 } } { \sigma _ { \tilde { g } _ { j } } ^ { 2 } }.$$

The equivalent uncorrelated statistics now decreases for overestimated 𝜎 ¯ 𝑔 𝑗 . Both the predictions from the absolute and from the relative error give the similar estimates for well calibrated errors in our tests.

We calculate the equivalent truth set size for both the VIB-CNF and AdamMCMC -CNF and the quantiles from Section 5. In Figure 5, we report the amplification as the ratio of the sum over all bin estimates and the training statistics

$$\sum _ { j = 1 } ^ { n _ { \text{bins} } } \hat { t } _ { j } / N$$

in the left panel, as well as the mean estimate over all bins on the right.

Since the amplification contains the sum over all quantiles of our setup and ˆ 𝑡 𝑗 depends on the fluctuations of the individual predictions 𝑔 ( 𝑖 ) 𝑗 around the posterior mean prediction only, we expect

Figure 5 . Left: Amplification estimate generated by equating the error prediction per bin for both BNNs to the Poisson error of an independent data set. Higher uncertainty results in lower amplification. Errorbars are calculated from the ensemble of 5 runs done per BNN method. Again, we use 50 samples of the weight posterior (approximation) for both methods. The faint solid lines show the result of exponential linear fit (least squares) to the last 8 points. Right: The mean estimate over all quantiles converges to a constant value at high numbers of quantiles resulting in linear scaling of the amplification with the number of quantiles.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-8dea64a3-3ea2-4f07-aaf7-2db51a3eb6b3.jpg)

it to scale linearly in the number of bins. This seems in good agreement with the figure. For large numbers of quantiles, where the BNNs are best calibrated, the average amplification per bin converges to a constant value. Fitting a exponential linear function exp ( 𝑎 + 𝑏 · log ( 𝑥 )) = 𝑎 ′ · 𝑥 𝑏 to these last 8 points of Figure 5 using least squares, we indeed find no significant deviations from 𝑏 = 1. We estimate 𝑎 ′ = ( 4 3 . ± 2 9 . ) · 10 -3 and 𝑏 = 0 99 . ± 0 06 for the VIB-CNF and . 𝑎 ′ = 0 012 . ± 0 004 and . 𝑏 = 0 99 . ± 0 04 for the . AdamMCMC -CNF. At lower numbers, the deviations of the model output for different parameters in the Bayesian set integrate over large intervals of the data space leading to smaller error estimates and increased amplification per bin.

This behaviour is consistent with the previous studies [5, 6] and the observation that one can not improve the estimation of low moments of the distribution, like the distribution mean, by oversampling with a generative neural network. From Figure 5, we can also estimate the minimum amount of bins to leverage the amplification. For the MCMC sample, evaluating at 100 bins is expected to yield an improved density estimation over using only the training set. This number could decrease for a less underconfident model. For highly granular binning, we find amplification estimates of more than a factor 100.

For smaller training statistics, we expect a higher initial amplification at low numbers of bins, while the corresponding larger uncertainty estimate will result in a flatter slope. The number of quantiles where an amplification larger than 1 first occurs will be smaller in such a case. Higher training statistics on the other hand will lead to a steeper slope and a later trade-off point. The results of [5] imply, that amplification effects are stronger in larger data spaces, due to the reduced density of the training data.

Similar calculations can be done for arbitrary binnings to justify the use of generative machine learning in a specific analysis. The evaluation of the Bayesian uncertainty prediction however requires the calculation of multiple sets of fast-simulation data points. This reduces the speed benefits of applying generative machine learning over more classical tools like MCMC simulation or inference.

VIB (

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00838v2-figure-8da45e76-3274-421b-b61a-4a2a81709084.jpg)

k

=10.0)

AdamMCMC (

=0.1)

Figure 6 . Jensen-Shannon divergence between the mean prediction by the Bayesian CNFs and the true data distribution (solid line) and between a uncorrelated data set of the size predicted by the BNN error estimate and the true data (dashed line). Both divergences align only for well calibrated uncertainties ( AdamMCMC at high numbers of quantiles) and indicate over- and underestimated errors otherwise. Uncertainties are reported from the ensemble of 5 independent runs done for estimation of the empirical coverage.

## 6.1 Checking Amplification with Jensen-Shannon Divergence

To test how well the sum over all bin estimates

$$\hat { N } = \sum _ { j = 1 } ^ { n _ { \text{bins} } } \hat { t } _ { j }$$

actually gauges the size of an equivalent independent data set, we calculate the Jensen-Shannon (JS) divergence

$$\bar { D } _ { \text{JS} } ( p, q ) = \frac { 1 } { 2 } \sum _ { j = 1 } ^ { n _ { \text{bins} } } \left ( p _ { j } \log \frac { p _ { j } } { \frac { 1 } { 2 } ( p _ { j } + q _ { j } ) } + q _ { j } \log \frac { q _ { j } } { \frac { 1 } { 2 } ( p _ { j } + q _ { j } ) } \right )$$

between the histogram estimation of the density in our quantiles and the known data distribution. The JS divergence is bounded by 0 and log 2, with smaller values indicating similarity between the compared distributions.

In our toy setup, the bins are constructed as quantiles. We evaluate the JS divergence for 𝑝 𝑗 = ¯ 𝑔 𝑗 1000 · 𝑛 𝑄 , the mean prediction of the BNN relative to total number generated, and 𝑞 𝑗 = 1 / 𝑛 𝑄 the probability per quantile when sampling from the data distribution. In Figure 6, we compare it to the JS divergence for 𝑝 𝑗 = 𝑡 𝑗 / ˆ , 𝑁 the relative population of the quantiles for a set of ˆ 𝑁 points drawn from the truth distribution, and the true quantile count 𝑞 𝑗 = 1 / 𝑛 𝑄 for a large range of 𝑛 𝑄 .

Where the BNN is well calibrated, i.e. for AdamMCMC and 𝑛 𝑄 &gt; 10 3 , the quality of the mean prediction lines up with the results of the uncorrelated set drawn to the size of the BNN errors. The Bayesian coefficient of variation correctly predicts the equivalent uncorrelated statistics. At lower numbers of quantiles, the error is overestimated. Consequently, the statistical equivalent is underestimated. This can also be observed for the VIB-CNF. However, for large number of quantiles where the uncertainty at low radii is underestimated, see Section 5.2, the performance of the mean

prediction is worse than anticipated by the BNN. Good calibration on the full data space therefore is important for a reliable prediction of ˆ . 𝑁

## 7 Conclusion

In the previous chapters, we present a novel evaluation of the uncertainty provided by a Bayesian generative neural network in a histogram. To this end, we propose constructing confidence intervals per histogram bin and compare the nominal coverage of the constructed interval to the empirical coverage obtained from a small ensemble of BNNs.

We observe a strong dependence of the calibration on the parameters of both a VIB-CNF and an MCMC-sampled CNF. Furthermore, we find a strong tendency to oversmooth with strong priors leading to underestimation of the data density and corresponding error at the non-differentiable inner edge of our toy distribution. While present in both approaches, this behavior was predominantly displayed by the VIB-CNFs.

We further use the calibrated errors to estimate the statistical power of the generated data in terms of the size of an equivalent independently sampled data set. This estimate correctly quantifies the performance of the BNNs mean prediction when the errors are well calibrated and assigns a concrete number to the data amplification in dependence of the employed binning. For a correct amplification estimate, it is crucial that the errors are well calibrated in the full data space.

Similar calibration checks can be applied wherever a generative neural network is used for inference or generation with a sufficient validation set or for interpolation into hold-out regions of the data.

## Acknowledgments

SB is supported by the Helmholtz Information and Data Science Schools via DASHH (Data Science in Hamburg - HELMHOLTZ Graduate School for the Structure of Matter) with the grant HIDSS-0002. SB and GK acknowledge support by the Deutsche Forschungsgemeinschaft (DFG) under Germany's Excellence Strategy - EXC 2121 Quantum Universe - 390833306 and via the KISS consortium (05D23GU4) funded by the German Federal Ministry of Education and Research BMBF in the ErUM-Data action plan. This research was supported in part through the Maxwell computational resources operated at Deutsches Elektronen-Synchrotron DESY, Hamburg, Germany. SD is supported by the U.S. Department of Energy (DOE), Office of Science under contract DEAC02-05CH11231.

Data and Code https://github.com/sbieringer/Bayesiamplify provides the code for simulating the toy example and conducting this analysis.

## References

- [1] Johannes Albrecht et al. A Roadmap for HEP Software and Computing R&amp;D for the 2020s. Comput. Softw. Big Sci. , 3(1):7, 2019.
- [2] Amber Boehnlein et al. HL-LHC Software and Computing Review Panel, 2nd Report. Technical report, CERN, Geneva, 2022.

| [3]   | Anja Butter et al. Machine learning and LHC event generation. SciPost Phys. , 14(4):079, 2023.                                                                                                                                                                     |
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [4]   | Baran Hashemi and Claudius Krause. Deep generative models for detector signature simulation: A taxonomic review. Rev. Phys. , 12:100092, 2024.                                                                                                                     |
| [5]   | Anja Butter, Sascha Diefenbacher, Gregor Kasieczka, Benjamin Nachman, and Tilman Plehn. GANplifying event samples. SciPost Phys. , 10(6):139, 2021.                                                                                                                |
| [6]   | Sebastian Bieringer, Anja Butter, Sascha Diefenbacher, Engin Eren, Frank Gaede, Daniel Hundhausen, Gregor Kasieczka, Benjamin Nachman, Tilman Plehn, and Mathias Trabs. Calomplification -the power of generative calorimeter models. JINST , 17(09):P09028, 2022. |
| [7]   | Anja Butter, Nathan Huetsch, Sofia Palacios Schweitzer, Tilman Plehn, Peter Sorrenson, and Jonas Spinner. Jet Diffusion versus JetGPT - Modern Networks for the LHC. 5 2023.                                                                                       |
| [8]   | Thomas Y. Chen, Biprateep Dey, Aishik Ghosh, Michael Kagan, Brian Nord, and Nesar Ramachandra. Interpretable Uncertainty Quantification in AI for HEP. In Snowmass 2021 , 8 2022.                                                                                  |
| [9]   | Braden S. Kronheim, Michelle P. Kuchera, Harrison B. Prosper, and Alexander Karbo. Bayesian Neural Networks for Fast SUSY Predictions. Phys. Lett. B , 813:136041, 2021.                                                                                           |
| [10]  | Sven Bollweg, Manuel Haußmann, Gregor Kasieczka, Michel Luchmann, Tilman Plehn, and Jennifer Thompson. Deep-Learning Jets with Uncertainties and More. SciPost Phys. , 8(1):006, 2020.                                                                             |
| [11]  | Jack Y. Araz and Michael Spannowsky. Combine and Conquer: Event Reconstruction with Bayesian Ensemble Neural Networks. JHEP , 04:296, 2021.                                                                                                                        |
| [12]  | Marco Bellagente, Manuel Haussmann, Michel Luchmann, and Tilman Plehn. Understanding Event-Generation Networks via Uncertainties. SciPost Phys. , 13(1):003, 2022.                                                                                                 |
| [13]  | Ranit Das, Luigi Favaro, Theo Heimel, Claudius Krause, Tilman Plehn, and David Shih. How to understand limitations of generative networks. SciPost Phys. , 16(1):031, 2024.                                                                                        |
| [14]  | Laurent V. Jospin, Hamid Laga, Farid Boussaïd, Wray L. Buntine, and Mohammed Bennamoun. Hands-on bayesian neural networks - A tutorial for deep learning users. IEEE Comput. Intell. Mag. , 17(2):29-48, 2022.                                                     |
| [15]  | José Mena, Oriol Pujol, and Jordi Vitrià. A survey on uncertainty estimation in deep learning classification systems from a bayesian perspective. ACM Comput. Surv. , 54(9):193:1-193:35, 2022.                                                                    |
| [16]  | Ethan Goan and Clinton Fookes. Bayesian Neural Networks: An Introduction and Survey , pages 45-87. Springer International Publishing, Cham, 2020.                                                                                                                  |
| [17]  | Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International conference on machine learning , pages 1613-1622. PMLR, 2015.                                                                     |
| [18]  | Pavel Izmailov, Sharad Vikram, Matthew D Hoffman, and Andrew G. Wilson. What are bayesian neural network posteriors really like? In International conference on machine learning , pages 4629-4640. PMLR, 2021.                                                    |
| [19]  | Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. In International conference on machine learning , pages 1683-1691. PMLR, 2014.                                                                                           |
| [20]  | Sebastian Bieringer, Gregor Kasieczka, Jan Kieseler, and Mathias Trabs. Classifier surrogates: sharing AI-based searches with the world. Eur. Phys. J. C , 84(9):972, 2024.                                                                                        |
| [21]  | Sebastian Bieringer, Gregor Kasieczka, Maximilian F Steffen, and Mathias Trabs. AdamMCMC: Combining Metropolis adjusted Langevin with momentum-based optimization. 2023.                                                                                           |

| [22]   | Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International conference on machine learning , pages 1530-1538. PMLR, 2015.                                                                                                               |
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [23]   | Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. Advances in neural information processing systems , 31, 2018.                                                                                                 |
| [24]   | Vinicius Mikuni, Benjamin Nachman, and Mariel Pettee. Fast point cloud generation with diffusion models in high energy physics. Phys. Rev. D , 108(3):036025, 2023.                                                                                                           |
| [25]   | Vinicius Mikuni and Benjamin Nachman. CaloScore v2: single-shot calorimeter shower simulation with diffusion models. JINST , 19(02):P02001, 2024.                                                                                                                             |
| [26]   | Matthew Leigh, Debajyoti Sengupta, John Andrew Raine, Guillaume Quétant, and Tobias Golling. Faster diffusion model with improved quality for particle cloud generation. Phys. Rev. D , 109(1):012010, 2024.                                                                  |
| [27]   | Erik Buhmann, Frank Gaede, Gregor Kasieczka, Anatolii Korol, William Korcari, Katja Krüger, and Peter McKeown. CaloClouds II: ultra-fast geometry-independent highly-granular calorimeter simulation. JINST , 19(04):P04020, 2024.                                            |
| [28]   | Erik Buhmann, Cedric Ewen, Darius A. Faroughy, Tobias Golling, Gregor Kasieczka, Matthew Leigh, Guillaume Quétant, John Andrew Raine, Debajyoti Sengupta, and David Shih. EPiC-ly Fast Particle Cloud Generation with Flow-Matching and Diffusion. 9 2023.                    |
| [29]   | Dmitrii Kobylianskii, Nathalie Soybelman, Etienne Dreyer, and Eilam Gross. Graph-based diffusion model for fast shower generation in calorimeters with irregular geometry. Phys. Rev. D , 110(7):072003, 2024.                                                                |
| [30]   | Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations , 2023.                                                                         |
| [31]   | Ranganath Krishnan, Mahesh Subedar, and Omesh Tickoo. Specifying weight priors in bayesian deep neural networks with empirical bayes. In Proceedings of the AAAI conference on artificial intelligence , pages 4477-4484. AAAI Press, 2020.                                   |
| [32]   | Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014.                                                                                                                                                                                            |
| [33]   | Ramon Winterhalder, Marco Bellagente, and Benjamin Nachman. Latent Space Refinement for Deep Generative Models. 6 2021.                                                                                                                                                       |
| [34]   | Anna Hallin, Joshua Isaacson, Gregor Kasieczka, Claudius Krause, Benjamin Nachman, Tobias Quadfasel, Matthias Schlaffer, David Shih, and Manuel Sommerhalder. Classifying anomalies through outer density estimation. Phys. Rev. D , 106(5):055006, 2022.                     |
| [35]   | Tobias Golling, Gregor Kasieczka, Claudius Krause, Radha Mastandrea, Benjamin Nachman, John A. Raine, Debajyoti Sengupta, David Shih, and Manuel Sommerhalder. The interplay of machine learning-based resonant anomaly detection methods. Eur. Phys. J. C , 84(3):241, 2024. |
Sebastian Bieringer Sascha Diefenbacher Gregor Kasieczka Mathias Trabs
Calibrating Bayesian Generative Machine Learning for Bayesiamplification
Recently, combinations of generative and Bayesian machine learning have been
introduced in particle physics for both fast detector simulation and inference
tasks. These neural networks aim to quantify the uncertainty on the generated
distribution originating from limited training statistics. The interpretation
of a distribution-wide uncertainty however remains ill-defined. We show a clear
scheme for quantifying the calibration of Bayesian generative machine learning
models. For a Continuous Normalizing Flow applied to a low-dimensional toy
example, we evaluate the calibration of Bayesian uncertainties from either a
mean-field Gaussian weight posterior, or Monte Carlo sampling network weights,
to gauge their behaviour on unsteady distribution edges. Well calibrated
uncertainties can then be used to roughly estimate the number of uncorrelated
truth samples that are equivalent to the generated sample and clearly indicate
data amplification for smooth features of the distribution.