Nonlinear Stochastic Control and Information Theoretic Dualities : Connections , Interdependencies and Thermodynamic Interpretations

In this paper, we present connections between recent developments on the linearly-solvable stochastic optimal control framework with early work in control theory based on the fundamental dualities between free energy and relative entropy. We extend these connections to nonlinear stochastic systems with non-affine controls by using the generalized version of the Feynman–Kac lemma. We present alternative formulations of the linearly-solvable stochastic optimal control framework and discuss information theoretic and thermodynamic interpretations. On the algorithmic side, we present iterative stochastic optimal control algorithms and applications to nonlinear stochastic systems. We conclude with an overview of the frameworks presented and discuss limitations, differences and future directions.


Introduction
While the topic of nonlinear stochastic control has been traditionally studied within control and applied mathematics, over the past 10-15 years, there has been an increasing interest by researchers in machine learning and robotics communities to expand nonlinear stochastic optimal control in terms of theoretical generalizations and algorithms.The main motivation for this increasing interest is the ability to solve stochastic optimal control problems with forward sampling of stochastic differential equations (SDEs).There have been a few approaches in the literature on this topic, called path integral (PI) control [1][2][3], Kullback-Leibler (KL) control or linearly-solvable control [4,5].
The PI control framework is derived for continuous time stochastic systems affine in controls and noise and for finite horizon optimal control problems.In the KL control, the derivation is in discrete time Markov decision processes (MDPs) and includes finite horizon, infinite horizon, exponentially-discounted and first exit optimal control problems.The continuous time equivalent of the KL control is recovered when transition probabilities are defined based on the corresponding SDEs.Due the central role that linear partial differential equations (PDEs) play in the analysis of the aforementioned approaches, we will refer to them as linearly-solvable optimal control (LSOC), and when necessary, we will use the explicit names of PI or KL control.Moreover, we will restrict our analysis to the finite horizon case.Similar connections have been identified for the infinite horizon case [6].The analysis for the infinite horizon case will be presented in a follow-up manuscript.
One of the important findings in the LSOC framework is the observation that under certain conditions related to the process noise and control authority, stochastic optimal control problems can be solved with forward sampling of SDEs and the evaluation of expectations.The fundamental theorem that made this observation possible, especially for the continuous case, is the Feynman-Kac lemma [7][8][9].The Feynman-Kac lemma connects SDEs and linear backward PDEs by providing a probabilistic representation of solutions of backwards PDEs.Alternative computational algorithms to the sampling-based LSOC framework incorporate methods on low rank tensor approximation to find solution of linear PDEs on a domain of interest [10].
With the goal to unify different views on stochastic optimal control as developed within different disciplines in sciences and engineering, this work aims to present recent developments and to discuss their connections with previous work using information theoretic concepts.In particular, we expand upon our previous work on this topic [11] and present connections between the LSOC framework as presented within the machine learning and statistical physics communities with the information theoretic view of nonlinear stochastic optimal control theory using the free energy-relative entropy relationship [12][13][14][15].
Below, we summarize the main points of our analysis: (i) The PI and KL control framework can be derived using the relative entropy-free energy relationship, and therefore, there are direct connections of the LSOC framework to previous work in control theory.These connections were recently shown in [11].From the epistemological stand point, the aforementioned connections provide a deeper understanding of optimality principles and identify the conditions under which these optimality principles emerge from information theoretic postulates.Essentially, there are alternative views/methodological approaches of looking into nonlinear stochastic optimal control that are illustrated in Figure 1.(ii) The derivation of nonlinear stochastic optimal control using the free energy and relative entropy relationship does not rely on the Bellman principle.In other words, one can derive the Hamilton-Jacobi-Bellman (HJB) equation without using dynamic programming.When the form of the optimal control policy has to be found, then the connection with stochastic optimal control based on dynamic programming is necessary.In this paper, we generalize the connection between free energy-relative entropy dualities and stochastic optimal control to systems that are non-affine in controls.The analysis leverages the generalized version of the Feynman-Kac lemma and identifies the necessary and sufficient conditions under which the aforementioned connections are valid.This generalization creates future research directions towards the development of optimal control algorithms for stochastic systems nonlinear in the state and control.In addition, it shows that there is a deeper relation between the Legendre transformation and stochastic control that goes beyond the class of control affine systems.(iii) While typically in stochastic optimal control theory, the cost function is pre-specified, this is not the case when the stochastic optimal control framework is derived using the free energy-relative entropy relationship.In the latter case, the form of the cost function related to control effort emerges from the structure of the underlying stochastic dynamics.This observation indicates that there are strong interdependencies between cost functions and dynamics and that the choice of the control cost function is not arbitrary.Another way to understand the importance of the aforementioned interdependencies is that, while in the traditional approach, the cost function is imposed to the problem, in the information theoretic view of stochastic optimal control, the cost function partially emerges from the formulation of the problem ( see Figure 1).(iv) We illustrate connections between stochastic control and the maximum entropy principle.The analysis relies on the generalized Boltzmann, Gibbs and Shannon entropy [16].We show that the stochastic control framework is recovered as the maximization of the generalized Boltzmann, Gibbs and Shannon entropy subject to energy and probability measure normalization constraints.(v) For the class of stochastic systems that are affine in control and noise, there are cost function formulations that cannot be represented within the information theoretic approach.Thus, although the information theoretic formulation of stochastic optimal control provides a general framework, there are cases in which the a priori specification of the cost function and the use of dynamic programming provide more flexibility.(vi) Besides the analysis on the connections between different formulations of stochastic optimal control theory, we also present iterative algorithms designed for stochastic systems and demonstrate some examples.
Figure 1.An unified view of nonlinear stochastic optimal control theory based on dynamic programming and free energy-relative entropy information theoretic dualities.
The paper is organized as follows.In Section 2, we provide the definitions of free energy and relative entropy and derive their mathematical connection.
In Section 3 we present the connection of the relative entropy and free energy relationship with the theory of stochastic control.In particular, in Section 3.1, we apply the relative entropy and free energy relationship to nonlinear stochastic dynamical systems affine in noise.In Section 3.2, the analysis on the application of the aforementioned relationship to nonlinear stochastic dynamics affine in controls and noise is presented together with connections to dynamic programming.In Section 4, we discuss thermodynamic interpretations and connections to the maximum entropy principle.In Section 5, we provide the derivation of the PI control as presented within the machine learning and statistical physics.In Section 6, the discrete time formulation is derived, and in Subsection 6.1, the connections to continuous time are shown.Finally in Section 7, we present algorithms, and in Section 8, we conclude with a discussion on the equivalencies and differences between the different views of stochastic optimal control.

Fundamental Relationship between Free Energy and Relative Entropy
In this section, we discuss the fundamental relationship between free energy and relative entropy [13].This relationship is key for deriving the stochastic optimal control problem.Let (Ω, F) be a measurable space, where Ω denotes the sample space and F denotes a σ-algebra, and let P(Ω) define a probability measure on the σ-algebra F. For the concepts that we shall propose, we need the following definitions.
Definition 1.Let P ∈ P(Ω), and let the function J (x) : Ω → be a measurable function.Then, the following term: is called the free energy (the function log e denotes the natural logarithm) of J (x) with respect to P and ρ ∈ .
[13]: Let P ∈ P(Ω) and Q ∈ P(Ω); then, the relative entropy of P with respect to Q is defined as: where "<<" denotes the absolute continuity of Q with respect to P and L 1 denotes the space of Lebesgue measurable functions on [0, ∞).We say that Q is absolutely continuous with respect to P, and we write The free energy and relative entropy relationship is expressed by the theorem that follows.
Theorem 1.Let (Ω, F) be a measurable space, where Ω denotes the sample space and F denotes a σ-algebra, and let P(Ω) define a probability measure on the σ-algebra F. Consider P, Q ∈ P(Ω) and the definitions of free energy and relative entropy as expressed in Definitions (1) and (2).Under the assumption that Q << P, the following inequality holds: where E P , E Q is the expectation under the probability measure P, Q, respectively, and ρ ∈ − and J : M → and M ∈ Z + .The inequality in (2) is the so-called Legendre transform.
Proof.We express the expectation E P as a function of the expectation E Q .In particular, Taking the logarithm of both sides of Equation (3) and using Jensen's inequality yields: log e E P exp (ρJ ) = log e exp (ρJ ) dP dQ dQ ≥ log e exp (ρJ ) The inequality (4) can be written as: Multiplying Equation ( 5) with 1 ρ , where ρ < 0 or ρ = −|ρ|, it follows Equation ( 2) with E Q (J ) = J dQ.
Inequality (2) gives a dual relationship between relative entropy and free energy, which leads to the minimization problem: The infimum in Equation ( 6) attained at Q * is given by: To verify that the infimum is attained by Equation (2), we have the following lemma.
Lemma 1.Given the definitions of free energy and relative entropy and the assumption of absolutely continuous measures Q << P, the LHS of the Legendre transformation in Equation ( 2) is attained by the optimal measure in Equation (7).
Proof.The proof is rather, simple and it is based on the substitution of Equation (7) into Equation (2).More precisely: In the case where ρ > 0, the inequality in (2) is flipped, and hence, the infimum in Equation ( 6) reverts to a supremum.

The Legendre Transformation and Stochastic Optimal Control
With the goal to use the Legendre transformation and to show its connection to optimal control, we define J as a state-and time-dependent cost function evaluated on trajectories starting at x(t) ∈ n at time t and with a time horizon t N ≥ t.More precisely, we have the mathematical form: where φ : n × → is a state-dependent terminal cost and q : n × → is state-and time-dependent running cost.We also define the function ξ : n × → as follows: where ν ∈ .Depending on the sign of ν, the function ξ(x, t) has different interpretations.For small ν, Equation ( 9) is a function of the mean and the variance ξ(x, t) = E P (J (x, t)) + ν 2 VAR (J (x, t)).For ν = |ρ|, Equation ( 9) is risk sensitive, whereas for ν = −|ρ|, it is risk seeking.For our analysis, ν = −|ρ|.Next, we incorporate the state and time dependencies in the Legendre transformation in Equation ( 6), and we have: Helmholtz Free Energy The RHS of the minimization problem in Equation ( 10) is the sum of a state-dependent cost and the relative entropy between the two measures P, Q; moreover, the minimization is w.r.t the probability measures Q.We assign the probability measures P and Q to passive, in the sense of uncontrolled dynamics, and to controlled dynamics and consider the task of steering a dynamical system from an initial to a target state.The goal in Equation ( 10) is to find the optimal probability measure/control that steers the system from the initial to the terminal state by minimizing the state cost at the expense of the information cost.The information cost is an implicit measure of control effort, and its final formulation depends on the structure of the underlying dynamics.The LHS in Equation ( 10) corresponds to Helmholtz free energy, while there is also a term that corresponds to the concept of the desirability function.This concept was introduced in [4] and plays a key role in our derivations and analysis that follow.In the next two sections, we apply the Legendre transformation to stochastic systems and identify the cases where there is a direct relationship with dynamic programming and the LSOC.

Application to Nonlinear Stochastic Dynamics with Affine Stochastic Disturbances
In this section, we consider stochastic dynamics of the form: where x ∈ n denotes the state of the system, u ∈ m denotes the control vector, B(x) : n → n×p is the diffusion matrix function, F(x, u) : n × m → n are the drift dynamics and dw ∈ p is a Gaussian white noise disturbance.The diffusion matrix is partitioned as where the drift term A(x) : n → n is defined as A(x) F(x, 0) and corresponds to the uncontrolled dynamics in Equation (11).Here, we denote the expectations evaluated on the system trajectories generated by the controlled dynamics and uncontrolled dynamics by E Q and E P , respectively.In addition, ).The definition of the Radon-Nikodym [17] derivative for the stochastic differential Equations ( 11) and ( 12) has the form: where the term ζ(u, t) is now defined as: Now, substituting Equations ( 13) and ( 14) into Equation (2), we obtain: When the minimum is attained for Q * given by Equation ( 7), we have: where the ) corresponds to the difference between the drift of the optimally-controlled (i.e., u = u * ) and the drift of the uncontrolled (i.e., u = 0) dynamics.Equations ( 15) and ( 16) demonstrate how the structure of the dynamics appears in the information cost under minimization in the Legendre transformation.Therefore, there is a straight-forward relationship between the structure of the stochastic dynamics under consideration and the form of the control cost function under minimization.While this observation is not surprising when the Legendre transformation is used, it suggests ways to design control cost functions in stochastic optimal control theory based on the form of the stochastic dynamics.Another interesting observation is that the LHS of Equation ( 16) is the minimum attained under the optimal, in the sense of the Legendre transformation, probability measure Q * .
A question that arises here is related to the connection between the two forms of optimality, namely the optimality in the Legendre sense and the optimality in the dynamic programming sense.To further investigate this connection, we will leverage the Feynman-Kac Lemma in its more general form for the case of backward PDEs [8].We also consider the stochastic dynamics in Equation (11) under the optimal control law u * (x, t): Under the assumptions of continuity and linear growth for F(x, u * (x, t)), B(x) and the existence and uniqueness of the weak solution of Equation ( 17) (see pages 364 and 366 of [8]), we have the following theorem: , and it satisfies the Cauchy problem: in [0, t N ) × n×1 with the boundary condition: then Ψ(x, t) admits the stochastic representation: In particular, such a solution is unique.The expectation above is taken with respect to sampled trajectories generated using (17).
Given the form of the Feynman-Kac lemma and the expectation in Equation ( 16), we set the terms L(x, t), and β(x t N ) in Equation (20) as follows: Based on the Feynman-Kac lemma, the free energy term ξ(x, t) can be interpreted as the unique solution of the backward PDE: with the boundary condition ξ(x(t N ), t N ) = φ(x(t N ), t N ).The interesting observation here is that the PDE in Equation ( 22) is the optimal HJB PDE for a stochastic optimal control problem with state cost q(x, t) and control cost term 1 2|ρ| ∆F T c (x, u * )Σ −1 Bc (x)∆F c (x, u * ) subject to the dynamics in Equation (11).It is clear therefore that there is a fundamental connection between the Legendre transformation and dynamic programing for the general class of stochastic systems that are affine only in the stochastic disturbances and nonlinear in controls and states.This observation generalizes our previous work on identifying the connections between the relative entropy and free energy dualities and the PI and KL controls [11].Essentially, the two methodologies result in the same HJB PDE when the state and the control cost function are defined as: The implications of this finding can be summarized as follows (i) The Helmholtz free energy satisfies the HJB PDE for the case of systems that are non-affine in controls and affine in stochastic disturbances.This observation has direct consequences to the development of algorithms that can compute the value function for a stochastic optimal control problem with forward sampling of SDEs.While this connection was known within the LSOC framework for dynamics affine in controls and noise, it is the first time that this connection has been derived for general classes of stochastic systems with dynamics nonlinear in state and control and affine only in noise.(ii) The optimal measure dQ * for the stochastic control problem with state and control cost as specified in Equation ( 23) is given by Equation (7).Note that this is the probability measure that corresponds to trajectories generated under the optimal control policy u * (x, t).A fundamental question at this point is related to how this optimal control can be numerically computed, such that dQ = dQ * .The difficulty arises from the fact that for the case of dynamic systems that are nonlinear in controls and cost functions that are non quadratic, there is no explicit form for the optimal control policy u * (x, t).This difficulty could be addressed by an a priori specification of the structure of the optimal control policy u(x, t) and then optimization of this structure, such that for any state x and time t, the optimal probability measure dQ * = dQ * (x, t) is reached.
Next, we discuss the connection between the free energy-relative entropy dualities and stochastic optimal control of systems with dynamics affine in control and noise.Again, the Feynman-Kac lemma plays a key role, but as will be shown, the way that it is applied differs from our analysis in this section, since it is directly applied to the desirability function.

Application to Nonlinear Stochastic Dynamics with Affine Controls and Disturbances
In this section, we apply the Legendre transformation for probability measures that correspond to stochastic dynamics affine in control and stochastic disturbances.In particular, we consider the stochastic dynamics [13,18]: where x ∈ n denotes the state of the system, B(x) : → n×p is the control and diffusion matrix function partitioned as B(x) = [0 T (n−p)×p , B T c (x)] T , where B c (x) : n → p×p is invertible, f (x) : n → n denotes the passive dynamics, u ∈ p is the control vector and dw ∈ p is a Gaussian white noise disturbance.Note that the difference between the two diffusion terms in Equations ( 24) and ( 25) is the fact that the control appears in Equation (25).This control, together with the passive dynamics, defines a new drift term.Expectations evaluated on the system trajectories generated by the uncontrolled and controlled dynamics are represented by E P and E Q , respectively.The corresponding probability measures of the aforementioned expectations are P and Q. Next, we use Equation (10) and the Radon-Nikodym derivative given by Equations ( 13) and (14), which now takes the form dQ dP = exp (ζ(u, t)) [8], where the term ζ(u, t) is given by: Substituting dQ dP into inequality (10) gives: Substitution of ζ(u) in the last equation results in: The last term in Inequality (28) corresponds to the cost function of a stochastic optimal control problem and is bounded from below by the free energy.In addition to providing a lower-bound on the objective function for the stochastic optimal control problem, Inequality (28) provides an explicit construction on how this lower bound can be computed.This computation involves forward sampling of the uncontrolled dynamics, evaluation of the expectation of the exponentiated state-dependent part, φ(x(t N )) and q(x(t)), and the logarithmic transformation of this expectation.Note that Inequality (28) is derived without relying on any principle of optimality and involves the application of Girsanov's theorem between controlled and uncontrolled stochastic dynamics, as well as the use of the dual relationship between the free energy and the relative entropy needed to compute the lower bound in (28).Inequality (28) defines a minimization problem where the RHS of the inequality is minimized with respect ζ(u, t) and, hence, with respect to the control u.At the minimum u = u * , the right part of the inequality in (28) attains its optimal ξ(x, t).Under the optimal control policy u * , the optimal distribution takes the from: An important question that arises is: What is the link between (28) and the principle of optimality in dynamic programming?To address this question, one needs to show that ξ(x, t) satisfies the HJB equation, and hence, ξ(x, t) is the corresponding value function [18].More precisely, we introduce a new variable Φ(x, t) defined as Φ(x, t) E P (exp (ρJ (x, t))) and apply the Feynman-Kac lemma [7] to arrive at the backward Chapman-Kolmogorov PDE: x (x, t).In this case, it can be shown that ξ(x, t) satisfies the nonlinear PDE: The nonlinear PDE in Equation (31) corresponds to the HJB equation [19] for the case of the minimizing optimal control problem, and hence, ξ(x, t) is the corresponding minimizing value function.It is important to note that the principle of optimality was not used to derive Equation (31).Furthermore, while the mathematical analysis results in the HJB PDE, it does not explicitly provide the form of the optimal control policy.This means that to derive Equation (31), it is not required to have an expression for the optimal control policy.This observation is in stark contrast with the classical treatment of stochastic optimal control theory, based on dynamic programming, where first the optimal control is specified and then the final form of the HJB Equation ( 31) is derived.
The optimal control policy associated with Equation ( 31) is expressed as: To recover the optimal control policy Equation (32), one needs to be aware of the optimal control derivation that is based on dynamic programming.

Thermodynamic Interpretations and Connections to the Maximum Entropy Principle
In this section, we discuss thermodynamic interpretations of nonlinear stochastic optimal control theory using the relative entropy-free energy relationship.More precisely, we consider the Baroh-Jaunch entropy or generalized Boltzmann-Gibbs-Shannon entropy [16] defined as: then Equation (2) takes the form: At Q = Q * , we have that: The last equation has the form F = U − T S, where F is the free energy, T = |ρ| −1 is the temperature and S is the generalized Boltzmann-Gibbs-Shannon entropy.Note that Baroh-Jaunch entropy is a concave function, and it is a generalized form of entropy, since it incorporates the Boltzmann, Gibbs and Shannon entropy [16].In addition, it is negative, and its maximum is reached for P = Q.Minimization of the KL(P||Q) is equivalent to maximization of the generalized Boltzmann-Gibbs-Shannon entropy S(P||Q).In the absence of the state cost, the optimal measure is the one that maximizes the Boltzmann-Gibbs-Shannon entropy, and therefore, P = Q.However, as it is shown next, in the presence of the state-dependent cost constraint, the optimal measure Q * should be "far" from the baseline probability measure P. When the probability measures Q and P are assigned to state distributions of controlled and uncontrolled stochastic dynamical systems, the Kullback-Leibler divergence between Q and P is an implicit measure of control effort.In this sense, minimization of the Kullback-Leibler divergence or maximization of the generalized Boltzmann-Gibbs-Shannon entropy is equivalent to minimization of the control effort.
Another interesting connection with thermodynamics emerges from the fact that the optimal policy can be derived using the maximum entropy principle.The form of entropy under maximization is the generalized Boltzmann-Gibbs-Shannon entropy.To makes things concrete, lets consider the following maximum entropy constrained optimization problem specified as follows: where c is positive constant.To find the solution, we form the augmented objective function by incorporating the constraints with proper Lagrange multipliers: Next, we define the term: Given the assumptions that f is Q-integrable and the signed measure L is absolute continuous with respect to Q, (L << Q), the signed measure L is finite (see the general form of Radon-Nikodym Theorem 5.5.3 in [20]).Later, it will be shown that L is a measure (positive-signed measure), but for now, we consider the more general case of the signed measure.Under the aforementioned assumptions, the Radon-Nikodym derivative dL (Q)  dQ is a well-defined operation.To find the optimal measure Q, we apply the Radon-Nikodym derivative in Equation (38) and set it to zero.In mathematical terms, this operation results in: Integration of the optimal measure dQ * to one gives an expression for µ: Substitution of µ back in Equation (39) gives the optimal probability measure in Equation (7).There are few interesting observations: (i) Substitution of the optimal measure dQ * in Lagrangian (37) results in: Moreover, given a certain performance level c, the Lagrange multiplier λ can be found by using the equation: ) corresponds to the Helmholtz free energy, since: Therefore, for the case stochastic dynamics affine in control and noise, the term − 1 λ µ is a value function and satisfies the HJB equation.
(iii) Initially, we considered L as a singed measure.However, given the optimal measure Q * and the form of the Lagrange multiplier µ, the signed measure L is positive, and therefore, it is a measure.
To show this, one can use the Legendre transformation between free energy and relative entropy.
The thermodynamic equilibrium of maximum entropy corresponds to maximization of the generalized Boltzmann-Gibbs-Shannon entropy that is equivalent to minimization of control effort subject to the performance and normalization constrains as expressed in the optimization problem in Equation (36).Moreover, the equilibrium measure is the optimal measure as specified in Equation (7).For the case of stochastic dynamics affine in controls and noise, this measure corresponds to trajectories sampled from the stochastic dynamics under the optimal, in the sense of dynamic programming, control policy.

Bellman Principle of Optimality
In this section, we consider the classical stochastic optimal control problem as a constrained optimization problem and derive the LSOC framework in continuous time.The analysis in this section is more known under the name of PI control, and it has been presented mostly in the machine learning and statistical physics communities [2,21].
Here, we present a generalized version, which was also derived in [11], which allows terms in the cost function to be both state and control dependent.This formulation is important for our later discussion on the generalizability of every approach (information theoretic, path integral, KL control) in the LSOC framework.In particular, we start with the cost functional: The expectation E Q in Equation ( 42) is evaluated on system trajectories generated by forward sampling of the controlled diffusion process Equation (11).We assume that the function F(x, u) is a nonlinear function of the state x ∈ n and affine in the control u ∈ m , and hence, The matrix function G(x) : n → n×m is the control transition matrix, and f (x) : n → n denotes the passive dynamics.Under the optimal control u = u * , the cost function J(x, u) is equal to the value function V (x, t).Next, let L(x, u, t) denote the running cost defined as L(x, u, t) q 0 (x, t) + q T 1 (x, t)u + 1 2 u T Ru, where q 0 (x, t) is a nonlinear, nonquadratic state-dependent cost, q T 1 (x, t)u is a cross-term depending on the state and control and 1 2 u T Ru is a quadratic control cost with R > 0. The stochastic HJB equation [15,19] associated with this stochastic optimal control problem can be expressed as follows: The corresponding optimal control is given by: The optimal control drives the system dynamics in the direction opposite that of the gradient of the value function V x (x, t).Furthermore, the value function satisfies the nonlinear, second-order PDE: where q(x, t) q 0 (x, t) Given the exponential transformation and the relationship between control authority and noise: the PDE in Equation (45) yields: with boundary condition ψ(x, t N ) = exp − 1 λ φ(x, t N ) .Now, applying the Feynman-Kac lemma to the Chapman-Kolmogorov PDE Equation (47) yields a solution in the form of an expectation over system trajectories; namely: The expectation E P in Equation ( 48) is taken on sample paths generated with the forward sampling of the uncontrolled diffusion equation dx = f (x)dt + B(x)dw, and the optimal control is given by: Since the initial value function V (x, t) is the minimum of the expectation of the objective function J(x, u) subject to controlled stochastic dynamics, it can be shown that: Note that Equation ( 50) is a form of the Legendre transformation, and in fact, it is identical to Equation (28) for the case where q With the derivation of the PI stochastic control starting with dynamic programming in continuous time, it is obvious that the mathematical steps follow the opposite direction as in the section where the the same framework is derived based on the relative entropy-free energy dualities; see Figure 1.Furthermore, within the class of stochastic systems affine in controls and stochastic disturbances, the approach that is discussed in this section provides more general formulations, since it allows cost functions with terms that are both state and control dependent, such as the term q T 1 (x, t)u.These terms cannot be recovered when the information theoretic approach is used for the class of stochastic systems with affine controls and disturbances.Therefore, under these certain conditions, the dynamic programming approach provides more flexibility in designing cost functions for optimal control problems.

Kullback-Leibler Control in Discrete Formulations
The KL control was presented in its most generalized form in [4].In this section, we will review the KL control for the finite horizon case.A preliminary analysis on the information theoretic connection of the KL control for the infinite horizon case can be found in [6].Within the KL control framework, the stochastic optimal control problem is formalized as a Markov decision process (MDP) with a stage-wise cost described as: The KL divergence in the last expression is applied to the one step ahead transition probabilities of the control U (x |x) and uncontrolled dynamics P (x |x).Application of the Bellman principle of optimality in the finite horizon case results in: where V (x, t k ) is the time-varying cost-to-go function.The U (•|x)-dependent terms in the functional above are minimized, and thus, we will have that: .
For these purposes, the normalization term G t k [Φ](x) is introduced with Φ(x, t k ) = exp (−V (x, t k )) being the desirability function.More precisely, we will have: Therefore, we have: Lemma 2. Lets consider the dynamics in Equation ( 56) and the function V (x, t) : n × → and Φ(x, t) : n × → with Φ(x, t) satisfying the linear Bellman equation: where q(x) is state-dependent cost and the operator G t k [Φ (dt) ](x) is defined as in Equation ( 52).If V (x, t) = − log e Φ(x, t), then V (x, t) satisfies the HJB PDE of an optimal control problem.
subject to controlled dynamics in Equation ( 56).
This lemma can be seen as an alternative derivation of the Feynman-Kac lemma [9].

Algorithms
In this section, we review the derivation of iterative PI control as shown in our previous work [3,11] and also discuss applications and algorithms.In particular, we will start our analysis with the expectation as expressed in Equation (48).Note that this expectation is evaluated over trajectories sampled via forward propagation of uncontrolled diffusion dx = f (x)dt + B(x)dw (0) (t) in which f (x, t) = f (x) − G(x)R −1 q 1 (x, t).In this paper, we assume that the state of the stochastic dynamics is partitioned as x = [x m x c ] T , and the drift and control transition terms are partitioned as follows f T with B c (x m ) : p → p .Note that systems such as multi-body systems have this form.We also assume that: To derive the iterative path integral control, we will start our analysis with the stochastic representation of the solution of backward Chapman-Kolmogorov PDE: Since at every iteration k, the sampling process takes place with the use of the control policy u k (x, t), the expression above is formulated as: where the Q is the probability measure that corresponds to the diffusion process dx = f (x)dt + G(x)u k (x, t)dt + B(x)dw (1) .The terms u k (x, t) and dw (1) are the control and noise used at iteration k.The ratio of the two probability measures d P d Q is the Radon-Nikodým.The aforementioned ratio for stochastic dynamics is formulated as follows: where the terms Υ uu (x), Υ uw (x) and Υ are defined as After formulating the probability measure P and using the equation above, Equation (61) will take the form: where i ) plays the role of the Lagrangian at iteration k that is specified as follows: where the term α(x(t j ), u k (t j )) is defined as α(x(t j ), u k (t j )) = fc (x(t j )) − G c (x m (t j ))u k (t j ) and fc (x(t j )) is the drift term defined as fc (x(t j )) = f c (x(t j )) − G c (x(t j ))R −1 q 1 (x(t j ), t j ).The terms } are the state and control trajectories at iteration k.In addition, the term µ(x j ) = , and thus, µ(x j )dt = B c (x m (t j ))dw (1) (t).In a more compact form, Equation (62) can be written as: where Lk = L k + 2λ log D.
Lemma 3. (Iterative path integral optimal control:) Given the form of the Lagrangian in Equation ( 63) and the desirability function in Equation (64), the iterative optimal path integral control is specified as: The path integral correction term δu P I is given by: where , while the term Ω(x m (t i )) is defined as: Proof.The optimal controls based on Relation (49) is specified as: Next, the term is computed where ψ xc(t) (x, t) = ∇ xc(t) ψ(x, t).In particular, by pushing the gradient inside the expectation in the definition of the desirability function, we have that: The term E P ( x) is the expectation under the probability P ( x), which is defined as . Based on the form of the Lagrangian in Equation ( 63), the term ∇ xc(t i ) L( x i ) takes the form: The notation O(dt) is used for terms of order dt.We will keep this notation, as we will see that these terms will cancel.The optimal control is expressed as: The term u L in the expression above takes the form: The multiplication of the optimal controls with dt is done in terms of quadratic order with respect to dt.These terms cancel out as dt → 0 or for very small dt.Finally, since µ(x)dt = B(x)dw (1) (t), we will have that the final result is: By combining Equations (69), ( 68) and (71), the final form for the iterative optimal control is expressed in Equation (67).

Open Loop Formulations and Application to an Inverted Pendulum
One of the characteristics of the iterative optimal control in Equation ( 65) is that the control u k+1 (x, t) at iteration k + 1 requires the knowledge of the control u k (x, t) for every pair (x, t).While the iterative characteristic of the proposed scheme improves scalability, the requirement for computing u k (x, t) for any state and time (x, t) prohibits the application of this scheme to high dimensional systems.An alternative approach to address this is to use a parametric or non-parametric approximation method to represent u k (x, t) and apply iterative path integral control in its initial feedback form (65).
Here, we suggest a receding horizon open loop formulation and restrict our analysis to stochastic systems with B c (x(t)) = B c , G c (x) = G c and q 1 (x(t), t) = 0.The algorithm is provided in Tables Algorithm 1 and Algorithm 2 and consists of three procedures, namely F nSample_T rajectories, F nU pdate_Controls and F nApply_Control_Dynamics. In particular, the functionality for the procedure F nSample_T rajectories is to sample trajectories starting from state x k by using an initial control trajectory u(:, k → T ) = (u(k), u(k + 1), ..., u(T )) and to return these sample trajectories and noise profiles used for sampling dw(:, k → T ).The next procedure is F nSample_U pdate and has as input the control trajectory u(:, k → T ), the sampled state trajectories Sampled_T rajectories and the noise profiles dw(:, k → T ).Its functionality, illustrated in Algorithm 2, is to apply the iterative path integral control in its open loop formulation and to compute the new control trajectory u updated (: , k → T ).In the open loop formulation, the state dependence of the correction term in Equation ( 66) is dropped, and therefore, the term δu PI (t) becomes only time varying.In F nApply_Control_Dynamics, the control is applied for one time step, and the overall algorithm repeats again. 2 ) 2 , and the state cost q(x) = 0 and control cost 1 2σ 2 u 2 .The variance of noise is σ = 0.5, and the time horizon used is t N = 300 * 0.01 = 3 s.The state, control trajectories and the cost are illustrated in Figure 2a-d.In particular, Figure 2a illustrates a set of 10 angular trajectories that reach the desired state(red horizontal line), and Figure 2b illustrates the corresponding angular velocities that also reach the desired state (red horizontal line).Figure 2c illustrates the stochastic iterative path integral control trajectories.Finally, Figure 2d illustrates the cost for the 10 trials as the system moves towards the target state p * under the application of the iterative optimal path integral control.

Discussion
In this paper we present four different approaches to LSOC.In the first approach, which is also the most traditional one, stochastic optimal control is formulated as the minimization of an objective function J(x, u) in Equation (42) subject to the controlled dynamics.The HJB PDE is derived based on the Bellman principle of optimality.The exponential transformation of the value function V (x) and the connection between control cost and variance Equation (46) transforms the HJB into the backward Chapman-Kolmogorov.The Feynman-Kac lemma is applied, and the solution of the Chapman-Kolmogorov PDE together with the lower bound on the objective function are provided.
The second approach starts with the risk-seeking version of the cost J (x).This quantity has also the form of the Helmholtz free energy.With the application of Girsanov's theorem between controlled and uncontrolled dynamics and the use of Jensen inequality, the Helmholtz Free energy is the lower bound of the objective function that consists of a state-dependent cost and an information cost, which is a measure of control effort.The link to Bellman optimality is established by showing that the Helmholtz free energy satisfies the HJB equation, and therefore, it is a value function.It should be clear by now that