arXiv:2609.07660stat.COSep 2026

Manuscript Offprint

arXiv:2609.07660

Thermodynamic Cyclic Processes with Markov Samplers in Bayesian Inference

Heinrich von Campe, Bjoern Malte Schaefer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The concept of Markov chain Monte Carlo (MCMC) cycles, an analogy to cyclic processes in heat engines, is presented in order to examine Bayesian inference problems. In this effort, we develop adaptive ensemble schedulers that allow the tuning of external parameters of a Bayesian canonical ensemble during an MCMC run, realising the MCMC cycles in practice. We run these cycles on different statistical models. As a fundamental insight, we find (both theoretically and in practice) that such systems can produce a non-zero net work output if and only if the considered model is non-Gaussian. As such, they may serve as a measure of non-Gaussianity in Bayesian inference, which we test on an example from supernova cosmology.

1 Introduction

One of the prime motivations for the development of the theory of thermodynamics in the 19th century was the study of heat engines as the first apparatuses that could translate heat into work as a usable form of energy (Saslow, 2020). In the beginning, the nature of gases, their working substances, was poorly understood on the microscopic level. Thus, thermodynamics was developed as an effective theory to accurately capture their macroscopic behaviour nonetheless. Subsequently, thermodynamics became a powerful theory that could be applied to systems of few as well as many degrees of freedom. When the “molecular picture” of matter was established, statistical physics was developed by Boltzmann and others to bridge the gap to the macroscopic thermodynamic notions. Much later, Jaynes (1957) found that thermodynamics and statistical physics may indeed also be understood as a theory of information.

Conversely, Bayesian inference and Markov Chain Monte-Carlo (MCMC) sampling can be studied from the point of view of statistical physics and thermodynamics as the following construction demonstrates. Bayes' theorem,

p(θ∣y)=L(y∣θ)π(θ)p(y),(1)p(\theta \mid y) = \frac{\mathcal{L}(y \mid \theta)\pi(\theta)}{p(y)}, \tag{1}

with the likelihood L(y∣θ)\mathcal{L}(y \mid \theta), parameter θ\theta, the data yy, and the prior π(θ)\pi(\theta), requires the evidence as a normalization constant

p(y)=∫dnθL(y∣θ)π(θ).(2)p(y) = \int \mathrm{d}^{n}\theta \mathcal{L}(y \mid \theta)\pi(\theta). \tag{2}

Additional parameters, the temperature TT and the sources JJ, extend this integral to a canonical partition sum in the sense of statistical physics

Z(T,J)=∫dnθ(L(y∣θ)π(θ))1/TeJ⋅θ/T.(3)Z(T,J)=\int \mathrm{d}^{n}\theta\left(\mathcal{L}(y\mid\theta)\pi(\theta)\right)^{1/T}e^{J\cdot\theta/T}. \tag{3}

To this one may then apply the tools from statistical mechanics and thermodynamics to obtain a theory of the Bayesian canonical ensemble and its extensions (Röver et al., 2023a; Kuntz et al., 2024; 2025). The sources J∈RnJ\in\mathbb{R}^n are well known from statistical physics and quantum field theory; they can be used to obtain the moments (cumulants) of the posterior by evaluating the (logarithmic) derivative of the partition sum ZZ at T=1T=1 and J=0J=0. In practice, the integrals often cannot be carried out analytically, which is why one resorts to Markov chain Monte-Carlo (MCMC) sampling algorithms such as the Rosenbluth-Metropolis-Hastings (RMH) algorithm (Metropolis et al., 1953; Hastings, 1970). Much like in a physical gas, such algorithms work by simulating a random walk in the sample space. The samples of the posterior are then given by the trajectory of the sampling “particles”. The thermodynamic point of view has yielded new convergence criteria for MCMC algorithms (Röver et al., 2023b) as well as entirely new sampling algorithms (Herzog et al., 2024; Robnik et al., 2026).

Aside from sampling, a different use case for the RMH algorithm is called simulated annealing with the aim of finding the global maximum of the posterior w.r.t. the position θ\theta (van Laarhoven & Aarts, 1987). This is accomplished by gradually decreasing the temperature TT as the sampler runs such that the sampler’s motion is more and more restricted around the maximum.

Contributions The main aim of this paper is the construction and study of an analogue to the cyclic processes of mechanical heat engines in Bayesian inference. We first develop the necessary mechanisms by generalising the idea of simulated annealing in order to vary both the temperature TT and the sources JJ during a simulation run. With this, we establish a new method named MCMC cycles where both parameters are changed in turn, forming a closed loop in (T,J)(T,J) space, just like in heat engines. We tune the parameters in a thermodynamically consistent way by introducing adaptive ensemble schedulers inspired by the notion of quasi-staticity (see section 2). The thermodynamic theory derived from the partition sum (3) allows us to make predictions about the exchanged heat and performed work during the MCMC cycles (section 3). Our further aims are to test whether they work in practice, whether our theoretical predictions may be confirmed and what properties these cycles exhibit (section 4). As we will see, the MCMC cycles function differently depending on the (non-)Gaussianity of the sampled density, allowing us to use them as a diagnostic for that which we test on an example of Bayesian inference in cosmology with type Ia supernovae. Throughout the paper, we use index notation with the Einstein summation convention that we briefly describe in Appendix A.

Related work MCMC methods were originally developed for use in statistical physics (Metropolis et al., 1953; Hastings, 1970) but have since been applied to many other fields, Lattice QCD (Creutz, 1980; Duane et al., 1987) and Bayesian inference (Gelfand & Smith, 1990; Geman & Geman, 1984) among them. The thermodynamic properties of heat engines have been studied since the 19th century (Carnot, 1872; Clausius, 1879; Thomson, 1852). The general thermodynamic nature of Bayesian inference and MCMC methods has been studied extensively (Jaynes, 1957; Röver et al., 2023a;b; Herzog et al., 2024; Kuntz et al., 2024; 2025). While the work by Wang et al. (2024) is related by title, neither the aim nor the proposed method are connected to ours.

References (29)