potentialpaper

A Revisit of Hamiltonian Monte Carlo Efficiency on Bayesian Neural Networks

Cuong N. Nguyen, Lam Si Tung Ho, Vu C. Dinh, Georgios Karagiannis, Cuong V. Nguyen

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Bayesian neural networks (BNNs) offer principled uncertainty quantification, yet sampling from their posteriors via Hamiltonian Monte Carlo (HMC) remains challenging. While recent work theoretically identified the efficiency degradation of ReLU-based networks, smooth unbounded activations (e.g., GELU, Swish, or Mish), which are prevalent in modern architectures, were assumed to be efficient due to their smoothness. In this work, we challenge this existing justification by deriving explicit local error formulas for the leapfrog integrator. Our analyses reveal that in addition to differentiability, the third-order curvature of the potential energy also significantly influences the HMC efficiency of BNN inference. Empirically, we find that even smooth unbounded activations may degrade sampling performance as severely as piecewise linear activations. Thus, optimally tuning the step size for these networks may require a comparable empirical step size scaling as their piecewise counterparts. This result sheds light on the implications for architecture design in Bayesian deep learning.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
1 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:45 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The paper re-visits prevailing assumptions in Hamiltonian Monte Carlo for Bayesian neural networks. A core finding is that third order curvature has a substantial effect on the sampling efficiency, challenging the assumption that smooth activation functions are enough to ensure efficiency.

The reviews are mixed and the reviewers have raised several concerns. In particular the questions and weaknesses of bRgf shall please be addressed in detail.

Also sJJK raised some concerns that shall be addressed in the review. However, the AC notes at this point that

  • proposing a new algorithm is not necessarily required for a NeurIPS paper, but a strong analysis of existing methods can be a valuable contribution as well; and
  • a paper does not necessarily need to be tailored to more active areas (e.g. MALA vs. HMC), but studying established methods can certainly be of value. Hence, these two points per se are not decisive for acceptance of the paper. The authors should however provide arguments for the concerns of sJJK as well.
Final justification

The paper introduces an interesting analysis on efficiency of HMC in Bayesian Neural Networks. The paper was very actively discussed, both between authors and reviewers and between reviewers after the rebuttal phase. One reviewer communicated that their concerns have been addressed and, furthermore, that their confidence is limited and requested that their review gets down-weighted. Among the remaining two reviewers no clear consensus was achieved, where one reviewer argued for rejection whilst the other for acceptance.

Consequently the AC read the paper carefully as well and argues also for acceptance: the paper adds a non-trivial and interesting analysis to one of the most important inference algorithms in BNNs. In the opinion of the AC, the criticism of the more negative reviewer are surely valid yet of more subjective nature.

This paper was a tricky case, but the AC votes for accepting it as a poster. [note: final decision is done by the PCs]

The authors should please note a novel point that was raised post-rebuttal: The experimental comparison uses step size x acceptance rate as a notion of HMC “efficiency,” but this quantity is not invariant to changes in target scaling or parametrization and therefore can be misleading when comparing different activation functions. I recommend that the authors either rename it to a more precise term such as “effective step size” or “local efficiency,” and clearly state that it measures local integrator behavior rather than global sampling efficiency.

Area Chair 27sT · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The paper re-visits prevailing assumptions in Hamiltonian Monte Carlo for Bayesian neural networks. A core finding is that third order curvature has a substantial effect on the sampling efficiency, challenging the assumption that smooth activation functions are enough to ensure efficiency.

The reviews are mixed and the reviewers have raised several concerns. In particular the questions and weaknesses of bRgf shall please be addressed in detail.

Also sJJK raised some concerns that shall be addressed in the review. However, the AC notes at this point that

  • proposing a new algorithm is not necessarily required for a NeurIPS paper, but a strong analysis of existing methods can be a valuable contribution as well; and
  • a paper does not necessarily need to be tailored to more active areas (e.g. MALA vs. HMC), but studying established methods can certainly be of value. Hence, these two points per se are not decisive for acceptance of the paper. The authors should however provide arguments for the concerns of sJJK as well.
Final justification

The paper introduces an interesting analysis on efficiency of HMC in Bayesian Neural Networks. The paper was very actively discussed, both between authors and reviewers and between reviewers after the rebuttal phase. One reviewer communicated that their concerns have been addressed and, furthermore, that their confidence is limited and requested that their review gets down-weighted. Among the remaining two reviewers no clear consensus was achieved, where one reviewer argued for rejection whilst the other for acceptance.

Consequently the AC read the paper carefully as well and argues also for acceptance: the paper adds a non-trivial and interesting analysis to one of the most important inference algorithms in BNNs. In the opinion of the AC, the criticism of the more negative reviewer are surely valid yet of more subjective nature.

This paper was a tricky case, but the AC votes for accepting it as a poster. [note: final decision is done by the PCs]

The authors should please note a novel point that was raised post-rebuttal: The experimental comparison uses step size x acceptance rate as a notion of HMC “efficiency,” but this quantity is not invariant to changes in target scaling or parametrization and therefore can be misleading when comparing different activation functions. I recommend that the authors either rename it to a more precise term such as “effective step size” or “local efficiency,” and clearly state that it measures local integrator behavior rather than global sampling efficiency.

Reviewer 6F5vOpenReview ↗
Rating
5/6
Confidence
2/5
Quality
3/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This work is a careful self contained analysis of the errors introduced in the Hamiltonian Monte Carlo's (HMC's) leapfrog integrator as a function of the loss function. This ties in with the efficiency (related to the acceptance ratio) of the HMC. The authors express the error as the third derivative of the loss function and difference between the gradients. This form of the error allows the authors to examine the role of various activation functions in the efficency of the HMC. They challenge the latent assumption that an activation simply being smooth is enough for efficiency guarantees.They complete their investigation with an empirical work on efficiency of simple feed forward neural networks with varying activation functions.

Strengths and weaknesses

I think this paper carefully identifies an unfounded assumption in the literature and investigates it. I don't really have much weak points but there are small typos and some points that would benefit clarification.

  • On line 148 on page 4 the three-times continuously differentiable class is written with a blackboard C (indicating complex numbers)
  • Exact equality on equation (8) is correct, but the proof writes the trapezoidal rule (equation 14 in the appendix) as an approximation. Actually trapezoidal rule in this form (with an arbitrary xi in a range) is exact.
  • Line 203 on page 5 "\emph{an} upper bound for the ...". This is a non-pedantic point actually. There can be many upper bounds, and since they are not lower bounds, they can only be heuristics on how the third order derivative affects the behavior. (that tracks, since being smooth or bounded or unbounded didn't end up being the sole determinants of HMC efficiency later on in the paper).
  • There is some inconsistency with defining efficiency. On line 6 it is defined in terms of a tunable linear parameter ℓ\ell, for the step size (with step size ϵ=ℓd−1/4\epsilon = \ell d^{-1/4}) however down on line 314 it is defined as eff(ε) = ε·α(ε), without any reference to the dimension d. It is not important asymptotically, but this affects the actual value of eff(ε).

I agree that following up on NUTS and other variants may be a promising direction. But also, beyond the efficiency (acceptance rate) it might be interesting to play with the temperature parameter, and make the model performance one of the metrics that are being measured. Right now there is no explicit temperature, and decreasing it (equivalently rescaling the potential loss component U) might show the interplay between the right temperature (right for getting a reasonably performant model at most MC samples) and efficiency.

Questions

see strengths and weaknesses

Limitations

yes

Final justification

After the discussion period with sJJK I chose to maintain my score. I do not believe that this work is unimportant because it only deals with HMC in the full batch case. However the later remarks in the discussion regarding the definition of efficiency made me rethink my confidence. Because I do agree that this is a misleading notion of efficiency and it should have been called local efficiency or effective step size. I am worried that this definition would be later picked up by other authors.

Formatting concerns

NA

3 comments
Authors · CommentOpenReview ↗

Authors’ Response to the Reviewer’s Helpful Comments and Questions

Thank you for the positive comments. Here are our responses to your questions.

  • Blackboard C\mathbb{C} on line 148 (p.4) This is indeed a typo. We meant the smoothness class C3\mathbb{C}^3.

  • Trapezoidal rule stated as ≈\approx (Eq. 14) while Eq. (8) is an equality. The reviewer is correct. We will change ≈\approx to == in Eq. (14) and note that this is what makes Theorem 1's Eq. (8) an exact equality.

  • An upper bound (line 203, p.5). We will state explicitly that our curvature expressions are particular upper bounds and therefore act as heuristics for how ∇3U\nabla^3U shapes behavior (but not as the sole determinant). This is consistent with our finding that boundedness/smoothness are not the only factors.

  • Inconsistent efficiency definition on line 6, eff(ℓ)=ℓ∗E[A]\mathrm{eff}(\ell)=\ell * \mathbb E[A] with ε=ℓ∗d−1/4\varepsilon = \ell * d^{-1/4} vs. line 314 eff(ε)=ε∗α(ε)\mathrm{eff}(\varepsilon)=\varepsilon*\alpha(\varepsilon) with no dd. The two coincide up to the dimensional scaling ℓ=ε∗d1/4\ell = \varepsilon* d^{1/4}; since dd is fixed within each experimental setting, the empirical eff(ε)=ε∗α(ε)\mathrm{eff}(\varepsilon)=\varepsilon * \alpha(\varepsilon) is eff(ℓ)\mathrm{eff}(\ell) up to a constant. We will use a single definition and state the dd-dependence explicitly where the asymptotic tuning ε=O(d−1/4)\varepsilon=\mathcal{O}(d^{-1/4}) is invoked.

  • Temperature reveals a performance–sampling trade-off. We conduct an additional experiment using the setting in Sec. 5.1 with a tempered posterior given by p(q∣D)∝p(q)p(D∣q)1/Tp(\textbf{q}| \mathcal{D}) \propto p(\textbf{q}) p(\mathcal{D}|\textbf{q})^{1/T}. We report the averaged results from 3 different seeds in the table below. Our results are consistent with the cold-posterior phenomenon indicated in [1]: predictive performance improves when moving from the nominal posterior (T=1T=1) toward colder posteriors (T<1T<1). However, cooling also makes posterior exploration increasingly difficult. Importantly, this trade-off depends strongly on the activation function. Sigmoid remains efficient over the considered cold-temperature regime, whereas Softplus exhibits rapidly increasing integration error, decreasing acceptance, and poorer mixing as the temperature is reduced. Overall, these results show that the observed activation-dependent differences persist under posterior tempering.

Activation TT Test MSE Accept rate ESS IACT
Sigmoid 4.004.00 0.0207±0.00030.0207 \pm 0.0003 0.998±0.001\mathbf{0.998 \pm 0.001} 43.23±15.5543.23 \pm 15.55 50.76±19.1850.76 \pm 19.18
2.002.00 0.0167±0.00040.0167 \pm 0.0004 0.995±0.0010.995 \pm 0.001 58.66±12.4658.66 \pm 12.46 35.04±6.72\mathbf{35.04 \pm 6.72}
1.001.00 0.0135±0.00030.0135 \pm 0.0003 0.993±0.0030.993 \pm 0.003 60.73±22.39\mathbf{60.73 \pm 22.39} 36.13±13.3036.13 \pm 13.30
0.500.50 0.0122±0.00010.0122 \pm 0.0001 0.984±0.0040.984 \pm 0.004 54.90±19.7054.90 \pm 19.70 40.22±16.1040.22 \pm 16.10
0.250.25 0.0115±0.0001\mathbf{0.0115 \pm 0.0001} 0.961±0.0070.961 \pm 0.007 43.61±30.5343.61 \pm 30.53 89.28±96.0789.28 \pm 96.07
Softplus 4.004.00 0.0146±0.00040.0146 \pm 0.0004 0.970±0.0070.970 \pm 0.007 51.47±29.1551.47 \pm 29.15 48.18±25.9848.18 \pm 25.98
2.002.00 0.0130±0.00010.0130 \pm 0.0001 0.931±0.0060.931 \pm 0.006 50.52±19.9550.52 \pm 19.95 45.05±21.1245.05 \pm 21.12
1.001.00 0.0122±0.00010.0122 \pm 0.0001 0.824±0.0490.824 \pm 0.049 33.37±13.4433.37 \pm 13.44 68.72±33.2568.72 \pm 33.25
0.500.50 0.0119±0.00020.0119 \pm 0.0002 0.476±0.1170.476 \pm 0.117 16.86±12.7416.86 \pm 12.74 265.03±306.90265.03 \pm 306.90
0.250.25 0.0783±0.11620.0783 \pm 0.1162 0.171±0.1980.171 \pm 0.198 15.41±2.2615.41 \pm 2.26 131.22±19.28131.22 \pm 19.28

We will make changes to the revised version based on the previous discussion.

References

[1] Wenzel et al., "How Good is the Bayes Posterior in Deep Neural Networks Really?", ICML 2020.

Reviewer 6F5v · CommentOpenReview ↗

Thank you for the comments.

Thank you for your detailed responses. I'm more confident of the score I gave now.

You didn't have to run extra experiments, I was just suggesting integrating model performance as a metric in future work where you also explore NUTS or other architectures. Perhaps since NUTS might explore more, some notion of diversity in the function space (how varied the model predictions become in generalization examples, with our without slight distribution shifts) may also be a good idea.

I see that sJJK raised the issue of fullbatch vs minibatch. But perhaps this might be due to the fact that they thought this was a general submission, but I regard it as a theory paper, and practicality are downstream matters. Yes one can apply stochastic HMC in practice. Perhaps in later work you can also consider how such stochasticity affects (empirically) the acceptance rate.

Authors · CommentOpenReview ↗

Thank you for your helpful recommendations. We appreciate these insightful suggestions and look forward to exploring these directions in our future work!

Reviewer sJJKOpenReview ↗
Rating
2/6
Confidence
5/5
Quality
2/4
Clarity
3/4
Significance
1/4
Originality
1/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper studies acceptance rate of Hamiltonian Monte Carlo (HMC) methods for posterior distributions of Bayesian neural networks. Some theoretical and empirical results are obtained about this, related to the third order derivatives of the potential. The choice of the activation functions play a significant role in this quantity.

Strengths and weaknesses

The strength of the submission is that it is attempting to contribute to the domain of Bayesian inference for neural networks, which holds potential for better uncertainty quantification and more robust algorithms.

Nevertheless, we do not think that the submission has significant new ideas, and no new algorithms have been proposed. The field of Bayesian inference for neural networks is not so much focused any more on HMC with Metropolis/Hastings accept-reject step (hence full dataset needs to be used during each step), but more on scalable methods using stochastic gradients, which are much more practical. The experimental evaluation is not convincing.

Questions
  1. In what sense is your theoretical results about HMC acceptance rates improve on existing results in the literature, such as "When does Metropolized Hamiltonian Monte Carlo provably outperform Metropolis-adjusted Langevin algorithm?", https://arxiv.org/abs/2304.04724, and "Fast mixing of Metropolized Hamiltonian Monte Carlo: Benefits of multi-step gradients", https://jmlr.csail.mit.edu/papers/volume21/19-441/19-441.pdf?

  2. How do you justify using HMC for Bayesian neural networks when each step takes one epoch and "What are Bayesian neural network posteriors really like?" has shown that even for small datasets such as CIFAR-10, full convergence in Gelman-Rubin (Rhat) is not reached after 20 million epochs?

Limitations

Authors have adequately addressed the limitations of their work.

Final justification

I have updated the contribution type to theory. This doesn't change my rating - the theoretical results here are not sufficiently deep and only cover local errors in a few pages. They are also not important enough because HMC with full gradients is not a practically relevant algorithm for deep learning. The experimental evaluation for Rhat diagnostics in the rebuttal is not convincing since not all step sizes were tuned to reach a target acceptance rate, small acceptance rate indicates that too large steps were used. Finally, the whole story about activation functions would change if normalisation layers such as layer norm would be included in the networks, as it's often done in practice. These would make the differences between smooth activation functions less noticeable.

Formatting concerns

No concerns.

4 comments
Authors · CommentOpenReview ↗

Authors’ Responses to Weaknesses, Q1, and Q2

Thank you for your comments on our submission. Below, we provide our responses to them.

  • Comparison to existing mixing-time results [2,3] (Q1): Our theorem 1 is an exact local-error identity for HMC together with a BNN-specific interpretation of that quantity, not a global mixing theorem. It asks a complementary question to the mentioned papers: whether the geometric quantities required by their theorems are controlled in BNNs at all, and how the activation function changes the realized values of those quantities. We additionally cover two cases outside the scope of [2,3]: classification, and non-smooth activations, for which we give an exact finite-step identity.

The mentioned results [2,3] are under more restrictive assumptions than our setting. Chen et al. [2] prove global mixing bounds for Metropolized HMC under global LL-smoothness, operator-norm Hessian-Lipschitzness, isoperimetry, and initialization conditions. Their acceptance proof already contains the endpoint gradient-norm difference and controls the accumulated cubic Taylor remainder. Chen et al. [3] provide substantially sharper high-probability acceptance control and O~(d1/4)\tilde{O}(d^{1/4}) dimension dependence under a stronger Frobenius-norm Hessian-Lipschitz condition, isoperimetry, and a warm start. The neural-network example in [3] is a two-layer squared-loss model with fixed bounded output weights and the global condition ∣σ∣,∣σ′∣,∣σ′′∣,∣σ′′′∣≤c|\sigma|,|\sigma'|,|\sigma''|,|\sigma'''|\le c. It therefore excludes the smooth unbounded activations central to our paper and removes growth caused by sampled output weights. They also note that they cannot state an explicit finite-width neural-network mixing bound because the required isoperimetric coefficient is not established.

Our results are separate from their guarantees. Instead, we address a complementary BNN-specific question: whether the geometric quantities required by such theorems are controlled in BNN settings, and how activation choice changes their realized values.

The scope difference can be made rigorous even for a bounded activation. In our fully Bayesian one-neuron regression model U(w,v)=12(w2+v2)+(y−vϕ(wx))2,U(w,v)=\tfrac12(w^2+v^2)+(y-v\phi(wx))^2, with sigmoid ϕ\phi and x≠0x\ne0, ∂2U∂w2(0,v)=1+x2v28,∂3U∂w2∂v(0,v)=x2v4\frac{\partial^2U}{\partial w^2}(0,v)=1+\frac{x^2v^2}{8}, \frac{\partial^3U}{\partial w^2\partial v}(0,v)=\frac{x^2v}{4}. Hence, even for BNNs with bounded activations, there exists no finite global smoothness constant, Hessian-Lipschitz constant, or mm-strong convexity constant as the Bayesian output weight varies. The term ∂2U/∂v2=1+2ϕ(wx)2\partial^2U/\partial v^2=1+2\phi(wx)^2 is ≤3\leq 3 for sigmoid but diverges for unbounded activation, giving an additional obstruction. Our local identity remains valid along each finite smooth segment and exposes the realized state- and direction-dependent terms even when these global constants are unavailable. We will cite these papers and revise our related work to include the above discussion.

  • On the value of our work and analysis of full-batch HMC (Weakness and Q2): For very large networks, full-batch HMC gets less attention compared to approximation methods due to the computational cost. However, it is the field's reference sampler, including in [1], which uses it to generate the gold-standard posteriors against which cheaper methods are validated. Recently, full-batch HMC for BNNs was used as a component in an approximate Bayesian method [4]. In a more practical application, sampling BNN posteriors using full-batch HMC has been employed to learn surrogates for complex physical systems such as hypersonic flow [5]. A recent NeurIPS paper [6] also analyzed full-batch HMC. Therefore, these works underscore that understanding HMC efficiency remains important.

References

[1] Izmailov et al., "What Are Bayesian Neural Network Posteriors Really Like?", ICML 2021.

[2] Chen et al., "Fast mixing of Metropolized Hamiltonian Monte Carlo: Benefits of multi-step gradients", JMLR, 2020.

[3] Chen et al., "When does Metropolized Hamiltonian Monte Carlo provably outperform Metropolis-adjusted Langevin algorithm?", arXiv 2026.

[4] Vellenga et al., "Last Layer Hamiltonian Monte Carlo", arXiv 2025.

[5] Thiagarajan et al., "Accelerating Hamiltonian Monte Carlo for Bayesian Inference in Neural Networks and Neural Operators", Computer Methods in Applied Mechanics and Engineering, 2025.

[6] Dinh et al., "Hamiltonian Monte Carlo on ReLU neural networks is inefficient", NeurIPS 2024.

Authors · CommentOpenReview ↗

Continuation of Our Previous Response to Q2

We continue our response to Q2 below.

  • Practical usage of our results (Q2): Our analysis suggests that smooth but unbounded activations such as Swish are less efficient for HMC because they induce larger third-order curvature than bounded alternatives. This can increase leapfrog integration error, requiring smaller step sizes, or pre-conditioning to propose reliable samples, as indicated by our empirical experiments. The high computational cost reported for the CIFAR-10 experiment in the mentioned paper [1] is therefore possibly explained by their use of a ResNet-20 with Swish. In addition, based on the observation about ESS and IACT in our additional experiments (see our response to the reviewer bRgf), our conclusions are potentially valid beyond full-batch HMC. For example, Chen et al. [2] bound the stationary-distribution error of perturbed Langevin dynamics by δc/λ\delta c/\lambda, separating the stochastic-gradient perturbation δ\delta from the mixing properties λ\lambda of the underlying dynamics. In exact settings, our results show that the choice of activation can strongly alter these underlying dynamics: activations with larger finite-step error terms exhibit substantially poorer ESS and larger IACT. Hence, activation-induced curvature could amplify the stationary error for a fixed level of stochastic-gradient noise. Establishing this connection formally for SGLD or SGHMC would require a separate convergence analysis in future work.

References

[1] Izmailov et al., "What Are Bayesian Neural Network Posteriors Really Like?", ICML 2021.

[2] Chen et al., "Stochastic Gradient Hamiltonian Monte Carlo", ICML 2014.

Reviewer sJJK · CommentOpenReview ↗

Acknowledgement of Rebuttal

Thank you for your response to my comments.

Even though the theoretical results of the submission has some value, I feel that the overall level of contribution is clearly insufficient for NeurIPS, especially in terms of importance to the community.

Hence I will keep my score.

The numerical experiments haven't been conducted sufficiently rigorously. In your response to bRgf, you've stated acceptance rates and ESS / IACT values. You should have indicated the way the number of leapfrog steps L was chosen, as well as the step sizes used. In general, you need to ensure that the acceptance rate is tuned to be above 0.6 (sometimes even higher is preferred). The number of steps L times the stepsize should be enough to traverse the distribution along its most spread out direction. Finally, randomising the number of leapfrog steps L (i.e. choosing it according to a geometric distribution) has been shown in the literature to improve convergence rates and stability of the sampler (Randomized HMC).

Authors · CommentOpenReview ↗

Further response to Reviewer sJJK

Thank you for your comment.

Please note that due to the length limit of the rebuttal and the number of questions by reviewer bRgf, we could not provide enough details on the choice of LL and ε\varepsilon. In that result, we used a common L=100L = 100 and ε=0.002\varepsilon = 0.002, which produce a reasonable travel distance T=εL=0.2T = \varepsilon L = 0.2 used in previous work for networks of the same size [1]. Note that to validate our theoretical findings, we must use the same LL and ε\varepsilon for a fair comparison between activation functions. The comparison of efficiency when varying acceptance rates by tuning LL and ε\varepsilon was already shown in our submission (see Figures 2 and 3 in our paper) where the efficiency was plotted for a range of acceptance rates from 0 to 1.

We agree that randomising LL could potentially improve the sampler, but this is out of scope of our theory and this paper.

References:

[1] Dinh et al., "Hamiltonian Monte Carlo on ReLU neural networks is inefficient", NeurIPS 2024.

Reviewer bRgfOpenReview ↗
Rating
3/6
Confidence
3/5
Quality
2/4
Clarity
2/4
Significance
2/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies the efficiency of leapfrog HMC for Bayesian neural networks with different activation functions. It argues that smoothness alone is not sufficient, while smooth but unbounded activations (e,g., GELU, Mish, Softplus) can also produce large local energy errors through large third-order curvature terms in the potential energy. The paper derives explicit local-error expressions for both smooth and piecewise-smooth activation regimes, and empirically investigates how these terms relate to acceptance rate and sampling efficiency across synthetic and real-world BNN experiments.

Strengths and weaknesses

Strengths:

  1. The paper studies an underexplored but practically important question of understanding how activation functions affect the efficiency of HMC for BNNs.
  2. The explicit decomposition of leapfrog local error highlights the role of third-order curvature, providing a new perspective beyond the conventional smooth/non-smooth distinction.

Weaknesses:

  1. It is not entirely clear for me which parts of the derivation are fundamentally new beyond applying classical leapfrog error analysis to BNN potentials.
  2. The experiments mainly rely on acceptance rate and the proposed efficiency metric, while standard MCMC diagnostics (e.g., ESS/sec, R^\hat{R}, autocorrelation, energy error distributions) are missing.
  3. Most experiments are conducted on relatively small synthetic or toy-scale BNNs. It is unclear whether the conclusions generalize to larger modern network architectures.
  4. Some claims appear stronger than the empirical evidence supports. In particular, the conclusion that smooth unbounded activations can degrade HMC "as severely as" piecewise activations may depend on the specific experimental settings and should be stated more cautiously.
  5. Typo: the likelihood term L(q∣xi,yi)\mathcal{L} (\mathbf{q} | \mathbf{x}_{i}, y_i ) in Bayes' rule in Eq. (1) should be L(yi∣xi,q)\mathcal{L} (y_i | \mathbf{x}_i , \mathbf{q} ).
Questions
  1. Can you clarify the novelty of Theorem 1 relative to standard leapfrog local-error/Taylor expansion results for smooth Hamiltonian systems? Is the main novelty the BNN-specific interpretation of the constants, or is there a technically new bound?
  2. Can you report more standard MCMC diagnostics (e.g., ESS, R^\hat{R}, and integrated autocorrelation time) for the experiments? This would help determine whether lower acceptance rates actually translate into poorer posterior exploration, rather than only poorer proposal acceptance.
  3. How sensitive are the results to HMC tuning choices, especially mass matrix, step-size adaptation, and trajectory length? For example, would diagonal/full mass-matrix adaptation reduce the observed gap between bounded and unbounded activations?
  4. The experiment focuses primarily on feed-forward networks. Can the conclusions be extended to other structures, such as ResNet?
  5. Can you include an ablation using rescaled activations or prior scales to distinguish the effect of activation unboundedness from the effect of posterior parameter scale?
Limitations

The limitations are partially addressed, but I think the paper should more explicitly discuss: limited model scale, reliance on acceptance-rate-based efficiency, lack of extensive diagnostics such as ESS and R^\hat{R}, dependence on HMC tuning choices, and the fact that the conclusions may not directly transfer to adaptive HMC/NUTS or alternative parameterizations.

Final justification

The rebuttal of the authors has addressed most of my concerns about the paper, including the theoretical novelty of Theorem1, the standard MCMC diagnostics, generalization to modern network architecture, and rescaled ablation. So, I have decided to raise my score to 3.

Formatting concerns

No major formatting or anonymity concerns noticed.

5 comments
Authors · CommentOpenReview ↗

Authors’ Responses to Weaknesses, Q1, and Q2

We thank Reviewer bRgf for your constructive feedback on our work. Below, we address the reviewer’s comments and concerns.

Weaknesses:

1&2. Please see our answers to Q1 and Q2 below.

  1. We emphasize that our main contribution is a new theoretical interpretation of how activation functions affect the sampling efficiency of HMC in BNNs. Accordingly, our experiments are designed primarily to validate these theoretical findings in diverse settings, including synthetic and real-world data (Sec. 5.1 and 5.2), varying widths and depths of networks (Appendix D), as well as a ResNet-like architecture and different pre-conditioning matrices (answers to Q3 and Q4 below). The observed trends are consistent across these settings, suggesting that our theoretical findings are not specific to a particular architecture or experimental configuration and could generalize to larger networks.

  2. We will tone this down to "sampling BNNs with unbounded activations using HMC is significantly less efficient than bounded counterparts".

  3. This is an alternative way to express the likelihood function in a previous work [1].

Questions:

  1. We note that the classical leapfrog analysis for smooth Hamiltonian systems already establishes an O(ε3)O(\varepsilon^3) one-step error and that Taylor or Poisson-bracket expansions contain high-order derivatives of the potential. The distinction of Theorem 1 is that it rewrites the one-step Hamiltonian error as the exact finite-step identity on the leapfrog segment that is particularly useful for BNNs. It separates two mechanisms, the finite change in gradient norm and the directional third-order derivative that can subsequently be analyzed in terms of the network architecture and activation function. In contrast, in standard analyses, the potential-dependent quantities are absorbed into error constants [2], or only an asymptotic expansion is typically reported [3].

  2. We report below the effective sample size (ESS), integrated autocorrelation time (IACT), and multi-chain R^\hat{R} over 5 independent chains. Under the same HMC configuration in Sec. 5.1, Sigmoid yields better results than Softplus and Swish on all metrics. These results are consistent with our energy-error analysis: at the same step size and trajectory length, the bounded activation produces more stable trajectories and substantially better log-posterior mixing than the smooth unbounded activations. We note that the large R^\hat{R} values for Softplus and Swish indicate that these chains did not converge.

Activation Accept rate ESS IACT R^\hat{R}
Sigmoid 0.916±0.0080.916 \pm 0.008 45.3±15.545.3 \pm 15.5 48.7±17.048.7 \pm 17.0 1.0121.012
Softplus 0.033±0.0370.033 \pm 0.037 8.6±8.58.6 \pm 8.5 833.2±821.5833.2 \pm 821.5 2.7222.722
Swish 0.195±0.1140.195 \pm 0.114 17.5±13.917.5 \pm 13.9 303.5±377.3303.5 \pm 377.3 1.6551.655

References

[1] Dinh et al., "Hamiltonian Monte Carlo on ReLU neural networks is inefficient", NeurIPS 2024.

[2] Neal, "MCMC using Hamiltonian dynamics", Handbook of MCMC, 2011.

[3] Blanes et al., "Numerical integrators for the Hybrid Monte Carlo method", SIAM J. Sci. Comput., 2014.

Authors · CommentOpenReview ↗

Continuation of Our Previous Response to Q3

We provide our response to Q3 below.

  1. In our theorems, step size and trajectory length appear explicitly to isolate the activation effect: the one-step error is characterized as a function of ε\varepsilon, while the global error is obtained by error accumulation over LL leapfrog steps. Our experiments therefore use common step-size and trajectory-length settings to validate our theoretical findings.

One future direction is to design step-size adaptation strategies that assign a smaller ε\varepsilon to a more difficult activation, while trajectory-length adaptation changes the frequency of the local mechanism. However, these choices do not introduce a new activation-dependent term as they mainly rescale or accumulate the mechanism described by our theorems.

The mass matrix differs qualitatively since it changes the geometry in which the derivatives of the potential are measured. We can extend our theorem to an arbitrary constant matrix M≻0M\succ 0: $\Delta H = \frac{\varepsilon^2}{8} \left[ \nabla U(q_1)^\top M^{-1}\nabla U(q_1) - \nabla U(q_0)^\top M^{-1}\nabla U(q_0) \right] - \frac{\varepsilon^3}{12} \nabla^3 U(q_\xi) \left[ M^{-1}p_{1/2}, M^{-1}p_{1/2}, M^{-1}p_{1/2} \right].$ Thus, diagonal adaptation can correct coordinate-wise scale, while a full mass matrix can correct correlated or rotated directions. It may reduce the gap when the excess curvature is concentrated in directions downweighted by M−1M^{-1}, but is not guaranteed: isotropic scaling changes the absolute but not the relative error, and a fixed MM cannot remove state-dependent curvature or a ReLU gradient jump. To validate this, we conduct an experiment to examine the effect of the mass matrix. We use the setting in Sec. 5.1 and find the adaptive pre-conditioning matrix during the warm-up phase as in Stan's implementation. We report the results for the identity, diagonal and dense mass matrices below. The dense matrix substantially reduces the error and restores high acceptance for Softplus and Swish, whereas identity and diagonal mass matrices fail to produce valid samples. However, dense estimates are highly ill-conditioned and yield low ESS for all three activations. Therefore, pre-conditioning mitigates but does not eliminate the activation-dependent gap.

Activation Mass Accept rate ESS IACT
Sigmoid Iden 0.917±0.0030.917 \pm 0.003 43.58±8.3743.58 \pm 8.37 47.08±9.3247.08 \pm 9.32
Diag 0.966±0.0030.966 \pm 0.003 27.67±5.1527.67 \pm 5.15 73.85±12.7073.85 \pm 12.70
Dense 0.997±0.0010.997 \pm 0.001 3.81±3.443.81 \pm 3.44 820.50±500.39820.50 \pm 500.39
Softplus Dense 0.986±0.0040.986 \pm 0.004 7.54±8.607.54 \pm 8.60 560.75±394.41560.75 \pm 394.41
Swish Dense 0.983±0.0030.983 \pm 0.003 6.56±5.366.56 \pm 5.36 544.07±498.61544.07 \pm 498.61
Authors · CommentOpenReview ↗

Continuation of Our Previous Response to Q4 and Q5.

We provide our response to Q4 and Q5 below.

  1. Our findings are not limited to MLPs because they only depend on derivatives of the posterior potential rather than on a specific connectivity pattern. For instance, consider the one-block residual model fres(x)=v(x+ϕ(wx))f_{\mathrm{res}}(x) = v(x+\phi(wx)) for the regression example. Its third derivative is $\frac{\partial^3 U_{\mathrm{res}}}{\partial w^3} = 6v^2x^3\phi'(wx)\phi''(wx) - 2vx^3 \left[y-v(x+\phi(wx)) \right] \phi'''(wx).$ Compared with the plain model, the exact difference is ∂3Ures∂w3−∂3Uplain∂w3=2v2x4ϕ′′′(wx).\frac{\partial^3 U_{\mathrm{res}}}{\partial w^3} - \frac{\partial^3 U_{\mathrm{plain}}}{\partial w^3} = 2v^2x^4\phi'''(wx). Thus, the skip connection changes the coefficient of the activation-induced curvature but does not entirely remove it. It may reduce the second term when the skip path improves the residual, although this is not guaranteed. We conduct an additional experiment to verify this claim, comparing MLPs with their residual counterparts at different depths. We report averaged results from 3 different runs below. For both MLP and residual networks, Sigmoid consistently yields more stable behaviour than Softplus and Swish. This trend suggests that our conclusions are not specific to MLPs and can generalize to more complex networks.
Architecture Depth Activation Accept rate ESS IACT
MLP 1 Sigmoid 0.872±0.0040.872 \pm 0.004 28.03±6.0228.03 \pm 6.02 73.37±14.1073.37 \pm 14.10
Softplus 0.014±0.0120.014 \pm 0.012 1.868±0.2611.868 \pm 0.261 1081.0±151.01081.0 \pm 151.0
Swish 0.125±0.0120.125 \pm 0.012 10.11±5.7510.11 \pm 5.75 246.3±134.5246.3 \pm 134.5
2 Sigmoid 0.721±0.0480.721 \pm 0.048 34.76±3.4034.76 \pm 3.40 57.91±5.6757.91 \pm 5.67
Softplus 0.028±0.0210.028 \pm 0.021 1.694±0.6801.694 \pm 0.680 1308.8±491.91308.8 \pm 491.9
Swish 0.105±0.0110.105 \pm 0.011 1.883±0.3941.883 \pm 0.394 1090.5±203.71090.5 \pm 203.7
3 Sigmoid 0.609±0.0830.609 \pm 0.083 24.14±6.2324.14 \pm 6.23 87.14±25.1687.14 \pm 25.16
Softplus 0.013±0.0060.013 \pm 0.006 10.60±14.9810.60 \pm 14.98 800.3±753.7800.3 \pm 753.7
Swish 0.023±0.0190.023 \pm 0.019 1.982±1.1331.982 \pm 1.133 1212.9±542.21212.9 \pm 542.2
Residual 1 Sigmoid 0.717±0.0540.717 \pm 0.054 19.78±11.1019.78 \pm 11.10 137.9±101.5137.9 \pm 101.5
Softplus 0.055±0.0510.055 \pm 0.051 11.84±7.1011.84 \pm 7.10 206.0±123.7206.0 \pm 123.7
Swish 0.179±0.0210.179 \pm 0.021 5.183±4.9555.183 \pm 4.955 645.0±417.1645.0 \pm 417.1
2 Sigmoid 0.538±0.0340.538 \pm 0.034 20.27±7.5920.27 \pm 7.59 111.9±53.18111.9 \pm 53.18
Softplus 0.018±0.0120.018 \pm 0.012 8.935±1.0538.935 \pm 1.053 225.8±25.19225.8 \pm 25.19
Swish 0.079±0.0180.079 \pm 0.018 7.561±9.8487.561 \pm 9.848 754.1±573.6754.1 \pm 573.6
3 Sigmoid 0.327±0.0810.327 \pm 0.081 16.88±5.9916.88 \pm 5.99 128.7±44.22128.7 \pm 44.22
Softplus 0.007±0.0060.007 \pm 0.006 4.462±3.2564.462 \pm 3.256 771.1±723.2771.1 \pm 723.2
Swish 0.018±0.0150.018 \pm 0.015 6.545±4.1506.545 \pm 4.150 382.4±242.5382.4 \pm 242.5
  1. We conduct an ablation to test the effect of activation rescaling, where we use the setting in Sec. 5.1 with activation ϕα(x)=α∗ϕ(x)\phi_\alpha(x) = \alpha * \phi(x), for α∈0.25,0.5,1,2\alpha \in \\{0.25, 0.5, 1, 2\\}. From the table below, we observe that activation rescaling is important. However, Softplus deteriorates substantially earlier: at α=0.5\alpha=0.5, its acceptance rate drops to 0.603. Meanwhile, Sigmoid remains stable up to α=2\alpha=2, suggesting that the original gap is not explained by activation scale alone, but unbounded activations are more sensitive to the same scaling factor. We can interpret boundedness as providing robustness against scale-induced deterioration, rather than claiming that unboundedness is the only source of poor HMC efficiency.
α\alpha Activation Accept rate ESS IACT
0.25 Sigmoid 0.997 45.09 44.36
Softplus 0.926 32.66 61.24
0.50 Sigmoid 0.989 40.72 49.12
Softplus 0.603 68.27 29.29
1.0 Sigmoid 0.972 19.45 102.84
Softplus 0.001 1.21 1649.62
2.00 Sigmoid 0.791 44.65 44.80
Softplus 0.001 1.66 1202.25

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…