TL;DR
In Bayesian deep learning, researchers long assumed that swapping "pointy" activations like ReLU for smooth ones like GELU or Swish guarantees fast, accurate posterior sampling via Hamiltonian Monte Carlo (HMC). This paper flips that assumption on its head: because modern smooth activations are unbounded, they generate massive third-order curvature in the energy landscape, causing numerical integration errors to explode. Surprisingly, old-school bounded activations like Sigmoid can make HMC three to four times more efficient than modern Transformer favorites.
What Problem Does This Paper Address?
Standard neural networks give you a single point estimate for weights; Bayesian Neural Networks (BNNs) infer a full probability distribution over them, offering principled uncertainty quantification. The gold standard for sampling from these complex, high-dimensional posteriors is Hamiltonian Monte Carlo (HMC). Imagine a frictionless puck sliding across the network's loss landscape—HMC uses gradient physics to propose distant, high-quality weight configurations.
Because computers work in discrete time, HMC approximates this physics using a "leapfrog integrator." If the simulation accumulates too much numerical error, energy isn't conserved, proposed samples get rejected, and you waste compute.
Recent theory showed that ReLU degrades HMC efficiency because its sharp kink at zero creates sudden gradient jumps. Consequently, the community assumed that smooth activations ubiquitous in modern architectures—like GELU, Swish, and Mish—would restore HMC's textbook efficiency. Classical analyses backed this up, treating landscape derivatives as harmless, static constants hidden inside big-$O$ notation. The authors ask: what happens when we actually crack open those constants for neural networks?
Methods
Instead of hiding the geometry of the neural network inside asymptotic bounds, the authors derive explicit local and global error formulas for the leapfrog integrator across both smooth ($C^3$, thrice-differentiable) and piecewise-smooth (e.g., ReLU) activation regimes.
By tracking exact Taylor expansions and path integrals over a trajectory of $L$ leapfrog steps, they split the Hamiltonian energy error ($\Delta H$) into two distinct, measurable physical sources:
- Gradient norm differences: How much the steepness of the potential energy changes between the start and end of a trajectory.
- Third-order curvature: A tensor contraction involving the third derivatives of the potential energy ($\nabla^3 U$) accumulated at every step along the path.
They then derive analytical upper bounds for single-neuron regression and classification networks to expose exactly how data, weights, and activation outputs interact inside that curvature term, and validate these dynamics empirically.
Datasets
No new benchmarks were introduced; the authors used controlled synthetic and real-world datasets to isolate architectural effects:
- Toy Regression: 100 synthetic 1D samples generated from a noisy cosine wave, $y_i = \cos(2x_i) + \varepsilon_i$.
- Toy Classification:
make_moonsfromscikit-learn(300 training and 100 test 2D binary points with 0.1 noise). - Real-World Regression: The TMDb Movie dataset (2,580 training and 645 test films after cleaning), predicting average user ratings from five financial and engagement features (budget, popularity, revenue, runtime, vote count).
Key Insights and Ideas
- Telescoping vs. Compounding Errors: Across a multi-step trajectory, gradient norm errors telescope—intermediate steps cancel out, leaving only the difference between the start and end points. Third-order curvature errors, however, accumulate additively at every single step. Longer trajectories amplify curvature problems.
- Smoothness Isn't Enough; Boundedness Matters: Analytic bounds reveal that third-order energy curvature scales directly with the magnitude of the activation output $|\varphi(u)|$ (and up to $|\varphi(u)|^3$ in classification!). Because GELU, Swish, Mish, and Softplus are unbounded, large pre-activations cause $\nabla^3 U$ to blow up. Even Softplus—which has tiny derivatives everywhere—suffers massive HMC errors simply because its output grows without bound.
- Architecture Dictates Sampler Tuning: Smooth unbounded activations can degrade HMC efficiency just as severely as non-differentiable ReLUs. In Bayesian deep learning, activation functions aren't just modeling choices—they fundamentally govern MCMC computational cost.
Key Results
- Curvature Dominates Error: In empirical error decompositions (Figure 1 above), third-order curvature completely dwarfs gradient differences. Bounded activations (Sigmoid, Tanh) keep curvature near zero, while unbounded smooth activations trigger error spikes orders of magnitude larger (reaching >4,000 for GELU in regression and ~380 for Softplus in classification).
- Scaling Penalties: As network width (up to 200 nodes) or depth (up to 4 layers) increases under fixed HMC settings, Sigmoid maintains an acceptance rate near 1.0, whereas GELU, Swish, Mish, and Softplus plummet below 0.2—and near 0.0 for the widest networks.
- 3x–4x Efficiency Gains: On synthetic benchmarks, bounded smooth activations (Sigmoid, Tanh) achieve HMC efficiency three to four times higher than unbounded smooth activations, whose dismal efficiency curves closely mirror ReLU's.
- Real-World Nuance: On the TMDb dataset, Sigmoid again achieved the highest sampling efficiency (peaking around $6.0 \times 10^{-4}$ vs. $<3.5 \times 10^{-4}$ for unbounded functions). Interestingly, Tanh degraded to match unbounded activations here, suggesting its steeper gradients and wider $(-1, 1)$ range still struggle in noisier, real-world landscapes.
Limitations and Future Work
The authors note that their theoretical bounds and experiments focus on relatively shallow MLPs. Modern deep architectures rely heavily on residual connections and layer normalization, which dramatically reshape gradient and curvature dynamics across depth. Additionally, the analysis assumes a standard identity mass matrix and fixed-trajectory HMC. Extending these explicit error formulas to preconditioned samplers (like Riemannian Manifold HMC) and adaptive-trajectory algorithms like NUTS—which might naturally mitigate curvature explosions by automatically shortening trajectories—remains an open and exciting next step.
Summary updated