Skip to main content

This is a preprint.

It has not yet been peer reviewed by a journal.

The National Library of Medicine is running a pilot to include preprints that result from research funded by NIH in PMC and PubMed.

ArXiv logoLink to ArXiv
[Preprint]. 2026 Sep 14:arXiv:2609.15897v1. [Version 1]

Bridging Control, Inference, Transport, and Thermodynamics

From Theory to Applications in Learning

Emmy Blumenthal 1,*, Nikolas Claussen 1,2,†, Benjamin Eysenbach 3,‡, Catherine Ji 1,§, Gautam Reddy 1,, Colin Scheibner 1,2,**, Benjamin Sorkin 1,2,††
PMCID: PMC13596642  PMID: 42780301

Abstract

The last decade has seen the development of powerful methods for learning complex structure from high-dimensional data. These advances have brought to the foreground fundamental connections between subdisciplines of physics, applied mathematics, and machine learning. In this review, we bring together some of these ideas, often expressed in different languages, to highlight a conceptual thread that links five distinct fields: control theory, optimal transport, probabilistic inference, non-equilibrium thermodynamics, and machine learning. A common theme is the optimization of free-energy-like functionals under dynamical or statistical constraints. We offer a guided tour through this thread and present selected applications in reinforcement learning, variational inference, and generative modeling. The review does not assume prior familiarity with these topics, and begins with principles originating from physics.

INTRODUCTION

Recent decades have seen the development of remarkably powerful tools for learning complex structure from data. These methods have brought to the foreground certain key connections between subdisciplines of physics and applied mathematics. The conceptual ideas have appeared in different fields at different times, sometimes rediscovered and often expressed in different languages. In this review, we bring together some of these connections to highlight a fascinating conceptual thread that links five distinct fields: control, transport, inference, thermodynamics and learning. The visual table of contents, Fig. 1, lays out the topics we cover and the links between them. These connections have proved fruitful for the development of powerful practical algorithms for generative modeling and control. We offer a guided tour through this thread and present selected applications in reinforcement learning, variational inference, and generative modeling. The review is written in the language of physicists and does not assume prior familiarity with these topics. Ideas from mechanics and thermodynamics are used as familiar anchors to introduce concepts in other areas.

FIG. 1.

FIG. 1.

Graphical table of contents: topics of the review and the connections between them.

The conceptual thread begins at the level of paths (left column in Fig. 1) in Variational structure of mechanics, control, and inference. This chapter develops a common variational language that is reused throughout the review. We introduce optimal control, which seeks the best way to steer a dynamical system—for example, guiding a rocket to a target while minimizing fuel consumption. We illustrate two complementary structural approaches for solving control problems. Introducing Lagrange multipliers for imposing a constraint on the dynamics leads to Hamiltonian equations. Another technique, known as dynamic programming, reformulates the optimization as a recursive equation. This reformulation leads to the Hamilton–Jacobi equation and, for stochastic control, its more general Hamilton–Jacobi–Bellman (HJB) counterpart. Controls and rewards play roles analogous to velocities and the negative Lagrangian in classical mechanics. We then pass from optimizing individual paths to distributions (right column in Fig. 1). The Maximum Entropy Principle (MaxEnt) selects a probability distribution that remains as close as possible to a reference distribution, as measured by the Kullback–Leibler (KL) divergence, while remaining consistent with data. We then generalize these tools for probabilistic inference to distributions over paths. For controlled driftdiffusive processes, Girsanov’s theorem identifies this pathspace KL divergence with a quadratic control cost, thereby connecting inference and control.

The next chapter, Control and transport of densities, illustrates how the control of paths can be used to obtain a geometric description for the evolution of probability densities. The topic of transport brings together ideas from the study of (stochastic) paths and of distributions (center column in Fig. 1). The first step is to impose constraints on both the initial and final densities of a stochastic control problem. These constraints lead to the Schrödinger bridge problem, which finds the most likely ensemble of stochastic paths that connects the two densities. If one retains the endpoint constraints but describes only how initial and final positions are paired, the problem becomes entropic optimal transport. In general, optimal transport asks how to move one density into another at minimum cost, much like reshaping a pile of earth while minimizing the cost of moving it. The entropic version adds a term that favors spreading probability among different pairings. For a quadratic cost, the zero-noise limit defines the 2-Wasserstein distance, which has special mathematical properties. This distance equips the space of probability densities with a geometry and leads to Wasserstein gradient flows: steepest-descent dynamics in which the evolving object is a probability distribution.

The chapter on Thermodynamics grounds this geometry in physics. At equilibrium, statistical mechanics assigns probabilities to microscopic states while retaining only a small number of macroscopic constraints. Maximum-entropy inference reproduces the familiar Gibbs distributions from constraints on mean energy, making a heuristic connection between inference and equilibrium thermodynamics. Away from equilibrium, control and transport describe finite-time transformations between distributions. Onsager’s least-dissipation principle generates phenomenological field theories whose dissipation rate is bounded by the Wasserstein distance. For stochastic dynamics farther from equilibrium, the Wasserstein transport cost provides thermodynamic speed limits on the entropy produced during a finite-time transformation. Nonequilibrium work fluctuation relations provide a complementary link between fluctuations, free-energy differences, and the energetic cost of driving. Thermodynamics therefore supplies physical meaning for the variational structures introduced earlier, which in turn furnish quantitative limits on thermodynamic processes.

The fourth conceptual chapter, Sampling and control, presents sampling as a general approach to probabilistic inference, optimization, and control. Monte Carlo methods estimate averages from samples, while simulated annealing searches for low-energy states. Exploring possible trajectories and weighting them according to their rewards also links sampling to control and reinforcement learning; the Feynman–Kac formula makes this connection precise for a class of stochastic control problems. Sampling faces several distinct challenges, including high dimensionality, separated modes that impede efficient exploration, and observables whose averages are dominated by rare trajectories. When an unnormalized target density is available, Annealed Importance Sampling (AIS) replaces direct sampling by a sequence of intermediate distributions and corrects the resulting nonequilibrium process through trajectory-dependent weights. The control perspective shows how guiding the dynamics toward important trajectories can reduce fluctuations. Although this ideal control is generally unknown, it provides a target for practical algorithms that learn progressively better sampling dynamics. This chapter thus closes the conceptual thread by turning efficient sampling into a control problem.

These connections provide a framework and common language for Applications (bottom row in Fig. 1). The first application is Reinforcement learning. Stochastic optimal control assumes that the dynamics of the environment are known. Reinforcement learning instead seeks good controls—called actions—by interacting with an environment and observing the resulting states and rewards. A policy gives the probability of taking each action in a given state and therefore defines an ensemble of trajectories. The connection between inference and control leads to Maximum Entropy Reinforcement Learning (MaxEnt RL), in which high-reward trajectories are favored while the policy retains some randomness. Applying dynamic programming to this objective leads to soft Q-learning and Soft Actor-Critic (SAC), practical algorithms for learning stochastically controlled paths when the dynamics are not known in advance.

The second application concerns Wasserstein gradient flows. The geometry of probability distributions provides a variational method for integrating Fokker–Planck equations. The same viewpoint helps describe large systems of interacting particles. In a suitable mean-field limit, the individual particles are replaced by an evolving density, which can obey a Wasserstein gradient flow. This description has also been used for wide neural networks, where many parameters are treated as interacting particles. Finally, in variational inference, a difficult target distribution is approximated within a simpler family of distributions. The KL objective has the form of a free energy, and projecting its Wasserstein gradient flow onto that family yields a practical approximation scheme.

The final application, Generative modeling with flows and diffusion, treats targets represented by data rather than by a known density. Normalizing flows and diffusion models learn deterministic maps or stochastic dynamics that transform samples from a simple base distribution into samples from the target distribution. In this sense, generative modeling is a learned transport problem. Flow matching learns a velocity field that carries the base density toward the data, while diffusion models learn to reverse a gradual noising process. These methods need not find a minimum-cost transport; their goal is to learn a transformation that can be estimated from finite data and used efficiently for sampling. The earlier connections explain why ideas from transport, inference, control, and nonequilibrium physics repeatedly appear in their construction, and why additional guidance can be understood as a control that favors selected outcomes.

A brief note on notation.

We have sought to unify notation across the chapters to the extent possible. The notation tables at the end of this review are organized by the chapter in which a symbol is first introduced.

I. VARIATIONAL STRUCTURE OF MECHANICS, CONTROL AND INFERENCE

In this chapter, we develop a common variational language for mechanics, control, and inference. We introduce two complementary approaches for solving control problems. We then turn to inferring probability distributions from observations, and show how inference over stochastic paths leads back to a particular class of control problems.

A. Finding optimal paths in classical mechanics and control theory

We begin with a gentle introduction to control theory. Consider an illustrative example — suppose we would like to guide a rocket towards a target in a certain amount of time by controlling its thrust. A large thrust accelerates the rocket but consumes more fuel, whereas insufficient thrust may not be enough to reach the target on time. How does one choose a thrust protocol so that the rocket reaches the target while consuming the least amount of fuel? Different control strategies generate different paths. In optimal control, we assume that there is a reward function that assigns a value or utility to each path. This reward may favor reaching a target, penalize control costs, or balance competing goals. Control theory offers mathematical tools for finding a control strategy that maximizes the total reward along the path. Although its variational roots are much older, modern optimal control took shape in the 1950s. Bellman’s dynamic programming and the maximum principle of Pontryagin offer two powerful and complementary approaches for solving control problems [1–3]. We now describe these two solution principles, which will reoccur throughout the rest of the review. The principles are best illustrated by demonstrating their relationship with standard formulations of classical mechanics.

The optimal control problem.

In optimal control, a system is described by a (possibly multi-dimensional) state xt whose evolution is modulated by a control ut. For the rocket, the state includes its position, velocity, and remaining fuel, while the control is the thrust. For convenience, we rescale time to the interval 0≤t≤1.

In stochastic optimal control, the state obeys1

x˙t=gtxt,ut+εηt, (1)

where ε sets the noise scale and ηt is standard Gaussian white noise, with ηt,iηs,j=δijδ(t-s). A reward rtxt,ut assigns a value per unit time to each state-control pair, while a terminal reward r1x1 assigns value to the final state. Starting from a fixed x0, the optimized objective is

V0x0=maxu0≤s<1r1x1+∫01rsxs,usds∣x0, (2)

where the expectation is taken over the noise histories ηt conditioned on the initial state x0 [4–6]. The controls may depend on the observed state, but not on future noise. A fuel cost, for example, enters with a minus sign in rt, while a terminal reward favors arrival near the target.

Perhaps intuitively, classical mechanics can be described as a special case of this optimization problem. Consider a particle with coordinates xt and velocity x˙t whose motion is described by a Lagrangian Lt(x,x˙). Its action is

Sx⋅=∫01Ltxt,x˙tdt, (3)

where x(⋅) denotes the full path. The principle of stationary action states that the physical path xt* makes S stationary under variations that leave the endpoints x0 and x1 fixed. Imposing stationarity leads to the Euler–Lagrange equations. We now map action minimization onto a control problem by choosing

gt(x,u)=u,ε=0, (4)
rt(x,u)=-Lt(x,u), (5)

and imposing that the terminal endpoint is x1. Here the control plays the role of velocity, ut=x˙t. The endpoint constraint can equivalently be imposed through a terminal reward that is zero at x1 and -∞ elsewhere. Maximizing the reward then minimizes the action. Note that classical mechanics only requires stationarity, that is, physical trajectories need not be minima and can instead be saddles. The optimization therefore selects action-minimizing paths, while the variational equations also describe other stationary paths.

There are two structural approaches for solving the control problem. The first treats the dynamics in Eq. (1) as a constraint and introduces Lagrange multipliers, leading to a Hamiltonian formulation. The second recursively expresses the optimal solution in terms of optimal solutions to shorter remaining problems, leading to the Hamilton–Jacobi–Bellman equation. Relating the two will identify the Lagrange multiplier as the gradient of a value function.

Lagrange multipliers and Hamiltonian dynamics.

A Lagrange multiplier converts a constrained optimization problem into a stationary problem in an enlarged set of variables. Variation with respect to the multiplier enforces the constraint, while variation with respect to the original variables supplies the optimality equations. To see this, let’s first take the deterministic limit ε=0. Introducing a time-dependent multiplier pt for the constraint x˙t=gtxt,ut gives the augmented objective

V~(x,u,p)=r1x1+∫01rtxt,ut+pt⋅gtxt,ut-x˙tdt, (6)

with the initial endpoint x0 held fixed. The sign of pt is conventional. Define the control Hamiltonian and its optimized form by

ℋtx,p,u=p⋅gtx,u+rtx,u, (7)
Ht(x,p)=maxuℋt(x,p,u). (8)

Variation with respect to pt and xt (after integrating by parts the term involving x˙t in Eq. (6)), together with maximization over u, gives the necessary optimality conditions [2, 4]. When Ht is differentiable, these take the form

x˙t=∇pHtxt,pt, (9)
p˙t=-∇xHtxt,pt, (10)
ut*=argmaxuℋtxt,pt,u. (11)

If the terminal state is free, the endpoint variation gives p1=∇r1x1, whereas if it is fixed, the terminal variation vanishes. For a free terminal state, the multiplier equation is thus evolved backward from the terminal condition along the trajectory. We will see below that pt measures how the optimal future reward changes under a displacement of the state.

For the specialization gt(x,u)=u and rt(x,u)=-Lt(x,u), the optimized Hamiltonian becomes

Ht(x,p)=maxup⋅u-Lt(x,u), (12)

which is the Legendre transform of the Lagrangian. The stationarity condition with respect to u gives

pt=∇uLtxt,ut=∇x˙Ltxt,x˙t, (13)

so the multiplier is the canonical momentum, and the remaining conditions are Hamilton’s equations.

Dynamic programming and the Hamilton–Jacobi equation.

The second approach involves keeping track of the maximum reward that remains available from every possible intermediate state (‘reward-to-go’). For the rocket, suppose we already knew the maximum total future reward attainable from every state xt+dt at time t+dt. The value of choosing a particular thrust at time t is its immediate reward, including the fuel cost, plus the expected best future reward from the state it produces. The optimal thrust is the one that maximizes this sum. In other words, if the expected best future reward is known, solving for the optimal thrust involves optimizing over a single step rather than over a full trajectory.

This method for solving a problem by breaking it into shorter subproblems and reusing their solutions is called dynamic programming [1]. In this setting, the key observation is that the control at the next state for an optimal strategy must itself be optimal. This gives a recursive relation between the best reward now and the best reward at the next time step, which we can solve backward from the terminal reward. The reuse of partial results is analogous to the transfer-matrix method in statistical mechanics, where a partial sum over configurations is updated one site at a time [7].

The central object in dynamic programming is the value function

Vt(x)=maxut≤s<1∫t1rsxs,usds+r1x1∣xt=x, (14)

with terminal condition V1(x)=r1(x). Thus, Vt(x) is the largest expected total reward that can still be collected from time t onward, starting at x, including the terminal reward. It does not include rewards already received. This is the optimal reward-to-go, and V0x0 is the objective in Eq. (2).

The controls after time t+dt have already been optimized inside Vt+dt, so only the control applied during the first short interval remains to be chosen. Splitting the total reward into the immediate and future contributions gives Bellman’s recursion, to first order in dt,

Vt(x)=maxurt(x,u)dt+Vt+dtx+gt(x,u)dt+εdWt+o(dt). (15)

Here dWt is a Gaussian noise increment with zero mean and dWt,idWt,j=δijdt, and the expectation is over this increment. Assuming the value function is smooth, expanding Vt+dt to first order in time and second order in the state increment, averaging over the noise, and retaining terms of order dt gives the Hamilton–Jacobi–Bellman (HJB) equation [5, 6]

∂tVt(x)+ε2∇2Vt(x)+maxugt(x,u)⋅∇Vt(x)+rt(x,u)=0. (16)

The control chosen at state x is the maximizer of the local expression,

ut*(x)=argmaxugt(x,u)⋅∇Vt(x)+rt(x,u). (17)

Thus, when gt and rt are known, the difficult optimization over an entire control history can be replaced by a backward equation for Vt followed by a local maximization at each state and time. Finding this function over a high-dimensional state space can nevertheless be difficult.

In the deterministic limit, the Hamiltonian Ht(x,p) introduced above allows us to write the HJB equation as

∂tVt(x)+Htx,∇Vt(x)=0. (18)

This equation also makes the connection between dynamic programming and the Lagrange-multiplier formulation explicit. Where Vt and Ht are smooth, set pt=∇Vtxt along an optimal trajectory. The state evolves as

x˙t=gtxt,ut*=∇pHtxt,pt. (19)

The total time derivative of pt along this trajectory is

p˙t=∂t∇Vtxt+x˙t⋅∇∇Vtxt. (20)

Taking the spatial gradient of Eq. (18) gives

∂t∇Vt+∇xHt+∇pHt⋅∇∇Vt=0, (21)

where ∇xHt denotes differentiation with respect to the explicit state argument of Ht(x,p) while holding p fixed, and the Hamiltonian derivatives are evaluated at p=∇Vt(x). Using x˙t=∇pHt and combining the above two equations, we get

p˙t=-∇xHtxt,pt. (22)

Thus, the trajectories along which the Hamilton–Jacobi equation is solved, its characteristics, obey precisely the Hamilton equations obtained from the Lagrange-multiplier approach. The multiplier pt is the gradient of the value function because it measures the sensitivity of the optimal future reward to a displacement of the current state.

For action-minimizing trajectories in classical mechanics, the value function is the negative of the minimum action remaining to the fixed endpoint x1,

Vtx=-minxs:xt=x,∫t1Lsxs,x˙sds. (23)

On a minimizing trajectory, variation of the initial endpoint gives δVt=pt⋅δx, while variation with respect to the velocity gives pt=∇x˙Lt. Hence

pt=∇Vtxt=∇x˙Lt, (24)

so the multiplier of optimal control becomes the canonical momentum of mechanics.

The two approaches thus give complementary descriptions: the Lagrangian viewpoint follows individual trajectories, while the Eulerian viewpoint of dynamic programming finds a field Vt(x) over all states. Note that we have assumed that the reward rt and dynamics gt are known. Reinforcement learning (RL) addresses the challenging problem of finding the optimal control when this information is not available in advance. In RL, one interacts with the environment to learn which controls, or actions, produce large cumulative reward from observed state transitions and rewards. The value function remains central because it provides an estimate of the long-term consequence of acting from each state. We return to the RL framework in Sec. V A of the Applications chapter.

B. Variational basis for probabilistic inference and control

We now turn to a different but related problem, wherein measurements constrain probabilities of random degrees of freedom, instead of control functions that steer individual paths. Since measurements rarely provide every microscopic detail of a system, we describe the system by a probability distribution that we seek to infer from the available observations. Bayesian inference is an example of such a capability: what is the distribution of x, given observations A and a prior p0(x) (which encodes existing knowledge about the system [8])? By Bayes’ rule, the conditional distribution is p(x∣A)=p(A∣x)p0(x)/p0(A), thereby recasting the problem as specifying a model for A given x. More generally, the central task of probabilistic inference is to determine conditional probabilities. In this chapter, we show that this task can be formulated as constrained optimization—a variational problem under constraints arising from observations. This formulation highlights a conceptual connection to the optimization problems of mechanics and control (Sec. IA), and provides the theoretical basis for path-integral stochastic control in Sec. ID. Later in the review, variational probabilistic inference will serve as a foundation for practical inference algorithms: Chapter IV uses control theory to address inference problems, while Sec. VB 3 considers variational inference, where the system distribution is approximated using a parametrized ansatz.

Here, we will introduce maximum-entropy inference, a method for finding a probability distribution for the system without prior knowledge, constrained to be consistent with observations. The observations take the form of measurements of moments like the mean or variance, which, however, do not fully determine the distribution. There is thus a many-to-one correspondence between microscopic models and the measurements. How to choose one model out of the many? One well-motivated approach is to construct a model of behavior pA(x) that is closest to a reference distribution p0(x), but remains consistent with the observations A. As we will show below, a natural candidate for measuring closeness is the Kullback-Leibler divergence,

DKL(p‖q)=∫dxp(x)logp(x)q(x). (25)

measuring how different (“the excess surprise”) the distribution p is from q [9]. We will furthermore see that using Lagrange multipliers that enforce consistency with observed paths has a natural interpretation as rewards. This choice will establish a conceptually and practically relevant connection between probabilistic inference and control.

1. Sanov’s theorem and the inference method

We first make a plausibility argument for the inference method through Sanov’s theorem. It equips DKL with a probabilistic interpretation as a measure of how a distribution estimated from samples deviates from the underlying true distribution. Namely, suppose that N independent and identically distributed (IID) samples xn1,…,N are drawn from a base measure, p0(x). Having drawn these samples, to what extent does the empirical measure,

pˆ(x)=1N∑n=1Nδx-xn, (26)

depart from p0(x)? Sanov’s theorem [10, 11] states that the probability of the empirical measure, P[pˆ], deviating from the ground truth p0(x) is exponentially suppressed with an increasing number of samples N:

P[pˆ]~e-NDKLpˆ‖p0, (27)

Eq. (27) is achieved using large-deviations theory, which concerns finding the asymptotic decline in probability of a rare event, wherein the probability typically takes the form ~e-NI with I called the rate function. The rate function here is the DKL, which possesses two appealing properties: DKL=0 and minimal if and only if pˆ=p0, and the spread itself gets smaller as N→∞:pˆ-p0~N-1/2. The rarer the event, the larger the KL divergence, and the more the probability is suppressed.

We will prove Eq. (27) via a path-integral calculation, exemplifying the path-integral machinery we will encounter later in the review. We compute the distribution of empirical measures P[pˆ] by definition, from the expectation of the functional delta function over the drawn samples,

P[pˆ]=∏m=1N∫dxmp0xm×δ[pˆ(x)-1N∑n=1Nδx-xn]. (28)

Expressing the delta function via its Fourier transform, δ[f(x)]∝∫D[iμ(x)]e∫dxμ(x)f(x), and noting the identical and independent integrals over samples, we rewrite

P[pˆ]∝∫D[iμ(x)]expN∫dxμ(x)Npˆ(x)+Nlog∫dx′p0x′e-μx′/N (29)

Since N→∞, we note that only μ(x)~N contributes to the Fourier integral, overall implying that the argument of the exponential is ~N. This justifies a saddle-point evaluation of the integral — the saddle point μ*(x) satisfies

p0(x)e-μ*(x)/N∫dx′p0x′e-μ*x′/N=pˆ(x), (30)

Inserting Eq. (30) in Eq. (29), we obtain Eq. (27).

Sanov’s theorem ensures that the deviations of the estimated measure from the ground truth are minimized with more samples. However, during probabilistic inference, the choice of a reference distribution is often that which can be sampled easily, meaning that there is no inherent reason why the underlying model is that of the base p0. This suggests that if we observe data inconsistent with p0 and seek the most likely alternative explanation, we should find the distribution pA that is closest to p0 in KL divergence while remaining consistent with the observations A. By observations we mean, e.g., measurable moments or state occupancies of the system, dictated by the unknown underlying distribution. For instance, later we will be interested in inferring and controlling the distributions over paths. Via a large-deviation principle, we may motivate the fact that the distribution pA closest to p0, consistent with observations A, satisfies

pA=argminpDKLp‖p0,s.t.∫dxp(x)=1and∫dxp(x)a(x)=A. (31)

This will serve as the basis for probabilistic inference throughout this review.

To motivate this inference, we recall that not all pˆ(x)s are possible if the value of a certain observable, A, is known and thus imposed as a constraint. The space of empirical distributions is thus reduced to those which satisfy A=N-1∑n=1Naxn. Therefore, Eq. (28) should be rewritten instead as

P[pˆ∣A]=∏m=1N∫dxmp0xm×δpˆ(x)-1N∑n=1Nδx-xn×δA-1N∑n=1Naxn. (32)

Even more so, note that Eq. (30) implies additionally that pˆ(x) must be normalized (∫dxpˆ(x)=1). The rest of the procedure to obtain Eq. (27) remains unchanged other than the additionally imposed observables. Following the above saddle-point calculation, Eq. (27) can be rewritten as

P[pˆ∣A]~exp-NDKLpˆ‖p0+η*∫dxpˆ(x)-1+λ*∫dxpˆ(x)a(x)-A, (33)

where η* and λ* are such that the overall rate function (the argument of the exponential) is minimized. (This calculation should be regarded as qualitative, as the saddle point in η and λ may often not be justified.) Therefore, we conclude that Sanov’s theorem motivates turning the inference problem of pA(x) into a constrained optimization problem, Eq. (31).

2. Maximum-entropy inference

Sanov’s theorem is closely related to maximum-entropy inference. Suppose, for simplicity, that the prior is the uniform distribution, p0(x)=1/∫dx′. In this case, the KL divergence simplifies to the negative of the Shannon entropy of a distribution p(x) [9],

H[p]=-∫dxpxlogpx. (34)

Shannon argued that Eq. (34) is a functional that can quantify information [12]. When the only available information is a set of measured expectation values, the “least-committal” distribution consistent with them is the one that maximizes entropy [13, 14].

Mathematically put, suppose a set of observables was measured, A=∫dxp(x)a(x). Combined with normalization, according to Eq. (31) (with entropy replacing the KL divergence) the inferred distribution is that which satisfies

pA=argmaxpH[p],s.t.∫dxp(x)=1and∫dxp(x)am(x)=Amm=1,…,M. (35)

Using the method of Lagrange multipliers, one finds the solution

pA(x)=1Zexp-∑m=1Mλmam(x), (36)

where

Z=∫dxexp-∑m=1Mλmam(x), (37)

arose from the Lagrange multiplier enforcing normalization. λm are the remaining Lagrange multipliers, determined from the implicit relation

Am=-∂logZ∂λm. (38)

The maximized entropy reads

HpA=logZ-∑m=1MλmAm. (39)

The above is the general statement for an inference scheme based on the maximum-entropy principle. It can be readily generalized to the case where the prior p0(x) is not uniform, e.g., the inferred distribution will become the “exponential tilt” of the base distribution

pA(x)∝p0(x)exp-∑m=1Mλmam(x). (40)

In the above expressions, am(x) can be polynomials, in which case A gives the moments of the underlying distribution. However, a particularly relevant observable for later is that which checks if x is in a region 𝒜,a(x)≔1𝒜(x), so A=∫a(x)p(x)dx=1. The constraint is then pA(x∈𝒜)≔pA(𝒜)=1. The maximum-entropy solution Eq. (35) is exactly the conditional probability distribution. At the same time, Bayes’ rule means p(x∣𝒜)=1𝒜(x)p0(x)/p0(𝒜). Thus, the constraint pA(𝒜)=1 implies:

DKLpA‖p0pA(𝒜)=1=DKL1𝒜⋅pA‖1𝒜⋅p0=DKLpA‖p(⋅∣𝒜)-logp0(𝒜) (41)

whose minimum is pA(x)=p(x∣𝒜). In this setting, maximum-entropy inference exactly reproduces Bayesian inference.

The minimum-KL-divergence formulation is closely related to Bayesian inference more generally. The “update” ratio pA(x)/p0(x)=e⋯ can be interpreted as the likelihood ratio, p(A∣x) by Bayes’ rule—the exponential factor reweighing the prior according to the information encoded by the imposed constraints. In this sense, the minimum-KL solution is thus a Bayesian-style update of the reference distribution, with the exponential tilt playing the role of an (unnormalized) likelihood. These general functional forms will appear repeatedly in the upcoming sections for specialized observables. We will furthermore see that the Lagrange multipliers will take the form of rewards, thereby generalizing ideas from Sec. IA to path-integral stochastic control. Furthermore, the DKL objective arises naturally in the context of Variational Inference (VI), the problem of approximating a complex distribution by a simpler—typically parametric—one, which will be discussed in Sec. V B 3.

Another noteworthy connection of maximum-entropy models is to exponential-family models [15, 16]. Maximum-entropy distributions subject to linear expectation constraints take the exponential-family form of Eq. (36), in which the Lagrange multipliers λm enter linearly in the exponent and determine the partition function Z. Beyond their conceptual connection to maximum entropy, exponential-family models are useful because their parameters can be estimated through convex optimization, making them particularly attractive for statistical inference and applications such as image processing.

In addition to Sanov’s theorem and the Bayesian-inference connections, there is a subtle connection of maximum-entropy inference to equilibrium statistical mechanics. Sanov’s theorem provides concrete grounds for the maximum-entropy approach, as large deviations are exponentially suppressed as the number of samples increases. In the thermodynamic limit the dimensionality of x (the number of particles), reaching as much as ~1023, far exceeds any feasible number of samples that one may obtain. Instead, the second law of thermodynamics and statistical mechanics provide the theoretical basis for finding the microscopic statistical model of materials. Nevertheless, both mechanisms—equilibrium statistical mechanics and maximum-entropy modeling—provide the same mathematical structures [11]. We shall discuss this correspondence in Sec. III A.

C. Probabilistic inference over paths

In Sec. IA, we considered how to control a system with known dynamics to maximize a prescribed reward. In Sec. I B, we saw how inference problems can be formulated as optimization problems in which we seek a distribution that is consistent with observed data while remaining as close as possible to a prior distribution. We now turn to the application of the large-deviation principle to the inference of distributions over paths. We will exploit the tools of stochastic optimal control to solve these path-distribution inference problems.

In a stochastic system, repeated realizations of the noise generate different trajectories, so in the context of stochastic optimal control, a given control determines a probability distribution over paths. When investigating the properties of a distribution over paths, we will exploit that, in generic settings, there is a correspondence between stochastic differential equations (SDEs) and distributions over paths. In particular, an SDE determines a distribution over paths in which each realization of the noise generates a different trajectory. Under certain regularity conditions, there is a converse relationship where a distribution over paths can be represented by an SDE whose drift and diffusion coefficients are determined by the properties of the distribution; we will restrict the inference problems we consider to those for which this correspondence holds. We use uppercase P for distributions over complete paths, reserving lowercase p for state densities. If we have a prior distribution over paths, P0[x(⋅)], and we observe some data about the system, the large-deviation principle tells us how to find the distribution over paths, Pu[x(⋅)], that is most similar to the prior while remaining consistent with the observations. Thus, because of the path distribution-SDE correspondence, the result of inference is a new SDE that describes the dynamics of the system under the inferred distribution over paths. Importantly, the inferred SDE will contain additional forces that will be determined by an optimization problem. To see this, consider a simple example of such a path-conditioning problem, namely, the Brownian bridge. In the Brownian bridge, we consider a particle known to start at a point x0 at time t=0 and undergo Brownian motion, but we impose the condition that the particle is at a prescribed target y at time t=1:

x˙t=εηt,conditionedonxt=0=x0,xt=1=y. (42)

Without this conditioning, the particle would hit y at time t=1 formally with probability zero. Within the ensemble of such conditioned paths, there is apparently an additional force that drives the particle to y at time t=1, which is not present in the unconditioned dynamics. Here, we will consider similar problems in which we condition on more general observations, and we will see that the large-deviation principle provides a natural way to infer the additional forces that emerge from this conditioning.

1. From inference to distributions over paths

Consider the prior distribution over paths, P0[x(⋅)], induced by the passive dynamics (i.e., the dynamics without any additional forces),

x˙t=ftxt+εηt. (43)

We seek to infer how this ensemble changes when observations constrain its properties. We will represent the inferred ensemble through an additional control,

x˙t=ftxt+utxt+εηt, (44)

and denote its path distribution by Pu[x(⋅)]. The reference and controlled processes start at the same fixed x0, as in Sec. IA. The marginal density at a single time is

ptu(x)=δx-xtPu.

We omit the superscript on a marginal when only one ensemble is under discussion. The large-deviation argument applies here with each sample being an entire trajectory. Among empirical ensembles compatible with the observations, it identifies those most likely to arise from repeated sampling of the passive dynamics. In the limit of many trajectories, the empirical path distribution concentrates on the corresponding inferred distribution.

Suppose the observations specify averages Am of trajectory observables am[x(⋅)], so that

∫𝒟xPu[x(⋅)]am[x(⋅)]=Am. (45)

Eq. (31) then states that the most likely path measure is found by minimizing over Pu the KL divergence from the prior P0 [17],

DKLPu‖P0=∫𝒟xPu[x(⋅)]logPu[x(⋅)]P0[x(⋅)]. (46)

while satisfying these constraints. These constraints can be enforced with Lagrange multipliers rm. We use the reward sign convention rm=-λm, where λm is the multiplier in the convention used in Sec. I B 2, so a positive reward appears with a positive sign in the exponential tilt. This gives the constrained objective:

ℒ=DKLPu‖P0-∑mrm∫𝒟xPu[x(⋅)]am[x(⋅)]-Am. (47)

Taking the variation with respect to the path distribution and setting it to zero gives the minimizing distribution. When represented by the optimal control u*, it reads

Pu*[x(⋅)]∝P0[x(⋅)]exp∑mrmam[x(⋅)], (48)

meaning the inferred path measure is an exponential tilt of P0 where the Lagrange multipliers rm enforce consistency with the observations. These Lagrange multipliers can be roughly interpreted as inferred rewards that the system, conditioned on the observations, is receiving. Because of the correspondence between path distributions and SDEs, the ‘tilts’ rm to the prior path distribution translate into apparent forces in the SDE describing paths drawn from Pu*. Our goal now is to solve the constrained optimization problem introduced to get an expression for ut* which is the apparent force that emerges when the system is conditioned on the observations.

2. Girsanov’s theorem

To do this, we exploit Girsanov’s theorem, which allows us to express the change of measure from P0 to Pu in terms of the control ut [18]. Girsanov’s theorem is a fundamental result in stochastic calculus because it provides a way to relate probability measures of stochastic processes with different drift terms. In the context of inference over paths, Girsanov’s theorem allows us to express the KL divergence between the prior and inferred path measures in terms of the added control ut. This will allow us to formulate the inference problem as an optimization problem over the control, which can then be solved using techniques from stochastic optimal control.

Girsanov’s theorem states that the ratio of the path measures of two SDEs which are driven by (potentially inhomogeneous) Gaussian noise and have differing drift terms can be expressed in terms of the difference in the drift terms. To see this, note that the controlled dynamics can be made to look like the passive dynamics by relabeling the noise:

x˙t=ftxt+utxt+εηtu=ftxt+εηtu+1εutxt. (49)

Here ηtu denotes the zero-mean noise under the controlled path measure. Thus, the same realized trajectory that requires the noise ηtu under the controlled dynamics would require the shifted noise ηt0=ηtu+1εutxt under the passive dynamics. The ratio between the two measures can then be written as:2

Pu[x(⋅)]P0[x(⋅)]=exp-12∫01dtηtu2exp-12∫01dtηt02=exp12ε∫01dtutxt2+1ε∫01dtutxt⋅ηtu. (50)

The KL divergence is the expectation of the logarithm of this ratio under the controlled path measure:

DKLPu‖P0=12ε∫01dtutxt2Pu+1ε∫01dtutxt⋅ηtuPu=12ε∫01dtutxt2Pu. (51)

In the final equality, the term linear in the controlled noise has vanished because under the controlled path measure, the noise ηtu has mean zero. Eq. (50) is the standard statement of Girsanov’s theorem [5].

3. Probabilistic inference as a control problem

With Girsanov’s theorem, this means that we can write Eq. (31) more formally as an optimization problem:

u*=argmaxu-12ε∫01dtutxt2+∫01dtrtxt+r1x1Pu (52)

where rt and r1 are again Lagrange multipliers chosen to enforce the constraint of consistency with observations. Here the trajectory reward is additive in time, with a separate terminal term. In this special case, the running reward of Sec. IA is

rt(x,u)⏟totalrunningreward=rt(x)⏟statereward-‖u‖22ε.

This now has the form of a control problem in which we are solving to find the optimal control ut*xt which maximizes the reward but has a cost from applying too strong a control [19–21]. We will see that the problem in Eq. (52) can be solved by converting it into a linear PDE for which Monte Carlo methods can be used to sample the optimal control.

In this context, the quadratic control cost has a probabilistic interpretation in that it measures how strongly the controlled ensemble departs from the passive dynamics. The same relation between noise and control cost that makes this inference interpretation possible also gives the associated HJB equation a particularly simple mathematical structure.

D. Mathematical structure of path integral stochastic control

Problems with objectives such as Eq. (52) are called path integral stochastic control (PISC) problems [22–26]. PISC problems are a special class of stochastic control problems in which the cost of control is quadratic in the control and the dynamics are linear in the control (i.e., in Eq. (1), gt(x,u)=ft(x)+u. Fig. 2 illustrates a solution to a PISC problem in which an ensemble of particles is controlled to achieve a distant terminal reward. These problems can be solved using a path integral perspective like in Eq. (48), but are most naturally solved using dynamic programming and the Hamilton–Jacobi–Bellman (HJB) equation as introduced in Sec. IA. PISC is a special class of stochastic control problems because the HJB equation takes a particularly simple form that can be transformed into a linear PDE.

FIG. 2.

FIG. 2.

Path integral stochastic control (PISC) for an ensemble of freely diffusing particles. Left: an ensemble of particles begins at a common initial condition and freely diffuses, failing to achieve some distant terminal reward. Middle: the value function which solves the PISC problem of the ensemble of particles achieving the maximum terminal reward subject to some control cost. Right: the resulting PISC policy leading a significant fraction of the particles to efficiently achieve the terminal reward.

1. The Cole–Hopf transformation of the HJB equation

To solve the inference problem, expressed as Eq. (52), we first define the value function to be the expected reward received if the optimal policy is taken starting at point x at time t:

Vt(x)=maxust≤s<1-12ε∫t1dsusxs2+∫t1rsxsds+r1x1xt=xPu (53)

which using dynamic programming (Eq. (16)) must satisfy

0=maxurt(x)+∂tVt+∇Vt⋅ft(x)+u+ε2∇2Vt-12ε‖u‖2 (54)

with the optimal control given by

ut*(x)=ε∇Vt(x). (55)

For PISC problems, the HJB equation is then the nonlinear PDE [27]

rt(x)+∂tVt+∇Vt⋅ft(x)+ε2∇2Vt+ε2∇Vt2=0 (56)

with the boundary condition V1(x)=r1(x). Remarkably, this nonlinear PDE can be converted into a linear equation by the Cole–Hopf transformation [22, 23],

Vt(x)=logψt(x), (57)

which upon substitution gives:

rt(x)+∂t+ft(x)⋅∇+ε2∇2ψt(x)=0 (58)

which is a backward Kolmogorov equation with a potential term. Notably, this is also the Schrödinger equation in imaginary time (i.e., with t→it) when ft=0 with ψ being the wavefunction, ε playing the role of ℏ/m, and -rt(x) playing the role of a potential energy term. In the small-ε limit, this parallels the passage from wave optics to geometrical optics, where the Hamilton–Jacobi equation becomes the eikonal equation. With this change of variables, the optimal control can be expressed as:

ut*x=ε∇logψt(x). (59)

2. Feynman–Kac formula and Doob’s h-transform

The transformed equation is linear, but solving it over the full state space can still be difficult in high dimensions. An alternative is to express its solution as an average over trajectories of the passive dynamics, weighted by their accumulated rewards. This is the stochastic counterpart of the imaginary-time path-integral representation from quantum mechanics and provides a starting point for the sampling methods discussed in Chapter IV. From the same reasoning as in Eq. (48), the optimal path measure conditional on starting at x at time t is given below. In these conditional path laws, x(⋅) denotes the remaining trajectory on t≤s≤1:

Pu*x(⋅)∣xt=x=1Zt(x)P0x(⋅)∣xt=xeRt[x(⋅)] (60)

where Rt[x(⋅)]=∫t1rsxsds+r1x1 is the cumulative state and terminal reward from time t to the final time 1, excluding control cost. We temporarily denote the normalization factor by Zt(x), which is a conditional partition function. Observe from Eq. (53) and Girsanov’s theorem that we can write the value function as

Vt(x)=Rt[x(⋅)]-12ε∫t1dsus*xs2xt=xPu*=Rt[x(⋅)]-logPu*x(⋅)∣xt=xP0x(⋅)∣xt=xxt=xPu*=Rt[x(⋅)]-Rt[x(⋅)]-logZt(x)∣xt=xPu*=logZtx, (61)

where the expectations above are all taken with respect to the optimal path measure Pu*x(⋅)∣xt=x. From Eq. (57), we then have ψt(x)=Zt(x). We henceforth use ψt for this conditional partition function. It is a positive function of the current state, not a normalized state density, and can be expressed as a path integral over the passive dynamics:

ψt(x)=∫𝒟xP0x(⋅)∣xt=x×exp∫t1rsxsds+r1x1. (62)

This is generalized to a result that a function ψt(x) satisfying Eq. (58) can be expressed as a conditional expectation over the passive dynamics, which is known as the Feynman-Kac formula [5, 23]. Expressing ψt in terms of a path integral is familiar from quantum mechanics, where the solution to the Schrödinger equation can be expressed as a path integral over all possible paths weighted by the exponential of the action, and the Feynman–Kac formula is the stochastic process analog of this result.

We can apply this result to the case where we are interested in inferring the dynamics of a system that is observed to be in a particular set 𝒜 at time t=1. For a path measure P, we write P(𝒜)≡Px1∈𝒜 for the probability of this terminal event. In this conditioning example the running state reward is zero, rt(x)=0. We are therefore interested in studying the case Pu(𝒜)=1, which requires r1x1 to be zero for x1∈𝒜 and -∞ for x1∉𝒜 (i.e., ψ1x1=1𝒜x1 where 1𝒜 is the indicator function for the set 𝒜). From Eq. (62), we then have ψt(x)=P0𝒜∣xt=x, which is the probability that the system is in the set 𝒜 at time t=1 given that it is in state x at time t under the passive dynamics; this conditioning function is the function conventionally called h in Doob’s h-transform [28]. We retain the symbol ψt(x) here. Eq. (60) is then directly Bayes’ rule:

Pu*x(⋅)∣xt=x=P0x(⋅)∣xt=x1𝒜x1P0𝒜∣xt=x (63)

From Eq. (59), the inferred dynamics (known as Doob’s h-transform) that lead to the system being in the set 𝒜 at time t=1 are then given by

x˙t=ftxt+ε∇logψtxt+εηt. (64)

The logarithmic gradient ∇logψt(x) is the conditioning or guidance term. It is closely related to the score ∇logpt(x) used in generative modeling and diffusion models, but the two are generally distinct: ψt(x) is a conditioning probability, whereas pt(x) is a marginal density. We return to scores and guidance in Sec. V C.

3. Example: Brownian bridge

The result in Eq. (64) allows us to now study the Brownian bridge (Eq. (42)) introduced in Sec. I C. In particular, we consider one-dimensional Brownian motion as the passive dynamics (i.e., ft(x)=0) and the system is observed to be in a particular state x1=y at time t=1 while starting at x0=0 at time t=0. To use Eq. (64) to solve this problem, we treat the target set 𝒜 as a small ball of radius δ→0+ around the target state y, so that 𝒜={x:‖x-y‖<δ}. Let kt∣s(z∣x) denote the transition density of the passive process from state x at time s to state z at time t>s. Then:

P0𝒜∣xt=x=∫𝒜dx1k1∣tx1∣x=∫𝒜dx112πε(1-t)exp-x1-x22ε(1-t)≈12πε(1-t)exp-‖y-x‖22ε(1-t)∫𝒜dx1 (65)

The dynamics of a Brownian bridge are given by Eq. (64):

x˙t=-xt-y1-t+εηt. (66)

This means that in the conditioned dynamics, there is a drift term that pushes the system to move in a straight line from the starting point to the target point, with a strength that diverges as t→1.

Conditioning a stochastic system can therefore be understood dynamically. The information supplied by an observation is expressed as a control that makes the observed behavior typical. The Brownian bridge makes this equivalence concrete, with an endpoint constraint appearing as a drift toward the target.

II. CONTROL AND TRANSPORT OF DENSITIES

The variational viewpoint of Chapter I compares trajectories through their action or control cost. We now consider the problem of moving an entire distribution between prescribed initial and final distributions, rather than a particle between prescribed locations. An intuitive picture is moving a pile of earth into another shape: the total amount of earth moved is unchanged, but there are many ways to rearrange it. Choosing a rearrangement that minimizes a specified cost is an optimal transport problem. When the motion of mass is stochastic, one considers the most likely evolution consistent with the two distributions at the endpoints. We begin with a version of transport, called the Schrödinger bridge problem, formulated in terms of stochastic control. We then consider more general formulations of transport and the geometry it defines on probability distributions. This geometry allows us to describe the evolution of densities as steepest descent, connecting the present chapter to the discussions of nonequilibrium thermodynamics, sampling, and learning further below.

A. The Schrödinger bridge problem

The Schrödinger bridge problem (SBP) asks for the distribution over stochastic trajectories that matches two prescribed endpoint densities while differing as little as possible from a reference process [29–32]. Unlike the fixed-endpoint bridge considered in Sec. I D 3, the initial and final positions are now drawn from distributions ρ0 and ρ1. The control generates a curve of densities t↦ρt connecting these endpoints while accounting for all possible particle trajectories between them. Fig. 3 illustrates this passage from controlling trajectories to transporting densities.

FIG. 3.

FIG. 3.

The Schrödinger bridge problem (SBP) for an ensemble of freely diffusing particles. Left: an ensemble of particles begins distributed according to an initial density ρ0 and freely diffuses to ρ10, failing to achieve the target terminal density ρ1. Middle: the value function Vt(x)=logψt(x) which solves the SBP of transporting the ensemble between the prescribed initial and terminal densities subject to a control cost. Right: the resulting control policy transports the particles so that the terminal density of the controlled ensemble matches the target density.

1. From trajectories to densities

As in Sec. I C, we consider non-interacting particles with controlled Langevin dynamics,

x˙t=ftxt+utxt+εηt,0≤t≤1, (67)

which is Eq. (1) with gt(x,u)=ft(x)+u and feedback u=ut(x). Here ηt is standard Gaussian white noise and ε>0. The reference dynamics have ut=0. Both the reference and controlled processes are initialized with x0~ρ0. We write P0[x(⋅)] and Pu[x(⋅)] for the reference and controlled distributions over complete paths, respectively; these are the path distributions introduced in Sec. I C. In contrast, ρt(x) is the density of the position at a single time under Pu, i.e., it is the marginal ptu(x) of Chapter I. We use ρt when emphasizing the transport of this density, and add a superscript when distinguishing different ensembles. For the independent particles considered here, this is both the single-particle marginal density and the density described by a large ensemble. The density generated by Eq. (67) obeys the Fokker–Planck equation, which expresses local conservation of probability:

∂tρt=-∇⋅ft+utρt+ε2∇2ρt,ρt=0=ρ0,ρt=1=ρ1. (68)

It is useful to distinguish the added control ut from the velocity vt that transports the density. Eq. (68) can equivalently be written as

∂tρt+∇⋅ρtvt=0,vt=ft+ut-ε2∇logρt.

Here ρtvt is the probability current. In the deterministic, driftfree case, vt=ut. Note that even when intermediate densities ρt are specified, we cannot identify a unique velocity field; adding a field wt with ∇⋅ρtwt=0 leaves the continuity equation unchanged. Specifying the two endpoint densities leaves still more freedom, since the intermediate densities are also unspecified. Thus, as in maximum-entropy inference, the constraints must be supplemented by a criterion for choosing among the compatible path distributions.

Suppose a large collection of independent particles evolving under P0 is observed to begin with density ρ0 and end with density ρ1. The large-deviation argument of Eq. (31), now applied to paths, selects the distribution over paths that satisfies these observations and is closest to P0 in KL divergence. This gives the SBP,

minPuDKLPu‖P0,s.t.ρt=0=ρ0,ρt=1=ρ1, (69)

where ρt is the marginal density under Pu. To relate this problem to control, we write Pu[x(⋅)]=ρ0x0Pux(⋅)∣x0, and similarly for P0. The chain rule for KL divergence gives

DKLPu‖P0=∫dx0ρ0x0DKLPu⋅∣x0‖P0⋅∣x0=12ε∫01dt∫dxρtxutx2, (70)

where the second equality follows from Girsanov’s theorem, Eq. (51), applied to paths with the same initial position. Consequently, minimizing Eq. (69) is equivalent to minimizing the expected quadratic control effort subject to Eq. (68) and its endpoint constraints. The SBP thus chooses the least surprising controlled ensemble relative to the reference process, or equivalently the one requiring the least expected control effort. This introduces the link between control, inference and transport, i.e., the control changes the path distribution and, through its single-time marginals, transports the density from ρ0 to ρ1.

2. The coupled forward–backward construction

We can impose the initial constraint directly by drawing x0 from ρ0, and impose the terminal constraint using a Lagrange multiplier function r1x1. As in Sec. I D, this multiplier acts as a terminal reward. For a fixed r1, and after dropping terms independent of the control, the problem is

minu12ε∫01dtutxt2-r1x1Pu,x0~ρ0. (71)

An initial reward r0x0 would have the fixed expectation ∫dxρ0(x)r0(x) and would not change this minimization. Maximizing the negative of the objective in Eq. (71) is analogous to solving the PISC problem considered in Sec. I D, with no additional running reward. Its value function therefore admits the Cole–Hopf transformation Vt=logψt, and Eq. (59) gives

ut*(x)=ε∇logψtx,ψ1x=er1x,∂tψt+ft⋅∇ψt+ε2∇2ψt=0. (72)

Unlike a prescribed terminal reward in PISC, r1 must now be chosen so that the terminal density is ρ1. Since ψt satisfies the backward Kolmogorov equation, it is interpreted as a field that propagates information backwards from t=1.

To find the density under this control, define a second field ψt†(x)=ρt(x)/ψt(x), so that

ρt(x)=ψt(x)ψt†(x). (73)

The two factors need not be normalized densities. Schrödinger’s key insight was that ψt† obeys the forward Kolmogorov equation of the reference process,

∂tψt†+∇⋅ftψt†-ε2∇2ψt†=0. (74)

To see this, substitute ρt=ψtψt† and ut*=ε∇logψt into Eq. (68). Expanding the derivatives gives

∂tψtψt†=-∇⋅ftψtψt†-ε∇⋅ψt†∇ψt+ε2∇2ψtψt†=ψt†-ft⋅∇ψt-ε2∇2ψt+ψt-∇⋅ftψt†+ε2∇2ψt†. (75)

The first bracket is ∂tψt by Eq. (72). Cancelling ψt†∂tψt from both sides and dividing by ψt yields Eq. (74). Thus, ψt propagates information backward from the final constraint, while ψt† propagates information forward from the initial constraint.

Let kt∣s(x∣y) denote the transition density of the reference process, namely, the conditional density of being at x at time t given position y at time s<t, with u=0 in Eq. (67). It is the propagator of the reference Fokker–Planck equation. The solutions of the backward and forward equations can therefore be written as

ψt(x)=∫dyk1∣tyxψ1y,ψt†(x)=∫dykt∣0xyψ0†y. (76)

The endpoint constraints couple these otherwise linear equations,

ψ0xψ0†x=ρ0x,ψ1xψ1†x=ρ1x. (77)

Note that neither endpoint factor is known in advance; specifying ψ1 determines ψ0 by backward propagation, while specifying ψ0† determines ψ1† by forward propagation. One may solve this Schrödinger system by alternating between the two constraints. Starting from a positive guess for ψ1, propagate it backward using the first line of Eq. (76) to obtain ψ0. Set ψ0†=ρ0/ψ0, propagate this field forward using the second line to obtain ψ1†, and update ψ1=ρ1/ψ1†. Repeating these steps enforces the initial and final constraints in turn. This procedure is the so-called Sinkhorn algorithm [32, 33].

With the two fields determined, the optimal distribution over paths is an endpoint reweighting, or ‘tilt’, of the reference distribution [31, 32],

Pu*[x(⋅)]=P0[x(⋅)]ψ1x1ψ0x0. (78)

Eq. (78) has the same exponential-tilt structure encountered in maximum-entropy inference and extends the Doob h-transform to prescribed endpoint distributions. Instead of conditioning an endpoint to lie in a set, the endpoint factors are chosen together to reproduce two full densities. The central result is therefore not a new form of the optimal control, which remains ut*=ε∇logψt, but the coupled forward–backward construction that determines this control from the two distributional constraints.

B. Entropic optimal transport and the Wasserstein distance

The Schrödinger bridge specifies a complete distribution over paths, and thus solves a dynamic transport problem. More generally, optimal transport considers the least expensive rearrangement of mass from one particular configuration to another, given a cost cx0,x1 for moving a unit mass from x0 to x1. In Monge’s original formulation, one views optimal transport as the most efficient strategy for moving a pile of earth from one location to another. Each point x0 is assigned a destination Tx0, and one minimizes ∫dx0ρ0x0cx0,Tx0 while requiring Tx0~ρ1 for x0~ρ0. However, a deterministic map cannot split mass, and therefore need not exist; for example, a point mass cannot be mapped deterministically into two separated point masses. Kantorovich’s formulation instead optimizes over a joint endpoint distribution πx0,x1 satisfying

∫dx1πx0,x1=ρ0x0,∫dx0πx0,x1=ρ1x1. (79)

Any such joint distribution is called a coupling of ρ0 and ρ1. Minimizing the mean cost over couplings allows the probability at one x0 to be distributed among several destinations [34].

To connect this static problem to the Schrödinger bridge, let kx1∣x0 denote the transition density of the reference process from t=0 to t=1 (we have dropped the 1∣0 subscript from our notation in Sec. II A). Consider the following optimization over couplings [31]:

π*=argminπεDKLπ‖ρ0k, (80)

subject to Eq. (79), where ρ0kx0,x1=ρ0x0kx1∣x0. Now, le‘ts say kx1∣x0=exp-cx0,x1/ε/Zx0. For example, if the reference process is Brownian motion, we have cx0,x1=x0-x12/2. Here the same ε>0 that sets the noise covariance in Eq. (67) sets the strength of the regularization (and is analogous to a temperature), and Zx0 normalizes the kernel over x1. Using the fixed marginal constraints, Eq. (80) is equivalent, up to constants, to

π*=argminπ∫dx0dx1πx0,x1cx0,x1+ε∫dx0dx1πx0,x1logπx0,x1. (81)

This objective corresponds to entropic optimal transport [35]. The first term is the mean transport cost, while the second is minus the Shannon entropy of the coupling introduced in Sec. I B 2. Eq. (81) therefore has the form of a constrained free-energy minimization: the cost favors efficient transport, whereas the entropy spreads probability among several possible pairings. As ε→0, the entropic term disappears and one obtains the Kantorovich formulation of optimal transport [34, 36].

Introducing Lagrange multipliers φ0x0 and φ1x1 for imposing the constraints in Eq. (79), and absorbing the overall normalization into them, gives

π*x0,x1=expφ0x0+φ1x1-cx0,x1ε=Zx0expφ0x0εk1∣0x1∣x0×expφ1x1ε. (82)

These multipliers depend on ε and their zero-noise limits are known as the Kantorovich potentials. A connection to the Schrödinger potentials can be made by setting ψ0†=Zexpφ0/ε and ψ1=expφ1/ε, which gives

π*x0,x1=ψ0†x0k1∣0x1∣x0ψ1x1,ψ0x0=∫dx1k1∣0x1∣x0ψ1x1,ψ1†x1=∫dx0k1∣0x1∣x0ψ0†x0. (83)

together with ρ0=ψ0†ψ0 and ρ1=ψ1†ψ1. These are precisely the endpoint versions of Eqs. (76) and (77). Sinkhorn iteration, analogous to the Sinkhorn algorithm introduced previously, is the alternating rescaling of ψ0† and ψ1 needed to solve for these quantities, and thus the optimal coupling π* [35].

The quadratic cost cx0,x1=x0-x12/2 has special geometric structure. For the zero-noise argument, write πε* and φ1ε to display their dependence on ε. From Eq. (82), the conditional density of x1 given x0 is

πε*x0,x1ρ0x0∝expφ1εx1-12x0-x12ε, (84)

where factors depending only on x0 are absorbed into the normalization. Rewriting the exponent as

-x022ε+1εx0⋅x1-x122-φ1εx1, (85)

shows by the Laplace principle that, as ε→0, the conditional density concentrates at the maximizing endpoints. Assuming the potentials converge with a fixed choice of additive constants, denote the limiting potential by φ1=limε→0φ1ε and define the supremum

ζx0=supx1x0⋅x1-φ‾1x1,whereφ‾1x1=12x12-φ1x1. (86)

If the maximizer x1*x0 is unique, differentiating the supremum with respect to x0 gives ∇ζx0=x1*x0, so the limiting optimal coupling is supported on the map

x1=Tx0=∇ζx0. (87)

Because ζ is a convex conjugate, it is convex. This result is known as Brenier’s theorem, which states that for a quadratic cost and absolutely continuous ρ0, the optimal transport map is the gradient of such a convex function [37]. In one dimension, this reduces to the familiar method for mapping a uniform distribution to an arbitrary distribution using the inverse of its cumulative distribution. Specifically, defining the cumulative distribution functions Ci(x)=∫-∞xdyρi(y),C0x0 is uniform on (0,1) when x0~ρ0, and x1=C1-1C0x0 has density ρ1, with Ci-1 denoting the quantile function. Hence,

T=C1-1∘C0 (88)

is the one-dimensional Brenier map.

These special properties motivate the 2-Wasserstein distance,

W22ρ0,ρ1=minπ∫dx0dx1x0-x12πx0,x1, (89)

where the minimization is over the couplings in Eq. (79). With the convention c=x0-x12/2 used above, the unregularized minimum mean cost is W22/2. In one dimension, the relationship to the cumulative distribution gives

W22ρ0,ρ1=∫01dzC0-1(z)-C1-1(z)2. (90)

The distinction between KL divergence and the 2-Wasserstein distance is illustrated in Fig. 4. In the chosen family of bimodal densities, changes in the relative weights and separation of the modes produce comparable KL divergences, whereas Wasserstein distance distinguishes them strongly because changing the relative weights requires transporting probability between the modes.

FIG. 4.

FIG. 4.

A comparison of the geometries induced by the KL divergence and the 2-Wasserstein distance on a two-parameter family of probability densities pθ relative to the reference density q. The inset curves show representative densities at different points in parameter space. The θ1 parameter changes the balance of modes of a bi-modal distribution; the θ2 parameter shifts the distance between the modes. Left: the KL divergence assigns similar costs to changes along the two parameter directions, producing approximately isotropic contours. Right: the 2-Wasserstein distance assigns a greater cost to changes that transport probability between the separated modes, producing strongly anisotropic contours. The figure is adapted from Ref. [38], and the distribution’s parameterization is described in the Supplementary Information of that work.

Note that the static formulation specifies which initial and final points are paired, but not how mass moves between them. In this deterministic, drift-free setting, the transport velocity equals the control, vt=ut. For a particle following x˙t=vtxt, the Cauchy–Schwarz inequality gives x1-x02≤∫01dtvtxt2, with equality for straight motion at constant speed. For an entire density, the velocity becomes a field vt(x) and valid paths must conserve probability locally. The remarkable content of the Benamou–Brenier theorem is that minimizing this kinetic action over all density paths and velocity fields gives exactly the same quantity as minimizing the static endpoint cost over couplings [36, 39]:

W22ρ0,ρ1=minρt,vt∫01dt∫dxρt(x)vt(x)2,∂tρt+∇⋅ρtvt=0, (91)

with endpoint constraints on ρ0 and ρ1. For a Brownian reference with ft=0, multiplying the objective in Eq. (69) by 2ε does not change its minimizer. In the limit ε→0, the diffusion term in Eq. (68) vanishes, so Eq. (91) can be interpreted as the zero-noise limit of the Schrödinger bridge, namely, the rescaled minimum 2εminPuDKLPu‖P0 approaches W22 [40].

Once the optimal map T is known, the minimizing density path is generated by linear interpolation of each transported particle,

xt=(1-t)x0+tTx0,x0~ρ0. (92)

The resulting ρt is called displacement interpolation, which is analogous to a straight line in the geometry of probability distributions [41]. A useful feature of the 2-Wasserstein distance is that the static map T also gives us the transport map for all intermediate times t, which we will return to later when we discuss flow matching in Sec. V C 2. As expected, this picture is consistent with the Brownian bridge discussed previously (Eq. (42)). For a fixed endpoint pair, the mean at an intermediate time t follows (1-t)x0+tx1, with covariance εt(1-t)I. As ε→0, the fluctuations disappear and the bridge collapses onto that straight path.

Although we focus on the quadratic cost here, other choices can produce different optimal assignments between the same endpoints. Increasing the exponent in cx0,x1=x0-x1p penalizes long displacements more strongly and changes how the source is partitioned among those targets. The optimal pairing also depends on the choice of transport cost. Fig. 5 shows an example with three target locations and compares linear, quadratic, and quartic distance costs for the same initial and final densities, showing how this choice changes the regions of the initial density assigned to each target mode.

FIG. 5.

FIG. 5.

Optimal transport maps between the same source density ρ0 and three-mode target density ρ1 under different choices of transport cost, c. In each panel, the three colored regions partition the initial density according to the correspondingly colored target mode, while one arrow shows a representative assignment from each region. Increasing the exponent penalizes long displacements more strongly and consequently changes how the initial density is partitioned among the target modes. The axes x(1),x(2) denote spatial components, whereas the subscripts in x0,x1 denote initial and final endpoints.

C. Wasserstein geometry and Wasserstein gradient flows

As we've now seen, the 2-Wasserstein distance W2 in Eq. (91) provides a notion of distance between probability densities in terms of the optimal flow field to transport one to another. This notion of distance provides the starting point for Wasserstein geometry, in which one treats the space of probability distributions like a Riemannian manifold in which the square root of the minimum in Eq. (91) is the distance between points [42]. This will allow us to generalize the notion of gradient flow for particles in a potential x˙=-∇F(x) to that of densities flowing down gradients of a functional. This geometric picture will provide the basis for elegant algorithms presented in the Applications Sec. V B.

In Wasserstein geometry, a probability density ρ is regarded as a point, a time-dependent density ρt as a curve, and its instantaneous rate of change st(x)=∂tρt(x) as a tangent vector. Crucially, Wasserstein geometry only permits trajectories ρt(x) that obey the continuity constraint, namely that they can be realized via a flow field vt

∂tρt=-∇⋅ρtvt (93)

Some trajectories are not allowed because they cannot be realized by a smooth flow field, for instance ρt=ρ1t+(1-t)ρ0 when ρ0 and ρ1 have disjoint support. This space of probability measures with finite second moment, equipped with W2, is denoted 𝒲2 [43, 44].

Due to the continuity constraint in Eq. (93), it is possible to set up a duality between each tangent vector s(x)=∂tρt and the velocity field v that generates it. The subtlety is that the velocity is not unique: adding a field whose probability current has zero divergence leaves s unchanged. The canonical way to remove this redundancy is motivated by the metric W2. Namely, given the tangent vector s in the tangent space of the distribution ρ, choose the velocity field v with minimum kinetic energy that generates s

v=argminv′∫dxρv′2s.t.s+∇⋅ρv′=0 (94)

This minimization problem can be solved with a Lagrange multiplier for the continuity constraint. Let’s say we choose its sign and normalization by adding -2∫dxχ(x)[s(x)+∇.(ρv)] to the kinetic energy. Variation with respect to v then gives v(x)=-∇χ(x). Thus, the minimum energy velocity is a potential gradient.

Having fixed v in this way, the minimum ‖s‖ρ2=∫dxρ‖v‖2 in Eq. (94) defines the squared norm of the tangent at ρ. Along a regular curve, this is the squared speed measured by W2:

stρt=limΔt→0W2ρt,ρt+Δt|Δt|,st=∂tρt. (95)

Equivalently, W22ρt,ρt+Δt=(Δt)2stρt2+o(Δt)2. The inner product of two tangents s,s′ follows from the polarization identity s,s′ρ=12s+s′ρ2-‖s‖ρ2-s′ρ2, giving

s,s′ρ=∫dxρ(x)v(x)⋅v′(x). (96)

where v(x) and v′(x) are the minimum-energy velocity fields associated with s and s′, respectively.

With the ingredients of Wasserstein geometry in hand, we can now define gradient descent for a functional ℱ[ρ]. Recall that for a function F(x) in Euclidean space, its gradient is defined in such a way as to enforce the chain rule: ∇F is the vector with the property dFxt/dt=x˙t⋅∇Fxt for all trajectories xt. In complete analogy, the Wasserstein gradient is defined to be the velocity field ∇Wℱ[ρ], with associated tangent vector s=-∇⋅ρ∇Wℱ[ρ], such that dℱρtdt=s,∂tρtρt for all trajectories ρt. To derive an explicit expression for ∇Wℱ[ρ], consider dℱ/dt over a flow generated by a potential v=-∇χ. Writing δℱ/δρ for the functional derivative, evaluated at the current density ρt, one obtains

dℱρtdt=∫dxδℱδρ∂tρt=∫dxδℱδρ∇⋅(ρ∇χ)=-∫dxρ∇δℱδρ⋅∇χ. (97)

Comparing Eq. (97) with the inner product in Eq. (96), the Wasserstein gradient velocity field is given by ∇Wℱ[ρ]=∇(δℱ/δρ). This is the gradient in its velocity representation, whereas the associated density tangent is -∇⋅ρ∇Wℱ[ρ]. A Wasserstein gradient flow (WGF) follows the negative gradient, with descent velocity vt=-∇Wℱρt. The resulting density evolution is

∂tρt=∇⋅ρt∇Wℱρt,dℱρtdt=-∫dxρt∇Wℱρt2≤0. (98)

The WGF is a distributional analog of gradient descent x˙=-∇F(x) in Euclidean space. For example, consider the free energy

ℱ[ρ]=∫dxρ(x)Φ(x)+∫dxρ(x)logρ(x). (99)

Eq. (98) becomes ∂tρt=∇⋅ρt∇Φ+∇2ρt, the familiar drift-diffusion Fokker–Planck equation [45]. The potential energy term drives probability down Φ, while the entropy term produces diffusion. Thus, the relaxation of a diffusive system can be read as steepest descent of a free energy in Wasserstein geometry, a connection that will later be discussed in the context of non-equilibrium thermodynamics (Sec. III B) and applications (Sec. V B).

Once steepest descent has been defined, one can ask familiar questions from optimization, now in the space of densities. For example, it is useful to define a notion of convexity that rules out competing local minima and controls the convergence rate—these ideas will come up again in Sec. V B on applications of WGF, particularly in the setting of variational inference. Recall that in Euclidean space, a function F is α-convex if

F(1-t)x0+tx1≤(1-t)Fx0+tFx1-α2t1-tx0-x12. (100)

Ordinary convexity corresponds to α=0. Analogously, a functional ℱ:𝒲2→R is α-geodesically convex if, along the constant-speed Wasserstein geodesic ρt [41],

ℱρt≤(1-t)ℱρ0+tℱρ1-α2t1-tW22ρ0,ρ1. (101)

We emphasize that the comparison in Eq. (101) is made along geodesic interpolation, rather than along the point-wise mixture of two densities. For α>0, under standard regularity assumptions, if ρt follows the Wasserstein gradient flow of an α-geodesically convex ℱ, then

ℱρt-infℱ≤e-2αtℱρ0-infℱ. (102)

assuming ℱ is bounded from below [43]. Eq. (102) states that the functional gap decays exponentially. If a minimizer ρ* exists, positive geodesic convexity makes it unique and gives ℱ[ρ]-ℱρ*≥αW22ρ,ρ*/2, so the same estimate also implies exponential convergence in W2. In addition to defining convex functionals, we can define convex sets. We say that a set of probability distributions is geodesically convex if it contains the Wasserstein geodesic between any two of its densities. Functionals that are α-geodesically convex over 𝒲2 retain their convexity properties and convergence guarantees when restricted to geodesically convex subsets. In later sections, we will use this framework to describe irreversible thermodynamic relaxation, numerical integration of Fokker–Planck equations, variational inference, and the mean-field dynamics of interacting particles.

III. THERMODYNAMICS

As we elucidate in this section, the previously explored ideas in control and inference have a deep connection to the time-honored subject of thermodynamics. Upon specifying a state-space geometry, statistical inference aims to select probability distributions consistent with partial information, whereas control theory seeks protocols that transport systems between prescribed configurations while minimizing a cost. Thermodynamics simultaneously determines admissible equilibrium macroscopic states and identifies the least costly transformations among them, compatible with the imposed constraints such as fixed temperature, fixed volume, or adiabaticity. Here, we aim to make these connections concrete. In Sec. III A, we discuss the maximum-entropy interpretation of equilibrium statistical mechanics. Subsequently, in Sec. III B we demonstrate that the Onsager least-dissipation principle and its extension to stochastic processes amount to an optimal transport problem.

A. Equilibrium thermodynamics as maximum-entropy inference

Here, we discuss the extent to which statistical mechanics of materials in equilibrium can be interpreted as a maximumentropy inference. As materials are composed of ~ 1023 degrees of freedom, it is infeasible to keep track of their individual dynamics. Instead, equilibrium statistical mechanics provides a means of describing microscopic particle configurations probabilistically. Using thermodynamic axioms (such as the thermodynamic entropy S reaching a maximum in an isolated system at equilibrium, and the ergodic hypothesis wherein all states are equiprobable within a fixed energy shell), Boltzmann, Gibbs, and Maxwell obtained the expressions for the microstate distribution at equilibrium [46].

Boltzmann argued that by the ergodic hypothesis, all microstates x with the same energy are equally likely in an isolated equilibrium system. He postulated that the microstate multiplicity W compatible with the conserved quantities is maximized at equilibrium (by a reasoning akin to modern saddle-point approaches), and thus sets the thermodynamic entropy via S=kBlogW (where the logarithm guarantees that entropy is additive). This is called the microcanonical ensemble and can be refined to accommodate additional conserved quantities, like particle number.

Boltzmann then considered a system whose energy fluctuates due to energy exchange with a large thermal bath, constituting the canonical ensemble. Suppose that the system has energy E(x) and the bath Etot-E, so that Etot is the conserved energy of the joint system (system and bath). The equilibrium probability distribution of the joint configuration xtot=x,xbath is uniform, peqxtot=1/WtotEtot. However, integrating the bath degrees of freedom for a fixed system configuration x yields

peq(x)=peqx,xbathpeqxbath∣x=WbathEtot-E(x)WtotEtot∝e-kB-1SbathEtot-E(x) (103)

(since WtotEtot=const). Therefore, physics naturally equipped us with a probability following a large-deviation principle, as logpeq is an extensive function. Since the bath is much larger than the subsystem E(x)≪Etot, we Taylor expand SbathEtot-E(x)≃SbathEtot-E(x)/T, where 1/T=dSbath(E)/dE is the bath temperature. We write β=kBT-1 for the inverse thermal energy. Thus, the equilibrium distribution of the subsystem microstates x reads:

peq(x)=1Ze-βE(x), (104)

We thus arrive at the Boltzmann distribution from physical principles: energy conservation, the ergodic hypothesis, and a large-deviation principle arising from the thermodynamic limit. In the above, Z is the partition function, and it is related to the free energy via ℱeq=-kBTlogZ. Similar fluctuation principles upon coupling to different reservoirs give rise to all other statistical-mechanical ensembles. Notably, the entropy across all ensembles can be written as

S=-kB∫dxpeqxlogpeq(x). (105)

Note that the Boltzmann factor (Eq. (104)) belongs to the exponential family (Eq. (36)), and the thermodynamic entropy (Eq. (105)) takes the form of a Shannon entropy (Eq. (34)). This suggests a link between equilibrium statistical mechanics and maximum-entropy modelling (discussed in Sec. IB 2). Indeed, Jaynes proposed interpreting thermodynamics as enforcing a maximum-entropy inference [13] wherein, for example, the average energy of a system, ℰ=∫dxpeq(x)E(x), when coupled to a thermal bath, acts as a constraint. Upon maximization, the thermodynamic entropy is given by the Shannon entropy of the entropy-maximizing distribution,

S=kBHpeq. (106)

It is important to stress, however, that the conceptual justification behind maximum-entropy modelling and Boltzmann statistics is fundamentally different. The former is motivated by the principle that, given limited information, the least-committal distribution is the one that maximizes entropy, while the latter follows from physical laws governing equilibrium statistical mechanics. The connection between maximum-entropy modelling and statistical mechanics thus arises from the coincidence between the functional forms obtained in the two frameworks. In that regard, while Eq. (106) is conceptually fascinating, there is no indication that either this relation or the information-theoretic interpretation of statistical mechanics should hold away from equilibrium.

While thermodynamic entropy (like other thermodynamic state functions such as temperature [47] and pressure [48]) is an equilibrium property of matter, is it possible to extend thermodynamic notions far from equilibrium? Since Shannon entropy is well-defined for a system out of equilibrium given its instantaneous distribution p(x), can it serve as an extension of entropy outside equilibrium, S→kBH[p], even though this quantity is not generally maximized? The answer lies in whether the emergent relations obtained by presuming a particular entropy functional are consistent with thermodynamic theorems and whether they provide useful predictions, e.g., for the extractable work during thermodynamic transformations.

For example, in certain systems (most often those uncoupled from an external bath), Shannon entropy is explicitly an inadequate measure of thermodynamic entropy [49, 50]. For instance, it is a Lyapunov function of the Liouville equation describing isolated systems, indicating that it does not increase as the system approaches equilibrium (despite the system potentially being ergodic). Therefore, not only may there be no physical reason to invoke maximum-entropy inference in such systems, but Shannon entropy may not be an adequate functional in the first place.

On the other hand, in other cases (most often stochastic systems away from the thermodynamic limit, where the number of particles is small), Shannon entropy provides a useful generalization of thermodynamic entropy out of equilibrium. For example, as we show in Sec. III B 4, it recovers the second law of thermodynamics as well as additional useful fluctuation theorems concerning the extractable work from stochastic systems [51, 52]. Furthermore, returning to Shannon’s construction, Shannon entropy is a functional that adequately quantifies uncertainty [12]. Therefore, in the absence of any knowledge about a problem’s structure beyond a few known expectation values, maximizing entropy under constraints is not an unreasonable inference methodology [14]. Indeed, maximum-entropy inference, both static and dynamical (where P denotes a distribution over trajectories), has proved useful across scales, including predicting protein structure [53], modeling neural communication [54], identifying bacterial swarming transitions [55], and characterizing alignment interactions during flocking [56]. Since thermodynamic variables are often uninformative in these systems, the imposed constraints are no longer temperature, pressure, and related quantities, but rather static and dynamic correlation functions [57, 58], compressed snapshot data [59, 60], transport coefficients [61, 62], and more, which nonetheless carry substantial information about the microstructure of the system. The success of such inference schemes depends not only on the adequacy of the maximum-entropy principle itself, but also on the judicious choice of the moments used to constrain the distribution [55]: moments that capture relevant aspects of the underlying dynamics can yield accurate predictions, whereas constraints on physically irrelevant observables may provide little useful information.

To conclude, there is a deep but subtle connection between equilibrium thermodynamics and information theory. Upon accepting the axioms of thermodynamics, Gibbsian statistical mechanics can be formulated as an inference problem on rigorous grounds. Since entropy is constructed to provide a consistent quantification of statistical uncertainty, exponential-family models can also be useful for inferring the steady-state microstructure of athermal systems, albeit with important limitations. The thermodynamic meaning of these models, however, remains subject to debate.

B. Nonequilibrium thermodynamics as a control problem

In Sec. III A, we recalled the statistical-mechanical characterization of systems at thermodynamic equilibrium, and discussed its information-theoretic interpretation. In this section, we will frame thermodynamic processes close to and far from equilibrium in the language of optimal transport. Thermodynamics provides a concrete notion of efficiency grounded in the second law,

TΣ=TΔS-Q=W-Δℱ≥0, (107)

where W is the mechanical work along a process and Δℱ is the resulting change in free energy ℱ. Here Σ is the entropy production, so that TΣ is the dissipated heat—the energy irreversibly lost during the transformation. (Note that, confusingly, Σ is often called entropy production; more often than not, entropy production Σ and change in entropy ΔS are different objects.) In particular, an efficient process between an initial and final state is one which minimizes the entropy production Σ, in turn allowing the extractable work -W to reach the thermodynamic upper bound -Δℱ.

In this section, we will discuss useful approaches for estimating the extractable work W and different computational strategies to minimize entropy production Σ using optimal-transport and path-integral methods. We begin by studying thermodynamic relaxation for small departures from equilibrium, described by the Onsager least-dissipation theory. We then extend these ideas to stochastic processes far from the thermodynamic limit (few degrees of freedom instead of Np~1023 particles), for which we will derive useful thermodynamics-inspired bounds, a geometric interpretation for minimizing the entropy production, and nontrivial equalities for the extractable-work fluctuations.

1. Optimal transport bounds efficiency via Onsager’s least-dissipation principle

Let’s start with a modest question—what are the dynamics when we depart from equilibrium but remain close to it? In this setting, Onsager formulated an approach that is phenomenological in nature [63, 64], which has since permitted the calculation of bounds on dissipation in terms of the Wasserstein metric. The connection to Wasserstein geometry ultimately occurs in the context of field theories, but Onsager’s governing principles are perhaps easiest to state in a discrete setting. In brief, consider an isolated system described by the generalized variables Xmm=1,…,M — for instance, concentrations of various compounds in a chemical mixture—that determine the system free energy, ℱX1,…,XM. Onsager postulated that, around equilibrium, the system responds linearly to gradients in the free energy:

dXmdt=-∑n=1MLmn∂ℱ∂Xn. (108)

where Lmn is the Onsager matrix of phenomenological transport coefficients. Physically, the coefficients Lmn, which can be measured experimentally as well as predicted theoretically in some cases [65], describe how changing one variable affects all other variables in response. For instance, in the thermoelectric effect, the corresponding Lmn is known as the thermoelectric coefficient and describes how changes in temperature drive changes in charge density. Eq. (108) serves as the basis for modern linear-irreversible thermodynamics [66], wherein a system relaxes to equilibrium linearly in the thermodynamic forces ∂ℱ/∂Xm, but the forces may be arbitrarily nonlinear in the X’s.

It is worth noting that Onsager proved various nontrivial properties of Lmn [64]. First, to satisfy the second law of thermodynamics (the nonnegativity of heat dissipation, Eq. (107)), Lmn must be positive-definite. Namely, close to equilibrium, very generally [63] the dissipation functional is given by the thermodynamic dissipative force -∑mL-1nmX˙m (friction coefficient times velocity) along a displacement X˙n,

TΣ˙=∑n,mL-1nmX˙nX˙m, (109)

which therefore requires a positive-definite Lmn to satisfy Σ˙>0. Moreover, the so-called Onsager reciprocity theorem states that Lmn must be symmetric, Lmn=Lnm, when the microscopic equations of motion are time-reversal symmetric.

Useful for our purposes is that, for systems obeying Onsager reciprocity [64], Eq. (108) can be obtained from a variational principle. Namely, near equilibrium, the velocities X˙m extremize the following function:

ℛX˙1,…,X˙M=12TΣ˙+dℱdt=12TΣ˙+∑m∂ℱ∂XmX˙m (110)

where ℛ is known as the Rayleighian, and in the second equality we used the chain rule for the free energy. Solving ∂ℛ/∂X˙m=0 is equivalent to Eq. (108) with the heat dissipation of Eq. (109). In this formulation, it is natural to think of gradients of ℱ as driving forces, and L-1 as yielding a metric that defines steepest descent.

Onsager’s theory can be connected with optimal transport when Eq. (110) is extended to field theories. We follow the lines of Ref. [67]. In a continuum (hydrodynamic) approach, one models a fluid via a collection of conserved density fields (e.g., mass, momentum, or energy density fields [68]). For simplicity, we will concentrate on a single scalar field nt(x) representing the density of a conserved quantity, such as particle density. We denote the conserved particle number by Np=∫nt(x)dx; unlike a probability density, nt need not integrate to one. Here nt(x) plays the role of Xm(t) in Eqs. (108)–(110), and the spatial coordinate x plays the role of the index m. The field-theoretical generalization of Eq. (110) can be used as a prescription to derive the equations of motion for nt(x). First, because the field is conserved, it evolves according to the continuum equation

∂nt(x)∂t+∇⋅nt(x)vt(x)=0, (111)

where v is the velocity field. Next, we assume that the free energy may be expressed as a local functional of n, namely ℱ[n]. Finally, we consider phenomenologically that the dissipation Σ˙ is quadratic in vt(x) as in Eq. (109),

TΣ˙=∫dxnt(x)Γnt(x)vt(x)2. (112)

where the phenomenological dissipation coefficient Γ(n) may be an arbitrary function of density n.

As a concrete example, one can have in mind a system of very dilute colloidal particles in a viscous fluid. In this case nt(x) represents the number density of the particles; neglecting hydrodynamic interactions, the drag is given by the Stokes drag Γ=6πηr (where r is the radius of the suspended particles, and η is the viscosity); and, assuming the particles are non-interacting, the free energy is the negative of the entropy ℱ=-TS=kBT∫nt(x)lognt(x)dx.

Upon extending the Onsager Rayleighian Eq. (110) to fields, we obtain

ℛ=12TΣ˙+dℱdt=12TΣ˙+∫dxnt(x)vt(x)⋅∇δℱδnt(x). (113)

with the entropy production Σ˙ of Eq. (112), and we used the functional chain rule and Eq. (111) for evaluating the change in free energy. According to the Onsager variational principle, the equation of motion for nt(x) is determined by choosing the flow vt(x) that minimizes ℛ. Taking δℛ/δv=0 yields

Γnt(x)vt(x)=-∇δℱδnt(x). (114)

We write μt(x)=δℱ/δnt(x) for the local chemical potential. Eq. (114), when combined with Eq. (111), yields a closed dynamical equation for n:

∂tn=∇⋅nΓ(n)∇δℱδn (115)

Returning to our example of a dilute colloidal suspension, one obtains

∂nt(x)∂t=D∇2nt(x), (116)

where D=kBT/(6πηr) is the Stokes-Einstein diffusion constant. Indeed, many of the known dynamical theories in soft matter, ranging from diffusion to phase separation and viscoelasticity, can be derived from Onsager’s variational principle [67].

Onsager’s least-dissipation theorem is closely related to optimal transport—as we show, the dissipation associated with the WGF serves as a lower bound on the true dissipated heat. Note the close resemblance of Eq. (115) to Eq. (98). The Onsager Rayleighian, Eq. (113), can be compared per particle with probability transport. Defining ρt(x)=nt(x)/Np gives

2ΓNp∫01dtℛt=∫01dt∫dxρt(x)vt(x)2+∫01dt∫dxρtx2Γ∇μtx⋅vtx. (117)

where, for simplicity, we have taken Γ=const. At the same time, return to Eq. (91). Using the method of Lagrange multipliers, the minimum of the 2-Wasserstein distance subject to the conservation law and initial and final distributions is found from the saddle point of the following Lagrangian,

∫01dt∫dxρt(x)vt(x)2+∫01dt∫dxρt(x)2∇χt(x)⋅vt(x)+(termsindependentofv). (118)

Here χt(x) is the transport potential of Chapter II, introduced by adding -2χt∂tρt+∇⋅ρtvt to the integrand before integrating by parts. Variation with respect to vt gives vt=-∇χt, where terms independent of vt have been ignored.

Eqs. (117) and (118) have the same quadratic velocity term. The former describes the particle density nt=Npρt, with dissipation expressed per particle, whereas the latter is the probability transport variational problem. Thermodynamics fixes the potential to χt=μt/Γ, where μt=δℱ/δnt is the chemical potential, instead of optimizing over χt. Thus, the Benamou-Brenier solution is a more efficient transportation mechanism;3 linear-irreversible thermodynamics is a Benamou-Brenier-type “partially” optimized transport, as the chemical potential is specified. We will return to the farreaching consequence of this realization—a bound, tighter than Eq. (107), for finite-time transformations—shortly. But until then—may a similar conclusion apply far from equilibrium?

2. Dynamics far from equilibrium

In constructing Onsager’s least-dissipation principle, we considered a coarse-grained hydrodynamic theory close to equilibrium. Yet, the same mathematical structures arise in many other types of dynamics, notably in stochastic processes far from equilibrium. In the following, we will be working within the framework of stochastic thermodynamics [51, 52], aiming to extend thermodynamic notions and theorems to fluctuation-dominated microscopic systems, such as driven colloidal suspensions and individual motor proteins. Since we are no longer in the thermodynamic limit, it is not obvious whether state functions such as temperature or pressure carry over to the microscale or whether the (fluctuating) mechanical work satisfies any relations akin to the second law (Eq. (107)). The immense success of stochastic thermodynamics, summarized in part here and in the coming sections, is the fact that many functions, including mechanical work, can indeed be used still; e.g., the fluctuating work is just any externally applied forces along a stochastic displacement. Upon selecting the surrounding bath properties (temperature, pressure, etc.) and adopting the Shannon entropy as the microscopic analogue of a nonequilibrium thermodynamic entropy, the second law of thermodynamics and many additional useful new fluctuation relations can be derived. The aim of this section is to explore the correspondence between the thermodynamics of stochastic systems and optimal control.

To demonstrate this point, we will consider the paradigmatic example of an overdamped colloid submerged in a thermal bath, which an agent drives via an external force Ft(x),

x˙t=DβFtxt+2Dηt, (119)

where D is the particle diffusivity and ηt is standard white noise. Thus, ε=2D, the stochastic drift is ft(x)=DβFt(x), and Ft denotes a physical force. The time-dependent probability distribution to obtain a microstate, pt(x), satisfies the Fokker-Planck equation [69]—the continuity equation with the current velocity

vtx=DβFtx-D∇logpt(x). (120)

As preparation for later, we distinguish between two types of steady states: One is an equilibrium state (as in Sec. III A), where the external driving force is constant in time and conservative, F=-∇E, yielding the Boltzmann factor as the equilibrium distribution, Eq. (104), and a zero current, v→0. The other is a nonequilibrium steady state, where the current need not be zero (v≠0), but the flux is divergence-free ∇⋅(pv)→0 so ∂p/∂t=0.

Since we may not be close to equilibrium, we may not rely on Onsager’s dissipation functional, and instead refer to the machinery of stochastic thermodynamics [52, 70]. Given our precaution in Sec. III A, we note that the Shannon entropy (Eq. (34)) is indeed an adequate choice for the thermodynamic entropy out of equilibrium in stochastic processes, Spt=-kB∫dxpt(x)logpt(x), since it will provide insightful and thermodynamically consistent results shortly. The change in entropy over time is

dSdt=-kB∫dxvt(x)⋅∇pt(x). (121)

According to the first law of thermodynamics, in this setting, the heat exchanged with the bath is minus the external work — the average of the externally applied forces along a displacement,

Q˙=-W˙=-∫dxpt(x)vt(x)⋅Ft(x). (122)

Thus, the entropy production is given by

Σ˙t=dSdt-Q˙T=kBD∫dxpt(x)vt(x)2. (123)

Indeed, it is zero at equilibrium (v=0), otherwise positive, and functionally consistent with Onsager’s Eq. (112).

Upon further comparison with the Benamou-Brenier approach, Eq. (91), we obtain an optimal-transport-inspired bound on the entropy production [71]. The mere fact that one started and terminated the process at particular distributions during a finite time τ means that one must have produced entropy which is bounded by the Wasserstein metric between the distributions

∫0τdtΣ˙t≥kBDτW22p0,pτ. (124)

Since W22 is itself nonnegative, Eq. (124) is a nontrivial bound on the total dissipated heat TΣ that is tighter than the second law of thermodynamics, Eq. (107).

The minimization of Eq. (118) necessitates a gradient current velocity, vt=-∇χt. Therefore, unless Ft is conservative (Ft=kBT∇logpt-χt/D), there is no chance to saturate the inequality in Eq. (124), let alone approach TΣ˙=0. Indeed, unless Ft is given by the optimal value of χt, even the Onsager least-dissipation principle will dissipate more heat than that prescribed by the Wasserstein-metric bound. To illustrate a related consequence of the above thermodynamic interpretations of Wasserstein geometry and its connection to the kinetics of stochastic processes, we outline in Sec. V B 1 the Jordan-Kinderlehrer-Otto scheme [45] in the language of optimal transport.

Interestingly, since W22 is a property of the two distributions (but not time; cf. Eq. (89)), the bound of Eq. (124) is inversely proportional to the elapsed time. Indeed, the second law only saturates for quasistatic transformations; otherwise, Eq. (124) provides a lower bound on the minimal heat that must have been dissipated to enable a finite-time process. Conversely, Eq. (124) can be interpreted as a thermodynamic speed limit on how quickly one may transform from p0(x) to pτ(x), giving rise to the lower bound τ≥kBW22/(DΣ).

To conclude, the Benamou-Brenier optimal transport problem sets a bound on the thermodynamic cost of very general, finite-time, nonequilibrium transformations [71]. There are additional, fascinating extensions, stemming from combining optimal transport with stochastic mesoscopic systems. For instance, the above statements were shown to apply to discrete-state Markov systems as well [72]. Upon introducing feedback via measurements, the dissipated heat bound can be made tighter in terms of the acquired information [73]. It is important to stress that although the above are nontrivial connections for far-from-equilibrium systems, these connections only apply in cases where the Einstein relation is valid [71, 72]. Otherwise, the Wasserstein metric only yields a bound on the entropy production in athermal and active systems (which is still given by Eq. (123) [51, 74]), but not on the dissipated heat, as the connection between the latter two breaks in the absence of a scalar temperature [75].

Is it possible to saturate the inequalities provided by the second law of thermodynamics? We present here two strategies—one involving the expression of entropy production as a thermodynamic metric in protocol space [76, 77], and the other involving fluctuation properties of stochastic processes [78, 79].

3. Geometric interpretation of entropy production

In the previous sections we found nontrivial bounds on the entropy production using optimal transport. Here, our aim is more practical—is it possible to engineer efficient thermodynamic transformations? By efficient we mean that the entropy production Σ is minimal so, according to Eq. (107), the extractable work is closest to the upper bound dictated by free energy. More concretely, while we did not specify Ft(x) in Sec. III B 2, here we consider specifically a conservative force, Ft(x)=-∇Et(x). We furthermore note that the time dependence of the potential, in practice, arises from a “control knob” that the experimentalist varies over time (e.g., increasing the electric power of an optical trap, thereby increasing the radiation-pressure force on a colloid). These knobs are often called protocols, which we denote by ut. Finding the most efficient thermodynamic transformation, therefore, entails optimizing the entropy production over the protocols ut. For the purpose of this section, the protocol ut can be thought of as the controls in Sec. IA.

In trying to find the optimization framework for the entropy production, we mention several noteworthy properties of entropy production, Eq. (123): First, clearly the quasi-static transformations are most efficient—since, close to equilibrium v(x)→0 everywhere in x, the dissipation Σ→0, necessarily from above due to the quadratic form. Even more so, we see that work extraction in the quasi-static limit is indeed possible. Qualitatively, the slower the time scale over which the process occurs, τ→∞, then vt(x)~τ-1. Since changes in free energy, entropy (Eq. (121)), work, and heat (Eq. (122)) are proportional to v but involve the integration over time, order-∫0τdtv~1 energy extraction is possible while the dissipation is ~∫0τdtv2~1/τ→0. Are all quasi-static transformations the same, or are some more efficient than others? For instance, due to critical slowing down, it may be counterproductive to move throughout Ising-model phase space through the critical point [77].

We restrict our attention to exploring the space of quasistatic transformations, as their entropy production is smallest. Since vt(x) is an involved function, requiring the knowledge of the instantaneous distribution in addition to the force, we seek to make the connection of quasistaticity to the protocol ut more concrete, as follows. For the process to be quasistatic, pt(x) must equilibrate on a faster timescale than the protocol evolves; namely all eigenmodes of the Fokker-Planck operator converge to equilibrium faster than the protocol varies. We first define the deviation δpt(x) of the instantaneous distribution pt(x) from the equilibrium Boltzmann factor corresponding to the instantaneous protocol value puteq(x):

pt(x)≔puteqx+δptx,pueq(x)=1Zuexp-EuxkBT,Zu=∫dxexp-EuxkBT. (125)

By inserting this solution into the Fokker-Planck equation,

∂pt(x)∂t=-ℒutptx,ℒu=-D∇⋅∇EuxkBT+∇, (126)

where ℒupueq=0, we find the exact expression

δpt(x)=-∫-∞tdseT-∫stds′ℒus′u˙s⋅∂puseq(x)∂u, (127)

where eT is a time-ordered exponential. We will now use the assumption of a quasistatic protocol: Since all modes of ℒu converge prior to ut changing considerably, eT-∫stds′ℒus′ suppresses integrand contributions in Eq. (127) where us departed much from ut. Thus, we approximately replace all protocol values us with ut,

δpt(x)≃-∫-∞tdse-(t-s)ℒutu˙t⋅∂puteq(x)∂u. (128)

In preparation for later, we define the protocol score (a vector for a multicomponent protocol):

Θu(x)≔1pueq(x)∂pueq(x)∂u=-1kBT∂Eu(x)∂u-∂Eu(x)∂uueq (129)

where ⟨a(x)⟩ueq=∫dxpueq(x)a(x).

Recall that the work is, by definition, the energy involved in shifting the potential in time [78],

W=∫01dt∫dxpt(x)u˙t⋅∂Eut(x)∂u. (130)

and the change in free energy is Δℱeq=-kBTlogZu1-logZu0. Using Eq. (107), we find the quasi-static expression for the entropy production:

Σ=1T∫01dt∫dxδpt(x)u˙t⋅∂Eut(x)∂u=kB∫01dtu˙t⋅ζut⋅u˙t, (131)

where the friction coefficient can be expressed as the integrated autocorrelation function of the thermodynamic force

ζu=∫0∞ds∫dxpueq(x)Θu(x)e-sℒu†Θu⊤(x)=∫0∞dsΘuxsΘu⊤x0ueq, (132)

where the average is in the equilibrium problem, Eq. (119), where the protocol is fixed (with x0~pueq).

Thus, Eq. (131) is an exact expression for the entropy production in terms of a Riemannian geometry in the protocol space [76]. (This contrasts with Eq. (124), which provides an optimal-transport-inspired bound on the entropy production.) The thermodynamic metric, ζu, describes the “friction” one would experience in a given position in phase space u. We now concretely see how entropy production decreases quadratically with slower driving u˙. However, we may now further ask questions such as how to optimally transition between states quasistatically, e.g., how to vary temperature and magnetic field to flip the magnetization in the zero-temperature Ising model [77]. These trajectories would correspond to finding the geodesics on the curved surface described by ζu, e.g., using geometric minimum-action methods [80] or by backpropagation [81]. Eq. (131) then allows us to investigate the efficiency and geometry of near-equilibrium thermodynamic transformations.

4. Thermodynamic fluctuation theorems

While the above has been a detailed, geometric treatise on close-to-equilibrium thermodynamics, one can find additional, surprising statistical characterizations of the work distributions far from equilibrium. Eq. (130) provides the mean work, and in the previous sections we derived second-law-like bounds TΣ=W-Δℱeq≥0. Here we seek additional statistical properties of the work along a stochastic trajectory xt,

wtx⋅=∫0tdsu˙s⋅∂Eusxs∂u,W=w1P, (133)

where P is the forward path distribution and w1 is the work over the complete unit-time protocol. The trajectories start and end at equilibria (x0~pu0eq and x1~pu1eq). For that purpose, we will be computing its moment-generating function (MGF), eλw1. We will show that it satisfies two useful equalities: the Jarzynski equality [78, 82],

e-w1/kBT=e-Δℱeq/kBT, (134)

and the Crooks fluctuation theorem [79].

pw1p‾-w1=ew1-Δℱeq/kBT, (135)

where P‾ is the reverse path distribution and p‾ is its distribution of work along a trajectory that is being orchestrated by the reversed protocol, u‾t≔u1-t, which starts from the corresponding (reversed) equilibrium initial condition, pu‾0eq=pu1eq.

The Jarzynski equality has been proven using the Feynman-Kac formula in Ref. [83]. Inspired by their approach, we present a new method for deriving the Crooks fluctuation theorem, involving a Feynman-Kac calculation of the forward- and reverse-process MGFs. While Eq. (134) vividly involves the work MGF at λ=-1/kBT, we convert Eq. (135) to involve the MGFs by multiplying it by p‾-w1eλw1 and integrating over w1, to find:

eλw1P=e-Δℱeq/kBTe-λ+1/kBTw1P‾. (136)

If the Crooks fluctuation theorem holds, Eq. (136) readily reproduces the Jarzynski relation, Eq. (134), by inserting λ=-1/kBT. Therefore, we aim to derive the Crooks fluctuation theorem, involving both the forward- and backward-running controls, ut and u‾t=u1-t.

Define the work-weighted endpoint density (similar to a moment-generating function) to appear at x at time t along the ut-controlled trajectories:

Mt(x,λ)=expλ∫0tdsu˙s⋅∂Eusxs∂uδx-xtP. (137)

Using Itô’s lemma [69], one can show that it follows the initial-value partial-differential equation:

∂Mt(x,λ)∂t=-ℒutMt(x,λ)+λu˙t⋅∂Eut(x)∂uMt(x,λ),M0(x,λ)=pu0eq(x). (138)

We define the initially conditioned MGF along the reversed-protocol, u‾t≡u1-t-controlled trajectories:

M‾t(x,λ)=expλ∫t1dsu‾˙s⋅∂Eu‾sxs∂u‾xt=xP‾. (139)

Using the Feynman-Kac formula, it satisfies the terminal-value partial-differential equation:

∂M‾t(x,λ)∂t=ℒu‾t†M‾tx,λ-λu‾˙t⋅∂Eu‾tx∂u‾M‾tx,λ,M‾1(x,λ)=1. (140)

In order to prove the Jarzynski and Crooks fluctuation theorems, we should find the connection between M and M‾, which will involve a time-reversal of the latter.

A useful, intermediate MGF we define is M~t(x,λ)≔M‾1-t(x,-λ-β). Based on Eq. (140), one can show that M~ satisfies the following equation:

∂M~t(x,λ)∂t=-ℒut†M~t(x,λ)+λ+1kBTu˙t⋅∂Eut(x)∂uM~t(x,λ), (141)

where the forward-time protocol has been restored, u‾1-t=ut, and d/d(1-t)=-d/dt. Note the property e-Eu(x)/kBTℒu†eEu(x)/kBT=ℒu. With this in mind, we find that

Mt(x,λ)=1Zu0e-Eut(x)/kBTM~t(x,λ), (142)

as by direct substitution, we see that the right-hand side of Eq. (142) indeed satisfies Eq. (138) along with its initial condition. Upon integrating Eq. (142) over x, evaluated at t=1, and recalling the definitions of the forward and backward MGFs, Eqs. (137) and (139), we recover the Crooks fluctuation theorem, Eq. (136),

eλw1P=∫dxM1(x,λ)=Zu1Zu0∫dxpu1eq(x)M‾0(x,-λ-β)=Zu1Zu0e-λ+1/kBTw1P‾. (143)

Upon replacing the partition functions with the free energy, Zu=e-ℱueq/kBT, and inverting the Laplace transform, we find the original Crooks fluctuation theorem, Eq. (135).

It is remarkable that for any equilibrium-to-equilibrium transformation, independently of how fast or sub-optimal the controls were, how strong the stochasticity is in the microscopic system, and how far the system has been out of equilibrium during the transformation, equalities such as Eqs. (134) and (135) hold without any approximation. As a corollary, by the Jensen inequality, they reproduce the second law of thermodynamics, ℱu1eq-ℱu0eq≤w1, which is an inequality for the average work involved in a protocol-driven transformation of the stochastic system. Previous sections involved near-equilibrium expansions or optimal-transport-inspired bounds. Fluctuation relations such as these are routinely used to estimate free energy differences in microscopic transformations [83, 84]. In Sec. IV B, we show that the Jarzynski relation can also have utility for importance sampling.

IV. SAMPLING AND CONTROL

Sampling from complex, high-dimensional probability distributions is a fundamental task in scientific computing, statistics, and machine learning. The sampling problem asks for the production of independent samples distributed according to a target probability distribution p1. In statistical mechanics, for instance, samples from the Boltzmann distribution allow estimation of physical observables, while in Bayesian inference, samples from the posterior distribution allow predictions based on observed data. This chapter describes the close connection between sampling, inference, control theory, and non-equilibrium thermodynamics, which forms the basis for modern machine-learning methods in reinforcement learning (Sec. V A) and generative modeling (Sec. V C). These links arise from two directions. On the one hand, sampling provides a general-purpose method for solving inference and control problems. On the other hand, control theory and non-equilibrium thermodynamics give rise to practical sampling algorithms. Indeed, such algorithms typically use a controlled, dynamic process that transforms samples from a simple base distribution p0 into the more complex target p1. Sampling thus becomes a control and transport problem of “guiding” base samples into regions of high target probability.

Sec. IV A begins by briefly reviewing the use cases and challenges of sampling in high dimension. Many classic algorithms generate samples using equilibrium physics. Sec. IV B introduces Annealed Importance Sampling (AIS), which allows harnessing non-equilibrium processes to generate samples, and can greatly outperform classical methods. AIS is closely connected to non-equilibrium thermodynamics (Sec. III B). Finally, Sec. IV C casts sampling as a control problem by optimizing the statistical efficiency of the sample-generation process. Vice versa, control problems can be solved by sampling trajectories and keeping count of the resulting reward (Sec. I D 2).

A. What is sampling and why is it hard?

We begin by fixing the setting. Our goal is to draw N independent samples xn~p1,n=1,…,N from a complex target distribution p1. We assume that we can evaluate an unnormalized density p~1(x) for the target, with p1(x)=p~1(x)/Z1. Throughout this chapter, p denotes a normalized probability density and a tilde denotes its unnormalized form. Below, we use dimensionless “energies” and write Ei(x)=-logp~i(x), so pi=e-Ei/Zi and -logpi=Ei+logZi. As we explain next, the sampling task naturally arises in statistical mechanics and Bayesian inference.

1. The Monte Carlo method

A key problem in equilibrium statistical mechanics is to calculate expectation values of physical observables, denoted a(x) for “average”, for example, the magnetization of a piece of metal [7]. This requires summing (or integrating) over all d-dimensional configurations x, weighted by the Boltzmann measure:

⟨a⟩=∫axp1xddx,p1(x)=exp(-βE(x))/Z (144)

where β=kBT-1,E is the energy, and Z is the normalization constant. Computing this integral in large dimensions requires summing a number of configurations exponential in d (the number of system degrees of freedom). This is generally intractable. A similar problem occurs in Bayesian inference [8], already encountered in Sec. I B. Here, the target distribution p1 is the posterior of a statistical model. By Bayes’ rule, the posterior for parameters or hidden variables x, conditioned on observations A, reads:

p(x∣A)=p(A∣x)p(x)/p(A)=explogp(A∣x)+logp0(x)/Z (145)

The target is now p1(x)=p(x∣A). The final form emphasizes that the prior p(x), the statistical model p(A∣x), and the observations A define an effective “energy landscape” for the parameters x. The x-independent p(A) acts like a normalization constant. Like in statistical mechanics, in complex, high-dimensional models, directly computing expectation values, like the parameter means or normalized posterior probabilities, is intractable.

The Monte Carlo method relies on a set of N (independent) samples from the target distribution p1 to estimate expectation values:

⟨a⟩1≈1N∑n=1Naxn≕aˆN,xn~p1,n=1,…,N. (146)

We use ⋅ˆ for estimators, and simplify subscripts ⟨a⟩1≔⟨a⟩p1 where unambiguous. Since it uses a finite number of samples, the estimator Eq. (146) is not perfect (throughout, we use ⋅ˆ for estimators). It is correct on average, but has a nonzero mean squared error

aˆn-⟨a⟩=0,aˆn-⟨a⟩2=Var(a)N. (147)

Estimating strongly fluctuating quantities requires many samples.

Computing statistical-mechanical observables and Bayesian inference thus become sampling tasks: Given an energy or an unnormalized probability density, draw independent samples to estimate observables or normalized probabilities.

2. Probability distributions in high dimension

Sampling in high dimension d≫1 is challenging. First, complicated probability distributions often feature multiple, disconnected modes. An example from physics is the Ising model in the ordered phase (Fig. 6, left). In the high-dimensional (thermodynamic) limit, the free energy barrier between the two magnetization states scales like d and thus becomes very large [7]. In Bayesian statistics, different modes in the posterior are distinct “explanations” of the observed data. Capturing all modes is therefore essential.

FIG. 6.

FIG. 6.

(Left) Boltzmann distribution of the magnetization at different temperatures in the fully connected Ising model with energy E=d-1∑i≠jσiσj where the σi∈{-1,1} are binary “spins”. The magnetization is the average over its spins, m(x)=d-1∑iσi. At high temperature, the distribution is simple and unimodal, but at low temperature, it has two disconnected modes. (Right) Magnetization of MCMC samples with d=20 spins in the low-temperature ferromagnetic phase β=2. The MCMC sampler carries out a random walk over spin configurations; jumps are barrier-crossing events between positive and negative magnetization. Convergence is very slow: it takes ~ 106 steps to escape a local free energy minimum.

Second, the high-probability regions that sampling must locate and explore become needles in a high-dimensional haystack [85]. This issue is often called the curse of dimensionality. More precisely, high-dimensional probability measures tend to concentrate into very narrow sets (Fig. 7, right), which sampling algorithms must explore. This phenomenon, a generalization of the central limit theorem, is called concentration of measure [86]. In statistical mechanics, it underlies the equivalence of micro- and macrocanonical ensembles in the thermodynamic limit d→∞ : large energy fluctuations become unlikely.

FIG. 7.

FIG. 7.

Samples from a Gaussian with zero mean and variance σ2=1/d in dimension d=2 and d=1000, plotted in (projected) polar coordinates r=∑ixi2,θ=arctanx1/x2. For large d, samples concentrate on a sphere of radius 1 around the mean.

How fluctuations grow with the number of dimensions is also of great importance in sampling. As a rule of thumb, estimating an extensive quantity like the energy is feasible. Let us consider a scalar observable a that is approximately Gaussian and for which the mean and standard deviation are of the same order. If the magnitude is extensive, |a|~d, the estimator Eq. (146) requires N≳d samples for an accurate estimate. However, estimating the exponential of an extensive quantity ea is very hard. Since Varea~e2Var[a]~e2d, it requires N≳ed samples and is thus infeasible. Controlling this variance is a key question in sampling algorithm design.

3. Basic sampling algorithms: importance and Langevin sampling

Most sampling algorithms begin with a base distribution p0 from which one can sample easily (often, the standard d-dimensional Gaussian 𝒩(0,I)) [87]. The game is then to convert samples from p0 into samples of the target distribution p1. The most straightforward implementation of this idea, transform sampling, applies a map to base samples. This idea underlies modern generative models and will be discussed in Application Sec. V C.

Importance sampling is based on reweighting. Assuming that the unnormalized density p~1 is known, one uses the base distribution p0 to produce a set of proposals xn~p0 (in this context, p0 is often called the proposal distribution). Weights ωn compensate for the difference between p0 and p1:

⟨a⟩1=⟨aω⟩0=⟨aω~⟩0⟨ω~⟩0≈∑n=1Nω~naxn∑n=1Nω~n,ω(x)=p1(x)p0(x),ω~n=p~1xnp~0xn,xn~p0. (148)

Crucially, the sample estimate only requires evaluating the unnormalized probability densities, since the normalization constants Z0,Z1 drop out.

Reweighting converts proposals into target samples. The closer p0 is to p1, the more efficiently the method works; if p0 and p1 are very different, most proposals land in regions of vanishing p1-probability. This means that the finite-sample estimate will be dominated by a few samples with the largest weights. This phenomenon can be quantified by the effective sample size, the number Neff of samples from p1 that yield the same error as N importance samples from p0, often approximated as [8]

Neff≈∑n=1Nω~n2/∑n=1Nω~n2. (149)

The effective sample size is thus set by the 2nd moment of the weights. Let us see how this arises. By Eq. (147), Neff samples from p1 yield an error Var[a]/Neff. Instead of the “bare” observable a, importance sampling estimates the product a⋅ω, where ω=p1/p0=explogp1-logp0 is the weight. The error of the importance sampling estimator Eq. (148) is therefore Var[a⋅ω]/N~(Var[a]⋅Var[ω])/N. Comparing the two yields Neff=N/Varelogp1-logp0. In high dimensions, importance sampling thus becomes ineffective. The ratio p1/p0 generally fluctuates wildly since probability measures concentrate in narrow regions [88]. The “energies” E0,1=-logp~0,1 are usually extensive, E0,1~d, and so ω=p1/p0~ed. Indeed, constraining p1/p0 is a key part of importance-sampling-based machine learning algorithms like PPO [89], which we will discuss in Sec. V A.

Markov chain Monte Carlo (MCMC) uses an easy-to-simulate stochastic process that converges to the target distribution p1 over time t. This generates samples incrementally and allows simulating complex, high-dimensional distributions. Its simplest variant, Langevin sampling, uses Brownian motion in a potential E1=-logp~1:

x˙t=-∇E1+εηt,x0~p0 (150)

Here ηt is the standard Gaussian white noise. We denote the marginal distribution of xt, the sampler density, by qt(x). The stationary distribution of this process is precisely p1=exp-E1/Z1, so after waiting long enough, xt can generate target samples. MCMC succeeds or fails based on how rapidly qt equilibrates to the target distribution. However, for complex, high-dimensional distributions, convergence can be painfully slow. For multi-modal distributions, Langevin dynamics can get stuck in a single energy minimum and thus perform poorly (Fig. 6, right). For instance, for a mixture of Gaussians with well-separated peaks μ1,μ2, trajectories must cross an energy barrier ΔE~μ1-μ22/σ2, which takes a time ~exp(ΔE).

While Langevin sampling is conceptually based on equilibrium physics, the algorithms we discuss next use non-equilibrium physics. They transform the base into the target distribution over a fixed, finite time frame, akin to the thermodynamic protocols encountered in Sec. III B. The target distribution is no longer a stationary state. Intuitively, this allows proceeding at “full speed” where equilibrium approaches must “slow down” as the target is approached.

B. Annealed importance sampling

The method of simulated annealing, originally introduced in statistical physics [7, 90], overcomes this issue and can be seen as an antecedent of modern diffusion methods. Simulated annealing was originally an algorithm to optimize an energy E(x). Because greedy optimization methods like gradient descent, x˙t=-∇E, can get stuck in local minima, one introduces noise (a finite temperature) to allow escape: x˙t=-∇E+εηt. However, if ε is too large, the state xt spends much time away from the energy minimum due to “thermal” fluctuations. Simulated annealing splits the difference by starting with a high temperature and gradually lowering it over time. The initial high-temperature distribution is supposed to act as a “bridge” connecting different energy minima.

1. Sampling with time-varying energies

By reparametrization, a changing noise level can be absorbed into a changing energy. In this section, we rescale so that ε=2 to simplify notation. One thus generates samples by:

x˙t=-∇Et+2ηt,x0~p0 (151)

The process generates proposal samples xt, with actual marginal density qt(x). For independent runs, xt(n) denotes the state in run n. By convention, time runs from t=0 to t=1. Thus, simulated annealing departs from conventional Langevin dynamics: samples are generated over finite time and using a time-dependent energy Et. One simple strategy is linear interpolation between the energies:

Et=1-tE0+tE1,wherep0=e-E0/Z0,p1=e-E1/Z1 (152)

Eq. (151) can be thought of as a thermodynamic protocol (Sec. III B). The “instantaneous equilibrium” distribution corresponding to Eq. (152) is pteq=e-Et/Zt, with p0eq=p0 and p1eq=p1.

However, this strategy is not yet perfect. The distribution q1 of the trajectory endpoints x1 from Eq. (151) is not the same as the equilibrium distribution p1, our target. Physically, the transformation induced by the time-dependent energy is non-adiabatic. Mathematically, the Fokker-Planck equation for qt reads ∂tqt=∇⋅qt∇Et+∇2qt. The pteq cannot be a solution since they are instantaneous equilibria, ∇⋅pteq∇Et+∇2pteq=0≠∂tpteq [91]. Therefore, x1 cannot be used directly as a sample for p1.

Annealed importance sampling [92] (AIS) corrects the annealing process Eq. (151) to produce samples from p1. Similarly to Girsanov’s theorem (Sec. I C 2), AIS computes how the marginal distribution of xt changes due to the additional force ∇Et-∇E0=t∇E1-E0 from the time-dependent energy. AIS computes a weight ωt for each realization xt that compensates for the difference between qt and pteq via importance sampling Eq. (148), i.e. ωt=pteqxt/qtxt. As we will derive shortly, this weight can be calculated “step-by-step” by integrating along the trajectory.

ddtlogωt=∂tlogpteqxt,ωt=Z0Zte-wt,wt=∫0t∂sEsxsds. (153)

where wt is the work performed on the trajectory particle due to the changing energy. In practice, the common factor Z0/Zt need not be computed: when estimating averages, one simply normalizes by the total weight of all AIS samples. A special case of AIS is thermodynamic integration [93], in which the energy Et is changed quasi-statically.

In non-equilibrium thermodynamics, Eq. (153) is known as Jarzynski’s equality [78] (Sec. III B 4 deduced it from Crooks’ fluctuation theorem, another non-equilibrium thermodynamics result). Jarzynski’s equality relates the free energy difference ℱ1eq-ℱ0eq=-logZ1+logZ0 to the work wt on individual trajectories. It notably allows calculating the free energy difference between two states. This result from thermodynamics was, in fact, an important inspiration for AIS [92].

2. Proof of the annealed importance sampling identity

Jarzynski’s equality was proven in Sec. III B 4 using the Feynman-Kac formula. Here, we provide an alternative derivation of Eq. (153), effectively using a path-integral approach [78, 92]. The biggest challenge lies in notation: we already distinguished the instantaneous equilibria pteq from the distribution qt of the non-equilibrium process Eq. (151). In addition, we now introduce the time-reversed version of Eq. (151), in which the energy is changed from E1 back to E0:

x‾˙t=-∇E1-t+2ηt,x‾0~p1 (154)

Note that the reverse process is initialized at p1, our target: q‾0=p1. We denote its marginal density by q‾t and its path law by P‾. We now show how pteq (equilibrium), qt (forward process), and q‾t (reverse process) are related.

We discretize time into small intervals, t=0,dt,2dt,…,1. Formally, the probability of a trajectory equals the product of the (infinitesimal) transition probabilities:

P[x(⋅)]=p0x0∏tktxt+dt∣xt (155)

In the discretization, we alternate between taking trajectory steps xt↦xt+-∇Et+2ηtdt and updating the energy, Et↦Et+dt. The kt(y∣x) are one-step transition matrices. They are the equilibrium transition probabilities for an energy “frozen” at Et, and, in particular, obey detailed balance. The transition probabilities of the reverse process are therefore4:

ktxt∣xt+dt=ktxt+dt∣xtpteqxtpteqxt+dt (156)

Hence, the difference in a trajectory xt’s log-probability under the forward and reverse processes reads:

logP‾[x(1-⋅)]P[x(⋅)]=∑tdtlogpt+dteqxt-logpteqxtdt=∫dt∂tlogpteqxt=logω1. (157)

The reverse process starts at q‾0=p1, so the weight ω1 corrects for the difference between q1 and p1. After reweighting with ω, the trajectory endpoints x1(n) can be used as importance samples.

In summary, AIS is an importance sampling scheme that uses time-dependent energy landscapes to generate samples from a target distribution. Because AIS leverages a non-equilibrium process, it can greatly outperform, say, Langevin sampling, when convergence to equilibrium is slow, for example due to energy barriers. The AIS importance weights are easy to calculate numerically5. An example is shown in Fig. 8 for the Ising model in the spontaneously magnetized phase. While Langevin sampling took 106 steps to escape a local free energy minimum, AIS can generate independent samples in 100 steps by cooling down from the unmagnetized phase. While AIS is guaranteed to deliver unbiased importance samples, its practical performance greatly depends on the annealing schedule, i.e., on the choice of the time-dependent energy Et. We discuss this question next.

FIG. 8.

FIG. 8.

(Left) Simulated annealing trajectories for the fully connected Ising model with d=20 spins, going from β=0 to β=2 in 100 steps. (Right) Distribution of magnetization at β=2 based on annealing runs. Without reweighting, the samples are not distributed correctly.

C. Sampling as a control problem

We now understand how to generate target samples using the AIS method. Does that mean that the sampling problem is “solved”? Further, the AIS scheme works for any time-dependent energy landscape. In which sense is one choice better than another? Just like thermodynamic protocols and the transport plans of Sec. II A can be optimized to minimize energy dissipation or transport costs, we will now discuss how sampling protocols can be optimized for statistical efficiency. As we noted above, importance sampling works best when the proposal and the target distributions are close. Otherwise, many samples land in regions of vanishing probability and are thus “lost”. By Eq. (149), the performance of importance sampling is quantified by the variance of the weights ω=explogp1-logp0. Our goal is thus to minimize weight variance to maximize statistical efficiency.

In the thermodynamic language of the Jarzynski equality (Sec. III B 4), minimal weight variance means that the work for moving the system between the two equilibria with free energies ℱ0,1eq=-logZ0,1 is minimal. To see this, recall Eq. (153): the unnormalized AIS weights are ω~t=exp-wt, where wt is the work performed on a trajectory xt. The Jarzynski equality Eq. (134) states that the free energy difference is ℱ1eq-ℱ0eq=-loge-w1≤w1. This bound is saturated when the work w1 on all trajectories is equal, and thus the weight variance is zero (we caution that minimal work coincides with minimal variance, but away from the minimum, the two objectives differ). Physically, an efficient protocol is close to adiabatic: it ensures that samples at time t rapidly thermalize to the next energy landscape Et+dt, and avoids, for instance, regions of phase transitions [77].

In an ideal importance sampler, Var[ω]=0 and thus ω(x)=const. That is, the ideal proposals x are already distributed according to the target p1. To get around this somewhat circular conclusion, we will formulate the design of a good proposal distribution as an optimization problem. Indeed, importance sampling can be seen as an optimal control problem by considering the time-dependent energy gradient -∇Et in Eq. (151) as a control force ut.

1. Sampler design as a control problem

To formalize sampler design as a Path Integral Stochastic Control (PISC) problem (Sec. ID), we consider a generalized setting. We aim to evaluate expectation values of the form a⋅eR0 over trajectories of a stochastic process:

a[x(⋅)]eR[x(⋅)],x˙t=ftxt+εηt, (158)

The brackets [⋅] indicate that a and R may now be functionals of the entire trajectory x(⋅).

To map Eq. (158) to the importance sampling setting, choose:

Rx⋅=logp1x1p0x1=E0x1-E1x1+logZ0Z1,ft=-∇E0,ε=2,a[x(⋅)]=ax1,x0~p0. (159)

The stochastic process produces Langevin samples from the base distribution; R is the log importance weight, so eR reweights them to the target; the expectation on the left of Eq. (158) is then ⟨a⟩p1. As discussed below Eq. (149), in high dimensions, the importance weight eR~ed fluctuates wildly. This makes a finite-sample estimate of Eq. (158) unreliable.

To remedy this, we add a control force ut to drive trajectories toward higher rewards, and then reweigh the trajectories to account for the change in distribution [26, 94],

x˙t=ftxt+utxt+εηt. (160)

We denote by P0[x(⋅)] the probability of a path without control, and by Pu[x(⋅)] the probability with control. To compensate for the modified dynamics, we reweigh:

a[x(⋅)]eR[x(⋅)]0=a[x(⋅)]eR[x(⋅)]P0[x(⋅)]Pu[x(⋅)]u (161)

We now need a suitable reward to choose the control u. We will aim to maximize R, balanced against a quadratic control cost:

u*=argminu∫01utxt22εdt-R[x(⋅)]u. (162)

We thus arrive at a PISC problem. Recall from Eq. (60) that the optimal path measure is a tilted version of the uncontrolled measure:

P*x(⋅)∣x0=x=P0x(⋅)∣x0=x⋅eR[x(⋅)]/Z (163)

Indeed, Girsanov’s theorem from Sec. I C 2 shows that ∫01utxt2/(2ε)dtu=DKLPu‖P0. The control cost is thus an entropy, and as we saw in Sec. I B 2, entropy maximization generally leads to solutions that are exponential tilts. Plugging the optimal control into Eq. (161):

a[x(⋅)]eR[x(⋅)]∣x0=x0=a[x(⋅)]eR[x(⋅)]P0[x(⋅)]P*[x(⋅)]x0=xu*=Za[x(⋅)]∣x0=xu*. (164)

The weights eR in the expectation are now constant (conditional on the initial condition x0 – unconditional expectation values must additionally average over the easy-to-sample x0~p0). In the case of importance sampling, we can compute ⟨a⟩p1 purely from samples xt,x0~p0 of the Langevin equation Eq. (160), with the control force found by optimizing Eq. (162). Since no reweighting is necessary, the effective sample size is maximal, Neff=N: every proposal sample is worth one true sample.

2. Non-equilibrium systems and transition path sampling

The formulation Eq. (158) also applies to non-equilibrium systems, like energetically driven chemical reactions [95, 96]. Instead of a Boltzmann distribution, the state xt of the system at time t follows a non-equilibrium Langevin equation, combining deterministic forces and random fluctuations. The dynamics in Eq. (158) thus become physically meaningful, rather than a sampling device. Evaluating expectation values over physical trajectories is of great importance, for example, to estimate chemical reaction rates. In this setting, so-called rare events can have outsize importance: the crossing of a potential barrier determines whether a reaction occurs or not. Mathematically, such events can be encoded in the reward R in Eq. (158). One faces the same challenge as above: strong fluctuations in eR lead to poor finite-sample estimates (the target event may simply not occur in a finite sample). Variational Path Sampling [95] addresses it precisely as discussed in Sec. IV C 1. One introduces a control ut to encourage the target rare events, and reweighs trajectories to compensate for the fictitious control when computing physical observables (Eq. (161)).

3. Control as a sampling problem

In summary, the design of an optimal importance sampler is a control problem, where the reward is the “target” probability of the trajectories. This result enables systematic optimization of annealing samplers. But, in some sense, we simply kicked the can down the road: how do we solve the resulting control problem? The key to resolving this conundrum is that, vice versa, control problems can be solved by sampling. Indeed, we saw in Sec. I C 3 that control problems can be seen as probabilistic inference problems. Since sampling provides a general-purpose method to solve the latter, it should also be applicable to the former. This suggests an iterative approach in which the sampler is used to solve a control problem, whose solution in turn improves the sampler. This duality between sampling and control will play an important role in Sec. V A on reinforcement learning.

Let us make this precise. The notations “ψ” and “R” in Eq. (158) are no coincidence. Conditioned on the trajectory’s initial condition, the weighted expectation in Eq. (158) is the Cole–Hopf transform ψs=eVs of the all-important value function of a control problem with accumulated reward R[x(⋅)] (Sec. I D 2). We write Rs[x(⋅)] for the accumulated reward from time s onward, including the terminal reward and excluding control cost. Recall that the value function obeys the HJB equation (the recursive formulation of optimality), which can be Cole-Hopf transformed into a Schrödinger equation (in imaginary time). The Feynman-Kac formula Eq. (62) shows that the solution to this Schrödinger equation can be obtained by a Feynman path integral over stochastic trajectories:

ψs(x)=eRs[x(⋅)]∣xs=xP0,x˙t=ftxt+εηt. (165)

The stochastic trajectories are now initialized at xs=x instead of at random. Up to this detail, the Feynman-Kac formula is precisely Eq. (158) with a=1,ft as the dynamics in the absence of control, and Rs as the reward of the control problem. Intuitively, Eq. (165) computes the value function by “undirected exploration” (no control applied) and taking inventory of the rewards encountered. In the language of this chapter, the Feynman-Kac formula is a sampling-based approach to control problems: applying the Monte Carlo method to Eq. (165) yields an estimate of the value function from a finite number of stochastic trajectories. However, Monte Carlo estimation faces the same challenge as in importance sampling. In high dimensions, eRs~ed fluctuates wildly. This makes a finite-sample estimate of Eq. (165) unreliable. Uncontrolled trajectories are very unlikely to gather high reward Rs, while it is precisely high-reward trajectories that dominate Eq. (165).

Sec. IV C 1 explains the solution: add a control force to bias trajectories towards higher rewards. This suggests an iterative procedure, starting with a guess for the optimal control ut(0):

  1. Generate importance samples from the ut(k)-controlled process (Eq. (161))

  2. Estimate logψ^(k) by Monte Carlo, using the reweighted trajectories (Eq. (165))

  3. Recompute the optimal control from the value function by optimizing the expected reward at each timestep (ut(k+1)(x)=ε∇logψ^t(k)(x), Eq. (55))

and repeat until convergence. This procedure is closely related to the policy iteration algorithm for control problems [97], which iterates evaluation of the current control’s value function (steps 1–2) with improvement of the control using the value function (step 3). Here, evaluation happens through Monte Carlo estimation. In Sec. V A on reinforcement learning (RL), we will see that policy iteration forms the basis for state-of-the-art methods like the soft actor-critic algorithm [98], and that controlling the variance of Monte Carlo estimates is a crucial question in RL algorithm design [97]. RL generalizes control theory to the case where the dynamics ft and reward rt are not known in advance but must be learned through exploration. RL is often formulated in a somewhat different language, but makes use of the same principles that connect control, inference, and sampling problems.

V. APPLICATIONS

The Applications chapter will cover three topics. Sec. V A on reinforcement learning builds on control theory (Sec. I A), maximum-entropy methods (Sec. I C), and sampling (Chapter IV); Sec. V B on Wasserstein gradient flows draws on transport (Chapter II) and non-equilibrium thermodynamics (Sec. III B); and Sec. V C on generative models combines ideas from transport (Chapter II) and sampling (Chapter IV). A general theme is moving from settings where the dynamics, rewards, or distributional constraints are known, to settings where they have to be learned from data. The Applications chapter is thus centered on ideas from machine learning.

A. Reinforcement learning

Before introducing the reinforcement learning (RL) problem, we begin with a simple example to build intuition and illustrate what makes the problem hard. Take a simple problem setting of a robot in a new warehouse that it has never seen before (Fig. 9), where its goal is to reach a target as soon as possible. Importantly, the robot has no prior knowledge about the warehouse, and can only make decisions based on its collected experience and observed rewards. Let’s say that the robot executes random actions until it reaches the goal. This initial path is likely suboptimal and circuitous. Should the robot continue taking this path or explore to find a potentially shorter route? Thus, if the robot wishes to find the optimal route, it must balance between collecting information about its environment and refining the solutions found so far. This balance, known as the exploitation-exploration problem, is the core difficulty of the RL problem.

FIG. 9. The explore-exploit problem in reinforcement learning.

FIG. 9.

The robot wishes to reach a goal, and is given a reward of 1 at the goal (star), a reward of 0 in empty cells, and a slightly negative reward −0.01 in hazard cells (electricity). Furthermore, at any point in time, the robot might break down with a large independent probability 10%. Thus, if the robot wants to maximize its expected reward, it should heavily prioritize shorter routes to the goal. Assume that the robot’s initial state is fixed to the top left of the warehouse. At initialization, the robot’s control is random and chooses these two actions with equal probability. From this point, the agent can choose one of two controls: go right or go down. These two controls lead to two paths towards the goal, a suboptimal path that is long and circuitous with ample opportunity to break down but with no penalties, and an optimal path that routes directly to the goal with a small incurred penalty (e.g. an activation energy barrier).

The RL formalism and methods build on the stochastic optimal control (SOC) framework. As discussed in Sec. I A, SOC aims to find the optimal control ut(x) that maximizes the expected cumulative reward in a stochastic environment. Like the SOC problem, the RL problem also aims to solve for optimal controls that maximize a cumulative reward. However, general RL aims to solve for optimal actions from the perspective of a decision-making entity in a new environment where both environmental statistics and rewards are unknown [97], like the robot in a new warehouse. This entity is known as an agent. Recall that, given the dynamics of the environment, a reward function, and boundary conditions, the Hamilton–Jacobi–Bellman (HJB) equation determines the value function and hence the optimal control. Its underlying recursion decomposes the value into the immediate reward and the expected value at the next state. This recursion forms the theoretical backbone of modern RL methods. In RL, finding the optimal control not only involves solving HJB but also requires the agent to accumulate experience such that finding the optimal controls is tractable. For instance, while completely random controls are very suboptimal if an agent already has access to environment dynamics and reward functions (SOC setting), such a strategy may actually be somewhat sensible in a new environment (RL setting), where random controls can help the agent explore and build a better model of the world; more generally, the agent must carefully balance exploitation (e.g. greedily navigating to states which have already been shown to lead to high total rewards) and exploration. The desiderata to maximize reward and gather data to improve controls in the future often compete, in what is known as the exploitation-exploration problem. This balancing act is a function of the restricted, harder RL problem setting and makes the SOC and the RL problem fundamentally different, despite the shared overall objective of finding optimal controls.

The central tension between exploration and exploitation is illustrated by the so-called two-armed bandit problem. An agent repeatedly chooses between two slot machines—the “two arms of a bandit”— each offering one unit of reward with a fixed but unknown probability and zero otherwise. Only the outcome of the chosen arm is observed, and the aim is to maximize the accumulated reward. Playing the arm with the larger observed average reward exploits existing information, whereas exploring the other arm ensures that the arm that has been deemed optimal with finite observations is indeed optimal. The bandit problem admits a solution to the exploration-exploitation tradeoff in a minimal setting, known as the Lai–Robbins bound [99] (in the asymptotic limit of a large number of plays). This bound shows that for strategies that learn efficiently across possible winning probabilities, the expected reward lost relative to knowing the better arm from the outset grows at least logarithmically with the number of plays. The intuition comes from the fact that large deviations in the observed reward can make a sub-optimal arm appear optimal. Sanov’s theorem, Eq. (27), tells us that the probability of the better arm producing observations that make it seem sub-optimal decreases exponentially with the number of times it is sampled, at a rate determined by the KL divergence. Such misleading data could cause the agent to neglect the better arm, with a loss that grows with the duration of play. Suppressing these rare but costly errors therefore requires continued exploration. The competition between exponentially decreasing probabilities and accumulating losses explains the logarithmic scale in the bound. Thus, successful strategies for exploration and exploitation are ones that increasingly favor the apparently better arms (or, more generally, actions) while continuing to test alternatives that the data have not yet ruled out.

1. The Markov decision process

Now that we have some intuition about the structure and fundamental challenges in the RL problem, we introduce necessary terminology to discuss key algorithms. States x are the RL vocabulary for coordinates in a particular state space 𝒳. For example, in the state space of the Cartesian plane, one possible state an agent can occupy is the origin. An environment is a space of states that an agent can navigate subject to transition dynamics k(⋅∣x,u), where the transitions are a (generally stochastic) function of the current state and current control. A reward function r(x,u) is a scalar function that takes as input a state and control and outputs a reward. Reinforcement learning is defined on discrete time steps n; we will use the subscripts xn and un to denote the states and controls at decision time tn. For finite-horizon problems, we include the timestep n in the state x throughout this section; policies and value functions therefore need no separate time subscript. An agent is a decision-making entity that executes controls in the world based on its observed transitions and rewards [97]. The controls an agent executes are known as actions u which lie within an action space 𝒰. Reactive controls are also referred to as a policy in RL, where the policy π(u∣x) is a distribution over controls conditioned on the current state x.

If the transition dynamics are Markovian – that is, if the statistics of the next state depend only on the current state and action and not any prior states and actions – the transition dynamics, reward function, state space, and action space define what is called a Markov Decision Process (MDP). If the transition dynamics are non-Markovian and rely on additional history, this problem is referred to as a Partially Observed Markov Decision Process, or a POMDP [100]. We do not consider POMDPs here, but note that effective approaches include augmenting model-free MDP algorithms with recurrent neural networks to incorporate memory [101].

For the finite-horizon formulas, let n=0,…,N label decision times tn=nΔt. The agent takes an action and receives a reward at the final step N. A policy induces a joint stateaction path law Pπx0:N,u0:N, where x0:N=x0,…,xN and similarly for u0:N.

a. The Objective.

Let π be an arbitrary policy. Denote the path measure of this policy as Pπ. Then, for some reward function r(x,u), the goal of RL is to maximize the objective 𝒥[π]:

𝒥[π]≜EPπ∑n=0Nrxn,un,maxπ𝒥[π].

In RL, it is standard to consider a cumulative reward modified by a discount factor 0<γ<1 that is taken to be close to 1. The discount factor weighs the reward and incentivizes accumulating reward sooner, rather than later:

𝒥[π]≜EPπ∑n=0Nγnrxn,un,maxπ𝒥[π].

Another way to understand the discount factor is that it imposes an independent 1-γ probability at every timestep that an agent permanently transitions to a “death” state with no reward (i.e. an absorbing state with no reward).

b. Value Functions

For the value definitions and Bellman equations in this subsection, we use the undiscounted convention γ=1. To solve the MDP, RL algorithms invoke theoretical tools from SOC. These methods rely on value estimation, where value denotes the expected cumulative future reward conditioned on a starting state x at step n, for a particular policy π:

Vπ(x)=EPπ∑j=nNrxj,uj∣xn=x. (166)

This value function is also known as a critic that critiques the “goodness” of a particular policy π at state x. For n<N, the value function satisfies the Bellman equation for policy π:

Vπ(x)=Eu~π(⋅∣x)r(x,u)+Ex′~k(⋅∣x,u)Vπx′. (167)

Here x′ denotes the next state. The optimal value function is

V*(x)=maxπVπ(x)=maxπEPπ∑j=nNrxj,uj∣xn=x, (168)

and measures the maximal cumulative expected reward achievable by a policy from a particular starting point. Like the value function in the continuous stochastic control setting, this discretized optimal value function similarly follows a recursive relationship:

V*(x)=maxur(x,u)+Ex′~k(⋅∣x,u)V*x′. (169)

This equation is known as the Bellman optimality equation, the discrete-time analogue of the Hamilton-Jacobi-Bellman equation. The Q function critiques the “goodness” of a particular policy π for some state and control:

Qπ(x,u)=EPπ∑j=nNrxj,uj∣xn=x,un=u. (170)

In other words, the Q function measures the cumulative expected reward of a policy when fixing the control at step n to u. For n<N, the Q function satisfies the Bellman equation for policy π:

Qπ(x,u)=r(x,u)+Ex′~k(⋅∣x,u)Eu′~π⋅∣x′Qπx′,u′. (171)

Here x′ and u′ denote the next state and action, respectively. The Q function also shows how to improve the policy π by scoring the values of all actions u. The simplest scheme for policy improvement is to choose, at each state x, an action that maximizes Qπ(x,u). With exact Q values, the resulting policy has expected cumulative reward at least as high as that of the original policy. However, clearly, this greedy scheme can lead to failed exploration if policy improvement is performed using an estimate of the true Q function from prior experience. Later in this section, we discuss alternative policy formulations that naturally incentivize exploration.

The optimal Q function definition directly follows:

Q*(x,u)=maxπQπ(x,u)=maxπEPπ∑j=nNrxj,uj∣xn=x,un=u. (172)

Just like the previously introduced objects, the optimal Q function also satisfies a Bellman optimality equation:

Q*(x,u)=r(x,u)+Ex′~k(⋅∣x,u)maxu′Q*x′,u′. (173)

The starting point of RL methods is based on these Bellman equations, which are the discretized analogues of the Hamilton-Jacobi-Bellman equation.

2. An overview of online RL algorithms

We explicitly consider the RL setting where an agent has access to the environment, and can actively choose transitions to gather new data. This problem setting is referred to as online RL. Key methods in this category include Soft Actor Critic (SAC) [98] and Twin-Delayed Deep Deterministic Policy Gradient (TD3) [102]. In this section, we focus on building up to the SAC method, which, in addition to being an established method for continuous control on which newer algorithms build [103], is also a Maximum Entropy RL (Max-Ent RL) method with close connections to maximum entropy inference principles discussed throughout this review. To get there, we start from basic, early precursors to SAC that do not require deep learning at all, then go through the practical considerations that ultimately culminate in SAC.

a. Tabular Q Learning.

A starting point to solve the RL optimization problem is to utilize the theoretical tools from SOC. Recall from Sec. IA that recursion provides a PDE called the Hamilton-Jacobi-Bellman equation. This PDE is a functional of the environment dynamics and the true reward function, where the solution is the optimal value function. Then, one route to find optimal controls is to first find the optimal value function, now with the Bellman Equation instead of the HJB equation, and extract the corresponding optimal control. However, the RL problem setting makes this route difficult: without access to the environment dynamics or the reward, we cannot directly solve the Bellman equation for the true optimal value function. One possible solution is to, instead, utilize some of the intuition from sampling. In RL, the agent actively collects experience that it must use to find optimal controls. When the agent executes a control at timestep n, the agent observes a transition with reward rn from state xn to the next state xn+1, which is a sample from the true environment dynamics and reward.

Recall the iterative connection between sampling and control developed in Sec. IV C: sampled trajectories update the value estimates, which guide changes to the controls, which change the next set of sampled trajectories. One route to update the value estimates and policy is to directly average the realized cumulative rewards of the current policy, improve the policy using these estimates, and then evaluate the updated policy. Evaluation and improvement thus iterate and build on each other, because changing the policy changes the expected future rewards, which is referred to as policy iteration. In the most naive approach, we can roll out M independent trajectories each starting from state x with initial control u at time tn, then follow policy π for all subsequent controls. We now switch to a discounted reward formulation, with 0<γ<1, so that rewards received later count less. Averaging the realized cumulative rewards of these rollouts gives:

Q^π(x,u)=1M∑i=1M∑j=nNγj-nrxj(i),uj(i). (174)

Then, a simple way to find a good policy based on these value estimates is to take the argmax over these estimated Q values:

u←argmaxuQ^π(x,u). (175)

However, evaluating different actions from complete rollouts can have high variance. Another approach uses a running estimate of value to replace the remainder of a trajectory [104]. Instead of sampling and summing all realized rewards after a particular state, we can directly use a running value estimate for the future returns from the next state. This substitution can reduce sampling variance at the cost of potentially introducing error from utilizing an incorrect running value estimate. The observed immediate reward r and the remaining estimated value from the next state x′ provide a new prediction for the current Q value, referred to as the target y:

y=r+γmaxu′Q^*x′,u′,forobservationx,u,r,x′. (176)

We can use these targets to update the current Q estimate, using a learning rate of ξ:

Q^*(x,u)←Q^*(x,u)+ξy-Q^*(x,u). (177)

Repeatedly updating the current Q estimate toward these target predictions converges to the optimal Q function under the assumption that every state and action is sampled infinitely often [97, 105]. Conceptually, this update can be thought of as a “backup” of value from the future value estimate to the present estimate. Because the future value is “easier” to estimate (e.g. requires aggregating rewards over fewer timesteps) and is trivial at the endpoint of a trajectory, where it becomes exactly the expected reward, this backup moves value backwards in time from the easier subproblem to harder subproblems. This intuition is also why we can refer to Hamilton-Jacobi-Bellman as a continuous form of dynamic programming and the Bellman Equation as discretized dynamic programming. Practically, a table holds these Q values, and the Bellman Backup indexes into this table and updates the value entries. As such, this algorithm is known as tabular Q-learning.

b. Deep Q-Networks.

The practical limitations of tabular Q Learning motivate the sequence of methods (Deep Q-Networks, Soft Q-Learning, and Soft Actor-Critic) we discuss below. First and foremost, storing and updating a separate Q value for every state and action in a table becomes infeasible in a large state space. Indeed, the tabular setup does not transfer to the continuous setting. Deep Q-networks (DQN) address this restriction by approximating the Q function with a neural network, allowing experience at one state to inform predictions at others [106]. We denote learned estimates of Qπ and Q* by Qθπ and Qθ*, where θ denotes the network weights.

DQN fits a neural-network estimate Qθ* of the optimal Q function using all of an agent’s prior observations – including transitions and observed rewards – aggregated within a replay buffer 𝒟. Rather than do tabular updates of the value functions following the Bellman equation, DQN directly minimizes the “error” between the value function and the recursed form of the value function over this replay buffer of all past experiences, which is amenable to neural network parameterization:

L(θ)=12Ex,u,r,x′~𝒟[Qθ*(x,u)-r+γmaxu′Qθ‾*x′,u′2,θ←θ-ξ∇θL(θ).

The notation θ‾ means that gradients cannot flow through the parameters in the target. The reason for this “stop gradient” is to force value to flow backwards in time: the value at time t should not be updated with the rewards that occurred before time t. While tabular Q learning provably converges, DQN does not provably converge without additional assumptions due to function approximation error [106, 107].

3. MaxEnt RL & Soft Q-learning

We now return to the undiscounted convention γ=1 for the MaxEnt derivation and the two algorithms below. Throughout the remainder of the RL section, Qπ and Vπ denote entropy-regularized (“soft”) values. The entropy coefficient α has the same units as the per-step reward; it is distinct from the convexity parameter used in Wasserstein geometry.

Learning values alone does not ensure that the agent explores, as is shown in Fig. 9. Indeed, the tabular Q-learning algorithm can only guarantee convergence if the policies visit every state infinitely often. In large state spaces, this condition can be impossible to satisfy even with random actions. Furthermore, always choosing the action with the largest estimated Q value can ignore routes with activation energy. In RL, a common heuristic for exploration is to take a random action a small, epsilon proportion of the time. This strategy is called epsilon-greedy exploration where, typically, the probability epsilon goes to 0 over the course of training [97, 106]. This exploration mechanism can be thought of as a heuristic version of simulated annealing. Later works employ Maximum-entropy RL (MaxEnt RL) to control exploration in a more principled way, incorporating the policy Shannon entropy Hπ⋅∣xn in the objective itself:

𝒥[π]≜EPπ∑n=0Nrxn,un+αHπ⋅∣xn (178)

where α is a temperature that controls the strength of the entropy term. This approach encourages the policy to spread out actions while exponentially weighting those with high expected reward. Here, we discuss Soft Q-learning, one of the early examples of MaxEnt RL that utilizes entropy as a principled mechanism to encourage exploration [108].

The crux of MaxEnt RL is the idea that the policy should induce the maximum-entropy path measure, where the energy of the measure is the expected cumulative reward. Crucially, MaxEnt RL has close connections to control as inference principles (Sec. I C). In fact, one can derive the soft Q-learning objective to learn optimal policies directly from a maximumentropy inference problem over path measures [20]. We lay out this derivation here, connecting MaxEnt RL to the approaches and perspectives discussed previously in the review.

The inference-as-control problem begins with a definition of a path measure induced by a particular control policy. If this path measure exhibits mean observables (for example, the Schrödinger Bridge problem), and these moments are all that is known about the realized trajectories, Sanov’s theorem states that the most likely path measure is the maximum entropy distribution that satisfies these moments. Each of these observables corresponds to a Lagrange Multiplier r that enforces this constraint, and the resulting max-ent path measure is:

Pu*[x(⋅)]∝P0[x(⋅)]exp∑mrmam[x(⋅)], (179)

Here am[x(⋅)] is the m-th observable measured along a trajectory. The Lagrange multiplier rm enforces a contraint on the averaged observable, as in Sec. IC. Thus, these approaches give controls u that give a max-ent realization of these observables.

In the control setting, we instead wish for the path measure to satisfy particular observations – for example, that the path measure realizes a high expected cumulative r for some fixed reward function. The rewards r no longer directly result from enforcing specific observables (e.g. termination within a particular set). Therefore, despite MaxEnt RL optimizing path measures that look identical to the control-as-inference approach, maximum entropy is a postulate of the MaxEnt RL approach – there is not a fundamental physical principle like Sanov’s theorem for fixed observables that underlies the MaxEnt RL formulation.

To derive the MaxEnt RL objective, we now express the continuous-time path measures above using the discrete-time MDP notation introduced in Sec. V A 1. As an example, the controlled stochastic dynamics of Sec. IA

x˙t=ftxt+utxt+εηt

discretized by an Euler–Maruyama step of duration Δt result in the Gaussian transition kernel:

kx′∣x,u=𝒩x′;z+ftn(x)+uΔt,εΔtI. (180)

where 𝒩 denotes the Gaussian density for the physical coordinates, where I is the identity matrix. Then, an agent executes controls and transitions according to this discretized transition kernel. When an agent visits the pair (x,u), the agent receives a reward r(x,u). Together, the kernel (or transition dynamics), the reward, and the state and action spaces define the finite-horizon Markov decision process (MDP), thus showing how the continuous control problem becomes the MDP.6 The policy πun∣xn denotes the agent’s probability of choosing action un in state xn at step n and plays the role of the control law ut(x). Iteratively combining the transition kernel and the policy through time gives the discrete-time analog of the controlled path measure Pu[x(⋅)], which now induces a measure over discretized trajectories xn,un:

Pπx0:N,u0:N=p0x0∏n=0Nπun∣xn∏n=0N-1kxn+1∣xn,un, (181)

and the analog of the reference measure P0[x(⋅)] is the measure of the passive dynamics with uniform action distribution π0un∣xn=c0:

P0x0:N,u0:N=p0x0∏n=0Nπ0un∣xn∏n=0N-1kxn+1∣xn,un. (182)

Say that we wish to find controls that lead to large rewards. One way to do so is to construct a target measure that upweights high-reward trajectories, then regress the control-induced path measure towards this target measure for the training objective. Following the maximum entropy postulate in the MaxEnt RL approach, one possible choice for this target measure is (a possibly unrealizable) maximum-entropy, reward-maximizing path measure with respect to a base measure P0x0:N,u0:N:

P*x0:N,u0:N≜argmaxPEP1α∑n=0Nrxn,un-DKLP‖P0=1ZP0x0:N,u0:Nexp1α∑n=0Nrxn,un. (183)

Here the maximization over P is over normalized path measures. P* is the reward-tilted target measure and α is a temperature that controls the strength of the tilt. Importantly, this P* is the theoretically optimal max-ent target distribution and need not be achievable by a particular policy. In practice, the rewards are only observed, as the agent does not have a priori access to the true reward function following standard RL assumptions. We seek a policy whose path measure approximates this target, where the limited policies can only determine the executed controls, not the dynamics of the system. The optimal policy for this inference objective therefore produces the closest realizable path measure, which is the minimizer of DKLPπ‖P*7:

π*≜argminπDKLPπ‖P* (184)

Note that the path distribution Pπ* is the closest realizable distribution and need not equal P*. Thus, we have derived an inference objective that should provide high-reward, maximum-entropy controls. What is the relationship between this inference objective and the MaxEnt RL objective? It turns out that in discrete time, the transition kernels cancel in the ratio of the two measures, which “simplifies” this inference into the MaxEnt RL objective. The result is shown in Eq. (185), Here Hπ⋅∣xn=-Eu~π⋅∣xnlogπu∣xn denotes the Shannon entropy of the policy at state xn and step n and the normalizing constant Z is independent of π. Minimizing the KL divergence is therefore equivalent, up to the positive factor 1/α and the additive constant logZ-(N+1)logc0 (neither of which should change the fixed point), to maximizing the maximum-entropy RL objective:

𝒥[π]≜EPπ∑n=0Nrxn,un+αHπ⋅∣xn. (186)

Thus, as desired, we have theoretically derived the maximum-entropy RL objective from MaxEnt inference principles. As a note, Eq. (186) has the same free-energy structure as entropic transport in Eq. (81), with negative reward playing the role of cost and temperature α the role of ε. Maximum-entropy RL introduces the entropy bonus in Eq. (186) as a regularizer that aids robustness [109] and exploration [98]. In the above derivation, we show that the entropy bonus emerges directly from the inference problem following Ref. [20]: the entropy bonus is the KL cost of deviating from the base dynamics, now without any assumption of Brownian noise. With Brownian noise, the same divergence reduces to the quadratic control cost of Eq. (51).

FIG. 10.

FIG. 10.

Eq. (185). As the reader can see, RL-notation is no joke.

While the above derivation gives the MaxEnt RL objective, it is unclear how to practically solve this maximization. In continuous time, we solved the KL control problem of Eq. (52) by dynamic programming, arriving at the HJB equation linearized using the Cole–Hopf transformation Vt*(x)=logψt(x) (Eq. (58)). The same transformation in discrete time leads to soft Q-learning [108], the MaxEnt RL variant of Q-learning [105]. The central object is the soft Q function, the action-conditioned, maximum-entropy counterpart of the value function with the state and the first action both held fixed:

Qπ(x,u)=r(x,u)+EPπ∑j=n+1Nrxj,uj-αlogπuj∣xj∣xn=x,un=u. (187)

The soft Q and soft value functions are related by

Vπ(x)=Eu~π(⋅∣x)Qπx,u-αlogπ(u∣x). (188)

Here Qπ excludes the entropy contribution of the fixed current action, while Vπ includes the current entropy contribution. By construction, Qπ satisfies the “soft” Bellman Eq. (189),

Qπ(x,u)=r(x,u)+Ex′~k(⋅∣x,u)Eu′~π⋅∣x′Qπx′,u′-αlogπu′∣x′. (189)

with the boundary condition Qπ(x,u)=r(x,u) at the final step N. Then, the optimal policy maximizes the conditional expectation on the right-hand side of Eq. (189), the expected Q value plus the policy entropy, independently at the next states x′. Setting the variation with respect to πu′∣x′ to zero gives a Boltzmann distribution over actions,8

π*(u∣x)=eQ*(x,u)/α∑veQ*(x,v)/α. (190)

Substituting π* into Eq. (189) then reveals an alternative form of the soft Bellman equation, assuming that the policy π is the true Boltzmann distribution:

Q*(x,u)=r(x,u)+Ex′~k(⋅∣x,u)αlog∑u′eQ*x′,u′/α. (191)

Thus, if the policy π* is known exactly, fixing (x,u) leaves the environment transition kx′∣x,u as the only remaining source of randomness in this backup.

Eq. (191) is the discrete counterpart of the max-ent HJB equation after the Cole–Hopf transformation, providing a consistency equation whose right-hand side is a conditional expectation under the path measure. In continuous time, we solved the consistency equation with explicit knowledge of the dynamics and the reward. In RL, neither is known, but every observed transition x,u,r,x′ provides a one-sample Monte Carlo estimate of the right-hand side, giving an update rule:

y=r+αlog∑u′eQ^*x′,u′/α,Q^*(x,u)←Q^*(x,u)+ξy-Q^*(x,u). (192)

Here, Q^* is the learned estimate of Q* and ξ is the learning rate. This update rule is the soft Q-learning algorithm (Algorithm 1), where the log-sum-exp is a softened maximum. As the temperature α→0, the softened maximum in the log-sum-exp becomes a hard maximum, recovering standard tabular Q-learning [105].

Soft Q-learning [108] has formed the basis for many popular RL algorithms, in which a neural network Qθ* approximates the soft Q function using the update rule in Eq. (192). Implementation details, such as the use of replay buffers and target networks, are important for getting these algorithms to work in practice.

Algorithm 1.

Soft Q-learning

Initialize Qθ* and replay buffer 𝒟; fix temperature α>0 and learning rate ξ
for each iteration do
 Collect experience: Run πθ(u∣x)∝eQθ*(x,u)/α, and store x,u,r,x′ in 𝒟
 Sample past experience: x,u,r,x′~𝒟
 Q target: y=r+αlog∑u′eQθ*x′,u′/α
 Update Q: θ←θ-ξ∇θQθ*(x,u)-y2, holding y fixed
end for

4. Soft actor-critic

Each update must still evaluate the log-sum-exp over every action, which is cheap for a few discrete actions. With continuous actions, the sum becomes an integral, and computing the Q-conditioned partition function ZQ(x)=∫dueQ(x,u)/α can become intractable and high-variance as the action dimension grows due to the curse of dimensionality. This curse makes it difficult to evaluate the normalized Boltzmann policy πQ(u∣x)=eQ(x,u)/α/ZQ(x) defined by the current critic Q, or the soft value αlogZQx′ on the right-hand side of the backup in Eq. (191).

This leads to Soft Actor-Critic (SAC), which learns a policy together with the value estimate [98]. The iteration in Algorithm 2 alternates between updating the critic’s estimate of value under the current policy and improving the policy using that estimate, with entropy included in both steps. The parameterized actor πθ aims to fit the true Boltzmann target πQ defined by the current critic Q. Simultaneously, the learned critic Qθπ aims to fit the value induced by the current policy πθ.

The unknown reward function and transition dynamics are only available through samples. Each observed transition supplies r and x′. Thus, the integral in ZQx′ can nevertheless remain intractable even when the current critic Q is directly evaluable. To address this integration problem, consider the Boltzmann policy πQ defined above. Suppose we could draw the next action u′ from πQu′∣x′ and evaluate its log density. A single draw would then replace the log-sum-exp, because substituting logπQu′∣x′=Qx′,u′/α-logZQx′ gives

Qx′,u′-αlogπQu′∣x′=Qx′,u′-αQx′,u′α-logZQx′=αlogZQx′ (193)

for every sampled u′. Thus, with an exact πQu′∣x′, this difference is independent of the sampled action u′ and provides a zero-variance estimate of the soft value function. In practice, we do not have access to the true Boltzmann πQ, so the estimator is not variance-free. Soft actor-critic [98, 110] keeps the combination Qx′,u′-αlogπϕu′∣x′ as the estimate of the soft value. Evaluating the normalized density πQ itself requires the same intractable partition function ZQ(x). Soft actor-critic therefore draws u′ from a second network, a policy πϕ(u∣x) with a tractable form, trained to stand in for πQ. This substitution turns Eq. (191) into the practical target used in the critic update in Algorithm 2

y=r+Qθπx′,u′-αlogπϕu′∣x′,whereu′~πϕ⋅∣x′. (194)

where, like Soft Q-learning, the learned Q function Qθπ is directly regressed towards the target. Then, training πϕ to maximize

maxϕEu~πϕ(⋅∣x)Qθπx,u-αlogπϕ(u∣x). (195)

is equivalent to minimizing DKLπϕ‖πQ, since the actor objective equals -αDKLπϕ‖πQ+αlogZQxk at fixed xk. Thus, for a fixed critic Q, the policy objective corresponds to projecting the learned policy πϕ onto the Boltzmann policy πQ. However, in practice, the critic estimate Qθπ can be noisy. Then, targets built from a maximum, or a soft maximum, of the estimates inherit an upward maximization bias. Practical implementations reduce overestimation by training two Q networks and using the smaller of the two targets, adding back in some pessimism [98].

Algorithm 2.

Soft Actor-Critic

Initialize critic Qθπ, actor πϕ, and replay buffer 𝒟; fix temperature α>0
for each iteration do
 Collect experience: Run πϕ, observe x,u,r,x′, and store in 𝒟
 Sample past experience: x,u,r,x′~𝒟
 Sample u′~πϕ⋅∣x′
 Critic target: y=r+Qθπx′,u′-αlogπϕu′∣x′
 Update critic: θ←θ-ξ∇θQθπ(x,u)-y2, holding y fixed
 Update actor:
  ϕ←ϕ+ξ∇ϕEv~πϕ(⋅∣x)[Qθπx,v-αlogπϕ(v∣x)
end for

Solving a fixed-point equation by stochastic approximation raises the question of convergence. When the algorithm stores one Q value per state-action pair, the update converges to the optimal Q function [105, 111], and similar guarantees exist for simple function classes such as linear MDPs [111, 112]. In continuous or high-dimensional settings, however, the algorithm cannot enumerate every state-action pair and must instead approximate Q* with a parametric function such as a neural network. Unfortunately, the convergence guarantee does not generally survive function approximation [107], and the failure is visible in practice. A standard benchmark is mountain car [113], an underpowered car on a sinusoidal hill that must accelerate back and forth to build enough energy to reach the top. Even in mountain car, learned RL solutions show a large gap from the known optimal control solution [114]. Thus, modern RL methods learn controls from samples alone and approximate intractable objects, at the cost of the exactness guarantees of the earlier control methods.

B. Wasserstein gradient flows

In this section, we examine three classes of applied problems for which Wasserstein geometry and Wasserstein gradient flows provide elegant solutions. The first problem is the numerical integration of Fokker-Planck equations, in which the Wasserstein geometry yields a powerful integration algorithm known as the Jordan-Kinderlehrer-Otto (JKO) scheme. Second, we discuss modeling the dynamics of many interacting particles, particularly the regime known as the mean-field limit in which each particle effectively interacts with a continuous density. The collective evolution of the particle density often takes the form of Wasserstein gradient flow, and this perspective has yielded insights into the training of wide neural networks, in which the parameters can be thought of as particles. Finally, we discuss the general problem of variational inference (VI), in which a complex distribution is approximated by a simpler one that can be used for sampling. The problem of finding the optimal parameters can be viewed as an instance of Wasserstein gradient flow, and this perspective yields physical intuition and stable algorithms. As we will see, variational inference as discussed in this section forms an “equilibrium” methodology, whose “non-equilibrium” counterparts are powerful, contemporary algorithms discussed in Sec. V C on flows and diffusion.

1. The Jordan-Kinderlehrer-Otto (JKO) scheme

The JKO scheme is a canonical example of using Wasserstein geometry to tackle numerical challenges, resulting in algorithms that are often more efficient, stable, and interpretable. Consider the general problem of numerically solving Fokker-Planck equations (FPE) driven by a conservative flow and constant diffusivity, which take the form:

∂ρt(x)∂t=∇⋅ρt(x)∇Φ(x)+∇2ρt(x) (196)

The unit diffusion coefficient corresponds to ε=2 in the convention of Chapter I. It may be tempting to numerically solve Eq. (196) by an explicit finite step update:

ρ(k+1)(x)=ρ(k)(x)+Δt∇⋅ρ(k)(x)∇Φ(x)+∇2ρ(k)(x) (197)

where ρ(k)(x)=ρkΔt(x) is the numerical discretization and Δt is the step size. While conceptually straightforward, this direct approach and those like it encounter certain challenges. First, under Eq. (197), ρ(k) is not guaranteed to be either positive or normalized, which is particularly problematic if ρ(k) represents a probability distribution. Second, one must explicitly compute derivatives of ρ(k)(x), which is costly in high dimensions and can introduce instabilities if ρ(k)(x) naturally concentrates onto singular manifolds such as points or lines. Third, the algorithm only converges for sufficiently small Δt. Fourth, the continuous-time FPE takes the form of a Wasserstein gradient flow v=-∇Wℱ, yet under Eq. (197), ℱ need not monotonically decrease at finite Δt.

Jordan, Kinderlehrer, and Otto proposed an integration scheme that overcomes these shortcomings [45]. It has two ingredients. First, the algorithm is variational: it breaks the numerical integration into a sequence of optimization problems. For intuition, consider integrating an ODE x˙=-∇Φ(x). A variational approach takes the form

x(k+1)=argminxx-x(k)22Δt+Φ(x) (198)
≈argminxx-x(k)22Δt+Φx(k)+x-x(k)⋅∇Φx(k) (199)
=x(k)-Δt∇Φx(k) (200)

which recovers the expected Euler update as Δt→0. As another example, the diffusion equation ∂tρ=∇2ρ, i.e. Eq. (196) with Φ=0, can readily be put in variational form:

ρ(k+1)=argminρρ-ρ(k)L222Δt+∫|∇ρ(x)|2dx (201)

where ‖f‖L22=∫dx|f(x)|2 is the squared L2 norm of f. While Eq. (201) is certainly variational, it still suffers some of the practical and conceptual limitations of Eq. (197). Practically, one still needs to compute derivatives of ρ, and Eq. (201) can only capture Eq. (196) with ∇Φ=0, i.e., there is no way to amend the action of Eq. (201) to account for the drift term ∇⋅(ρ∇Φ). Conceptually, there is no reason to think of ρ as a probability distribution in Eq. (201): both the L2 norm and the functional in the second term make sense even when ρ is non-normalized or negative. In this sense, Eq. (201) emphasizes a particular interpretation of the diffusion equation — it punishes gradients. But we also know that diffusion has a probabilistic interpretation: it promotes randomness, thereby increasing entropy. Is there a version of Eq. (201) that emphasizes this interpretation?

These shortcomings are addressed by the second ingredient of the JKO scheme. Namely, one replaces the L2 norm in Eq. (201) with one that is adapted to probability: the Wasserstein distance. In doing so, one also replaces the gradient penalty with a thermodynamically meaningful quantity: the free energy. The resulting update scheme takes the form

ρ(k+1)=argminρW22ρ(k),ρ2Δt+ℱ[ρ] (202)

Eq. (202) has several advantages. First, it accommodates both drift and diffusion within a single variational principle, and it has a clear probabilistic interpretation: descend ℱ as fast as possible while not changing ρ too much in the Wasserstein sense. This change in conceptual approach also resolves the practical issues arising in Eq. (197): ρ(k) is guaranteed to remain a valid probability distribution for all k, the integration is stable, and ℱρ(k) is guaranteed to decrease monotonically for all Δt. Moreover, Eq. (202) has the advantage of being derivative-free — the gradients and divergences of Eqs. (197)–(201) are replaced by an optimal transport problem [115]. In particular, the JKO scheme can be brought to the Benamou-Brenier form [116] (see Sec. II B), which allows one to rigorously take the continuum (Δt→0) limit, as well as to introduce efficient optimization methods [115] such as the Sinkhorn algorithm or point-mass approximations. The clear geometric motivation behind Eq. (202) also results in better interpretability; for instance, one can write down explicit formulas for the implicit bias (i.e., effective modifications of ℱ) introduced at finite Δt [117].

As a practical matter, the JKO scheme tends to shine in the following contexts. In very high dimensions, explicit spatial derivatives or spectral methods become computationally expensive, whereas solving the optimal transport problem at each time step remains comparatively efficient using particle-based or other methods. Another context where JKO is helpful is when ρ(x) has finite or irregular support, which is difficult to accommodate with spectral or other grid-based methods but is naturally handled by optimal transport optimization. Finally, JKO handles pattern-forming PDEs well, particularly when mass tends to aggregate onto singular points, lines, or manifolds. In short, JKO offers a practical advantage in high dimensions, with irregular boundaries, or in mass-concentrating situations.

2. The mean-field limit of interacting particles

Now we study how WGF helps us understand the dynamics of the interaction of many identical particles, particularly the so-called mean-field limit, in which the dynamics of the individual particles can be replaced by the dynamics of a coarse-grained density. This limit is of fundamental interest in mathematical physics (e.g., how do continuum theories like fluid mechanics rigorously emerge from interacting particles?), and in practical applications, such as the training of wide neural networks, in which the neurons are viewed as interacting particles. In certain situations, the coarse-grained density obeys WGF, which is typically simpler to analyze than a full many-body system and offers geometric intuition that underlies convergence theorems. For example, this approach allows one to prove under what conditions training a wide two-layer NN converges to global minima of its loss.

The mathematical setting of interest is a collection of Np interacting particles with coordinates xt(1),…,xtNp, obeying the following Langevin dynamics:

dxt(i)=-∇iΦNpxt(1),…,xtNpdt+εdWt(i) (203)

where dWt(i) are independent Wiener processes and ∇i means that the gradient is evaluated with respect to argument i. To permit a mean-field limit, we assume that the particles are “identical” in the sense that their potential is only a function of their unlabeled density. That is, we can write ΦNpxt(1),…,xtNp=𝒱ρ^t where

ρ^t(x)=1Np∑i=1Npδx-xt(i) (204)

is the empirical probability measure, normalized to one. We reserve ρt for the continuous mean-field density and Np is the particle count. A common class of such interactions consists of single- and two-particle potentials:

ΦNpx(1),…xNp=∑iΦx(i)+12Np∑i,jUx(i),x(j)=Np∫Φ(x)ρ^(x)dxNp2∫U(x,y)ρ^(x)ρ^(y)dxdy≡𝒱[ρ^] (205)

where we assume U(x,x)=0 to exclude self interactions. Now Let’s assume that the initial positions of the particles are drawn independently from a continuous density ρ0, namely x0(i)~iidρ0. The mean-field limit boils down to the following approximation: instead of tracking all the individual particles, one tracks the evolution of the continuous density. More precisely, one assumes that at a later time t, the particles are once again independently and identically distributed, but now according to an updated density ρt. A representative particle xt, for which ρt is the distribution, evolves according to

dxt=-∇W𝒱ρtxtdt+εdWt (206)

where ∇W𝒱=∇(δ𝒱/δρ) is the Wasserstein gradient introduced in Sec. II C. Eq. (206) is often referred to as a McKean-Vlasov process [118], and is simply a rewriting of Eq. (203) in which the particle label has been dropped, and the potential is expressed in terms of the continuous density ρt instead of the empirical density ρ^t. Qualitatively, Eq. (206) mathematizes the intuition that as Np→∞, the typical particle xt effectively interacts with an average continuous field ρt of particles. The corresponding Fokker-Planck equation for ρt is given by:

∂tρt=∇⋅ρt∇Wℱρt=∇⋅ρt∇W𝒱ρt+ε2∇2ρt. (207)

where ℱ=𝒱-ε2H and Hρ=-∫ρlogρdx is the entropy. Eq. (207) is sometimes referred to as a McKean-Vlasov equation9, and it precisely takes the form of WGF. Whether and for what values of Np and t the mean-field approximation is a good approximation is a field of mathematical research known as propagation of chaos [119].

As a practical example, the WGF structure of Eq. (207) has been useful in analyzing the training dynamics of large machine learning (ML) models such as neural networks (NNs) [120–123]. Large ML models are often trained by defining a loss function and performing versions of gradient descent, e.g., Stochastic Gradient Descent (SGD) or Adaptive Moment Estimation (Adam), in their parameters. For a large but finite number of parameters, the loss landscape typically features many saddles, large manifolds of degenerate minima, and different minima-manifolds separated by shallow barriers. These features make the convergence of gradient descent difficult to analyze. However, when many of the parameters enter the loss identically, such as in a very wide NN, an Np→∞ limit can be taken, allowing one to analyze the evolution of the density ρt of the parameters over training time. The density ρt generally obeys WGF and the functional ℱ that it minimizes is generally much simpler than the loss landscape governing the evolution of a finite number Np of parameters. This simplification allows convergence results to be obtained. It should be noted that there is an older collection of results, sometimes referred to as Universal Approximation Theorems [124–126], that ask which classes of functions can be approximated by a given ML architecture. The question at stake here is perhaps even more relevant: under what conditions are these functions actually reached via training?

To illustrate typical ingredients of such an approach, consider a two-layer neural network

fNpx;Θt=1Np∑i=1Npwt(i)φx;zt(i) (208)

In Eq. (208), fNpx;Θt is the model to be trained. Here φx;zt(i) is a nonlinear function, referred to as a “feature”, with weight wt(i) and internal parameters zt(i). All the parameters of fNp may be collected in a single vector Θt=θt(1),…,θtNp where θt(i)=wt(i),zt(i). The parameters are given a time index t because they will evolve over training. The function fNPx;Θt is trained to approximate a target function y(x) with x distributed according to a density ν(x). This is done by minimizing a loss function LΘt, a common choice for which is the mean-squared error (MSE):

LΘt=12∫y(x)-fNpx;Θt2ν(x)dx=12Eνy-ftNp2 (209)

where ftNp=fNp⋅;Θt for brevity. The loss is minimized by using some form of gradient descent, typically with stochasticity. For instance

dθt(i)=-Np∇iLdt+εdWt(i) (210)

The factor Np compensates for the 1/Np in the network output: differentiating L with respect to one neuron’s parameters produces a factor 1/Np. Multiplying the learning rate by Np therefore keeps each neuron’s drift of order one as the network grows. In practice, more practical forms of gradient descent are used, for instance stochastic gradient descent in which stochasticity does not come from a Wiener process dWt(i), but from using finite sample-size Monte Carlo estimates of the loss. Regardless of the precise method, the loss L is a complicated, nonconvex function of the parameters Θt, so proving (or understanding) anything about training may at first seem to be a daunting task.

To gain intuition, we can think of each neuron i as being a particle with coordinate θt(i), and (noisy) gradient descent, e.g. Eq. (210), as introducing interactions between the particles. For the two-layer neural network, the key insight is that Eq. (208) can be written as a function of neuron density only:

fNpx;Θt=∫a(x;θ)ρ^t(θ)dθ (211)

where θ=(w,z),a(x;θ)=wφ(x;z), and ρ^t(θ)=1Np∑i=1Npδθ-θt(i) is the empirical distribution of the parameters. Because fNp only depends on the density of parameters, the loss LΘt can also be expressed in terms of the density alone. For example, the MSE becomes:

LΘt=ℒρ^t=∫Φ(θ)ρ^t(θ)dθ+12∫Uθ,θ′ρ^t(θ)ρ^tθ′dθdθ′+Cy (212)

where Φ(θ)=-Eν[y(x)a(x;θ)] and Uθ,θ′=Eνa(x;θ)ax;θ′ are single- and two-particle potentials, and Cy=12Eνy(x)2 is independent of θ. The fact that the interactions only depend on the density ρ^(θ) makes the convergence of training dynamics amenable to mean-field-based proof techniques.

The exact convergence statements proven in the literature [120–123] require some mathematical formalism to state precisely, and depend on the exact technical hypotheses placed on the features φ, the loss L, and the training algorithm. There are, however, some shared ingredients: one typically assumes that the network is “initialized” by drawing initial parameters, θ0(i), independently from a well-behaved distribution ρ0, typically obeying some precise regularity conditions. One is then interested in the evolution of the coarsegrained distribution ρt, which obeys a McKean-Vlasov equation, whose precise form depends on the exact architecture, loss, or version of gradient descent under consideration. Typically, the McKean-Vlasov equation can be interpreted in terms of WGF of a functional ℱ,∂tρt=∇⋅ρt∇Wℱρt, where ℱ consists of the loss ℒ plus entropic terms arising from stochasticity. The dynamical problem of training the neural network is then mathematically transformed into studying the comparatively simple geometric and topological properties of ℱ. While the functional ℱ is not necessarily geodesically convex in the Wasserstein sense, it often permits enough structure to make mathematical statements about convergence to global minima for ρ0 obeying suitable conditions. The conditions placed on ρ0 for convergence are of some practical use, because they can be interpreted as instructions on reasonable ways to initialize the NN for training. Intuitively, WGF is the right mathematical framework for analyzing these problems because of the underlying physical picture: the parameters θt(i) are particles, but these particles cannot jump, or be created or destroyed. Therefore, continuous motion of a density, i.e. WGF, naturally emerges.

To give a sense of the results proven, Ref. [122] considers a quadratic loss and training via either stochastic gradient descent or noisy stochastic gradient descent; for the latter case, they prove that any absolutely continuous ρt converges to a unique global minimum of ℱ that controllably approximates the MSE. They also prove that ftNp converges to the Np→∞ limit with bounds on the rate of convergence as a function of Np and training time t. Ref. [121] considers models of the form of Eq. (208) with technical hypotheses on the forms of the nonlinearity and data distribution, and identifies convergence to a global minimum, and studies the size of fluctuations for finite Np and t. Ref. [120] provides convergence proofs for exact gradient descent for a class of architectures and loss functions defined by the property that the functional ℱ they give rise to obeys certain homogeneity conditions.

A couple of additional general remarks are in order. First, the mean-field approach based on a single density of neurons works for a two-layer neural network, but deeper networks require additional information about the connections between layers. Mean-field methods have been extended to these settings, with different assumptions and conclusions [127, 128]. Second, there is a common source of confusion: one observes that ℒ in Eq. (212) is manifestly convex in the parameter density ρ, i.e. ℒλρ′+(1-λ)ρ≤λℒρ′+(1-λ)ℒ[ρ] for any two densities ρ,ρ′ and λ∈[0,1]. While true, this mixture-interpolation notion of convexity is not the useful one for training based on gradient descent. Under gradient descent, the parameters flow along Wasserstein gradients, not weighted mixtures, and they certainly do not teleport (as is sometimes required for interpolation). Therefore, convexity with respect to Wasserstein geodesics is the useful mathematical framework to use, and one cannot directly conclude that ρt converges to a unique global minimum under training due to interpolation convexity. Finally, one might wonder: why not freeze the internal parameters zt(i) and only optimize the feature weights wt(i)’s? After all, the MSE loss LΘt is explicitly convex in wt(i). This approach, often referred to as kernel regression, is certainly feasible, but it suffers from two drawbacks. First, a much larger Np is required for kernel regression to approximate the Np=∞ global minimum [120]. Second, kernel regression exhibits a different implicit bias: when both the w’s and the z’s are dynamic, it is observed that the network learns comparatively sparse distributions for the wt(i)’s, and the selected features φx;zt(i) have been updated via zt(i), and thus tend to be informative about the learned properties of the data. When only the zt(i)’s are frozen, the learned distribution over the w’s tends to be broader and, by construction, no individual feature φx;zt(i) reveals properties about the data. Whether ingredients from the mean-field approach can be extended to other architectures remains an open question.

3. Variational inference

Our final example of applications of WGF is to variational inference (VI) [129]. VI addresses the following challenge: one is confronted with a probability density p1=p~1/Z1 that is difficult to sample from and whose unnormalized form p~1 may be all that is available; however, we assume that we have access to a family of distributions pθ defined by a finite number of parameters θ, and that the pθ are easy to normalize and sample from, e.g. the family of Gaussians. Our goal is to find the optimal parameters θ* such that pθ* best approximates p1. This arises, for example, in Bayesian settings, in which one has a prior p0(x) and observations A, and one would like to sample from the posterior p1(x)=p(x∣A)=p(A∣x)p0(x)/p0(A), where the normalization constant p0(A)=∫p(A∣x)p0(x)dx is often intractable. It is also thematically related to variational methods in quantum mechanics or statistical physics, in which the ground state of a model may be approximated by an ansatz featuring only a few parameters.

For the connection to WGF, we are interested in the setting where “best approximation” is defined as minimizing the Kullback-Leibler divergence

θ*=argminθDKLpθ‖p1 (213)

As noted earlier in the review, the gradient of DKLpθ‖p1 with respect to θ is independent of Z1=∫p~1dx, which is often infeasible to compute. One tempting option to minimize Eq. (213) is to simply perform gradient descent in the parameters, i.e.

θ˙=-∇θL(θ) (214)

with L(θ)=DKLpθ‖p1. However, in practice, this naive parameter-centric approach is often problematic. The loss L(θ) may be poorly conditioned and nonconvex. Moreover, certain families of probability distributions are only well defined on a subset of parameters; for instance, a Gaussian distribution is only well defined if its covariance matrix is positive-definite. Unfortunately, Eq. (214) may lead to violations of these constraints. Finally, if one were to reparameterize the same family of probability distributions, Eq. (214) would yield a different trajectory through probability space—so Eq. (214) lacks parameterization invariance.

Wasserstein geometry is useful in addressing these issues. For convenience, write p1(x)=e-Φ(x)/Z1, with dimensionless potential Φ=-logp~1, and write

ℒpθ=DKLpθ‖p1=∫Φ(x)pθ(x)dx+∫pθ(x)logpθxdx+logZ1. (215)

It seems that one approach to minimizing DKLpθ‖p1 would be to perform Wasserstein gradient flow down the functional ℒpθ, namely update pθ according to ∇⋅pθ∇Wℒpθ. Yet, there is a fundamental problem: there is no guarantee that one can find a trajectory of parameters θt such that θ˙⋅∂θpθ=∇⋅pθ∇Wℒpθ. In other words, the naive WGF may induce a flow field that flows out of the subspace of probability distributions defined by the parameters θ.

The resolution is to project the Wasserstein descent velocity onto the tangent space of the parametric family. Recall from Sec. II C that a density tangent is represented by a minimum-energy velocity v=-∇χ, so ∂tpt=-∇⋅ptvt. The inner product of two such velocities at density p is

v,v′p=∫pxvx⋅v′xdx. (216)

Consider a parametric family ℳ=pθ:θ∈Ω, where Ω is a parameter domain of dimension dθ. In local coordinates θ=θ1,…,θdθ, define velocities vi=-∇χi by ∂θipθ=-∇⋅pθvi. They induce the metric gij=vi,vjpθ. The projection of a velocity field v is

projℳv=∑i,jvig-1ijvj,vpθ. (217)

The projected descent velocity is -projℳ∇Wℒpθ, and its density evolution is

∂tpθt=∇⋅pθtprojℳ∇Wℒpθt. (218)

Writing L(θ)=ℒpθ, the same evolution in parameter coordinates is

θ˙i=-∑j=1dθg-1ij∂θjL(θ). (219)

Comparing Eq. (219) to Eq. (214), the metric induced by Wasserstein geometry essentially acts to redirect the gradients with respect to θ. Moreover, one can show that Eq. (219) is equivalent to a parametric version of the JKO style update introduced in Sec. V B 1

θt+Δt=argminθW22pθt,pθ2Δt+ℒpθ (220)

in the limit Δt→0.

So what does all this formalism buy us? The minimization algorithm in Eq. (218), or equivalently Eq. (219), comes with elegant convergence guarantees. Recall from Sec. II C that the functional ℒ can have a notion of convexity (namely α-geodesic convexity) completely analogous to convexity in finite-dimensional optimization, and that this notion of convexity ensures that WGF converges to its global minimum. Recall also from Sec. II C that ℳ is a geodesically convex subset of probability distributions if it contains the entire Wasserstein geodesic between any two of its elements. One can show that whenever ℳ is geodesically convex and ℒ is α-geodesically convex, the projected WGF in Eq. (218) is guaranteed to reach its unique minimum on ℳ, and do so exponentially fast. Especially important in the context of VI is that the loss ℒ in Eq. (215) is in fact α-geodesically convex whenever p1 is strongly log-concave, which means that it is written as p1∝e-Φ for some α-convex Φ (see Sec. II C for the definition of α-convex). So in short, one can use the structure of Wasserstein geometry to turn the problematic optimization in Eq. (214) into a well-behaved one.

Let’s explore two pedagogical examples of parametric subspaces. First, take ℳ to be the set of all non-degenerate Gaussians on Rd, which goes by the name Bures-Wasserstein space BWRd [130]. Each distribution in this family can be represented by the mean m∈Rd and covariance matrix Σ∈S++d, where S++d is the set of all symmetric, positive-definite d×d matrices. To see that the optimization problem is nontrivial, one can check that L(m,Σ) defined by Eq. (215) is not necessarily convex in the parameters (m,Σ) even when Φ(x) is α-convex in x—for example, consider Φ(x)=x4 in d=1 dimension. Now Let’s apply the machinery of WGF and see what the dynamical optimization equations for m and Σ look like. First, Let’s check that BWRd is geodesically convex. One can show that the Wasserstein geodesic between any two Gaussians p0=𝒩m0,Σ0 and p1=𝒩m1,Σ1 is given by the transport map

xt=(1-t)x0+tΣ0-1/2Σ01/2Σ1Σ01/21/2Σ0-1/2x0-m0+m1 (221)

Notably, Eq. (221) is an affine transformation for all t. Recall that any affine transformation of a normal distribution is a normal distribution, so the pt∈BWRd for all t, confirming that BWRd is geodesically convex. Next, we would like to find an explicit expression for the projected Wasserstein gradient ∇BWℱ=projBWRd∇Wℱ on a functional ℱ. Because all Gaussians are connected by affine maps, and all affine maps take Gaussians to Gaussians, it follows that the tangent space to BWRd corresponds to all affine maps. Using this fact and a bit of algebra, one finds that:

∇BWℱ[p](x)=∇2δℱδpp(x-m)+∇δℱδpp. (222)

Here ∇2 in a matrix expression denotes the Hessian; the Laplacian is its trace. The parameter dynamics are

m˙t=-∇δℱδppt, (223)
Σ˙t=-∇2δℱδpptΣt-Σt∇2δℱδppt. (224)

For the special case of VI, we take ℱ=DKLp‖p1 and the flow equations become

m˙t=-⟨∇Φ⟩pt, (225)
Σ˙t=-∇2ΦptΣt-Σt∇2Φpt+2I. (226)

Eqs. (225)–(226) can be implemented straightforwardly because the expectations are taken with respect to the Gaussian measure pt=𝒩mt,Σt. In the naive approach, Eq. (214), of directly optimizing with respect to m and Σ, the equations for the mean m˙t are unchanged, while Eq. (226) for Σ˙t differs in its dependence on Σt. With the standard Frobenius inner product for covariance matrices, ordinary gradient descent gives:

Σ˙t=-12∇2Φpt+12Σt-1, (227)

which can create situations in which Σ becomes singular (loses its positive definiteness) during optimization. The geometric perspective of WGF avoids this pathology, makes the convex nature of the problem more transparent, and leads to other generalizations and principled convergence guarantees [131, 132].

As a second, theoretically rich, example, suppose ℳ is the set of all discrete measures comprising Np point masses: p^t(x)=1Np∑i=1Npδx-xt(i) [133, 134]. Here, the parameters xt(i) can be thought of as point particles, whose positions need to be optimally situated to approximate the target distribution p1. Upon inspection, this is exactly the setting of interacting particles considered in Sec. V B 2. Therefore, using the loss in Eq. (215), the particles update according to

dxt(i)=-∇Φxt(i)dt+2dWt(i) (228)

where the noise convention is ε=2, as in Chapter IV. This is simply traditional MCMC sampling (see Chapter IV). However, there is a conceptually interesting point: Unlike Eqs. (225)–(226), or more generally, Eq. (219), the evolution in Eq. (228) is stochastic, not deterministic. This is ultimately connected to the fact that the discrete measure p^t is singular, so gradients of the entropic contribution to Eq. (215) are ambiguous. While stochastic updates are not inherently problematic, this has led to a conceptual question: are there purely deterministic equations for the xt(i) that would nevertheless give rise to an equivalent approximation in the Np→∞ limit? In the language of Sec. V B 2, is there a deterministic version of Eq. (228) that gives rise to the same mean-field limit in Eq. (207)? An intuitive attempt would be to replace the delta functions δx-xt(i) with a smoother function khx-xt(i) of width h, which gives the evolution equations

x˙t(i)=-∇Φxt(i)-∇xlog1Np∑jkhx-xt(j)x=xt(i) (229)

where the density gradient differentiates the evaluation argument x with particle centers held fixed, before setting x=xt(i). The continuum limit Np→∞ yields

∂tpt=∇⋅pt∇Φ+logkh⋆pt (230)

where kh⋆pt(x)=∫kh(x-y)pt(y)dy denotes convolution. Notably, this approach is not entirely straightforward because pt in Eq. (230) does not converge to p1 unless h=0, which raises a subtle question of limits for Np→∞ and h→0. This subtlety motivates an alternative, more recent, approach known as Stein variational gradient descent [133, 134]. The basic idea is to put the regularization in a different location:

∂tpt=∇⋅pt𝒦hpt∇logptp1 (231)

In Eq. (231), 𝒦hp implements convolution weighted by p. Namely, given f(x), the smoothed version is

𝒦hp(f)(x)=kh⋆(pf)(x)=∫f(y)p(y)kh(x-y)dy (232)

Interestingly, the smoothing operator 𝒦hp can also be interpreted as a projection of the Wasserstein gradient ∇Wℱ=∇logpt/p1 [134]; however, this projection is distinct from projℳ in Eq. (218); it instead projects the velocity onto the reproducing kernel Hilbert space associated with the kernel kh, see e.g. [134] for more detail. The discretized version of Eq. (231) takes the form:

x˙t(i)=-1Np∑j=1Npkhxt(i)-xt(j)∇Φxt(j)+∇khxt(i)-xt(j) (233)

where ∇Φxt(j) differentiates the potential at particle j, while ∇kh(z) differentiates the kernel argument z=xt(i)-xt(j). Notice that Eq. (233) is straightforward to implement, and Eq. (231) genuinely permits p1 as a stationary solution. Yet, questions surrounding its convergence remain a topic of investigation [135–139]. Nonetheless, Eq. (233) has a clear physical interpretation: the first term captures gradient descent, while the second is a particle repulsion encouraging exploration of the full potential.

In addition to these two examples, several other parametric spaces for VI have received attention. For example, the treatment of Bures-Wasserstein space above can be extended to Gaussian mixtures by considering measures over BWRd itself [131, 140, 141]10. Another powerful approach is to consider a mean-field approximation (not to be confused with the mean-field limit of interacting particles) in which ℳ=⊗i=1d𝒲2(R)⊂𝒲2Rd is the space of products of one-dimensional distributions [43, 142, 143]. Across these examples, VI benefits from theoretical guarantees when Φ(x) is α-convex. Much modern interest is in situations in which Φ(x) is not convex, but may be multi-modal and feature low-dimensional structure. Building models that are effective for sampling in this more advanced context motivates the next section on flow and diffusion (Sec. V C).

C. Generative modeling with flows and diffusion

In Chapter IV on Sampling, we explored the following problem: given a (potentially unnormalized) probability distribution p(x), how to draw a set of N independent samples xnn=1N? In this section, we ask the inverse problem: given a set of samples xnn=1N, how to infer the probability distribution p(x) and generate a new independent sample xN+1 from the estimated distribution? The former task is known as density estimation, and the latter task is generative modeling. Like many inverse problems, generative modeling is a somewhat ill-defined task: one aims to generate samples similar, but not identical to those from the training set (an issue referred to as “generalization versus memorization”). Generative modeling is an important problem: In many contexts, like protein structures [144] or natural images [145], training samples are abundant, but unlike in physics or chemistry, an explicit model for the data is not available. Over the last ten years, deep-learning-based generative models have proven astonishingly successful at producing samples from such complex, high-dimensional distributions. This section provides an overview of these new methods, their utility for scientific simulations, and their connection to the ideas around sampling, transport, and non-equilibrium physics discussed in Chapters I–IV. Note that we do not attempt a systematic literature review.

Like for sampling, the key difficulty in generative modeling is the high dimension d of the sample space. A typical example is image generation, where d≈200,000 (for 256 × 256-pixel color images). Learning high-dimensional probability distributions is difficult, since the training samples only cover a vanishing fraction of high-dimensional space (the “curse of dimensionality”). Vice versa, a generative model needs to target this vanishing fraction to succeed. Put flippantly, randomly choosing pixel values has vanishing probability of producing an image of a cat (Fig. 11). In addition, complex probability distributions are typically multi-modal. As for sampling, modern designed models generate samples from a high-dimensional target distribution p1 (e.g., the space of images) by dynamically transforming a simple base distribution p0 (e.g., the standard Gaussian). We already encountered such transport problems in Chapter II on optimal transport. Like optimal transport, generative models are recipes for transforming probability distributions, now designed to make it easy to learn the transformation from training data. Diffusion models [145, 146] are perhaps the most well-known machine learning methods of this type. They learn a stochastic process that generates samples from a target distribution defined by a set of training samples. Diffusion models were originally inspired by the physical ideas of non-equilibrium thermodynamics and simulated annealing discussed in Chapter IV [146]. This section approaches generative modeling using the (effectively equivalent) frameworks of stochastic interpolation [147] and flow matching [148]. We believe that this choice will make the core idea behind diffusion models easier to understand and generalize.

FIG. 11.

FIG. 11.

Not a cat.

1. Variational transform sampling

Fundamentally, this section is based on the method of transform sampling, which applies a map T to transform a sample x~p0 into y=T(x). Throughout this section, we use “y” to denote samples generated by a transform. The map T can also be thought of as a “decoder”, and x as a “hidden variable” [149]. The probability distribution of y is called the pushforward T*p0. By changing variables, the probability density of T*p0 is:

T*p0(y)=p0T-1(y)⋅det∇yT-1 (234)

For example, the linear map y=M⋅x transforms a standard Gaussian into one with covariance matrix Σ=MM⊤. A second example is provided by one-dimensional distributions, where the map T is defined by the cumulative distribution functions of p0,p1 (Eq. (88)).

The algorithms in this section combine transform sampling with variational inference (VI, Sec. V B 3). VI approximates a target distribution p1 by a member q of a parametrized family. Here, the trial family is defined by a set of transformations T^ via Eq. (234). VI is an intuitive match for modern ML techniques like expressive neural networks and largescale, gradient-based optimization. To bring these techniques to bear, one needs a loss function ℒ to measure the difference between the estimated q and the target distribution p1. Here, our goal is to build loss functions that can be efficiently approximated using training samples, without explicit knowledge of p1. Then, the transformation T^ can be learned directly from data by minimizing ℒ.

2. Flow matching

The key idea of flow matching is to construct the transformation T^ step-by-step from a velocity field v^, parametrized by a neural network [150]. Flow matching generates target samples y1 by integrating the ODE y˙t=v^tyt starting from a random initial condition y0=x0~p0 (say, an image of white noise). Flow matching defines a suitable loss function that allows learning the velocity v^ from training samples. In contrast to diffusion models, the sample generation process is deterministic; Sec. V C 4 will introduce stochasticity.

Both flow matching and diffusion models are based on mass transport. Consider a time-dependent11 vector field v^t(x) on Rd. Here and below, hats denote learned maps or fields. The marginal of the generated trajectories yt is qt. By convention, time t ranges from 0 to 1, so that qt=0=p0 is the base, and we want to adjust the generative process so that q1 matches the target distribution p1 (reader beware: the reverse convention is also often used in the literature). The flow map T^t(x) transports particles along the integral curves of v^t, and is defined by solutions to the ODE

y˙t=v^tyt,yt=0=x0~p0,T^tx0≔yt. (235)

If the initial conditions are sampled yt=0~p0, the time-dependent distribution qt=T^t*p0 is governed by conservation of mass [152]:

∂tqt(x)+∇⋅qt(x)⋅v^t(x)=0 (236)

If a qt fulfills Eq. (236), it is said to be generated by the flow v^. In fluid dynamics terms, Eq. (235) is the Lagrangian, and Eq. (236) the Eulerian formulation.

Note that many different velocity fields can generate the same qt. Indeed, adding a divergence-free vector field, v^t↦v^t+vt′, with ∇⋅qtvt′=0, leaves Eq. (236) invariant. In Sec. II B, we saw how optimal transport singles out one of these vector fields by minimizing a transport cost. On the other hand, not all time-dependent distributions can be generated by a flow. For example, direct interpolation between two probability densities, pt(x)=(1-t)p0(x)+tp1(x) with disjoint support requires “mass teleportation” and cannot be generated by any flow.

Flow-generated distributions are very convenient: given v^, one can generate samples of q1 by integrating Eq. (235). How can one identify a velocity field v^ so that q1=T^1*p0 matches the target distribution p1? A first idea is to directly optimize the transport map T^1, obtained by integrating Eq. (235). This approach is, however, very inefficient: evaluating the objective requires simulating the entire trajectory. Instead, one uses a stochastic interpolant [147, 148], a stochastic process xt with x0~p0 and x1~p1. Recall that in generative modeling, the target distribution p1 is unknown. Instead, one has access to a set of training samples (for example, an image database). One constructs a stochastic interpolant from these training samples, for example:

xt=(1-t)x0+tx1,x0~p0,x1~p1. (237)

The endpoints x0,x1 are sampled independently12. For instance, x1 could be an image sampled from the database, and x0 could be Gaussian noise, so that xt is a sequence of increasingly noisy images (Fig. 13). In this sense, Eq. (237) can be thought of as a version of the Brownian bridge from Sec. ID 3, conditioned to terminate in the target sample x1. The interpolant Eq. (237) defines a time-dependent probability path xt~pt from p0 to p1. The pt play a role similar to the instantaneous equilibria in annealed importance sampling (Sec. IV B). It is important to distinguish the interpolant xt from the generating process yt; even if initialized at the same starting point x0~p0, the two processes lead to different trajectories.

FIG. 13.

FIG. 13.

A stochastic interpolant adds progressively larger amounts of uncorrelated Gaussian noise to an initial image.

Crucially, the probability path pt defined by Eq. (237) can be generated by a flow field (in the sense of mass conservation, Eq. (236)). As we show shortly, the velocity v of the interpolant pt is the average of the trajectories’ speed:

vt(x)=x˙t∣xt=x (238)

Here and below, ⟨⋅∣⋅⟩ denotes the conditional expectation. The average is over the randomly sampled endpoints x0,x1, which determine xt,x˙t. To derive Eq. (238), integrate ∂tpt against a test function φ(x), and use the law of total expectation:

∫φ(x)∂tpt(x)ddx=ddtφxt=∇φ⋅xt˙=∇φ⋅xt˙∣xt=-∫φ(x)∇⋅ptx˙t∣xt=xddx (239)

Fig. 12 shows a toy example (p1 is a mixture of Gaussians), where the true flow field v can be computed analytically.

FIG. 12.

FIG. 12.

(Left) Stochastic interpolation using Eq. (237) between p0=𝒩(0,I), a standard Gaussian, and p1=∑jcj𝒩μj,Σj, a Gaussian mixture with weights cj (in the 2d example shown, c1=0.4,c2=0.6). Since xt=(1-t)x0+tx1 is a sum of Gaussian mixture variables, the intermediate distributions are also Gaussian mixtures, pt=∑jcj𝒩tμj,(1-t)2I+t2Σj. The plot shows contour lines of pt for t=0,1/2,1. (Right) The flow map can be calculated from the intermediate pt’s using Eq. (242). It transports samples from p0 to samples from p1 in unit time (black). Note that the integral curves are bent while the trajectories of the interpolant are straight lines.

The stochastic interpolant defines the objective: match the estimated flow field v^ to the true one v. The resulting flow matching loss reads, using the law of total expectation:

ℒFM[v^]=∫01v^txt-vtxt2dt=∫01v^txt-x˙t∣xt2dt=∫01dtv^txt2-2v^txt⋅x˙t+const.=v^txt-x˙t2+const. (240)

The additive constant in Eq. (240) is independent of v^, and thus does not affect training. Eq. (240) has three important properties. First, the unique minimizer is the true flow field. Thus, at the minimum, qt matches the interpolant distribution pt, and yt=1 is a sample from p1 (note that yt and xt have the same marginals, but the trajectory laws can differ). Second, since xt=(1-t)x0+tx1, the expectation value is easily estimated using independent samples x0~p0,x1~p1 from the training set. Third, the loss is simulation-free: it does not require simulating the entire trajectory yt. Thus, one can efficiently train the neural network v^ to generate target samples by stochastic gradient descent on ℒFM. In summary, the overall flow-matching workflow reads:

  1. Design a stochastic interpolant xt whose distribution pt bridges the simple base distribution p0 and the target p1.

  2. Using interpolant samples generated from a training set, train a velocity field v^ by minimizing v^txt-x˙t2.

  3. Generate samples by integrating the ODE y˙t=v^tyt, with yt=0=x0~p0.

One can see that flow matching bears a close resemblance to dynamic optimal transport (OT). Both aim to transform a base into a target distribution via “local”, mass-conserving dynamics, Eq. (236). Like in optimal transport, in Eq. (237), samples move along straight lines between endpoints. However, the choice of the endpoints is precisely the opposite: OT couples the endpoints deterministically via the transport map T,x1=Tx0, while in Eq. (237), the endpoints are independent. Therefore, OT and stochastic interpolation are not identical. Sampling from the OT process is computationally hard, since it requires finding a very specific flow field that additionally minimizes a transport cost. In flow matching, the stochastic interpolant is instead designed to be easy to sample. These samples serve as a device to find a flow field v^ that takes p0 to p1.

Flow matching can be viewed not only as data-driven transport, but also as an iterative denoising process. This perspective sheds light on how flow matching is able to learn multi-modal distributions. Multi-modality was already a challenge in the context of sampling from a known distribution (Chapter IV). Since x0 is typically Gaussian white noise, the stochastic interpolant is a sequence of increasingly noisy images (Fig. 13). One can think of the velocity field as a denoiser, which estimates xt+dt from the (infinitesimally) more noisy version xt as xt+dt∣xt≈xt+vtxtdt. The flow-matching loss Eq. (240) measures the squared error of the denoiser. Intuitively, flow matching thus breaks down a difficult sampling task (generating an image) into a sequence of simpler tasks (incrementally denoising an image).

This step-wise approach is essential to handle multi-modality. Indeed, suppose one were to add a large, finite amount of noise to a target sample and attempt to denoise it in one step. The denoiser Dt at interpolation time t has mean squared error Dtxt-x12 (smaller t corresponds to more noise). Because the noise removes details, several different reconstructions are compatible with the noisy sample. The optimal denoiser (with minimum least-squares error) will return the average of all reconstructions, Dt*(x)=x1∣xt=x. If the distribution is multi-modal, this average is a blurred mix of different modes that does not resemble any sample of the target distribution. However, for an infinitesimal amount of noise, the reconstruction problem becomes uni-modal. This is the principle that flow matching exploits to learn multi-modal distributions.

3. The score function

Let us take a closer look at the distributions pt for a linear interpolant between a standard Gaussian and an arbitrary target. If x0 is standard Gaussian and independent of x1, the conditional density is also Gaussian, pt⋅∣x1=𝒩tx1,(1-t)2I. Taking the gradient, one obtains ∇logptxt∣x1=-x0/(1-t). Averaging over endpoints using the law of total expectation gives [153]:

∇logpt(x)=∇logptx∣x1∣xt=x=-x0∣xt=x1-t. (241)

The quantity ∇logpt is called the score. We already encountered the score in Sec. ID 2 in the context of optimal control, where it served as a control force that drives a particle towards a target. Here, the score plays a similar role. Eq. (241) shows that the score can separate the noise x0 from the current xt, and thus allows reconstructing the target x1. After a little algebra:

vt(x)=x˙t∣xt=x=x-x0∣xt=xt=x+1-t∇logpt(x)t,0<t<1. (242)

Flow matching with an initially Gaussian distribution is therefore closely related to score matching [154], a method that uses the score to fit statistical models. Flow and diffusion models can be viewed as a combination of simulated annealing (Sec. IV B) and score matching [155]. Eq. (242) demonstrates that the velocity field is a potential gradient: logpt acts as a time-dependent energy landscape that guides a sample from the initial to the target distribution (see the example in Fig. 12). Note that the relation between score and flow only holds for linear interpolation where one endpoint is Gaussian; in general, there is no simple relation between pt and v.

4. From flow matching to diffusion

In flow matching, sampling is a deterministic process, defined by the ODE Eq. (235). Diffusion models instead use a stochastic sampling process, which, however, has the same marginals. To see how, add ∇logpt to and subtract it from the mass conservation equation for the interpolant (target) density pt:

∂tpt=-∇⋅vt+ε2∇logqt-ε2∇logptqt=-∇⋅v^t+ε2∇logptpt+ε2∇2pt (243)

Eq. (236) is thus reformulated as a Fokker-Planck equation with diffusion, compensated by an additional drift. This seemingly tautological manipulation allows defining a new sampling process. The Fokker-Planck Eq. (243) gives a Langevin equation for trajectories:

y˙t=vtyt+ε2∇logptyt+εηt=1tyt+1+ε-22t∇logptyt+εηt. (244)

In the second step, we used the relation between score and velocity. Because the density obeys Eq. (243), the stochastic process Eq. (244) still generates samples from p1. Effectively, diffusion models add an additional stochastic term to the interpolant Eq. (237), such that there is stochasticity at intermediate t even after fixing the endpoints. Stochastic sampling has practical advantages: it can improve stability so that even an imperfectly learned score produces reasonable samples [147].

With the above results, flow matching can be compared to the original formulation of denoising diffusion models [156]. Here, a forward diffusion process gradually adds noise to a target sample x1. This forward process is the pendant of the stochastic interpolant and generates samples from which the score function is learned. Given the score function, target samples are generated by Eq. (244). In this context, Eq. (244) is called the reverse process, since it is the time-reversal of the forward diffusion process.

To see this, reparametrize time as s=-logt, so s=0 is the target distribution and s=∞ is standard Gaussian noise. The forward process is initialized at the target distribution:

x˙s=-xs+2ηs,xs=0~p1 (245)

Since we set ε=2, as s→∞, the distribution ps(x) converges to a standard Gaussian (the base distribution). (Note that the intermediate distributions ps are not equivalent to those of the stochastic interpolant Eq. (237).) The forward process obeys the Fokker-Planck equation:

∂sps(x)=∇⋅xps+12∇2ps=∇⋅psx+12∇logps (246)

To reverse the probability flow, one flips the sign of the effective flow field x+ε2∇logps↦-x+ε2∇logps. One thus reverses time, starting from a large final time S≫1. The reverse process, which generates target samples starting from noise, reads [156, 157]

y˙s=ys+ε2∇logpS-sys+εηs (247)

This idea of time-reversing a process that starts at the target distribution p1 is precisely what underlies the proof of annealed importance sampling and the Jarzynski identity in Sec. IV B 2.

Finally, Eq. (244) also allows revisiting the distinction between flow matching and Langevin sampling with energy E=-logp1. Flow matching uses a non-equilibrium process to transform probability distributions in finite time, and the target p1 is not a stationary state. The potential is time-dependent, and the intermediate-time distributions pt are explicitly distinct from the target and instead act as a bridge between p0 and p1. By contrast, Langevin dynamics only converge to its equilibrium distribution p1 as t→∞.

5. One-step generation and normalizing flows

Once a flow-matching model is trained, generating samples requires integrating the flow field v^ (or an SDE for a diffusion model). This can be slow and makes the generation process difficult to fine-tune for downstream applications. Consistency models [158] and rectifying flows [159] distill the flow field v^ into a neural-network model for the flow map T^1, which allows generating samples in one step. Such one-step models parallel the transition from Benamou-Brenier dynamic optimal transport (Sec. II B, Eq. (91)) to the static Monge-Kantorovich problem (Sec. II B).

In this section, we will discuss another one-step generative method, normalizing flows [160], one of the inspirations for flow matching models. Despite their name, normalizing flows are not flows, but generate samples using a single-step transform. While flow matching excels at learning generative models from training data, normalizing flows can also learn from an energy function or unnormalized probability density. This makes them very useful for improving sampling algorithms in statistical mechanics simulations and Bayesian statistics (Chapter IV). In this setting, no training samples are available: producing them is the whole point.

As before, the goal is to transform a base p0 into a target p1 distribution via Eq. (234). Samples are generated as y=T^x0,x0~p0 where the base distribution p0 is often Gaussian (hence, “normalizing” flow). In contrast to flow matching, which constructs T^ iteratively, normalizing flows directly parametrize T^ by a neural network. However, not any neural network will do: Eq. (234) shows that the inverse T^-1 and the Jacobian determinant det∇xT^-1 are needed to compute the transformed density q=T^*p0. One thus uses neural network architectures designed specifically to make these quantities easy to evaluate. A minimal example is the following neural network layer for a 2-component vector x=x(1)x(2) [161]:

x(1)x(2)↦a^x(2)⋅x(1)+b^x(2)x(2) (248)

where a^ and b^ are neural networks for scale and shift. Since Eq. (248) is an affine function in x(1) and copies x(2), it is easy to invert. More complex networks can be built by stacking layers.

Next, we need a procedure to adjust q=T^*p0. to match the target distribution p1, paralleling the minimization of the flow matching loss in Eq. (240). One possibility is to use a training dataset xn of samples from p1. In this case, one maximizes the log-likelihood ∑n=1Nlogqxn of the training data. In the setting of Bayesian inference or statistical mechanics simulations, one has access to the unnormalized density p~1 instead of training samples. In Sec. V B 3, we saw that variational inference uses p1 to define a data-free objective:

DKLq‖p1=logq-logp1q≈1N∑n=1Nlogqxn-logp1xn,x(n)=T^x0(n),x0(n)~p0 (249)

Here, DKL is the Kullback-Leibler (KL) divergence, a measure of the distance between two probability distributions encountered several times in previous chapters. Because of the logarithm, the normalization constant Z1 drops out when optimizing Eq. (249). The expectation value in Eq. (249) is approximated using samples from q, so no target distribution samples are required (hence, “data-free”). Now, T^ can be trained by minimizing DKLq‖p1 via gradient descent [162]. The data-free objective has certain drawbacks: it can encourage mode collapse, where the map T^ always returns samples from a single mode and fails to explore the full distribution p1 [163]. This is a well-known effect of the KL divergence. It strongly penalizes any probability density outside of the support of p1 due to the term logq/p1, but failing to sample from a part of p1 receives a much milder penalty.

Once trained, one can generate samples T^x0. However, if the variational approximation is not perfect, these samples will be biased (not exactly distributed ~p1). This is a serious issue in scientific contexts. Fortunately, one can combine a normalizing flow with another sampling technique like importance sampling from Chapter IV to correct the bias [163]. As long as q covers the support of p1, the result is guaranteed to be unbiased. This achieves the “best of both worlds”: the conventional sampling algorithm provides mathematical guarantees, and the power of machine learning allows rapid identification of high-probability regions in d-dimensional space. Normalizing flows have been successfully used to accelerate statistical physics simulations, for instance in lattice QCD [164]. More generally, gradient-based optimization can systematically tune parameters of sampling algorithms that were traditionally tuned by hand, like the proposal distribution for an importance sampler.

6. Generalizations and ongoing work

In summary, machine learning has made striking progress on the classic problem of sampling from complex, high-dimensional distributions. These techniques transform a simple base distribution to the target via a transform that is fit variationally to data. The greatest success has come from methods based on mass transport, like diffusion and flow matching, which construct the transform map step by step. In flow matching, one first designs a dynamical process that interpolates between the base (often, uniform noise) and the target, and then learns the corresponding probability flow. In the domain of image and video generation, flows and diffusions are the state of the art and have eclipsed previous approaches, like Variational Autoencoders [149] and Generative Adversarial Networks [165]. On the other hand, for language and other “sequential datasets”, autoregressive models, which iteratively predict the next sequence element or “token”, dominate.

Flow matching can be generalized in several directions. First, the design of the stochastic interpolant offers significant flexibility. Eq. (237), linear interpolation, is only the simplest possibility. Second, there is an equal amount of freedom in choosing a sampling algorithm (stochastic or deterministic sampling), which can lead to important numerical efficiency gains. Lastly, different neural network architectures can be used to approximate the velocity field or score. This leads to a large zoo of methods [147, 148].

Next, in generative modeling, one is rarely interested in generating “random” samples from the target distribution p1 (in contrast to statistical mechanics). After all, a random sample could simply be drawn from the training set. Instead, one is interested in a sample that fulfills some particular task: an image that matches a given caption, or a protein with a particular functionality. Guided diffusion uses additional “guidance” terms to nudge the sampling process yt towards a user-defined aim [166]. The population distribution p1 of images/proteins/… serves as a conduit, a convenient fiction, towards the ultimate goal of a task-directed model. Guided diffusion is a form of sampling with a control ut which we discussed above. A running reward can be supplied by an ML model (like a classifier) to score whether the trajectory xt progresses towards a desired sample like a particular type of image, and a terminal reward can score the final sample.

Finally, flow matching can also be generalized from continuous distributions on Rd, such as images, to discrete ones, such as text data. In this case, a sample is a sequence x=x1,…,xd,xi∈𝒜 from a finite alphabet 𝒜. The stochastic interpolant becomes a Markov chain that converts a sequence into a sample from a simple base distribution p0. For example, masked diffusion [167] continuously masks out sequence elements (so p0 has only one element, the fully masked sequence). The goal is now to learn a Markov process that reverses the masking. The transition rates of this process play the role of the velocity field in the continuous setting, and one minimizes a loss similar to Eq. (240). Alternatively, the discrete data can be embedded into a continuous space. For language modeling, discrete diffusion has recently become competitive with the next-token-prediction paradigm that underlies most large language models [167]. In contrast to the latter, diffusion models can generate many tokens at once, and thus leverage more computing power.

Statistical mechanics of memorization and generalization.

Flow matching and diffusion models are optimized by using a set of training samples, but so far, we have not paid any attention to the limited size of this training set. The models are fit not to the true target p1, but to the empirical distribution p^data(x)=N-1∑n=1Nδx-xn of the finite training set. Therefore, the “optimal” flow map under Eq. (240) reproduces the empirical distribution, and generation always returns a sample from the training set. This evidently undesirable phenomenon is called memorization; the model fails to generalize to new samples. In practice, memorization is avoided by stopping the training process early, and systematic approaches to avoid memorization are a topic of current research. The phenomenon of benign overfitting, where a model perfectly interpolates the training data without impeding performance, is thus absent in flow models. A model with zero training flow matching loss always memorizes.

The dynamics of diffusion models starting from pure noise bear a close resemblance to a statistical mechanics system that is slowly cooled from an initially high temperature. Flow-matching time is thus analogous to temperature. Indeed, flow matching and diffusion models can be fruitfully analyzed using statistical mechanics, which has shed light on the generalization-memorization transition. Refs. [168, 169] argue that flow matching dynamics undergo a series of symmetry-breaking phase transitions as a function of time t. At a first “ferromagnetic” transition, samples xt commit to one of the modes of the target distribution, generating a novel sample. However, as the dynamics continue, a second “glass” transition traps xt near a sample from the training dataset (Fig. 14).

FIG. 14.

FIG. 14.

Memorization-generalization transition for a 1D mixture of Gaussians: interpolating distributions pt between a Gaussian base and the empirical distribution of a Gaussian mixture (N=4 samples). At the ferromagnetic transition, pt splits into the distinct modes of the target distribution. At the glass transition, trajectories become trapped near a training sample from the empirical distribution.

In Chapter IV, we saw how an analogy with physical annealing gave rise to powerful algorithms for sampling from a known distribution. An interesting avenue for future research is whether the analogy between annealing and flow matching could be used to design “better”, more statistically efficient generative models, now learned from training data.

Acknowledgments

E.B. acknowledges support from the Fannie and John Hertz Foundation Fellowship. E.B. and C.J. acknowledge this material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE-2444107. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation. N.C. was supported in part by Princeton University through the Princeton Center for Theoretical Science and the Center for the Physics of Biological Function, as well as by the National Institute of General Medical Sciences (NIGMS) of the National Institutes of Health (NIH) under award numbers R01GM082938 and R35GM156427. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health. Part of this work was performed at the Kavli Institute for Theoretical Physics (KITP), supported by NSF grant PHY-2309135 and Gordon and Betty Moore Foundation Grant No. 2919.02. N.C. and B.S. acknowledge useful discussions at the Beg Rohu Summer School of Physics 2026 and thank all summer school lecturers. C.S. was supported in part by Princeton University through the Center for the Physics of Biological Function. This work was performed in part at the Aspen Center for Physics, which is supported by National Science Foundation grant PHY-2210452. B.S. was supported by the Princeton Center for Theoretical Science and in part by the Center for the Physics of Biological Function at Princeton University. G.R. was partially supported by a joint research agreement between NTT Research Inc and Princeton University. We acknowledge the use of generative AI for editorial purposes.

Footnotes

1

Eq. (1) is the physicists’ notation for the stochastic process dxt=gtxt,utdt+εdWt, where Wt is a standard Wiener process. Throughout the review, we use the Itô convention for stochastic calculus, in which ηt is independent of the current state xt.

2

Here, the integral ∫01dtutxt⋅ηtu is formally an Itô integral.

3

The optimized χt satisfies the Hamilton–Jacobi equation ∂tχt= ∇χt2/2, up to a time-dependent additive gauge; its gradient gives the corresponding Burgers equation.

4

For the SDE Eq. (151), one can explicitly compute the (Gaussian) transition kernel to confirm Eq. (156). Alternatively, Eq. (156) can serve as the definition of the reverse process (well-defined as pteq is the instantaneous equilibrium).

5

Using the discrete Eq. (157). Note that there is no “discretization error”: AIS sampling is mathematically exact also for discrete-time Markov chains defined by a set of transition matrices.

6

We assume the problem is fully observed, so the dynamics are Markovian. We consider the objective where γ=1 (undiscounted), noting that discounting can be recovered by augmenting the MDP with stochastic transitions to a zero-reward, permanent “death” state.

7

The choice of reverse KL is intentional, as it requires sampling from Pπ (something we know how to do) rather than P* (which we do not know how to sample from a priori).

8

Greedily maximizing this quantity at each state is a form of soft policy iteration. Ref. [98] proves that it globally optimizes Eq. (186).

9

Historically, McKean refers to the stochastic process ε>0 and Vlasov refers to the deterministic process ε=0

10

In the development of WGF above, we have assumed that the base space Rd is equipped with the standard Euclidean metric. As would be appropriate for BWRd one can consider generalizations to intrinsically curved spaces by treating ∇ as a covariant derivative and using Riemannian dot products where appropriate.

11

Note that in practice, explicit time-dependence of the velocity field is often unnecessary, and can even be detrimental to performance [151]. In high dimensions, source p0 and target p1 do not overlap, so the velocity can change along trajectories without being explicitly time-dependent.

12

One can also sample x0,x1 dependently, for instance, to predict the next frame of a movie from the preceding one

TABLES OF NOTATION

The final column links to the section where each symbol first appears. Each chapter has a separate table, and we list notation in the order in which each symbol was first introduced. Familiar symbols may have different meanings in clearly identified contexts, for example, mechanical action S[x(⋅)] and thermodynamic entropy S[p].

TABLE I:

Chapter I: Mechanics, Control, and Inference.

Symbol Meaning or convention Section
x,xt,x(⋅) State argument, state at time t, and complete trajectory. In Chapter V, xn denotes the state at decision step n and yt distinguishes a generated path from an interpolant. IA
u,ut(x) Control value and feedback control; the applied control is utxt. In Chapter III, ut also denotes a prescribed experimental protocol. IA
t,s Time; the control horizon is 0≤t≤1. IA
gt(x,u) General controlled drift. IA
ε Noise covariance per unit time; amplitude ε, diffusion coefficient ε/2. Also the entropic transport regularization in Sec. II B. In Chapter III, ε=2D. IA
ηt,Wt Standard Gaussian white noise and standard Wiener process. IA
rt(x,u) Running reward, including control costs. In Sec. V A, r(x,u) is a per-step reward; its running-reward limit includes a factor Δt. IA
r1(x) Terminal reward, separate from running reward. In Sec. II A it enforces the final density constraint. IA
Vt(x) Optimal expected reward-to-go, including control costs. In Sec. V A, Vπ evaluates a policy and V* is optimal. IA
Lt(x,x˙),S[x(⋅)] Mechanical Lagrangian and action. IA
pt Costate; canonical momentum in the mechanics specialization. IA
ℋt(x,p,u) Control Hamiltonian before maximization over u. IA
Ht(x,p) Optimized Hamiltonian, Ht=maxuℋt. IA
p(x),pt(x) Probability density and time-dependent marginal density. In Chapter IV, p0,p1 denote the base and target densities. IB–IC
p0,pA Reference density and density inferred from observations A. Superscripts distinguish these from time subscripts. IB
DKL(p‖q) KL divergence, with averaging under its first argument; also used for path distributions. IB
⟨⋅⟩p Expectation under the indicated density; conditioning is written inside the brackets. Also written Ep[⋅] in Chapter V. IB
N Number of independent samples; in Sec. V A, N instead denotes the final decision index and M counts rollouts. IB
pˆ Empirical density estimated from samples; p^data denotes the training-set density in Sec. V C. Hats indicate estimates, not samples. IB
I Large-deviation rate function. IB
am(x),am[x(⋅)] State observable and, in Sec. I C, trajectory observable. IB–IC
Am Prescribed mean of observable am. IB
H[p] Shannon entropy with natural logarithms. In Sec. V A, H[π(⋅∣x)] is the policy entropy at state x. IB
M Number of imposed observable constraints; in Sec. V A, the number of independent rollouts. IB
λm Multiplier enforcing the mean of observable am, with the negative sign in the exponential tilt. IB
Z Normalization constant or partition function. In Sec. II B, Zx0 normalizes a transition kernel; in Sec. V A, ZQ(x)=∫eQ(x,u)/αdu normalizes the Boltzmann policy. IB
𝒜,1𝒜 Conditioning set and its indicator. IB
P0,Pu,Pu* Reference, controlled, and optimally controlled path distributions. In Sec. V A, Pπ is the joint state-action path law induced by a policy, and Pπ* is its optimal realizable form. IC
y Prescribed terminal point in the Brownian-bridge examples. IC
ft(x) Passive drift; additive control gives gt(x,u)=ft(x)+u. IC
ptu(x) Marginal density under Pu; denoted ρt(x) in Chapter II. IC
⟨⋅⟩Pu Expectation over the indicated path distribution. IC
rm Reward coefficient enforcing a trajectory constraint, with rm=-λm. IC
rt(x) State reward, excluding the separately displayed quadratic control cost. IC
ψt(x) Exponentiated PISC value, ψt=eVt. Also denoted Zt(x) during its derivation; the backward factor in Sec. II A. ID
Rt[x(⋅)] Accumulated state and terminal rewards from t onward, excluding control cost. ID
∇logpt(x) Spatial score of a marginal density; distinct from the conditioning field ∇logψt and the protocol score Θu of Chapter III. ID
kt∣s(z∣x) Passive transition density from x at s to z at t>s;k=k1∣0 in Sec. II B. In Chapter IV, kt freezes the energy for one step; in Sec. V A, k(x′∣x,u) is the environment transition kernel. ID

TABLE II:

Chapter II: Transport and Wasserstein Geometry.

Symbol Meaning or convention Section
ρt,ρ0,ρ1 Evolving density and prescribed endpoint densities. In Sec. V B, ρ^t=Np-1∑iδx-xt(i) is the empirical particle density. II A
vt(x) Density-transport velocity: ∂tρt+∇⋅ρtvt=0. Generally distinct from ut;v^t is a learned estimate in Sec. V C. II A
ψt†(x) Forward Schrödinger factor, with ρt=ψtψt†. The dagger does not denote complex conjugation. II A
cx0,x1 Cost of transporting unit mass between two endpoints. II B
Tx0 Transport map assigning a final position to an initial position. In Sec. V C, Tt is a flow map and T^t a learned map, not necessarily optimal. II B
πx0,x1,π* Endpoint coupling and optimal coupling, with marginals ρ0,ρ1. Noise dependence is displayed as πε* when taking a limit. II B
φ0,φ1 Endpoint dual potentials for entropic transport; φ1=εr1 with compatible normalization. Their limits are Kantorovich potentials. II B
ζ,φ‾1 Convex conjugate and shifted limiting endpoint potential: φ‾1(x)=‖x‖2/2-φ1(x),T=∇ζ. II B
C0,C1 Cumulative distribution functions of the endpoint densities; Ci-1 denotes the quantile function. II B
θ,pθ Parameters and corresponding density in the geometric illustration; reused for the parametric VI family in Sec. V B. II B
W2ρ0,ρ1 2-Wasserstein distance; its square is the minimum mean squared displacement. The costc=x0-x12/2 has minimum W22/2. II B
F(x) Ordinary scalar objective in the Euclidean gradient-descent analogy. II C
s(x),st(x) Density tangent; along a curve, st=∂tρt, with ∫stdx=0. II C
𝒲2 Space of probability measures with finite second moment, equipped with W2. II C
χ(x) Potential for the minimum-energy transport velocity, with v=-∇χ. In Sec. V B, vi=-∇χi represents the parameter tangent ∂θipθ. II C
‖s‖ρ,s,s′ρ Wasserstein tangent norm and inner product at density ρ. II C
ℱ[ρ] Functional of a density, such as free energy. II C
∇Wℱ[ρ] Wasserstein gradient in its velocity representation; the descent velocity is its negative. II C
δℱ/δρ Functional derivative; ∇Wℱ=∇(δℱ/δρ). II C
Φ(x) Dimensionless potential in the illustrative free energy with unit diffusion coefficient; reused in Sec. V B, with p1=e-Φ/Z1 for VI. II C
α Convexity or geodesic-convexity parameter; positive values indicate strong convexity. II C

TABLE III:

Chapter III: Thermodynamics.

Symbol Meaning or convention Section
S[p] Thermodynamic entropy, S[p]=kBH[p] in the statistical description used here; distinct from mechanical action S[x(⋅)]. III A
T,kB,β Bath temperature, Boltzmann constant, and inverse thermal energy β=kBT-1. III A
peq,pueq Equilibrium density, including dependence on a fixed protocol u. In Chapter IV, pteq=e-Et/Zt is the prescribed equilibrium bridge. III A
E(x),Eu(x),Et(x) Microstate energy; Et=Eut for a protocol. General sampling algorithms in Chapter IV absorb β into Et and use dimensionless energy. III A
ℱeq,ℱueq Equilibrium free energy, -kBTlogZu;-logZu in Chapter IV’s thermal units. III A
ℰ Mean internal energy, ⟨E⟩p. III A
Σ,Σ˙t Total entropy production and its rate; distinct from the change ΔS in system entropy. III B
Q,W Mean heat received by the system and mean work done on it. III B
Np Particle number; distinct from N statistical samples. In Sec. V B, also the number of neurons viewed as parameter particles. III B
Xm,Lmn Macroscopic variables (m=1,…,M) and Onsager transport coefficients. III B 1
ℛ Rayleighian, ℛ=12TΣ˙+ℱ˙; distinct from accumulated reward Rt. III B 1
nt(x) Conserved particle number density, with ∫ntdx=Np. Its normalized form is ρt=nt/Np. III B 1
Γ(n) Dissipation or drag coefficient in the continuum Onsager description. III B 1
η,r Fluid viscosity and colloid radius in the Stokes-drag example; η here is distinct from white noise ηt. III B 1
μt(x) Chemical potential, δℱ/δnt(x); for constant drag, relaxation has χt=μt/Γ. III B 1
D Physical diffusion coefficient, D=ε/2. III B 1
Ft(x) Physical force; the overdamped stochastic drift is ft=DβFt. III B 2
τ Process duration when physical elapsed time is displayed explicitly. III B 2
δpt(x) Deviation from instantaneous equilibrium: pt=puteq+δpt. III B 3
ℒu,ℒu† Operators with convention ∂tp=-ℒup;-ℒu† is the backward generator. The dagger denotes the operator adjoint. III B 3
Θu(x) Protocol score, ∂ulogpueq(x); a vector for a multicomponent protocol. III B 3
ζu Integrated equilibrium score-correlation tensor defining the protocol-space metric. Its energy-unit friction normalization is kBTζu. III B 3
wt[x(⋅)] Work accumulated along one trajectory up to time t;W=w1P for the unit-time protocol. Dimensionless in Chapter IV’s sampling formulas. III B 4
P,u‾t,P‾ Forward path law, reversed protocol u‾t=u1-t, and reverse path law. In Chapter IV, Et=E1-t and xtrev=x1-t denotes a reversed realization. III B 4
λ Work-MGF transform variable in eλw; inverse-energy units when w is physical work. III B 4
Mt,M‾t,M~t Work-weighted endpoint density, reverse conditional MGF, and transformed reverse MGF used in the fluctuation-theorem proof. III B 4

TABLE IV:

Chapter IV: Sampling and Control.

Symbol Meaning or convention Section
p~,p=p~/Z Unnormalized density and the corresponding normalized probability density. IV A
d Dimension of configuration space or number of model degrees of freedom. IV A 1
aˆN Monte Carlo estimate of ⟨a⟩ from N independent samples xn. For an ensemble of paths, xt(n) labels time and run separately. IV A 1
σi,m(x) Ising spin and configuration magnetization, m(x)=d-1∑iσi. IV A 2
ω,ω~ Normalized importance ratio and unnormalized weight. In AIS, ω~t=e-wt and ωt=Z0/Ztω~t. IV A 3
Neff Effective sample size estimated from the weights, ∑nω~n2/∑nω~n2. IV A 3
qt,q‾t Actual forward and reverse sampler densities, distinct from prescribed densities. In AIS, q0=p0,q‾0=p1; in Sec. V C, qt=T^t*p0 is the learned model’s density. IV A 3

TABLE V:

Chapter V: Applications in Learning.

Symbol Meaning or convention Section
𝒳,𝒰 RL state and action spaces. V A 1
π(u∣x) Policy: conditional action distribution; time is included in the state for finite-horizon problems. Later, πQ denotes the Boltzmann policy defined by a critic. V A 1
n,N Decision step and final decision index; n=0,…,N and tn=nΔt. V A 1
Qπ(x,u),Q*(x,u) Exact policy-specific and optimal action values; hats denote learned tabular estimates. In MaxEnt RL, these denote entropy-regularized (“soft”) values. V A 1
θ,Qθπ,Qθ* Neural-network estimates of policy-specific and optimal values; θ denotes the network weights. V A 2
i,M Rollout sample index and number of independent rollouts, i=1,…,M. V A 2
𝒥[π] Expected RL return; the text specifies discounting and any entropy bonus. V A 2
γ Reward discount factor. V A 2
y Sampled Bellman target used to update a critic. V A 2
ξ Learning rate. V A 2
𝒟 Replay buffer of observed transitions and rewards. V A 2
L(θ),ℒ[ρ] Loss as a function of parameters or a functional of a density, respectively. V A 2
θ‾ Parameters held fixed when evaluating a critic target; target-network updates, if used, are specified separately. V A 2
α RL entropy temperature in reward units; distinct from the convexity parameter in Wasserstein geometry. V A 3
π0(u∣x),c0 Reference action distribution and its constant value in the uniform case. V A 3
P* Unrestricted reward-tilted target path law; generally distinct from Pπ*. V A 3
ϕ,πϕ Actor parameters and corresponding parameterized policy. V A 4
ΦNp,𝒱[ρ] Many-particle potential and its density-functional representation, with the normalization displayed in Sec. V B 2. V B 2
U(x,y) Pair-interaction potential, also used for interactions between parameter particles. V B 2
fNpx;Θt Finite-width neural-network predictor; distinct from the passive drift ft. V B 2
Θt,θt(i),wt(i),zt(i) Full parameter collection, neuron parameters, feature weights and internal feature parameters; θ=(w,z). V B 2
φ(x;z) Nonlinear feature; its weighted form is the observable a(x;θ)=wφ(x;z). V B 2
y(x),ν(x) Target regression function and input-data density; distinct from the Bellman target y. V B 2
ℳ,Ω,dθ Parametric density family, parameter domain and parameter dimension. V B 3
gij Parameter-space metric induced by Wasserstein geometry. V B 3
projℳ Orthogonal projection of a velocity onto the tangent space of the parametric density family. V B 3
BWRd,∇BW Gaussian Bures–Wasserstein space and its projected gradient. V B 3
m,Σ,S++d Gaussian mean, covariance and space of symmetric positive-definite covariance matrices. V B 3
h,kh,𝒦hp Smoothing bandwidth, spatial kernel and density-weighted smoothing operator. V B 3
T*p Pushforward of a distribution through a map T. V C 1
vˆ Estimated probability flow field. V C 2
yt Sample-generating process in flow and diffusion models. V C 2
xt Stochastic interpolant defined from training samples. V C 2
ℒFM[v^] Flow-matching loss. V C 2
cj Gaussian-mixture weights, with cj≥0 and ∑jcj=1. V C 2
a^,b^ Learned scale and shift functions in an affine normalizing-flow layer. V C 5

References

  • [1].Bellman R., The theory of dynamic programming, Bulletin of the American Mathematical Society 60, 503 (1954). [Google Scholar]
  • [2].Pontryagin L. S., Boltyanskii V. G., Gamkrelidze R. V., and Mishchenko E. F., The Mathematical Theory of Optimal Processes (Interscience Publishers, New York, 1962) translated from the Russian by K. N. Trirogoff; English edition edited by Neustadt L. W.. [Google Scholar]
  • [3].Dreyfus S., Richard Bellman on the birth of dynamic programming, Operations Research 50, 48 (2002). [Google Scholar]
  • [4].Evans L. C., An introduction to mathematical optimal control theory, Lecture notes, Department of Mathematics, University of California, Berkeley: (2024), spring 2024 version. [Google Scholar]
  • [5].Øksendal B., Stochastic differential equations, in Stochastic differential equations: an introduction with applications (Springer, 2003) pp. 38–50. [Google Scholar]
  • [6].Fleming W. H. and Rishel R. W., Deterministic and Stochastic Optimal Control, Applications of Mathematics, Vol. 1 (Springer-Verlag, New York, 1975). [Google Scholar]
  • [7].Mézard M. and Montanari A., Information, Physics, and Computation, 1st ed. (Oxford University PressOxford, 2009). [Google Scholar]
  • [8].Gelman A., Carlin J. B., Stern H. S., Dunson D. B., Vehtari A., and Rubin D. B., Bayesian Data Analysis, 0th ed. (Chapman and Hall/CRC, 2013). [Google Scholar]
  • [9].Cover T. M. and Thomas J., Elements of information theory (Wiley, 1999). [Google Scholar]
  • [10].Sanov I. N., On the probability of large deviations of random magnitudes, Matematicheskii Sbornik. Novaya Seriya 42(84), 11 (1957), in Russian. [Google Scholar]
  • [11].Touchette H., The large deviation approach to statistical mechanics, Phys. Rep. 478, 1 (2009). [Google Scholar]
  • [12].Shannon C. E., A mathematical theory of communication, Bell Syst. Tech. J. 27, 379 (1948). [Google Scholar]
  • [13].Jaynes E. T., Information theory and statistical mechanics, Phys. Rev. 106, 620 (1957). [Google Scholar]
  • [14].Jaynes E., On the rationale of maximum-entropy methods, Proc. IEEE 70, 939 (1982). [Google Scholar]
  • [15].Zhu S. C., Wu Y. N., and Mumford D., Minimax entropy principle and its application to texture modeling, Neural Comput. 9, 1627 (1997). [Google Scholar]
  • [16].Wainwright M. J., Jordan M. I., et al. , Graphical models, exponential families, and variational inference (Now Publishers, 2008). [Google Scholar]
  • [17].Pressé S., Ghosh K., Lee J., and Dill K. A., Principles of maximum entropy and maximum caliber in statistical physics, Reviews of Modern Physics 85, 1115 (2013). [Google Scholar]
  • [18].Girsanov I. V., On transforming a certain class of stochastic processes by absolutely continuous substitution of measures, Theory of Probability & Its Applications 5, 285 (1960). [Google Scholar]
  • [19].Theodorou E. and Todorov E., Relative entropy and free energy dualities: Connections to path integral and KL control, in IEEE 51st Annual Conference on Decision and Control (CDC) (2012) pp. 1466–1473. [Google Scholar]
  • [20].Levine S., Reinforcement learning and control as probabilistic inference: Tutorial and review, arXiv preprint arXiv:1805.00909 (2018). [Google Scholar]
  • [21].Boué M. and Dupuis P., A variational representation for certain functionals of Brownian motion, The Annals of Probability 26, 1641 (1998). [Google Scholar]
  • [22].Kappen H. J., Linear theory for control of nonlinear stochastic systems, Physical Review Letters 95, 200201 (2005). [DOI] [PubMed] [Google Scholar]
  • [23].Kappen H. J., Path integrals and symmetry breaking for optimal control theory, Journal of Statistical Mechanics: Theory and Experiment 2005, P11011 (2005). [Google Scholar]
  • [24].Todorov E., Linearly-solvable markov decision problems, Advances in neural information processing systems 19 (2006). [Google Scholar]
  • [25].Todorov E., Efficient computation of optimal actions, Proceedings of the National Academy of Sciences 106, 11478 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [26].Theodorou E., Buchli J., and Schaal S., A generalized path integral control approach to reinforcement learning, Journal of Machine Learning Research 11, 3137 (2010). [Google Scholar]
  • [27].Fleming W. H. and Soner H. M., Controlled Markov Processes and Viscosity Solutions, 2nd ed., Stochastic Modelling and Applied Probability, Vol. 25 (Springer, New York, 2006). [Google Scholar]
  • [28].Chetrite R. and Touchette H., Nonequilibrium Markov processes conditioned on large deviations, Annales Henri Poincaré 16, 2005 (2015). [Google Scholar]
  • [29].Schrödinger E., Über die Umkehrung der Naturgesetze, Sitzungsberichte der Preussischen Akademie der Wissenschaften, Physikalisch-Mathematische Klasse 8–9, 144 (1931). [Google Scholar]
  • [30].Schrödinger E., Sur la théorie relativiste de l’Électron et l’interprétation de la mécanique quantique, Annales de l’Institut Henri Poincaré 2, 269 (1932). [Google Scholar]
  • [31].Léonard C., A survey of the Schrödinger problem and some of its connections with optimal transport, Discrete and Continuous Dynamical Systems 34, 1533 (2014). [Google Scholar]
  • [32].Chen Y., Georgiou T. T., and Pavon M., Stochastic control liaisons: Richard Sinkhorn meets Gaspard Monge on a Schrödinger bridge, SIAM Review 63, 249 (2021). [Google Scholar]
  • [33].Sinkhorn R., Diagonal equivalence to matrices with prescribed row and column sums, The American Mathematical Monthly 74, 402 (1967). [Google Scholar]
  • [34].Villani C. and Society A. M., Topics in Optimal Transportation, Graduate studies in mathematics (American Mathematical Society, 2003). [Google Scholar]
  • [35].Cuturi M., Sinkhorn distances: Lightspeed computation of optimal transport, in Advances in Neural Information Processing Systems 26 (2013) pp. 2292–2300. [Google Scholar]
  • [36].Benamou J.-D. and Brenier Y., A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem, Numer. Math. 84, 375 (2000). [Google Scholar]
  • [37].Brenier Y., Polar factorization and monotone rearrangement of vector-valued functions, Communications on Pure and Applied Mathematics 44, 375 (1991). [Google Scholar]
  • [38].Blumenthal E. and Reddy G., Self-organized robustness in mean-field interacting systems (2026), arXiv:2606.27626 [physics.bio-ph]. [Google Scholar]
  • [39].Benamou J.-D., Brenier Y., and Guittet K., The monge–kantorovitch mass transfer and its computational fluid mechanics formulation, International Journal for Numerical Methods in Fluids 40, 21 (2002), https://onlinelibrary.wiley.com/doi/pdf/10.1002/fld.264. [Google Scholar]
  • [40].Chen Y., Georgiou T. T., and Pavon M., On the relation between optimal transport and Schrödinger bridges: A stochastic control viewpoint, Journal of Optimization Theory and Applications 169, 671 (2016). [Google Scholar]
  • [41].McCann R. J., A convexity principle for interacting gases, Advances in Mathematics 128, 153 (1997). [Google Scholar]
  • [42].Otto F., The geometry of dissipative evolution equations: The porous medium equation, Communications in Partial Differential Equations 26, 101 (2001). [Google Scholar]
  • [43].Chewi S., Niles-Weed J., and Rigollet P., Statistical Optimal Transport (Springer, 2025). [Google Scholar]
  • [44].Ambrosio L., Gigli N., and Savaré G., Gradient Flows in Metric Spaces and in the Space of Probability Measures, 2nd ed., Lectures in Mathematics ETH Zürich (Birkhäuser) oCLC: 254181287. [Google Scholar]
  • [45].Jordan R., Kinderlehrer D., and Otto F., The variational formulation of the Fokker–Planck equation, SIAM J. Math. Analys. 29, 1 (1998). [Google Scholar]
  • [46].Kardar M., Statistical Physics of Particles (Cambridge University Press, 2007). [Google Scholar]
  • [47].Casas-Vazquez J. and Jou D., Temperature in non-equilibrium states: A review of open problems and current proposals, Rep. Prog. Phys. 66, 1937 (2003). [Google Scholar]
  • [48].Solon A. P., Fily Y., Baskaran A., Cates M. E., Kafri Y., Kardar M., and Tailleur J., Pressure is not a state function for generic active fluids, Nat. Phys. 11, 673 (2015). [Google Scholar]
  • [49].Lebowitz J. L., Microscopic origins of irreversible macroscopic behavior, Phys. A: Stat. Mech. Appl. 263, 516 (1999). [Google Scholar]
  • [50].Levin Y., Pakter R., Rizzato F. B., Teles T. N., and Benetti F. P., Nonequilibrium statistical mechanics of systems with long-range interactions, Phys. Rep. 535, 1 (2014). [Google Scholar]
  • [51].Seifert U., Stochastic thermodynamics, fluctuation theorems and molecular machines, Rep. Prog. Phys. 75, 126001 (2012). [DOI] [PubMed] [Google Scholar]
  • [52].Peliti L. and Pigolotti S., Stochastic Thermodynamics (Princeton University Press, 2021). [Google Scholar]
  • [53].Weigt M., White R. A., Szurmant H., Hoch J. A., and Hwa T., Identification of direct residue contacts in protein–protein interaction by message passing, Proc. Natl. Acad. Sci. U.S.A. 106, 67 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [54].Meshulam L. and Bialek W., Statistical mechanics for networks of real neurons, Rev. Mod. Phys. 97, 045002 (2025). [Google Scholar]
  • [55].Sorkin B., Be'er A., Diamant H., and Ariel G., Detecting and characterizing phase transitions in active matter using entropy, Soft Matter 19, 5118 (2023). [DOI] [PubMed] [Google Scholar]
  • [56].Cavagna A. and Giardina I., Bird flocks as condensed matter, Annu. Rev. Condens. Matter Phys. 5, 183 (2014). [Google Scholar]
  • [57].Cavagna A., Giardina I., Ginelli F., Mora T., Piovani D., Tavarone R., and Walczak A. M., Dynamical maximum entropy approach to flocking, Phys. Rev. E 89, 042707 (2014). [DOI] [PubMed] [Google Scholar]
  • [58].Sorkin B., Ricouvier J., Diamant H., and Ariel G., Resolving entropy contributions in nonequilibrium transitions, Phys. Rev. E 107, 014138 (2023). [DOI] [PubMed] [Google Scholar]
  • [59].Avinery R., Kornreich M., and Beck R., Universal and accessible entropy estimation using a compression algorithm, Phys. Rev. Lett. 123, 178102 (2019). [DOI] [PubMed] [Google Scholar]
  • [60].Martiniani S., Chaikin P. M., and Levine D., Quantifying hidden order out of equilibrium, Phys. Rev. X 9, 011031 (2019). [Google Scholar]
  • [61].Dyre J. C., Perspective: Excess-entropy scaling, J. Chem. Phys. 149, 210901 (2018). [DOI] [PubMed] [Google Scholar]
  • [62].Sorkin B., Diamant H., and Ariel G., Universal relation between entropy and kinetics, Phys. Rev. Lett. 131, 147101 (2023). [DOI] [PubMed] [Google Scholar]
  • [63].Onsager L., Reciprocal relations in irreversible processes. I., Phys. Rev. 37, 405 (1931). [Google Scholar]
  • [64].Onsager L., Reciprocal relations in irreversible processes. II., Phys. Rev. 38, 2265 (1931). [Google Scholar]
  • [65].Zwanzig R., Nonequilibrium Statistical Mechanics (Oxford University Press, 2001). [Google Scholar]
  • [66].De Groot S. R. and Mazur P., Non-Equilibrium Thermodynamics (Dover Publications, 1984). [Google Scholar]
  • [67].Doi M., Onsager’s variational principle in soft matter, J. Phys.: Condens. Matter 23, 284118 (2011). [DOI] [PubMed] [Google Scholar]
  • [68].Hansen J. P. and McDonald I., Theory of Simple Liquids, 3rd ed. (Academic Press, 2003). [Google Scholar]
  • [69].Schuss Z., Theory and Applications of Stochastic Processes (Springer, New York, 2010). [Google Scholar]
  • [70].Sekimoto K., Langevin equation and thermodynamics, Prog. Theor. Phys. 130, 17 (1998). [Google Scholar]
  • [71].Aurell E., Gawedzki K., Mejia-Monasterio C., Mohayaee R., and Muratore-Ginanneschi P., Refined second law of thermodynamics for fast random processes, J. Stat. Phys. 147, 487 (2012). [Google Scholar]
  • [72].Van Vu T. and Saito K., Thermodynamic unification of optimal transport: Thermodynamic uncertainty relation, minimum dissipation, and thermodynamic speed limits, Phys. Rev. X 13, 011013 (2023). [Google Scholar]
  • [73].Taghvaei A., Miangolarra O. M., Fu R., Chen Y., and Georgiou T. T., On the relation between information and power in stochastic thermodynamic engines, IEEE Control Sys. Lett. 6, 434 (2022). [Google Scholar]
  • [74].Sorkin B., Ariel G., and Markovich T., Consistent expansion of the Langevin propagator with application to entropy production, J. Stat. Mech.: Theor. Exp., 013208 (2025). [Google Scholar]
  • [75].Sorkin B., Diamant H., Ariel G., and Markovich T., Second law of thermodynamics without einstein relation, Phys. Rev. Lett. 133, 267101 (2024). [DOI] [PubMed] [Google Scholar]
  • [76].Sivak D. A. and Crooks G. E., Thermodynamic metrics and optimal paths, Phys. Rev. Lett. 108, 190602 (2012). [DOI] [PubMed] [Google Scholar]
  • [77].Rotskoff G. M. and Crooks G. E., Optimal control in nonequilibrium systems: Dynamic Riemannian geometry of the Ising model, Physical Review E 92, 060102 (2015). [DOI] [PubMed] [Google Scholar]
  • [78].Jarzynski C., Equilibrium free-energy differences from nonequilibrium measurements: A master-equation approach, Physical Review E 56, 5018 (1997). [Google Scholar]
  • [79].Crooks G. E., Entropy production fluctuation theorem and the nonequilibrium work relation for free energy differences, Phys. Rev. E 60, 2721 (1999). [DOI] [PubMed] [Google Scholar]
  • [80].Rotskoff G. M., Crooks G. E., and Vanden-Eijnden E., Geometric approach to optimal nonequilibrium control: Minimizing dissipation in nanomagnetic spin systems, Phys. Rev. E 95, 012148 (2017). [DOI] [PubMed] [Google Scholar]
  • [81].Engel M. C., Smith J. A., and Brenner M. P., Optimal control of nonequilibrium systems through automatic differentiation, Phys. Rev. X 13, 041032 (2023). [Google Scholar]
  • [82].Jarzynski C., Nonequilibrium equality for free energy differences, Physical Review Letters 78, 2690 (1997). [Google Scholar]
  • [83].Hummer G. and Szabo A., Free energy reconstruction from nonequilibrium single-molecule pulling experiments, Proc. Natl. Acad. Sci. U.S.A. 98, 3658 (2001). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [84].Collin D., Ritort F., Jarzynski C., Smith S. B., Tinoco I., and Bustamante C., Verification of the Crooks fluctuation theorem and recovery of RNA folding free energies, Nature 437, 231 (2005). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [85].Betancourt M., A Conceptual Introduction to Hamiltonian Monte Carlo (2018), arXiv:1701.02434 [stat]. [Google Scholar]
  • [86].Vershynin R., High-Dimensional Probability: An Introduction with Applications in Data Science, 2nd ed. (Cambridge University Press, 2026). [Google Scholar]
  • [87].Krauth W., Statistical Mechanics: Algorithms and Computations (Oxford University PressOxford, 2006). [Google Scholar]
  • [88].Chatterjee S. and Diaconis P., The sample size required in importance sampling, The Annals of Applied Probability 28, 1099 (2018). [Google Scholar]
  • [89].Schulman J., Wolski F., Dhariwal P., Radford A., and Klimov O., Proximal policy optimization algorithms, arXiv preprint arXiv:1707.06347 (2017). [Google Scholar]
  • [90].Kirkpatrick S., Gelatt C. D., and Vecchi M. P., Optimization by Simulated Annealing, Science 220, 671 (1983). [DOI] [PubMed] [Google Scholar]
  • [91].Coste S., Importance sampling: The Jarzynski connection (2026). [Google Scholar]
  • [92].Neal R. M., Annealed Importance Sampling (1998), arXiv:physics/9803008. [Google Scholar]
  • [93].Frenkel D. and Smit B., Chapter 7 - free energy calculations, in Understanding Molecular Simulation (Second Edition) (Academic Press, San Diego, 2002) second edition ed., pp. 167–200. [Google Scholar]
  • [94].Kappen H. J. and Ruiz H. C., Adaptive importance sampling for control and inference, Journal of Statistical Physics 162, 1244 (2016). [Google Scholar]
  • [95].Singh A. N., Das A., and Limmer D. T., Variational Path Sampling of Rare Dynamical Events, Annual Review of Physical Chemistry 76, 639 (2025). [DOI] [PubMed] [Google Scholar]
  • [96].Das A. and Limmer D. T., Variational control forces for enhanced sampling of nonequilibrium molecular dynamics simulations, The Journal of Chemical Physics 151, 244123 (2019). [DOI] [PubMed] [Google Scholar]
  • [97].Sutton R. S., Barto A. G., et al. , Reinforcement learning: An introduction, Vol. 1 (MIT press Cambridge, 1998). [Google Scholar]
  • [98].Haarnoja T., Zhou A., Abbeel P., and Levine S., Soft actorcritic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor, in International conference on machine learning (Pmlr, 2018) pp. 1861–1870. [Google Scholar]
  • [99].Lai T. L. and Robbins H., Asymptotically efficient adaptive allocation rules, Advances in Applied Mathematics 6, 4 (1985). [Google Scholar]
  • [100].Kaelbling L. P., Littman M. L., and Cassandra A. R., Planning and acting in partially observable stochastic domains, Artificial Intelligence 101, 99 (1998). [Google Scholar]
  • [101].Ni T., Eysenbach B., and Salakhutdinov R., Recurrent model-free RL can be a strong baseline for many POMDPs, in Proceedings of the 39th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 162 (PMLR, 2022) pp. 16691–16723. [Google Scholar]
  • [102].Fujimoto S., van Hoof H., and Meger D., Addressing function approximation error in actor-critic methods, in Proceedings of the 35th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 80 (PMLR, 2018) pp. 1587–1596. [Google Scholar]
  • [103].Bhatt A., Palenicek D., Belousov B., Argus M., Amiranashvili A., Brox T., and Peters J., CrossQ: Batch normalization in deep reinforcement learning for greater sample efficiency and simplicity, in International Conference on Learning Representations (2024). [Google Scholar]
  • [104].Sutton R. S., Learning to predict by the methods of temporal differences, Machine Learning 3, 9 (1988). [Google Scholar]
  • [105].Watkins C. J. and Dayan P., Q-learning, Machine learning 8, 279 (1992). [Google Scholar]
  • [106].Mnih V., Kavukcuoglu K., Silver D., Rusu A. A., Veness J., Bellemare M. G., Graves A., Riedmiller M., Fidjeland A. K., Ostrovski G., Petersen S., Beattie C., Sadik A., Antonoglou I., King H., Kumaran D., Wierstra D., Legg S., and Hassabis D., Human-level control through deep reinforcement learning, Nature 518, 529 (2015). [DOI] [PubMed] [Google Scholar]
  • [107].Baird L., Residual algorithms: Reinforcement learning with function approximation, in Proceedings of the Twelfth International Conference on Machine Learning (Morgan Kaufmann, 1995) pp. 30–37. [Google Scholar]
  • [108].Haarnoja T., Tang H., Abbeel P., and Levine S., Reinforcement learning with deep energy-based policies, in International conference on machine learning (PMLR, 2017) pp. 1352–1361. [Google Scholar]
  • [109].Eysenbach B. and Levine S., Maximum entropy RL (provably) solves some robust RL problems, in 10th International Conference on Learning Representations, ICLR; 2022 (2022). [Google Scholar]
  • [110].Haarnoja T., Zhou A., Hartikainen K., Tucker G., Ha S., Tan J., Kumar V., Zhu H., Gupta A., Abbeel P., and Levine S., Soft actor-critic algorithms and applications (2018), arXiv:1812.05905 [cs.LG]. [Google Scholar]
  • [111].Agarwal A., Jiang N., Kakade S. M., and Sun W., Reinforcement learning: Theory and algorithms, CS Dept., UW Seattle, Seattle, WA, USA, Tech. Rep 32, 96 (2019). [Google Scholar]
  • [112].Jin C., Yang Z., Wang Z., and Jordan M. I., Provably efficient reinforcement learning with linear function approximation, Mathematics of Operations Research 48, 1496 (2023). [Google Scholar]
  • [113].Moore A. W., Efficient Memory-based Learning for Robot Control, Tech. Rep. (University of Cambridge, 1990). [Google Scholar]
  • [114].Huber S., Unger H., Schäfer G., and Rehrl J., Chebyshev policies and the mountain car problem: Reinforcement learning for low-dimensional control tasks, in Forty-third International Conference on Machine Learning (2026). [Google Scholar]
  • [115].Carrillo J., Craig K., Wang L., and Wei C., Primal dual methods for Wasserstein gradient flows, F. Comput. Math. 22, 389 (2022). [Google Scholar]
  • [116].Burger M., Carrillo J. A., and Wolfram M.-T., A mixed finite element method for nonlinear diffusion equations (2010). [Google Scholar]
  • [117].Halmos P. and Hanin B., Implicit bias of the jko scheme (2026), arXiv:2511.14827 [stat.ML]. [Google Scholar]
  • [118].McKean H. P., A class of markov processes associated with nonlinear parabolic equations, Proceedings of the National Academy of Sciences 56, 1907 (1966). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [119].Sznitman A.-S., Topics in propagation of chaos, in Ecole d’Eté de Probabilités de Saint-Flour XIX — 1989, edited by Hennequin P.-L. (Springer Berlin Heidelberg, Berlin, Heidelberg, 1991) pp. 165–251. [Google Scholar]
  • [120].Chizat L. and Bach F., On the global convergence of gradient descent for over-parameterized models using optimal transport, in Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18 (Curran Associates Inc., Red Hook, NY, USA, 2018) p. 3040–3050. [Google Scholar]
  • [121].Rotskoff G. and Vanden-Eijnden E., Trainability and accuracy of artificial neural networks: An interacting particle system approach, Communications on Pure and Applied Mathematics 75, 1889 (2022), https://onlinelibrary.wiley.com/doi/pdf/10.1002/cpa.22074. [Google Scholar]
  • [122].Mei S., Montanari A., and Nguyen P.-M., A mean field view of the landscape of two-layer neural networks, Proceedings of the National Academy of Sciences 115, E7665 (2018), https://www.pnas.org/doi/pdf/10.1073/pnas.1806579115. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [123].Sirignano J. and Spiliopoulos K., Mean field analysis of neural networks: A law of large numbers, SIAM Journal on Applied Mathematics 80, 725 (2020). [Google Scholar]
  • [124].Cybenko G., Approximation by superpositions of a sigmoidal function, Mathematics of Control, Signals and Systems 2, 303 (1989). [Google Scholar]
  • [125].Barron A. R., Universal approximation bounds for superpositions of a sigmoidal function, IEEE Trans. Inf. Theor. 39, 930–945 (1993). [Google Scholar]
  • [126].Park J. and Sandberg I. W., Universal approximation using radial-basis-function networks, Neural Computation 3, 246 (1991). [DOI] [PubMed] [Google Scholar]
  • [127].Nguyen P.-M. and Pham H. T., A rigorous framework for the mean field limit of multilayer neural networks, Mathematical Statistics and Learning 6, 201 (2023). [Google Scholar]
  • [128].Sirignano J. and Spiliopoulos K., Mean field analysis of deep neural networks, Mathematics of Operations Research 47, 120 (2022). [Google Scholar]
  • [129].Blei D. M., Kucukelbir A., and McAuliffe J. D., Variational inference: A review for statisticians, Journal of the American Statistical Association 112, 859 (2017). [Google Scholar]
  • [130].Takatsu A., Wasserstein geometry of Gaussian measures, Osaka Journal of Mathematics 48, 1005 (2011). [Google Scholar]
  • [131].Lambert M., Chewi S., Bach F., Bonnabel S., and Rigollet P., Variational inference via wasserstein gradient flows, in Advances in Neural Information Processing Systems, edited by Oh A. H., Agarwal A., Belgrave D., and Cho K. (2022). [Google Scholar]
  • [132].Diao M., Balasubramanian K., Chewi S., and Salim A., Forward-backward gaussian variational inference via jko in the bures-wasserstein space, in Proceedings of the 40th International Conference on Machine Learning, ICMĽ23 (JMLR.org, 2023). [Google Scholar]
  • [133].Liu Q. and Wang D., Stein variational gradient descent: a general purpose bayesian inference algorithm, in Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS’16 (Curran Associates Inc., Red Hook, NY, USA, 2016) p. 2378–2386. [Google Scholar]
  • [134].Liu Q., Stein variational gradient descent as gradient flow, in Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17 (Curran Associates Inc., Red Hook, NY, USA, 2017) p. 3118–3126. [Google Scholar]
  • [135].Lu J., Lu Y., and Nolen J., Scaling limit of the stein variational gradient descent: The mean field regime, SIAM Journal on Mathematical Analysis 51, 648 (2019). [Google Scholar]
  • [136].Korba A., Salim A., Arbel M., Luise G., and Gretton A., A non-asymptotic analysis for stein variational gradient descent, in Advances in Neural Information Processing Systems, Vol. 33 (2020) pp. 4672–4682. [Google Scholar]
  • [137].Salim A., Sun L., and Richtarik P., A convergence theory for SVGD in the population limit under talagrand’s inequality t1, in Proceedings of the 39th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 162, edited by Chaudhuri K., Jegelka S., Song L., Szepesvari C., Niu G., and Sabato S. (PMLR, 2022) pp. 19139–19152. [Google Scholar]
  • [138].Das A. and Nagaraj D., Provably fast finite particle variants of svgd via virtual particle stochastic approximation, in Advances in Neural Information Processing Systems, Vol. 36, edited by Oh A., Naumann T., Globerson A., Saenko K., Hardt M., and Levine S. (Curran Associates, Inc., 2023) pp. 49748–49760. [Google Scholar]
  • [139].Shi J. and Mackey L., A finite-particle convergence rate for stein variational gradient descent, in Proceedings of the 37th International Conference on Neural Information Processing Systems, NIPS '23 (Curran Associates Inc., Red Hook, NY, USA, 2023). [Google Scholar]
  • [140].Chen Y., Georgiou T. T., and Tannenbaum A., Optimal transport for gaussian mixture models, IEEE Access 7, 6269 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [141].Delon J. and Desolneux A., A wasserstein-type distance in the space of gaussian mixture models, SIAM Journal on Imaging Sciences 13, 936 (2020). [Google Scholar]
  • [142].Jiang Y., Chewi S., and Pooladian A.-A., Algorithms for mean-field variational inference via polyhedral optimization in the Wasserstein space, in Proceedings of Thirty Seventh Conference on Learning Theory, Proceedings of Machine Learning Research, Vol. 247, edited by Agrawal S. and Roth A. (PMLR, 2024) pp. 2720–2721. [Google Scholar]
  • [143].Ghosh S., Lu Y., Nowicki T., and Zhang E., On representations of mean-field variational inference, Journal of Applied Analysis doi: 10.1515/jaa-2024-0110. [DOI] [Google Scholar]
  • [144].Watson J. L., Juergens D., Bennett N. R., Trippe B. L., Yim J., Eisenach H. E., Ahern W., Borst A. J., Ragotte R. J., Milles L. F., Wicky B. I. M., Hanikel N., Pellock S. J., Courbet A., Sheffler W., Wang J., Venkatesh P., Sappington I., Torres S. V., Lauko A., De Bortoli V., Mathieu E., Ovchinnikov S., Barzilay R., Jaakkola T. S., DiMaio F., Baek M., and Baker D., De novo design of protein structure and function with RFdiffusion, Nature 620, 1089 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [145].Ho J., Jain A., and Abbeel P., Denoising Diffusion Probabilistic Models (2020), arXiv:2006.11239 [cs]. [Google Scholar]
  • [146].Sohl-Dickstein J., Weiss E., Maheswaranathan N., and Ganguli S., Deep unsupervised learning using nonequilibrium thermodynamics, in Proceedings of the 32nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 37, edited by Bach F. and Blei D. (PMLR, Lille, France, 2015) pp. 2256–2265. [Google Scholar]
  • [147].Albergo M. S., Boffi N. M., and Vanden-Eijnden E., Stochastic Interpolants: A Unifying Framework for Flows and Diffusions (2025), arXiv:2303.08797 [cs]. [Google Scholar]
  • [148].Lipman Y., Havasi M., Holderrieth P., Shaul N., Le M., Karrer B., Chen R. T. Q., Lopez-Paz D., Ben-Hamu H., and Gat I., Flow Matching Guide and Code (2024), arXiv:2412.06264 [cs]. [Google Scholar]
  • [149].Kingma D. P. and Welling M., An Introduction to Variational Autoencoders 10.48550/ARXIV.1906.02691 (2019). [DOI] [Google Scholar]
  • [150].Lipman Y., Chen R. T. Q., Ben-Hamu H., Nickel M., and Le M., Flow matching for generative modeling, in International Conference on Learning Representations (2023) arXiv:2210.02747. [Google Scholar]
  • [151].Kadkhodaie Z., Pooladian A.-A., Chewi S., and Simoncelli E., Blind denoising diffusion models and the blessings of dimensionality (2026), arXiv:2602.09639 [cs]. [Google Scholar]
  • [152].Villani C., Optimal Transport, edited by Berger M., Eckmann B., De La Harpe P., Hirzebruch F., Hitchin N., Hörmander L., Kupiainen A., Lebeau G., Ratner M., Serre D., Sinai Ya. G., Sloane N. J. A., Vershik A. M., and Waldschmidt M., Grundlehren Der Mathematischen Wissenschaften, Vol. 338 (Springer Berlin Heidelberg, Berlin, Heidelberg, 2009). [Google Scholar]
  • [153].Vincent P., A connection between score matching and denoising autoencoders, Neural Computation 23, 1661 (2011). [DOI] [PubMed] [Google Scholar]
  • [154].Hyvärinen A., Estimation of non-normalized statistical models by score matching, Journal of Machine Learning Research 6, 695 (2005). [Google Scholar]
  • [155].Song Y. and Ermon S., Generative modeling by estimating gradients of the data distribution, in Advances in Neural Information Processing Systems, Vol. 32 (2019). [Google Scholar]
  • [156].Song Y., Sohl-Dickstein J., Kingma D. P., Kumar A., Ermon S., and Poole B., Score-Based Generative Modeling through Stochastic Differential Equations (2021), arXiv:2011.13456 [cs]. [Google Scholar]
  • [157].Anderson B. D., Reverse-time diffusion equation models, Stochastic Processes and their Applications 12, 313 (1982). [Google Scholar]
  • [158].Song Y., Dhariwal P., Chen M., and Sutskever I., Consistency Models (2023). [Google Scholar]
  • [159].Liu X., Gong C., and Liu Q., Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow (2022). [Google Scholar]
  • [160].Rezende D. and Mohamed S., Variational inference with normalizing flows, in Proceedings of the 32nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 37, edited by Bach F. and Blei D. (PMLR, Lille, France, 2015) pp. 1530–1538. [Google Scholar]
  • [161].Dinh L., Sohl-Dickstein J., and Bengio S., Density estimation using Real NVP, in International Conference on Learning Representations (2017) arXiv:1605.08803. [Google Scholar]
  • [162].Noé F., Olsson S., Köhler J., and Wu H., Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning, Science 365, eaaw1147 (2019). [DOI] [PubMed] [Google Scholar]
  • [163].Gabrié M., Rotskoff G. M., and Vanden-Eijnden E., Adaptive Monte Carlo augmented with normalizing flows, Proceedings of the National Academy of Sciences 119, e2109420119 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [164].Kanwar G., Albergo M. S., Boyda D., Cranmer K., Hackett D. C., Racanière S., Rezende D. J., and Shanahan P. E., Equivariant Flow-Based Sampling for Lattice Gauge Theory, Physical Review Letters 125, 121601 (2020). [DOI] [PubMed] [Google Scholar]
  • [165].Goodfellow I. J., Pouget-Abadie J., Mirza M., Xu B., Warde-Farley D., Ozair S., Courville A., and Bengio Y., Generative Adversarial Networks (2014). [Google Scholar]
  • [166].Dhariwal P. and Nichol A., Diffusion models beat GANs on image synthesis, in Advances in Neural Information Processing Systems, Vol. 34 (2021). [Google Scholar]
  • [167].Sahoo S. S., Arriola M., Schiff Y., Gokaslan A., Marroquin E., Chiu J. T., Rush A., and Kuleshov V., Simple and Effective Masked Diffusion Language Models (2024), arXiv:2406.07524 [cs]. [Google Scholar]
  • [168].Raya G. and Ambrogioni L., Spontaneous symmetry breaking in generative diffusion models, in Advances in Neural Information Processing Systems 36 (Neural Information Processing Systems Foundation, Inc. (NeurIPS), New Orleans, Louisiana, USA, 2023) pp. 66377–66389. [Google Scholar]
  • [169].Biroli G., Bonnaire T., De Bortoli V., and Mézard M., Dynamical regimes of diffusion models, Nature Communications 15, 9957 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]

Articles from ArXiv are provided here courtesy of arXiv

RESOURCES