Source-linked AI summary
Microcanonical Hamiltonian Monte Carlo and the Helmholtz Theorem
Heinrich von Campe, Bjoern Malte Schaefer
TL;DR
MCHMC's thermodynamic properties had not been studied in detail. The paper derives its thermodynamic description and tests Helmholtz-theorem validity, finding that MCHMC formally realizes a microcanonical ensemble and motivating a low-dimensional extension.
Problem
MCHMC had been studied technically and empirically, but its thermodynamic properties remained unexplored.
Source: §1 · p. 2Method
The authors derive thermodynamic variables and potentials from a microcanonical partition function and use volume entropy to construct a low-dimensional sampling extension.
Source: §1 · p. 2, §5 · p. 12Results
MCHMC formally realizes a microcanonical ensemble and analytically satisfies the Helmholtz theorem for sensible Hamiltonians and any likelihood and prior, with toy and supernova demonstrations.
Source: §1 · p. 2, §5 · p. 12Takeaways & Limitations
The paper argues canonical MCMC algorithms are more natural than MCHMC from thermodynamic and information-theoretic perspectives.
Source: §1 · p. 2The numerical experiments are two demonstrations of the theorem, not comprehensive numerical tests.
Source: §3.4 · p. 10
Abstract
from arXiv · showhide
The recently proposed Microcanonical Hamiltonian Monte Carlo algorithm has not yet been studied in detail from a thermodynamic point of view; this work aims to fill that gap. We demonstrate how thermodynamical state variables and potentials can be derived and thereby demonstrate that the construction of the algorithm formally represents a microcanonical thermodynamic ensemble. In particular, we demonstrate (analytically and numerically) that the algorithm fulfils the Helmholtz theorem, an alternative formulation of the first law of thermodynamics. Furthermore, we construct a new sampling algorithm that extends the original to lower-dimensional inference problems. Finally, we argue that canonical Markov Chain Monte Carlo algorithms are more natural than Microcanonical Hamiltonian Monte Carlo from the thermodynamic and information-theoretic point of view.
1 Introduction
Thermodynamic tools have informed canonical MCMC, but the thermodynamic properties of MCHMC remained unexplored. This work examines MCHMC through statistical physics and connects its algorithmic conditions to thermodynamic concepts.
1 Introduction
- Thermodynamic approaches had already produced new HMC convergence criteria and inspired a macrocanonical sampling algorithm.Source: §1 · p. 2
- MCHMC had been technically and empirically studied, but its thermodynamic properties had not been explored; this work studies a microcanonical partition function to determine them.Source: §1 · p. 2
- The paper reports that MCHMC analytically satisfies the Helmholtz formulation of the first law, with a condition conceptually linked to ergodicity.It also reports numerical demonstrations on a toy problem and type Ia supernova inference.Source: §1 · p. 2
- The paper relates volume entropy to a new sampling algorithm and argues canonical MCMC is more natural than MCHMC from thermodynamic and information-theoretic perspectives.Source: §1 · p. 2
2 Theory
The section derives MCHMC from a microcanonical ensemble and shows how its samples recover the posterior. It then sets out the Helmholtz theorem’s conditions, the role of volume entropy, and a volume-based variant for lower-dimensional sampling.
2.1 A Thermodynamic Motivation for Microcanonical Hamiltonian Monte Carlo
- With N fixed at 1, the partition functions satisfy Ω₀(E = J = 0) = Ω₂(E = J = 0) = Ωₙ₋₁p(y); marginalising the Ω₂ microcanonical phase-space density yields the posterior p(θ | y).Source: §2.1 · pp. 3–4
- Unlike HMC’s per-step energy conservation, MCHMC runs on a constant-energy surface, drawing a momentum direction and integrating to obtain the next position.The momentum magnitude is set by the energy condition; HMC instead draws its initial momentum from a Gaussian.Source: §2.1 · pp. 3–4
- Both kinetic and potential energies plateau quickly in the illustrated energy-conserving run, which the authors connect to the potential’s upper bound.They suspect this behaviour relates to reported better performance of H0, whose logarithmic kinetic energy is not bounded from below.Source: §2.1 · pp. 4–5, Figure 1 · p. 4
2.2 The Helmholtz Theorem for the Microcanonical Ensemble
- For a microcanonical system, the Helmholtz theorem gives dS(E, J) = 1/T(E, J)dE − Λ(E, J)/T(E, J) · dJ, provided trajectories are monocyclic.Monocyclicity requires each trajectory on an energy level to reach all phase-space states at that energy.Source: §2.2 · pp. 5–6
- The theorem’s entropy is volume entropy, not surface entropy; this choice also motivates VMCHMC, which samples the region below the energy level.VMCHMC can be applied to one- or two-dimensional problems, but approaches MCHMC in high dimensions, where it adds no new benefit.Source: §2.2 · p. 5
- Although the Helmholtz theorem resembles the first law, it is a proven theorem for mechanically described microcanonical systems, whereas the first law is an empirical postulate.The paper presents the theorem as an equivalent basis for statistical mechanics.Source: §2.2 · p. 5
3 The Helmholtz Theorem and Microcanonical Hamiltonian Monte Carlo
The paper tests whether MCHMC satisfies the Helmholtz theorem by examining monocyclicity and comparing thermodynamic quantities with entropy derivatives across analytical, toy, and cosmological settings. The reported numerical examples support the theorem, while remaining demonstrations rather than comprehensive tests.
3 The Helmholtz Theorem and Microcanonical Hamiltonian Monte Carlo
- The test compares temperature and source quantities from their thermodynamic definitions with the corresponding entropy derivatives across general likelihoods, a Gaussian toy problem, and supernova inference.Agreement in these comparisons is the paper's stated test of the Helmholtz theorem.Source: §3 · p. 6
3.1 Random bounces, ergodicity and monocyclicity
- Random momentum-direction resampling lets trajectories leave their initial radial axis; the authors connect this exploration of the constant-energy surface to monocyclicity, a condition stronger than ergodicity.Without resampling in the illustrated isotropic Gaussian case, the trajectory remains on its initial radial path.Source: §3.1 · pp. 6–7, Figure 2 · p. 6
3.2 General Likelihood
- Analytical calculations confirm the Helmholtz theorem for H0 and H2, while the derivations extend to separable Hamiltonians with bijective, monotonically increasing kinetic energy depending on momentum magnitude.Direction-dependent dispersion or a non-separable Hamiltonian makes the derivation more difficult; the latter also requires more sophisticated integrators.Source: §3.2 · pp. 7–8
3.3 Toy Example: Gaussian Likelihood
- For a three-dimensional Gaussian likelihood, the predicted temperature is T = 2E/3, and sample-based estimates agree with theory in infinite- and finite-volume tests.At fixed energy E = 1, estimates across dimensions also show reasonable agreement with the theoretical prediction.Source: §3.3 · p. 8, Figure 4 · p. 9
3.4 Cosmological Application: Supernova Cosmology
- In the supernova inference example, sample-based temperatures agree with finite-difference derivatives of volume entropy, confirming the Helmholtz theorem in this setting.The authors describe this as a demonstration, not a comprehensive numerical test.Source: Figure 5 · p. 9, §3.4 · p. 10
4 Notions of entropy and the thermodynamic nature of MCMC Methods
The paper argues that canonical MCMC is more natural than MCHMC from thermodynamic and information-theoretic perspectives. Its comparison turns on the canonical ensemble’s entropy interpretation and partition-sum construction.
4 Notions of entropy and the thermodynamic nature of MCMC Methods
- The canonical partition sum needs no momentum degrees of freedom in its simplest form, unlike the more involved microcanonical construction.The authors state that momenta are essential in the microcanonical case but not for defining the canonical partition sum.Source: §4 · p. 10
- At unit temperature, canonical entropy equals the posterior’s Shannon entropy, whereas the microcanonical entropy at zero energy is an evidence-type quantity the authors deem unmeaningful as an information-entropy measure.The canonical identity is attributed to Röver et al. (2023a).Source: §4 · p. 11
- The authors argue that a local microcanonical Hamiltonian cannot yield the global evidence term needed for entropy, while a canonical Legendre transform incorporates the required globality.They characterize Hamiltonians and phase-space densities as reasonably local, and partition functions and information-theoretic entropy as global functionals.Source: §4 · p. 11
- The authors conclude that canonical algorithms such as Rosenbluth-Metropolis-Hastings and HMC are more natural because their thermodynamic entropy better matches statistical inference.Their argument contrasts this with the microcanonical zero-energy entropy described as an evidence-type integral.Source: §4 · p. 11
5 Conclusion
The paper analyzes MCHMC as a microcanonical ensemble and finds that it satisfies the Helmholtz theorem under stated conditions. It also introduces a volume-based extension and argues that canonical algorithms are more natural with respect to entropy.
5 Conclusion
- The derivation formally identifies MCHMC as a realization of a microcanonical ensemble.Source: §5 · p. 12
- Volume entropy inspires a volume-based microcanonical sampler that extends MCHMC to low dimensions and approaches it in high dimensions.Source: §5 · p. 12
- Random bounces enable ergodicity and monocyclicity, linking MCHMC’s design to the conditions for the first law.Without the Helmholtz theorem, the sampler is not ergodic with respect to the joint position–momentum distribution.Source: §5 · p. 12
- Analytically, MCHMC satisfies the Helmholtz theorem for sensible Hamiltonian choices and any likelihood and prior under the stated scope.The result is nontrivial for H2; H0 provides the better-performing sampling algorithm.Source: §5 · p. 12
- Numerically, the theorem holds within precision in a toy problem and a Bayesian supernova-cosmology example.The authors describe these as demonstrations rather than comprehensive numerical tests.Source: §5 · pp. 12–13
- The authors argue that only canonical algorithms such as Rosenbluth-Metropolis-Hastings and HMC match thermodynamic entropy to posterior Shannon entropy.They also state that no microcanonical sampling algorithm can make the two notions of entropy agree.Source: §5 · p. 13
- Broader tests of the theorem remain future work, and further numerical tests may be constrained by H2’s requirements.For the second numerical test, transformations were needed to ensure the sampler worked.Source: §5 · p. 13
A Volume-based Microcanonical Hamiltonian Monte Carlo (VMCHMC)
VMCHMC uses a volume-based microcanonical construction whose position marginal recovers the posterior at zero energy and source. It extends MCHMC to low-dimensional inference and approaches MCHMC in high dimensions.
A Volume-based Microcanonical Hamiltonian Monte Carlo (VMCHMC)
- At zero energy and source, the volume-based construction recovers the evidence up to a factor and yields the desired posterior as its position marginal.Source: A Volume-based Microcanonical… · p. 15
- VMCHMC replaces the surface-based construction with a new volume and Hamiltonian, then samples initial momentum uniformly within a ball before integrating the equations of motion.Source: A Volume-based Microcanonical… · p. 15
- Unlike MCHMC, VMCHMC applies to one- and two-dimensional inference problems; at high dimension, it approaches MCHMC.In that limit, sampled momenta lie near the energy-ball boundary and the new Hamiltonian approaches H2.Source: A Volume-based Microcanonical… · p. 15
- The Helmholtz theorem is less natural for this sampler because it requires a proper microcanonical ensemble based on Ω.The authors also characterize its entropy notion as equally unnatural as MCHMC’s.Source: A Volume-based Microcanonical… · p. 15
- Figure 6 compares VMCHMC samples at E=J=0 with the ground-truth posterior for a two-dimensional Gaussian likelihood.Source: Figure 6 · p. 16
B Details of the Numerical Experiments
The appendix reports numerical settings for MCHMC and VMCHMC experiments, including entropy-estimation procedures and implementation choices.
B Details of the Numerical Experiments
- All MCHMC experiments used H2, random bounces with probability 0.1 after each integration step, and either Yoshida or Velocity-Verlet integration.Step size balanced phase-space exploration against visible numerical instability; total H2 was monitored along chains.Source: B Details of the Numerical Experiments · p. 16
- Finite-volume entropy estimates used pymultinest on finite prior boxes for Gaussian and SNIa cases, with temperature estimated by finite differences.The energy difference was 5 · 10^-3, and each estimate used 10 runs with 1000 live points.Source: B Details of the Numerical Experiments · p. 16
- VMCHMC refreshed momenta deterministically every few integration steps and was otherwise implemented analogously to MCHMC.Source: B Details of the Numerical Experiments · p. 16