Manuscript Offprint
arXiv:2610.09886Sparsifying Stochasticity, Not Capacity: Partial Stochasticity via Deep Weight Factorization of Prior Scales
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Bayesian neural networks need not be fully stochastic to be universal conditional density approximators, but it remains open which parameters should be stochastic. We learn this split by applying deep weight factorization to the prior scales, which are the standard deviations of the parameter priors, while fitting the functional prior to a Gaussian process with a maximum mean discrepancy objective. A parameter whose prior scale falls below a cutoff becomes deterministic and is optimized during inference, so the regularizer sparsifies stochasticity rather than capacity. We give a certificate for universal conditional density approximation that is checkable in linear time, together with a minimal repair when it fails. We further show that the common hybrid scheme of sampling some parameters and optimizing the others is stochastic approximation for a type-II maximum a posteriori objective, and that coupled step sizes can leave a tracking error that does not vanish as the step size shrinks. On a bimodal target, the learned split stays close to an unconstrained reference across all budgets and is insensitive to the cutoff, while random masks that distribute the same prior scales across layers are worse by up to two orders of magnitude. On UCI benchmarks, our method performs on par with a fully stochastic network while keeping about half of its parameters deterministic.
1 INTRODUCTION
As neural networks are increasingly deployed in real-world applications, reliable uncertainty quantification becomes essential. Bayesian neural networks address this by treating their parameters as random variables, which combines the flexibility of neural networks with principled uncertainty estimates.
Maurizio Filippone
KAUST, Saudi Arabia
A recent work (Sharma et al., 2023) has shown theoretically and empirically that it is not necessary to treat all parameters in a stochastic way to obtain good uncertainty estimates. It is even enough to make the number of stochastic parameters of the network match the target dimension as long as stochasticity is introduced in the early layers and the downstream network has general function approximation properties (Leshno et al., 1993). This result is promising since it allows for the reduction in the number of stochastic parameters.
However, partial stochasticity complicates model selection by adding another modeling choice: which parameters should we treat in a stochastic way? The theory does not give any indication on how to make this choice. Due to the combinatorially large number of possible ways to assign parameters to the stochastic and deterministic groups, it is computationally impractical to find a solution via brute force. An additional complication is how to choose sensible priors over stochastic parameters, which is crucial for obtaining good performance and sound uncertainty quantification.
Building on deep weight factorization (Kolb et al., 2025), we apply the factorization not to the network weights but to the prior standard deviations, which we refer to as prior scales. Sparsity in the scales means sparsity in stochasticity: a parameter whose prior scale collapses to zero is deterministic. Unlike pruning and spike-and-slab-based constructions, which keep pruned parameters at zero in the posterior, our deterministic parameters remain free to be optimized during inference, so the capacity of the fitted network is retained.
Learning the split changes the inference problem. Partially stochastic networks are typically fitted by a hybrid scheme that samples the stochastic parameters while optimizing the deterministic ones. Despite its widespread use, it has not been established what this scheme approximates: it does not sample the joint posterior, nor is the deterministic block a standard maximum a posteriori (MAP) estimate, since the stochastic parameters are integrated throughout optimization. With this work, we aim to close this gap.
Our contributions are: (1) a method that learns the deterministic/stochastic split by imposing deep weight factorization on prior scales. This sparsifies stochasticity rather than capacity, and for a factorization depth of the non-zero scales are bounded away from zero at stationary points (Theorem 4.1); (2) a functional prior fitted by the maximum mean discrepancy (MMD), where the degree-two polynomial kernel reduces to moment matching with weights fixed by the kernel, together with a decomposition of the Kullback-Leibler (KL) divergence that explains why a sparse network can match at most the moments (Proposition 4.3, Lemma A.3); (3) a deterministic certificate for the universal conditional density approximation property, that is checkable in linear time, and a minimal repair when it fails (Proposition 4.7, Corollary A.9); (4) a characterization of the hybrid inference scheme as stochastic approximation for a type-II MAP objective, and a tracking bound showing that coupled sampler and optimizer step sizes leave an error term that does not shrink with the step size, which is attained by a Gaussian example (Theorem 4.9, Theorem A.13, Corollary 4.10, Proposition A.14).
Functional prior The prior on the parameters also induces a functional prior through
Here, is defined by the network architecture and, therefore, deterministic. However, this now enables us to change our view from parameters to functions.
Inference The posterior is intractable due to the intractability of the marginal likelihood . We sample it with stochastic gradient Hamiltonian Monte Carlo (SGHMC) (Chen et al., 2014), which scales to large datasets.
Partially and fully stochastic neural networks We first introduce fully-connected neural networks (multi-layer perceptrons (MLPs)), where the th layer is defined as
where is a possibly non-linear function (activation function), is the output of the 'th layer, is the weight matrix of the 'th layer, and is the bias of the 'th layer. For the first layer we set . In contrast to fully stochastic neural networks, where all parameters are stochastic (Neal, 1996), partially stochastic neural networks have both deterministic and stochastic parameters (Sharma et al., 2023).
Deep weight factorization Hoff (2017) showed that regularization is equivalent to regularization of a two-factor Hadamard parameterization, which avoids the non-differentiability of the penalty. Kolb et al. (2025) extended this to depth through:
where denotes the element-wise Hadamard-product. As Equation (1) inflates the dimensionality of the objective, the optimization is very sensitive to the initialization of the parameters as reported in Kolb et al. (2025).
3 RELATED WORKS
Functional priors in Bayesian neural networks The specification of priors is an important, yet difficult task as the prior has a direct impact on the performance of the neural network and should capture any prior knowledge about the data. For a thorough review of priors in Bayesian deep learning we refer the reader to the work of Fortuin (2022). A common trick, which was also mentioned by Fortuin (2022), is to change the perspective from the parameter space to the functional space and impose a prior on the function induced by the neural network (Flam-Shepherd et al., 2017; Wild et al., 2022). Tran et al. (2022) showed that optimizing the functional prior induced by the network to emulate a Gaussian process (GP) before sampling from the posterior can improve performance substantially.
Partially stochastic neural networks Fully stochastic neural networks are well-known and extensively researched (MacKay, 1995; Neal, 1996). For a comprehensive review of Bayesian neural networks (BNNs) we refer the reader to (Arbel et al., 2023).
The notion of partially stochastic neural networks, however, is a rather recent development driven by the work of Sharma et al. (2023). In this work, the authors have contributed theoretically and empirically to the development and justification of partial stochasticity by proving that many popular architectures have the property of being universal conditional density approximators (UCDAs); this means that under mild topological constraints, these models can approximate any conditional distribution. Since then, interest in partially stochastic neural networks, their application, and their properties has grown (e.g., (Calvo-Ordoñez et al., 2024; Allec and Ziatdinov, 2025; Prabhudesai et al., 2023)).
Sparsity in neural networks The weak (Frankle and Carbin, 2019) and strong lottery ticket hypotheses (Natale et al., 2024) give the justification for efforts to sparsify neural networks. One possible way to impose sparsity on the parameters is to perform automatic relevance determination, which is placing hyperpriors on the priors and shrinking scales continuously (Neal, 1996). So a parameter is rarely exactly deterministic and the split is never explicit. Many other works, e.g., (Hubin and Storvik, 2024; Wang et al., 2021; Deng et al., 2019), have focused on spike-and-slab priors (Mitchell and Beauchamp, 1988). However, all of these approaches prune capacity of the network by setting parameters to zero; our approach is different. We make the prior scales and mean learnable parameters and we then optimize the functional prior to prune the prior scales. This makes the parameters deterministic and the split explicit.
Selection of the stochastic and deterministic parameters The choice between stochastic and deterministic parameters for partially stochastic neural networks is a relatively new task for model selection. Closest to our setting, Andrade and Sato (2025) select the stochastic parameters from a MAP estimate. Subnetwork inference (Daxberger et al., 2021), which we include as SNI-PSNN, belongs to the same family of MAP-based selection methods. These methods first train a full network and select the split from its MAP estimate. Our split is learned from the functional prior, which uses only the inputs and requires no trained model. Sparse subspace variational inference (Li et al., 2024) removes parameters from the network and thereby reduces its capacity, whereas our deterministic parameters remain free to be optimized during inference. Rochussen (2024) fixes a structured subset of parameters in order to break weight symmetries, which is complementary to learning the split.
4 METHODS
Throughout the paper, we fit the functional prior by minimizing the MMD between the functional prior of the network and the target GP (for an introduction see (Rasmussen and Williams, 2008)) at random measurement locations. Previous work used the (sliced) Wasserstein distance for this purpose (Tran et al., 2022, 2021). The MMD (Gretton et al., 2012) is cheap to estimate from samples and allows the kernel to be chosen for the task. We specify the kernels used in our experiments in Section 5. We propose a novel way to find a split between stochastic and deterministic parameters by employing a deep weight factorization (DWF) parameterization (Kolb et al., 2025) for the prior scales of the parameters. In this section, we detail our method while supporting it with theoretical results. All proofs are in Section A.
4.1 Learning the split
Parameterization: For every we introduce factors , their product and , , . We refer to as the prior scale of . We chose this reparameterization of the prior scales to ensure that the standard deviations are non-negative with . The prior is for each parameter , where both and are trainable parameters. We initialize . With an odd activation and a zero-mean target process, is a stationary point of the objective, and the learned means remain at zero in our experiments. We perform the DWF on the prior scales only and initialize them according to (Kolb et al., 2025).
For measurement locations , let denote the distribution of under the prior with means and scales , and the corresponding marginal of the GP. For a kernel we define
where the generator G of the measurement locations is described below. In practice both distributions are replaced by the empirical measures of function samples (Remark A.6). We cast the prior optimization problem as
During the optimization, a parameter whose prior scale falls below a cutoff c is set to be deterministic, so that it receives no gradient from the objective. After optimization, we apply the minimal repair of Corollary A.9 whenever the certificate of Proposition 4.7 fails. On the UCI datasets this changes at most 34 parameters, or 0.3% of the network.
A natural question is to what extent affects sparsity. We show in Theorem 4.1 that at stationary points there is a gap in absolute values between the values that are set to 0 and the surviving prior scales. If lies within this gap, changing has no effect on the result. Kolb et al. (2025) have shown that performing DWF of depth is equivalent to optimizing with a -quasi norm. Since for , the penalty is only a quasi-norm, as the triangle inequality fails, and it is no longer convex. Its derivative grows without bound as , so small non-zero values are expensive and are pushed to exactly zero, which brings the penalty closer to and makes it sparser than (cf. Remark A.2). For the statistical properties of penalties with we refer the reader to Knight and Fu (2000) and Chartrand (2007), and for their realization through deep factorizations to Kolb et al. (2025). Proposition A.1 extends this to layer-specific , which yields the following theorem:
Theorem 4.1 (No small non-zero scales). Let , let . Let as a function of with all other variables fixed, and suppose . If is a stationary point of in these factors, then either all factors vanish, in which case or
The bound holds at exact stationary points. An optimizer step stops at approximate stationarity, and shrinks as the bound on the gradient grows, so the gap is not guaranteed in practice. In our experiments the surviving scales extend down to the cutoff, so the split depends on the choice of c in practice. The fitted model, however, is insensitive to c over more than an order of magnitude (Figure 4).
Remark 4.2. For comparable , choosing enforces : later layers are sparsified more aggressively.
A consequence of this theorem is that removes only scales that are exactly zero at every stationary point.
Borgwardt et al. (2006) showed that an MMD with a polynomial kernel of degree d matches moments up to degree d. For the degree-two kernel used in our experiments, this takes the following form.
Proposition 4.3 (The MMD reduced to moment matching). Let on , and let denote the second-moment matrix. Then for any two distributions with finite second moments,
Here the subscript 2 of denotes the use of the polynomial kernel of degree 2.
The weights of the mean and the second-moment term are thus fixed by the kernel and need not be tuned. In our implementation the objective is scaled by , which only rescales .
To estimate the objective we draw measurement locations from a generator which mixes the empirical distribution of the training inputs and a uniform distribution over the input range as suggested by Sun et al. (2019) and also done by Tran et al. (2022): , i.e. each location is a training input with probability and uniform otherwise. We use for the experiments. The choice of determines where the functional prior is actually constrained: the uniform component forces the match to hold away from the training data, which is precisely the region in which out-of-distribution uncertainty is evaluated.
4.2 Preserving expressiveness
We analyze how masking affects the UCDA property of Sharma et al. (2023) (Theorem A.7) through two notions.
Definition 4.4 (Bias coverage). Let be the surviving set in the first layer. The bias coverage is , and is the set of fully deterministic units.
Remark 4.5. The definition counts biases rather than weights for a reason. A stochastic input weight contributes , which vanishes at , so the scale in the proof of Proposition 4.7 would not be bounded away from zero and the recovery map would fail there. A stochastic bias enters additively and keeps for every input.
Definition 4.6 (UCDA of a masked network). Fix a mask. The masked network is a UCDA if for every as in Theorem A.7 with a continuous generator and every , there exist values of the deterministic parameters and a Gaussian distribution with independent nondegenerate coordinates on such that , where denotes the bounded-Lipschitz metric.
The definition only states that the mask does not restrict expressiveness, not that the approximation is found in practice. It is hard to check directly, but the following certificate can be checked in linear time.
Proposition 4.7 (Deterministic certificate). Let be compact and let have hidden layers with a continuous, strictly monotone, non-polynomial activation . Stochastic parameters may occur in any layer. If
then the masked network is a UCDA. Both conditions are checkable in time.
Remark 4.8. If the deterministic first-layer weights are fixed, for example after training, the second condition becomes , where are the first-layer weights of the units in , and Proposition A.8 gives the minimal repair for this case.
Note that need not be the raw input space. If a fixed continuous map precedes the network, the proposition applies unchanged with the dimension of its output.
If the certificate of Proposition 4.7 fails, a minimal repair restores it by making at most first-layer biases stochastic and, if needed, the cheapest units outside these fully deterministic (Corollary A.9).
4.3 Inference
The prior optimization provides three inputs to the inference stage. The split fixes the stochastic dimension and hence determines whether the model can represent the target conditional at all, the surviving scales define the prior over the stochastic block, and the means center the prior of both blocks. Let be the output of the prior optimization and set . We write , and , where is governed by a hyperparameter . We use this reparameterization so that corresponds to the value of the softplus function at 0. The hyperparameter controls how far the deterministic parameters may move from their prior mean. By Proposition A.12, freezes them at , a finite gives a type-II MAP estimate, and gives type-II maximum likelihood.
The deterministic block is optimized with Adam (Kingma and Ba, 2014) under the prior , and the stochastic block is sampled with SGHMC (Chen et al., 2014) under the prior . Let denote the joint posterior of under these two priors.
Theorem 4.9 (The near-degenerate approximation is a type-II MAP estimate). Let be the set of densities , with finite entropy and , where is the envelope from Assumption A.10 (ii), and let . Under Assumption A.10, for all and ,
with being a constant, for and locally bounded. The minimizers of are with .
By Fisher's identity, (Cappé et al., 2005), so the hybrid scheme is stochastic approximation EM for , with the sampler acting as a Monte Carlo E-step. Because the target of the sampler moves with , the step sizes matter. The next result shows that if sampler and optimizer share a step size, the bound on the tracking error does not vanish as the step size shrinks.
Corollary 4.10 (Coupled step sizes yield a non-vanishing tracking error). Assume in addition to the setting of Theorem A.13 that with and for all . Then for all
(a) Coupled. . The stationarity part of the bound tends to as . (b) Decoupled. If and , then
This bound is attained for a Gaussian example (Proposition A.14) and therefore sharp. We therefore let the optimizer step size decay faster than the sampler step size (Section E).
5 EXPERIMENTS
Unless stated otherwise, we use a MLP with two hidden layers of 100 units and a tanh activation. For regression we use CONCRETE, WINE, BIKESHARING and BOSTON, and for classification BANKNOTE, HTRU2, ONLINESHOPPERS and CREDIT. All of these datasets come from the UCI suite (Kelly et al., 2023). For each dataset we use ten random splits into 90% training and 10% test data and report the mean and standard deviation over the splits. We evaluate regression by root mean squared error (RMSE), negative log-likelihood (NLL) and expected calibration error (ECE), and classification by accuracy (ACC), NLL and ECE. Details are given in Section E. For the prior optimization we use the MMD with the degree-two polynomial kernel , which matches the mean and the second moment of the function values (Proposition 4.3).

Figure 1: Share of deterministic parameters per layer for DWF-PSNN before repair, with mean and standard deviation over ten splits
5.1 Learned Split
Figure 1 shows the learned split. It is stable across data splits, keeps the first and the output layer largely deterministic and leaves about half of the middle layer stochastic. The coverage condition holds in every run. The condition fails on datasets with many input features, and the minimal repair then changes between 1 and 34 parameters (Section C).
5.2 Conditions of the certificate

Figure 2: Predictive distribution at the bimodal input, with the true conditional dashed and certified configurations in blue. (a) Unconstrained reference, (b) output layer randomized, (c) no nonlinearity, (d) every weight randomized with fixed scales, (e) one randomized bias.
The certificate constrains a masked network through bias coverage, through the number of fully deterministic units, and through the activation. Figure 2 shows one configuration per condition on a target whose conditional distribution is bimodal, so that any Gaussian conditional is excluded by construction. In the reference (a) the noise enters as an additional input and every weight is deterministic, so the map is unconstrained and the reachable error is limited only by optimization. A single randomized bias in an admitted position (e) comes close to that reference. Randomizing the output layer (b) leaves the bias coverage at zero and fails, with sixty-four randomized parameters as much as with one. Randomizing every weight with fixed prior scales (d) fails from the opposite side, since no fully deterministic units remain. Removing the nonlinearity (c) fails while count and position are correct. The three conditions are therefore not vacuous and are needed together. Table 1 numerically supports the findings by providing the mean Wasserstein-1 distance.
Table 1: Mean Wasserstein-1 distance to the true conditional over nine held out inputs, with the standard error over five data seeds. The sampling floor is the distance between two independent samples from the true conditional at this sample size, and the point predictor is what a model reaches by matching the conditional median.
| variant | condition violated | |
|---|---|---|
| sampling floor | — | .020 |
| point predictor | — | .681 |
| noise input, | reference, none | |
| layer 1, | none | |
| layer 1, , weight | vanishes at | |
| output layer, | bias coverage | |
| output layer, all | bias coverage | |
| layer 1, , linear | activation | |
| full | deterministic units | |
| deterministic | no randomness |
We have added a more detailed version of Table 1 in Section D (Table 15). There we change the notation from layer 1 to first layer.

Figure 3: Learned and random splits on the bimodal target over five data seeds. Random masks permute the learned scales within each layer (circles) or across all layers (triangles) and are colored by whether they satisfy the certificate.
Randomizing up to sixty-four parameters of the output layer never approaches the certified configuration (Figure 6 in Section D), so the count of stochastic parameters does not substitute for their position. Figure 3 varies the budget instead. The learned split stays at between and deterministic parameters, and permuting its scales within a layer has no effect, since the units of a layer are exchangeable. Permuting them across layers is worse by up to two orders

Figure 4: Cutoff applied after the optimization on the bimodal target, over five data seeds. Left, share of deterministic parameters. Right, distance to the true conditional after refitting with the thresholded scales.
of magnitude and often worse than the fully deterministic model. The learned split thus matters through how it allocates stochasticity across layers. The certificate is sufficient but not necessary and leaves the scales free, so it does not separate these masks with fixed scales cleanly. Figure 4 varies the cutoff applied after the optimization. The prior scales do not separate into two groups, so the share of deterministic parameters grows with , from 90.2% at for to 99.7% at for . The distance to the true conditional nevertheless stays between 0.061 and 0.066 for all cutoffs and both values of , so the scales removed by a larger cutoff are too small to affect the fitted model.
5.3 The role of
We study the regimes of Proposition A.12 on CONCRETE. Freezing the deterministic parameters at in
Table 2: Results on CONCRETE for regimes (ii) and (iii) (mean std), with the drift of the deterministic parameters. The sampling hyperparameters differ from those of the benchmark (Section E).
| 0.03 | 2.5 | ||
|---|---|---|---|
| RMSE () | |||
| NLL () | |||
| ECE () | |||
regime (i) gives an RMSE of .997 .001 and an NLL of 4.74 .02, since all deterministic parameters are then zero. Table 2 shows regimes (ii) and (iii). As grows, the deterministic parameters move further from their prior mean, and RMSE and NLL improve monotonically. For the drift stays small, in line with Corollary A.16. The ECE behaves differently. It is lowest for and already close to its value in regime (iii) for , although all differences in ECE lie within one standard deviation. Small values of thus trade a little predictive accuracy for better calibration, while every finite improves substantially on regime (i).
5.4 Prior optimization

Figure 5: Top (from left to right): the deterministic fraction against iterations and the smallest surviving and the largest pruned prior scales; the mean () and the uncentered second-moment () terms on a logarithmic scale; the covariogram of the optimized prior against the target GP. Bottom (from left to right): DWF-PSNN prior and GP sample paths ; the GP posterior; the DWF-PSNN posterior
Here, we run the prior optimization on a 1D toy dataset. The data is drawn from a GP and we artificially introduce a gap in the middle. Figure 5 shows that the objective and both moment terms converge. The sample paths of the prior and the GP still differ in smoothness, which reflects the non-Gaussian part that the objective does not target (cf. Lemma A.3). The posterior nevertheless gives sensible uncertainty away from the data.
5.5 UCI benchmarks
We compare our approach (DWF-PSNN) to a fully stochastic network, where the functional prior is optimized (ALS-BNN); a partially stochastic network, where the first layer is stochastic, the subsequent layers are deterministic, and the functional prior is optimized (FLS-BNN); a partially stochastic neural network that makes the same overall share of parameters deterministic as DWF-PSNN, chosen uniformly at random across all layers and without repair (RAND-PSNN); the partially stochastic neural network as introduced in Daxberger et al. (2021) (SNI-PSNN), which represents MAP-based selection of the stochastic parameters. On these benchmarks, whose likelihoods are Gaussian or categorical, RAND-PSNN performs on par with DWF-PSNN, so the allocation of stochasticity matters less here than on the bimodal target of Figure 3. We refer the reader to Section B for the detailed results and Section E for more information on the experimental details. Table 3 shows that DWF-PSNN ranks at least as well as the fully stochastic ALS-BNN in all six combinations, although it keeps about half of its parameters deterministic.
Table 3: Mean ranks across the classification and regression datasets, computed from the mean performance on each dataset with tied ranks averaged. Lower ranks indicate better performance. The Nemenyi critical difference (CD) at is 3.05 for both tasks (, ). The only pairwise difference that exceeds it is between RAND-PSNN and SNI-PSNN in classification NLL.
| Classification () | |||
|---|---|---|---|
| Method | ACC () | NLL () | ECE () |
| DWF-PSNN | |||
| ALS-BNN | |||
| FLS-BNN | |||
| RAND-PSNN | |||
| SNI-PSNN | |||
| Friedman | |||
| Regression () | |||
|---|---|---|---|
| Method | RMSE () | NLL () | ECE () |
| DWF-PSNN | |||
| ALS-BNN | |||
| FLS-BNN | |||
| RAND-PSNN | |||
| SNI-PSNN | |||
| Friedman | |||
Table 4 shows that the certificate fails on the datasets with many input features, both for the learned masks before repair and for random masks with the same budget. The repair changes on average at most 28.1 parameters per split and never more than 34.
6 CONCLUSION
Learning with neural networks in a partially stochastic framework requires determining whether each parameter should be treated as deterministic or stochastic.
Table 4: Certificate on the UCI datasets. Share of splits in which the learned mask satisfies the certificate before repair, mean number of parameters changed by the repair, and share of 2,000 random masks with the learned budget that satisfy the certificate.
| Dataset | learned | repair | random | |
|---|---|---|---|---|
| BANKNOTE | 4 | 1.00 | 0.0 | 1.00 |
| HTRU2 | 8 | 1.00 | 0.0 | 1.00 |
| CONCRETE | 8 | 0.90 | 0.1 | 0.97 |
| WINE | 10 | 0.00 | 5.5 | 0.09 |
| BIKESHARING | 12 | 0.00 | 7.3 | 0.01 |
| BOSTON | 13 | 0.00 | 7.8 | 0.00 |
| ONLINESHOPPERS | 17 | 0.00 | 11.7 | 0.00 |
| CREDIT | 23 | 0.00 | 28.1 | 0.00 |
These choices affect guarantees of universal approximation and performance. In this paper, we proposed a novel approach to learn such a split by applying deep weight factorization to the prior scales, while matching the functional prior to a Gaussian process with an MMD objective. A certificate that is cheap to check guarantees universal conditional density approximation, and a minimal repair restores it when it fails. We characterized the inference scheme as a stochastic approximation for a type-II MAP objective. Then we showed that coupled step sizes of the sampler and the optimizer can leave a persistent tracking error. Our experiments show that the learned split allocates stochasticity where it matters and that the method is competitive on UCI benchmarks.
6.1 Limitations and Future Work
Beyond MLPs. By the observation after Proposition 4.7, the certificate covers the head of a convolutional or transformer model with a fixed stack below it. Applying the split there is a natural next step, but Corollary A.9 needs a head wider than the feature dimension, which most architectures do not satisfy. The stack itself, with its shared weights, stays outside our analysis.
Closed-loop dynamics. Theorem A.13 and Corollary 4.10 assume that the optimizer path does not depend on the sampler noise. In our algorithm the Adam updates use the current samples, so the analysis covers the tracking part of the error but not the feedback between the two blocks. Extending the bounds to this closed-loop setting is left for future work.
6.2 AI Use Statement
In this work, we used generative AI tools to help formulate mathematical claims, to provide ingredients for the proofs and assist in writing them, to give feedback on the methodology and the experiments, and to help implement the methods. Additionally, we used generative AI tools to edit the text for readability and to write and edit code. We have reviewed all AI-assisted work. All proofs were checked line by line by the authors, the code was tested for correctness, and the text was checked for plagiarism. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.
References
Allec, S. I. and Ziatdinov, M. (2025). Active and transfer learning with partially Bayesian neural networks for materials and chemicals. Digital Discovery, 4:1284–1297.
Andrade, D. and Sato, K. (2025). On the effectiveness of partially deterministic Bayesian neural networks. Computational Statistics, 40(5):2491–2518.
Arbel, J., Pitas, K., Vladimirova, M., and Fortuin, V. (2023). A primer on Bayesian neural networks: Review and debates. arXiv preprint arXiv:2309.16314.
Borgwardt, K. M., Gretton, A., Rasch, M. J., Kriegel, H.-P., Schölkopf, B., and Smola, A. J. (2006). Integrating structured biological data by Kernel Maximum Mean Discrepancy. Bioinformatics, 22(14):e49–e57.
Calvo-Ordoñez, S., Meunier, M., Piatti, F., and Shi, Y. (2024). Partially stochastic infinitely deep Bayesian neural networks. In Proceedings of the 41st International Conference on Machine Learning, ICML'24. JMLR.org.
Cappé, O., Moulines, É., and Rydén, T. (2005). Inference in hidden Markov models. In Springer Series in Statistics.
Chartrand, R. (2007). Exact reconstruction of sparse signals via nonconvex minimization. IEEE Signal Processing Letters, 14(10):707–710.
Chen, T., Fox, E., and Guestrin, C. (2014). Stochastic Gradient Hamiltonian Monte Carlo. In Xing, E. P. and Jebara, T., editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1683–1691, Beijing, China. PMLR.
Cortez, P., Cerdeira, A., Almeida, F., Matos, T., and Reis, J. (2009). Wine Quality. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C56S3T.
Csiszár, I. (1975). I-Divergence Geometry of Probability Distributions and Minimization Problems. The Annals of Probability, 3(1):146–158.
Daxberger, E., Nalisnick, E., Allingham, J. U., Antoran, J., and Hernandez-Lobato, J. M. (2021). Bayesian Deep Learning via Subnetwork Inference. In Meila,
M. and Zhang, T., editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 2510–2521. PMLR.
Deng, W., Zhang, X., Liang, F., and Lin, G. (2019). An Adaptive Empirical Bayesian Method for Sparse Deep Learning. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc.
Fanaee-T, H. (2013). Bike Sharing. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5W894.
Flam-Shepherd, D., Requeima, J., and Duvenaud, D. (2017). Mapping Gaussian process priors to Bayesian neural networks. In NIPS Bayesian deep learning workshop, volume 3.
Fortuin, V. (2022). Priors in Bayesian Deep Learning: A Review. International Statistical Review, 90(3):563–591.
Frankle, J. and Carbin, M. (2019). The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks. In International Conference on Learning Representations.
Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. (2012). A Kernel Two-Sample Test. Journal of Machine Learning Research, 13(25):723–773.
Harrison, D. and Rubinfeld, D. L. (1978). Hedonic housing prices and the demand for clean air. Journal of Environmental Economics and Management, 5(1):81–102.
Hoff, P. D. (2017). Lasso, fractional norm and structured sparse estimation using a Hadamard product parametrization. Computational Statistics & Data Analysis, 115:186–198.
Hubin, A. and Storvik, G. (2024). Sparse Bayesian Neural Networks: Bridging Model and Parameter Uncertainty through Scalable Variational Inference. Mathematics, 12:788.
Kelly, M., Longjohn, R., and Nottingham, K. (2023). The UCI machine learning repository. https://archive.ics.uci.edu.
Kingma, D. and Ba, J. (2014). Adam: A Method for Stochastic Optimization. International Conference on Learning Representations.
Knight, K. and Fu, W. (2000). Asymptotics for lasso-type estimators. The Annals of Statistics, 28(5):1356–1378.
Kolb, C., Weber, T., Bischl, B., and Rügamer, D. (2025). Deep Weight Factorization: Sparse Learning Through the Lens of Artificial Symmetries. In The Thirteenth International Conference on Learning Representations.
Kuleshov, V., Fenner, N., and Ermon, S. (2018). Accurate Uncertainties for Deep Learning Using Calibrated Regression. In Dy, J. and Krause, A., editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 2796–2804. PMLR.
Leshno, M., Lin, V. Y., Pinkus, A., and Schocken, S. (1993). Multilayer feedforward networks with a nonpolynomial activation function can approximate any function. Neural Networks, 6(6):861–867.
Li, J., Miao, Z., Qiu, Q., and Zhang, R. (2024). Training Bayesian Neural Networks with Sparse Subspace Variational Inference. In Kim, B., Yue, Y., Chaudhuri, S., Fragkiadaki, K., Khan, M., and Sun, Y., editors, International Conference on Learning Representations, volume 2024, pages 51238–51249.
Lohweg, V. (2012). Banknote Authentication. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C55P57.
Lyon, R. (2015). HTRU2. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5DK6R.
MacKay, D. J. (1995). Bayesian neural networks and density networks. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 354(1):73–80. Proceedings of the Third Workshop on Neutron Scattering Data Analysis.
Mitchell, T. J. and Beauchamp, J. J. (1988). Bayesian Variable Selection in Linear Regression. Journal of the American Statistical Association, 83(404):1023–1032.
Natale, E., Ferré, D., Giambartolomei, G., Giroire, F., and Mallmann-Trenn, F. (2024). On the Sparsity of the Strong Lottery Ticket Hypothesis. In Globerson, A., Mackey, L., Belgrave, D., Fan, A., Paquet, U., Tomczak, J., and Zhang, C., editors, Advances in Neural Information Processing Systems, volume 37, pages 40565–40592. Curran Associates, Inc.
Neal, R. M. (1996). Bayesian Learning for Neural Networks. Lecture Notes in Statistics. Springer New York, NY, 1 edition.
Prabhudesai, S., Hauth, J., Guo, D., Rao, A., Banovic, N., and Huan, X. (2023). Lowering the computational barrier: Partially Bayesian neural networks for transparency in medical imaging AI. Frontiers in Computer Science, 5:1071174.
Rasmussen, C. E. and Williams, C. K. I. (2008). Gaussian Processes for Machine Learning. Adaptive computation and machine learning. MIT Press, Cambridge, Mass., 3. print edition.
Rochussen, T. (2024). Structured Partial Stochasticity in Bayesian Neural Networks. In Sixth Symposium on Advances in Approximate Bayesian Inference - Non Archival Track.
Sakar, C. and Castro, Y. (2018). Online Shoppers Purchasing Intention Dataset. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5F88Q.
Sharma, M., Farquhar, S., Nalisnick, E., and Rainforth, T. (2023). Do Bayesian Neural Networks Need To Be Fully Stochastic? In Ruiz, F., Dy, J., and van de Meent, J.-W., editors, Proceedings of The 26th International Conference on Artificial Intelligence and Statistics, volume 206 of Proceedings of Machine Learning Research, pages 7694–7722. PMLR.
Sun, S., Zhang, G., Shi, J., and Grosse, R. (2019). Functional Variational Bayesian Neural Networks. In International Conference on Learning Representations.
Tran, B.-H., Rossi, S., Milios, D., and Filippone, M. (2022). All You Need is a Good Functional Prior for Bayesian Deep Learning. Journal of Machine Learning Research, 23(74):1–56.
Tran, B.-H., Rossi, S., Milios, D., Michiardi, P., Bonilla, E. V., and Filippone, M. (2021). Model Selection for Bayesian Autoencoders. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W., editors, Advances in Neural Information Processing Systems, volume 34, pages 19730–19742. Curran Associates, Inc.
Vladimirova, M., Verbeek, J., Mesejo, P., and Arbel, J. (2019). Understanding Priors in Bayesian Neural Networks at the Unit Level. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 6458–6467. PMLR.
Wang, Y., Deng, W., and Lin, G. (2021). Bayesian sparse learning with preconditioned stochastic gradient MCMC and its applications. Journal of Computational Physics, 432:110134.
Welsh, D. J. A. (1970). On Matroid Theorems of Edmonds and Rado. Journal of the London Mathematical Society, s2-2(2):251–256.
Wild, V. D., Hu, R., and Sejdinovic, D. (2022). Generalized Variational Inference in Function Spaces: Gaussian Measures meet Bayesian Deep Learning. In Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., and Oh, A., editors, Advances in Neural Information Processing Systems, volume 35, pages 3716–3730. Curran Associates, Inc.
Yaida, S. (2020). Non-Gaussian Processes and Neural Networks at Finite Widths. In Proceedings of The First Mathematical and Scientific Machine Learning Conference, volume 107 of Proceedings of Machine Learning Research, pages 165–192. PMLR.
Yeh, I.-C. (1998). Concrete Compressive Strength. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C5PK67.
Yeh, I.-C. (2009). Default of Credit Card Clients. UCI Machine Learning Repository. DOI: https://doi.org/10.24432/C55S3H.
A THEORETICAL RESULTS AND PROOFS
A.1 Learning the split
Proposition A.1 (Layer-weighted quasi-norm). Since depends on the factors only through ,
Proof. Fix and . By the AM-GM inequality , with equality if and only if for all . Hence, the inner minimum of under the constraint equals . Multiplying by and summing over and gives the claim.
Remark A.2 (Effective penalty of the prior scales). Since for our reparameterization we have near zero, the penalty behaves like . On the prior scale itself the regularizer is therefore of type, which is sparser than the quasi-norm acting on .
Theorem 4.1 (No small non-zero scales). Let , let . Let as a function of with all other variables fixed, and suppose . If is a stationary point of in these factors, then either all factors vanish, in which case or
Proof. Write and . Stationarity in the -th factor reads . Multiplying by gives , so
If , all factors vanish. Otherwise , and forces and . Hence, . This expression is decreasing in , so yields . The bound on follows from .
The following Lemma is a special case of the Pythagorean identity onto exponential families (Csiszár, 1975):
Lemma A.3 (Pythagorean decomposition). Let be a distribution on with finite second moments, mean and positive definite covariance matrix , and let . Then for every Gaussian with positive definite covariance matrix,
In particular, if P has no Lebesgue density, both and are infinite.
Proof. and are equivalent to Lebesgue measure. If is not absolutely continuous, then and the identity holds trivially. Otherwise let be the density of , the density of , and be the density of . Since and are quadratic polynomials and share their first two moments, and also , and all four quantities are finite. The integral lies in because the entropy of is bounded by that of . If it equals , both sides are infinite. Otherwise
☐
Remark A.4 (Why moments). When the number of stochastic parameters drops below the number of measurement points, the network output has no Lebesgue density. By Lemma A.3 both divergences are then infinite, and only the moment discrepancy can be controlled. This motivates an objective based on the first two moments. By Proposition 4.3, MMD vanishes exactly when the first two moments agree, so is such an objective. For deeper networks the non-Gaussianity term can be substantial (Vladimirova et al., 2019; Yaida, 2020), and a characteristic kernel could target it.
Remark A.5 (Hierarchical targets). When the kernel hyperparameters of the target process carry hyperpriors, as in our experiments, the target Q is a mixture of Gaussians and not itself Gaussian. Proposition 4.3 holds for arbitrary distributions with finite second moments and is unaffected. Lemma A.3 applies with Q replaced by its Gaussian moment projection , which is exactly the Gaussian whose moments our objective matches.
Proposition 4.3 (The MMD reduced to moment matching). Let on , and let denote the second-moment matrix. Then for any two distributions with finite second moments,
Here the subscript 2 of MMD denotes the use of the polynomial kernel of degree 2.
Proof. Expanding, and . Hence, with the feature map , where the last component carries the Frobenius inner product. Since , the mean embedding exists, and
Remark A.6 (What is optimized in practice). is the number of measurement locations. In every step we draw from and compute the empirical moments from function samples. The loss of this step is for the empirical measures and , which is the biased MMD estimator scaled by . If the GP moments are computed exactly, replace by . Since the locations are redrawn in every step, the optimized quantity is , which is the empirical counterpart of .
A.2 Preserving expressiveness
For simplicity, we repeat the UCDA theorem by (Sharma et al., 2023) again:
Theorem A.7 (Universal Conditional Distribution with Finite Stochasticity). Let take values in a compact and in . Let be a network with deterministic parameters and Gaussian noise independent of with finite mean and variance. Suppose that for some hidden layer , after restricting to a ball , (1) and are fully input by this layer, (2) ranges over a compact set, (3) there is a deterministic, continuous, surjective with , and (4) the downstream network is a universal approximator in the sense of (Leshno et al., 1993). If admits a continuous generator, then approximates arbitrarily well.
Proposition 4.7 (Deterministic certificate). Let be compact and let have hidden layers with a continuous, strictly monotone, non-polynomial activation . Stochastic parameters may occur in any layer. If
then the masked network is a UCDA. Both conditions are checkable in time.
Proof. Let and fix with . Units in carry no stochastic parameter, so , and follows. Let .
Step 1: reduced network Consider configurations in which every weight from a unit in into layer 2 has mean 0, and every stochastic parameter in layers has variance . Denote the output by . For the output depends on the first layer through the units in . For decompose the pre-activation as , where
with independent standard Gaussian that are independent of . Set for . Conditionally on the vector is , and since this distribution does not depend on , is independent of . The first layer output on is with and , a continuous function of . We verify the conditions of Theorem A.7 for with and . (1) Holds by construction, (2) is a continuous image of the compact set . (3) A continuous strictly monotone has a continuous inverse on the interval , so is recovered continuously. Since and the deterministic parameters are free, we may choose their values such that . Now we recover , then for , where is continuous and bounded from below. This map is continuous, recovers exactly and is surjective onto the restricted domain. (4) Since , the network from layer 1 onward has at least one hidden layer with a continuous non-polynomial activation, and its weights out of are free. (Leshno et al., 1993) applies. Hence for every , there are parameter values with .
Step 2: Downstream noise Write , where collects all first-layer noise, the standard Gaussian noise of the stochastic parameters in layers , and is jointly continuous. Then and
Given , choose with . On the compact set , the map is uniformly continuous in . Choosing and accordingly, gives a nondegenerate Gaussian distribution on with .
Complexity One pass over the bias mask gives , one pass over the weight mask gives T. Together this adds up to
Proposition A.8 (Make , full rank). For fixed values of the deterministic first-layer weights, the rank condition can be restored as follows. For let , where denotes the first-layer parameters of unit , be the number of parameters of unit that survived the prior optimization. Making unit fully deterministic means setting for all changing parameters.
Let be any set of units excluded from the repair and put . Suppose . Then (i) the family is the set of independent sets of a linear matroid on , and every basis has exactly elements; (ii) sorting by in increasing order and greedily adding a unit whenever it increases the rank returns a basis of minimum total weight ; (iii) making every unit of fully deterministic yields a mask whose set of fully deterministic units contains , so that ; (iv) no repair that leaves the units of untouched and restores the rank condition changes fewer parameters if no unit in is fully deterministic. The cost is
Proof. (i) Linear independence of rows of a fixed matrix defines a linear (matric) matroid on the row index set with , so all bases have elements. (ii) The weight is nonnegative and modular, and for such weights the greedy algorithm returns a minimum-weight basis of a matroid (Welsh, 1970). (iii) Every parameter of a unit in has after the repair, so , and the rank of a submatrix does not decrease when rows are added. (iv) Any repaired mask satisfying the certificate has some with , hence contains a basis of the matroid, and every surviving parameter of every unit of must have been set to zero, which costs . The complexity of it is one sort plus rank-one updates of QR factorization of size .
Corollary A.9 (Minimal Repair). Suppose . Let , so that , and for every first-layer unit let be the number of its stochastic parameters.
Step 1 (coverage). If , choose with and make the biases of stochastic. Otherwise choose with . This changes parameters and gives , and no repair achieving changes fewer.
Step 2 (deterministic units). Let be the set of fully deterministic units after Step 1 and . If , let consist of the units of with the smallest , and make all first-layer parameters of these units deterministic. This changes parameters, and no repair that leaves untouched and achieves changes fewer, where .
The resulting mask satisfies the certificate of Proposition 4.7. Step 2 does not undo Step 1 because , and Step 1 does not undo Step 2 because the units of have stochastic biases and are therefore not in .
Proof. Step 1 makes one bias stochastic per changed parameter, which gives afterwards, and any repair achieving this must change at least biases. For Step 2, the units of have stochastic biases, so and by . Hence exists. Any repair that leaves untouched and achieves must make at least units of fully deterministic, and doing so for a unit changes exactly parameters. The sum of over units is smallest for the units with the smallest , which are those in . After both steps and , so Proposition 4.7 applies.
A.3 Inference
Assumption A.10 (Regularity). (i) For every , the map is continuously differentiable. (ii) There are and , with for all . (iii) and for all .
Remark A.11. (iii) holds for categorical likelihoods and for Gaussian likelihoods with noise variance bounded from below. (ii) holds whenever the gradient grows polynomially in , since is Gaussian. Under (ii) and (iii), dominated convergence shows that is and that is continuous for every bounded continuous .
Let denote the joint posterior of under the prior , so that .
Proposition A.12 ( interpolates between freezing and type-II ML). Under Assumption A.10 the joint posterior has a Lebesgue density for every . Moreover, (i) as , converges weakly to ; (ii) for , is, up to a constant, the log marginal posterior density of ; (iii) as , uniformly on compacts. Keeping the degenerate prior while optimizing is ill-posed, since the log-prior is off the atom.
Proof. The joint density is integrable by regularity assumption (iii). For (i) let be bounded and continuous and set . and are bounded by and and continuous by the Remark A.11. Since ,
using . (ii) follows by writing out . For (iii), .
Theorem 4.9 (The near-degenerate approximation is a type-II MAP estimate). Let be the set of densities , with finite entropy and , where is the envelope from Assumption A.10 (ii), and let . Under Assumption A.10, for all and ,
with being a constant, for and locally bounded. The minimizers of are with .
Proof. By definition of the KL divergence,
and . Exactly . By the mean value theorem and (ii) of Assumption A.10, , so
which defines . Using ,
and substituting gives the stated form of . The KL term is nonnegative and vanishes if and only if , which lies in by (iii). It is the only term that depends on , so minimizing reduces to maximizing .
Theorem A.13 (Tracking bound under constant step sizes). Assume for all (C1) with , (C2) , (C3) , (C4) for the s-marginals. Let denote the state of the sampler after steps, with momentum . Let be the distribution of and . Then
Proof. Since is invariant for and for an open-loop path,
Iterating gives the second bound. The third follows from the triangle inequality, marginalization, and (C4). ☐
Corollary 4.10 (Coupled step sizes yield a non-vanishing tracking error). Assume in addition to the setting of Theorem A.13 that with and for all . Then for all
(a) Coupled. . The stationarity part of the bound tends to as . (b) Decoupled. If and , then
Proof. Insert into Theorem A.13 and use . For (b) add from (C4).
This result gives an upper bound for the error, the following proposition shows that this bound is also attained:
Proposition A.14 (The coupled bound is attained). Let on , let be the unadjusted Langevin kernel with , let and let . Then (C1) to (C3) hold with , , , , and
In the coupled case this is at least for all , independently of .
Proof. Synchronous coupling gives (C1) with . The variance recursion has fixed point , so and (C2) holds with . Since and the variance recursion does not involve with . The lag satisfies and , hence . Two Gaussians with equal variance and means differing by are at -distance , and . Finally, .
We also manage to find an error decomposition, where each term relates to a specific modeling choice. This allows us to better understand how to make the modeling choices, if we want to reduce the error.
Corollary A.15 (Error decomposition). In the setting of Theorem A.13, let satisfy and , let be the burn-in, , , and with an independent copy of . Then
Proof. Bias. Decompose
Since is 1-Lipschitz, the first sum is at most by Theorem A.13, the second is at most term (c) by (C2), and the third is at most by (C4).
Variance. For let . By (C1) applied to Dirac measures, . Hence,
and trivially . Therefore, . Minkowski's inequality combines bias and standard deviation.
Corollary A.16 (Drift radius). Every stationary point of satisfies . If, in addition is -Lipschitz and , then is strongly concave, is unique, and with ,
so the drift equals . By Fisher's identity, is estimable from the frozen run of regime (i) at no extra cost.
Proof. The identity is the stationary condition . An -Lipschitz gradient makes convex, so is strongly concave with modulus . From the identity, and ; rearrange.
B DETAILED UCI RESULTS
First we are going to provide some information on the datasets. The licenses of the datasets can be found on their respective websites.
| Dataset | Sample size | Parameters | Citation | |
|---|---|---|---|---|
| CONCRETE | (8, 1) | 1030 | 11101 | (Yeh, 1998) |
| BOSTON | (13, 1) | 506 | 11601 | (Harrison and Rubinfeld, 1978) |
| BIKESHARING | (12, 1) | 731 | 11501 | (Fanaee-T, 2013) |
| WINE | (10, 1) | 4898 | 11301 | (Cortez et al., 2009) |
| ONLINESHOPPERS | (17, 2) | 12330 | 12102 | (Sakar and Kastro, 2018) |
| CREDIT | (23, 2) | 30000 | 12702 | (Yeh, 2009) |
| BANKNOTE | (4, 2) | 1372 | 10802 | (Lohweg, 2012) |
| HTRU2 | (8, 2) | 17898 | 11202 | (Lyon, 2015) |
Table 5: Dataset characteristics.
Table 6: Results on BANKNOTE (mean std).
| ACC in % (↑) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| \text{ACC in %} | ||||||||||
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 7: Results on HTRU2 (mean std).
| ACC in % (↑) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| \text{ACC in %} | ||||||||||
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 8: Results on ONLINESHOPPERS (mean std).
| ACC in % (↑) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| \text{ACC in %} | ||||||||||
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 9: Results on CREDIT (mean std).
| ACC in % (↑) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| \text{ACC in %} | ||||||||||
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 10: Results on CONCRETE (mean std).
| RMSE (↓) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 11: Results on WINE (mean std).
| RMSE (↓) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| DWF-PSNN | ||||||||||
| ALS-BNN | ||||||||||
| FLS-BNN | ||||||||||
| RAND-PSNN | ||||||||||
| SNI-PSNN | ||||||||||
Table 12: Results on BIKESHARING (mean std).
| RMSE (↓) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |
|---|---|---|---|---|
| DWF-PSNN | ||||
| ALS-BNN | ||||
| FLS-BNN | ||||
| RAND-PSNN | ||||
| SNI-PSNN |
Table 13: Results on BOSTON (mean std).
| RMSE (↓) | NLL (↓) | ECE (↓) | Deterministic parameters in % | |
|---|---|---|---|---|
| DWF-PSNN | ||||
| ALS-BNN | ||||
| FLS-BNN | ||||
| RAND-PSNN | ||||
| SNI-PSNN |
C THE LEARNED SPLIT
Figure 1 and Table 14 summarize the split learned by the prior optimization. The split is stable across splits of the data, with standard deviations of at most 0.04 in the share of deterministic weights. The first and the output layer are largely deterministic, while the middle layer keeps about half of its weights stochastic. Since the middle layer holds the large majority of the parameters, it dominates the overall share of deterministic parameters reported in Section B. The classification datasets are sparsified slightly more than the regression datasets.
The middle layer is sparsified least, although its regularization weight exceeds that of the first layer. This does not contradict Remark 4.2, which assumes comparable gradient bounds across layers. The middle layer has a larger fan-in, and the gradient of the objective with respect to its prior scales is therefore unlikely to be bounded by the same constant as in the other layers.
In every dataset and split, between 7 and 27 of the 100 first-layer biases remain stochastic. The coverage condition of Proposition 4.7 therefore holds with a wide margin. Before repair, the condition holds on BANKNOTE, HTRU2 and in nine of ten splits of CONCRETE. On the other datasets the repair changes on average between 5.5 and 28.1 parameters per split, with the largest number of changes on CREDIT, which has the most input features (cf. Table 4). Whether the output bias is deterministic varies between datasets, from none of the splits on BANKNOTE to all of them on CREDIT and WINE. The certificate places no condition on the output bias, so this variation does not affect the expressiveness of the masked network. All values refer to the learned masks before repair.
Table 14: Learned split of DWF-PSNN. The first columns give the share of deterministic parameters per layer, with mean and standard deviation over the ten splits. The next column gives the range over splits of the number of stochastic first-layer biases out of 100. The last column gives the number of splits in which the output bias is deterministic.
| Dataset | Deterministic parameters | Stochastic first-layer biases | Deterministic output bias | ||
|---|---|---|---|---|---|
| Layer 1 | Layer 2 | Output layer | |||
| ONLINESHOPPERS | 9–17 | 6/10 | |||
| CREDIT | 7–20 | 10/10 | |||
| BANKNOTE | 8–18 | 0/10 | |||
| HTRU2 | 10–18 | 7/10 | |||
| CONCRETE | 11–22 | 4/10 | |||
| BOSTON | 12–24 | 5/10 | |||
| BIKESHARING | 13–25 | 4/10 | |||
| WINE | 18–27 | 10/10 | |||
D THE CONDITIONS OF THE CERTIFICATE
Table 15: The violated conditions are the ones in Proposition 4.7. Values are the mean Wasserstein-1 distance to the true conditional over nine held out inputs, with the standard error over five data seeds. The sampling floor is the distance between two independent samples from the true conditional at this sample size, so no model can go below it, and the point predictor is what a model reaches by matching the conditional median without representing any spread. The last column repeats the study with learnable prior scales.
| variant | condition violated | |||
|---|---|---|---|---|
| fixed | learned | |||
| sampling floor | — | — | ||
| point predictor | — | |||
| noise input, | reference, none | |||
| first layer, | none | |||
| first layer, , weight | vanishes at | |||
| output layer, | bias coverage | |||
| output layer, all | bias coverage | |||
| first layer, , linear | activation | |||
| full | deterministic units | |||
| deterministic | no randomness | |||

Figure 6: Distance to the true conditional against the number of randomized parameters in the output layer, with the certified configuration and the sampling floor as horizontal lines. Mean over five data seeds with the standard error.
Setup. The target has a bimodal conditional distribution with an input dependent mixture weight, so that any Gaussian conditional is excluded by construction. Since the certificate is a statement about representation, posterior inference would confound capacity with the quality of the sampler. Every variant is therefore fitted directly as a conditional generator by minimizing the energy score, which is strictly proper, and is scored by the Wasserstein-1 distance to the true conditional. Within each data seed we keep the best of five restarts, selected on the validation energy score and never on the reported distance, because the statement is an existence statement about parameters. All variants share one architecture with two hidden layers of width sixty-four and differ only in which parameters are randomized. In the column fixed, every stochastic parameter has prior scale . In the column learned, the scales are parameterized by a softplus and fitted jointly with the means, without a sparsity penalty.
The reference acts as a gate. In the reference the randomness enters as an additional input and every weight is deterministic, so the map is unconstrained. It reaches 0.053 against a sampling floor of 0.020, which shows that the fitting procedure is not the binding constraint and that the remaining differences can be read as consequences of the condition each variant violates.
Why biases and not weights. The variant that randomizes a weight of the first layer rather than a bias satisfies the count and the position, and still reaches only 0.284. A stochastic input weight contributes , which vanishes at , so the scale in the proof of Proposition 4.7 is not bounded away from zero and the predictive distribution degenerates there. This is the reason Definition 4.4 counts biases.
Fixed and learnable prior scales. Only the fully stochastic row depends on this choice, and it changes by a factor of fifty. With learnable scales that variant contains the certified one as a special case, since it can drive all but standard deviations to zero, and the optimizer finds such a configuration. The condition therefore constrains a fixed mask with fixed scales, which is the setting of our two stage method, where the prior scales are determined in the first stage and held during sampling. With fixed scales the variant is not merely worse but wildly overdispersed, at eight times the distance of a point predictor, which is why its panel in Figure 2 appears flat.
Count does not substitute for position. Figure 6 increases the number of randomized parameters in the output layer from one to sixty-four. The distance is flat between 0.46 and 0.59 throughout and never approaches the certified configuration at 0.074, so a factor of sixty-four in the count does not compensate for a position the certificate rejects.

Figure 7: All variants of Table 15 at three inputs, with fixed prior scales. In the panel titles denotes the output dimension , rank denotes the condition on the fully deterministic units and no noise corresponds to no randomness in Table 15. Grey dashed is the true conditional, blue marks the configurations the certificate admits. The vertical range is fixed by the target density, so mass outside it appears flat.
Figure 8 shows the prior scales behind Figure 4. For most factors are driven many orders of magnitude below the cutoff, which shows that the penalty of Section 4.1 pushes pruned scales towards zero. For the scales form a continuum across the cutoff.

Figure 8: Histogram of on the bimodal target over five data seeds, with the cutoff on the prior scale, which corresponds to , as a dashed line. For larger the pruned products collapse towards zero.
E EXPERIMENTAL DETAILS
We use a MLP with two hidden layers of 100 units each and a tanh activation function, where not stated differently. All regression and classification experiments were run on an Nvidia A40 GPU, and each model finished in less than two hours. The runs for the role of and the UCDA experiment have also been performed on an Nvidia A40 GPU and finished within hours. All other experiments were performed on a MacBook Pro 2021 with Apple M1 Pro chip and took between a few minutes and a few hours. Unless stated otherwise, we use the random seed 123 for initialization and sampling, and all methods share the same ten data splits. We build on the code base provided by (Tran et al., 2022). The repository does not state a license. The accompanying paper is published under CC-BY 4.0. We have not performed an extensive hyperparameter search, but in most cases tried out a few configurations and picked the best one. Additionally, we use a two-phase learning-rate schedule. Let denote the total number of optimization steps and let . For optimizer , the learning rate at step is given by
where and .
The learned masks satisfy the coverage condition in all runs. The condition fails on the datasets with many input features, where fewer than first-layer units are fully deterministic. In these runs we apply the minimal repair of Corollary A.9, which changes between 1 and 34 parameters per run (Table 4).
E.1 Regression experiments
For regression, ECE denotes the calibration error of Kuleshov et al. (2018). We summarize the predictive distribution of test point by a Gaussian with the predictive mean and variance and evaluate its cumulative distribution function at the target . For the confidence levels with , let be the share of test points with . We report . This is a sum over the levels and not an average, so its scale is not comparable to that of the classification ECE. Additionally, we standardize the targets. The target GP has a constant zero mean function, a variance of 1, a length-scale of , and a noise variance of 0.1. On top of that, we have the following hyperpriors:
We set D=3 and the cutoff as 0.01. The configuration for the prior optimization are:
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Number of iterations | 10000 |
| Regularization () | / D |
| Number of function samples | 100 |
| Learning rate | 0.01 |
| Kernel | Polynomial of degree 2 |
Table 16: Hyperparameters used for prior optimization
For sampling we have used the following hyperparameters:
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Number of samples per chain | 30 |
| Discarded samples before sampling | 10 |
| Thinning interval | 200 |
| Number of chains | 4 |
| Momentum decay | 0.02 |
| Burn in steps | 3000 |
| SGHMC learning rate (h) | 0.03 |
| Adam learning rate () | 0.003 |
Table 17: Hyperparameters used for all models but SNI-PSNN
We have set .
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Prior precision | 1.0 |
| Stochastic fraction | 0.1 |
| Noise variance | 0.1 |
| Epochs | 1000 |
| Learning rate | 0.01 |
Table 18: Hyperparameters used for SNI-PSNN
E.2 Classification experiment
The GP is set up as in the regression experiment. For the prior optimization we also use the same hyperparameters, but with a batch size of 128. For the sampling we use the following hyperparameters:
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Number of samples per chain | 30 |
| Discarded samples before sampling | 10 |
| Thinning interval | 200 |
| Number of chains | 4 |
| Momentum decay | 0.02 |
| Burn in steps | 3000 |
| SGHMC learning rate (h) | 0.01 |
| Adam learning rate () | 0.001 |
Table 19: Hyperparameters used for all models but SNI-PSNN
Again we have set .
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Prior precision | 1.0 |
| Stochastic fraction | 0.1 |
| Noise variance | 0.1 |
| Epochs | 1000 |
| Learning rate | 0.01 |
Table 20: Hyperparameters used for SNI-PSNN
E.3 Prior optimization
The hyperpriors are the same, but the hyperparameters are as follows:
| Hyperparameter | Value |
|---|---|
| Batch size | 128 |
| Number of iterations | 15000 |
| Regularization () | (1.2, 2.4, 4.8) / D |
| Number of function samples | 100 |
| Learning rate | 0.03 |
| Kernel | Polynomial of degree 2 |
Table 21: Hyperparameters used for prior optimization
The sampling configurations are:
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Number of samples per chain | 60 |
| Discarded samples before sampling | 20 |
| Thinning interval | 100 |
| Number of chains | 4 |
| Momentum decay | 0.01 |
| Burn in steps | 10000 |
| SGHMC learning rate (h) | 0.03 |
| Adam learning rate () | 0.003 |
Table 22: Sampling hyperparameters
Additionally, we have set .
E.4 Role of
We have used the same hyperparameters for the prior optimization as in the regression experiments. For sampling we have used:
| Hyperparameter | Value |
|---|---|
| Batch size | 64 |
| Number of samples per chain | 100 |
| Discarded samples before sampling | 10 |
| Number of burn-in steps | 10000 |
| Thinning interval | 20 |
| Number of chains | 4 |
| Momentum decay | 0.02 |
| SGHMC sampler rate () | 0.03 |
| Adam learning rate () | 0.003 |
Table 23: Hyperparameters used for sampling
For (ii) we use and , and for (iii) .
E.5 Learned and random splits on the bimodal target
We use the architecture, target and energy-score fitting of Section D. In a first stage, the prior scales are parameterized as with factors and fitted jointly with the means under the penalty of Section 4.1, with and layer weights in the ratio . Scales below are set to zero. Unlike in the UCI experiments, we apply this threshold only after the first stage, so that all scales receive gradients during the optimization. In a second stage, the means are refitted with the mask and the scales held fixed. Random masks permute the thresholded scales either within each layer and parameter type or across all parameters. We use five data seeds, three random masks of each kind per seed and 12,000 steps per fit.
E.6 Sensitivity to the cutoff
We use the setting of Section E.5 with and five data seeds. After the first stage we threshold the learned scales at and refit the means with the mask and the scales held fixed, using 12,000 steps per fit.
E.7 Certificate of random masks
For each dataset we draw 2,000 random first-layer masks with the learned shares of deterministic weights and biases and check both conditions of Proposition 4.7. At the learned budget, random masks satisfy the certificate on BANKNOTE and HTRU2, in 97% of the draws on CONCRETE, and in at most 9% of the draws on the other datasets.