A Pontryagin Perspective on Reinforcement Learning

## Abstract

Abstract Reinforcement learning has traditionally focused on learning state-dependent policies to solve optimal control problems in a closed-loop fashion.
In this work, we introduce the paradigm of open-loop reinforcement learning where a fixed action sequence is learned instead.
We present three new algorithms: one robust model-based method and two sample-efficient model-free methods.
Rather than basing our algorithms on Bellman’s equation from dynamic programming, our work builds on Pontryagin’s principle from the theory of open-loop optimal control.
We provide convergence guarantees and evaluate all methods empirically on a pendulum swing-up task, as well as on two high-dimensional MuJoCo tasks, demonstrating remarkable performance compared to existing baselines.

## 1 Introduction

Figure: Figure 1: Comparison of closed-loop (feedback) and open-loop (feedforward) control. In closed-loop reinforcement learning (RL), the goal is to learn a policy ($\pi$). In open-loop RL, a fixed sequence of actions ($u_{0:T-1}$) is learned instead, with the action $u_{t}$ independent of the states $x_{0:t}$.

Reinforcement learning (RL) refers to “the optimal control of incompletely-known Markov decision processes” (Sutton and Barto, , p. 2).
It has traditionally focused on applying dynamic programming algorithms, such as value iteration or policy iteration, to situations where the environment is unknown.
These methods solve optimal control problems in a closed-loop fashion by learning feedback policies, which map states $x_{t}$ to actions $u_{t}$.
In contrast, this work introduces the paradigm of *open-loop reinforcement learning* (OLRL), in which entire action sequences $u_{0:T-1}$, over a horizon $T$, are learned instead.
The closed-loop and open-loop control paradigms are illustrated in Fig. 1.

There are good reasons why RL research has historically focused on closed-loop control.
Many problems, particularly those with stochastic or unstable dynamics, cannot be satisfactorily solved in an open-loop fashion.
However, in some settings, open-loop control is the only viable option, for example when economic reasons prevent the use of sensors.
A feedback policy may also produce unpredictable behavior if the environment changes, whereas an open-loop solution, which cannot detect environmental changes, is robust in such cases.
In open-loop control, we optimize over action sequences, and so we need to find one action per time step.
In finite-horizon settings, this can be considerably cheaper than closed-loop control, as optimizing over policies amounts to finding one action for each state of the system.
Finally, there are also fundamental control-theoretic reasons for combining a feedback policy that attenuates disturbances with a feedforward controller that is optimized for reference tracking.
In many situations, such a design significantly outperforms a solution purely based on feedback (e.g., Åström and Murray, , Sec. 12.4).

Indeed, for these reasons, there exists a large body of literature on open-loop optimal control theory (Pontryagin et al., ).
In this work, we introduce a family of three new open-loop RL algorithms by adapting this theory to the setting of unknown dynamics.
Whereas closed-loop RL is largely based on approximating the Bellman equation, the central equation of dynamic programming, we base our algorithms on approximations of *Pontryagin’s principle*, the central equation of open-loop optimal control.
We provide a model-based method whose convergence we prove to be robust to modeling errors.
We then extend this algorithm to settings with completely unknown dynamics and propose two fully online model-free methods.
Finally, we empirically demonstrate the robustness and sample efficiency of our methods on an inverted pendulum swing-up task and on two complex MuJoCo tasks.

## 2 Background

We consider a reinforcement learning setup with state space $\mathcal{X}\subset\mathbb{R}^{D}$, action space $\mathcal{U}\subset\mathbb{R}^{K}$, and a fixed horizon $T\in\mathbb{N}$.
An episode always starts with the same initial state $x_{0}\in\mathcal{X}$ and follows the deterministic dynamics $f:\mathcal{X}\times\mathcal{U}\to\mathcal{X}$, such that $x_{t+1}=f(x_{t},u_{t})$ for all times $t\in[T-1]_{0}$.(^1^11For $n\in\mathbb{N}$, we write $[n]\doteq\{1,2,\dots,n\}$ and $[n]_{0}\doteq\{0,1,\dots,n\}$. Unless explicitly mentioned, all time-dependent equations hold for all $t\in[T-1]_{0}$.)
After every transition, a deterministic reward $r(x_{t},u_{t})\in\mathbb{R}$ is received, and at the end of an episode, an additional terminal reward $r_{T}(x_{T})\in\mathbb{R}$ is computed as a function of the terminal state $x_{T}$.
We can thus define the value of the state $x_{t}$ at time $t$ as the sum of future rewards

$$ $V_{t}(x_{t};u_{t:T-1})\doteq\sum_{\tau=t}^{T-1}r(x_{\tau},u_{\tau})+r_{T}(x_{T })=r(x_{t},u_{t})+V_{t+1}\{f(x_{t},u_{t});u_{t+1:T-1}\}\text{,}$ $$

where we defined $V_{T}$ as the terminal reward function $r_{T}$.
Our goal is to find a sequence of actions $u_{0:T-1}\in\mathcal{U}^{T}$ maximizing the total sum of rewards $J(u_{0:T-1})\doteq V_{0}(x_{0};u_{0:T-1})$.
We will tackle this trajectory optimization problem using gradient ascent.

#### Pontryagin’s principle.

The gradient of the objective function $J$ with respect to the action $u_{t}$ is

$$ $\nabla_{u_{t}}J(u_{0:T-1})=\nabla_{u}r(x_{t},u_{t})+\nabla_{u}f(x_{t},u_{t}) \underbrace{\nabla_{x}V_{t+1}(x_{t+1};u_{t+1:T-1})}_{\lambda_{t+1}\in\mathbb{R }^{D}}\text{,}$ (1) $$

where the terms of $J$ related to the earlier time steps $\tau\in[t-1]_{0}$ vanish, as they do not depend on $u_{t}$.
We denote Jacobians as $(\nabla_{y}f)_{i,j}\doteq\frac{\partial f_{j}}{\partial y_{i}}$.
The *costates* $\lambda_{1:T}$ are defined as the gradients of the value function along the given trajectory.
They can be computed through a backward recursion:

$$ $\displaystyle\lambda_{t}$ $\displaystyle\doteq\nabla_{x}V_{t}(x_{t};u_{t:T-1})=\nabla_{x}r(x_{t},u_{t})+ \nabla_{x}f(x_{t},u_{t})\lambda_{t+1}$ (2) $\displaystyle\lambda_{T}$ $\displaystyle\doteq\nabla V_{T}(x_{T})=\nabla r_{T}(x_{T}).$ (3) $$

The gradient (1) of the objective function can thus be obtained by means of one forward pass through the dynamics $f$ (a rollout), yielding the states $x_{0:T}$, and one backward pass through Eqs. 2 and 3, yielding the costates $\lambda_{1:T}$.
The stationarity condition arising from setting Eq. 1 to zero, where the costates are computed from Eqs. 2 and 3, is known as *Pontryagin’s principle*.
(Pontryagin’s principle in fact goes much further than this, as it generalizes to infinite-dimensional and constrained settings.)
We re-derive Eqs. 1, 2 and 3 using the method of Lagrange multipliers in Appendix B.

## 3 Method

If the dynamics are known, then the trajectory can be optimized as described above, by performing gradient ascent with the gradients computed according to Pontryagin’s equations 1, 2 and 3.
In this work, we adapt this idea to the domain of reinforcement learning, where the dynamics are unknown.
In RL, we are able to interact with the environment, so the forward pass through the dynamics $f$ is not an issue.
However, the gradient computation according to Pontryagin’s principle requires the Jacobians $\nabla_{x}f_{t}\doteq\nabla_{x}f(x_{t},u_{t})$ and $\nabla_{u}f_{t}\doteq\nabla_{u}f(x_{t},u_{t})$ of the unknown dynamics.
In our methods, which follow the structure of Algorithm 1, we therefore replace these Jacobians by estimates $A_{t}\simeq\nabla_{x}f_{t}$ and $B_{t}\simeq\nabla_{u}f_{t}$.
We now show that, given sufficiently accurate estimates $A_{t}$ and $B_{t}$, this algorithm still converges to a local maximum of the objective $J$.
In the following sections we then discuss model-based and model-free methods to obtain such estimates.

### 3.1 Convergence of Algorithm 1

Figure: Algorithm 1 Open-loop reinforcement learning

Before discussing concrete methods for open-loop RL, whose main concern is the construction of appropriate estimates $A_{t}$ and $B_{t}$, we first show that replacing $\nabla_{x}f_{t}$ and $\nabla_{u}f_{t}$ with such estimates is a good idea.
In particular, we show that, under certain assumptions on the accuracy of $A_{t}$ and $B_{t}$, Algorithm 1 converges to an unbiased local optimum of the true objective $J$.
Our convergence result relies on the following three assumptions.

###### Assumption 3.1 .

All rewards are encoded in the terminal reward $r_{T}$. In other words, $r(x,u)=0$ for all $x\in\mathcal{X}$ and $u\in\mathcal{U}$.

This assumption is without loss of generality, since we can augment the state $x_{t}$ by a single real variable $\rho_{t}$ that captures the sum of the running rewards (i.e., $\rho_{0}=0$ and $\rho_{t+1}=\rho_{t}+r(x_{t},u_{t})$).
An equivalent setup that satisfies Assumption 3.1 is then obtained by defining a new terminal reward function $r^{\prime}_{T}(x_{T},\rho_{T})\doteq r_{T}(x_{T})+\rho_{T}$ and setting the running rewards $r^{\prime}$ to zero.

###### Assumption 3.2 .

There exist constants $\gamma,\zeta>0$ with $\gamma+\zeta+\gamma\zeta<1$ such that for any trajectory $(u_{0:T-1},x_{0:T})$ encountered by Algorithm 1, the following properties hold for all $t\in[T-1]_{0}$:

- (a)
The error of $A_{t+s}$ is bounded, for all $s\in[T-t]$, in the following way:
$\lVert A_{t+s}-\nabla_{x}f_{t+s}\rVert\leq\\
\frac{\gamma}{3^{s}}\frac{\underaccent{\bar}{\sigma}(\nabla_{u}f_{t})}{\bar{
\sigma}(\nabla_{u}f_{t})}\left\{\prod_{i=1}^{s-1}\frac{\underaccent{\bar}{
\sigma}(\nabla_{x}f_{t+i})}{\bar{\sigma}(\nabla_{x}f_{t+i})}\right\}
\underaccent{\bar}{\sigma}(\nabla_{x}f_{t+s}).$
- (b)
The error of $B_{t}$ is bounded in the following way: $\lVert B_{t}-\nabla_{u}f_{t}\rVert\leq\zeta\underaccent{\bar}{\sigma}(\nabla_{
u}f_{t})$.

Here, $\underaccent{\bar}{\sigma}(A)$ and $\lVert A\rVert\doteq\bar{\sigma}(A)$ denote the minimum and maximum singular value of $A$, respectively.

This assumption restricts the errors of the estimates $A_{t}$ and $B_{t}$ which are used in place of the true Jacobians $\nabla_{x}f_{t}$ and $\nabla_{u}f_{t}$ in Algorithm 1.
Although the use of the true system for collecting rollouts prevents a buildup of error in the forward pass, any error in the approximate costate $\tilde{\lambda}_{t}$ can still be amplified by the Jacobians of earlier time steps, $\nabla_{x}f_{\tau}$ for $\tau\in[t-1]$, during the backward pass.
Thus, to ensure convergence to a stationary point of the true objective function, the errors of these Jacobians need to be small.
This is particularly important for $t$ close to $T$, as the errors will be amplified over more time steps.
Assumption 3.2 provides a quantitative characterization of this intuition.

###### Assumption 3.3 .

There exists a constant $L>0$ such that, for all action sequences $u_{0:T-1}^{A},u_{0:T-1}^{B}\in\mathcal{U}^{T}$ and all times $t\in[T-1]_{0}$, $\lVert\nabla_{u_{t}}J(u_{0:T-1}^{A})-\nabla_{u_{t}}J(u_{0:T-1}^{B})\rVert\leq L
\lVert u_{t}^{A}-u_{t}^{B}\rVert$.

This final assumption states that the objective function $J$ is $L$-smooth with respect to the action $u_{t}$ at each time step $t\in[T-1]_{0}$, which is a standard assumption in nonconvex optimization.
This implies that the dynamics $f$ are smooth as well.
We are now ready to state the convergence result.

###### Theorem 3.4 .

Suppose Assumptions 3.1, 3.2 and 3.3 hold with $\gamma$, $\zeta$, and $L$.
Let $\mu\doteq 1-\gamma-\zeta-\gamma\zeta$ and $\nu\doteq 1+\gamma+\zeta+\gamma\zeta$.
If the step size $\eta$ is chosen small enough such that $\alpha\doteq\mu-\frac{1}{2}\eta L\nu^{2}$ is positive, then the iterates $(u_{0:T-1}^{(k)})_{k=0}^{N-1}$ of Algorithm 1 satisfy, for all $N\in\mathbb{N}$ and $t\in[T-1]_{0}$,

$$ $\frac{1}{N}\sum_{k=0}^{N-1}\lVert\nabla_{u_{t}}J(u_{0:T-1}^{(k)})\rVert^{2} \leq\frac{J^{\star}-J(u_{0:T-1}^{(0)})}{\alpha\eta N}\text{,}$ $$

where $J^{\star}\doteq\sup_{u\in\mathcal{U}^{T}}J(u)$ is the optimal value of the initial state.

###### Proof.

See Appendix D.
∎

###### Assumption 3.1 .

###### Assumption 3.2 .

###### Assumption 3.3 .

###### Theorem 3.4 .

###### Proof.

### 3.2 Model-based open-loop RL

The most direct way to approximate the Jacobians $\nabla_{x}f_{t}$ and $\nabla_{u}f_{t}$ is by using a (learned or manually designed) differentiable model $\tilde{f}:\mathcal{X}\times\mathcal{U}\to\mathcal{X}$ of the dynamics $f$ and setting $A_{t}=\nabla_{x}\tilde{f}(x_{t},u_{t})$ and $B_{t}=\nabla_{u}\tilde{f}(x_{t},u_{t})$ in Algorithm 1 of Algorithm 1.
Theorem 3.4 guarantees that this *model-based* open-loop RL method (see Algorithm 2) is robust to a certain amount of modeling error.
In contrast to this, consider the more naive *planning* method of using the model to directly obtain the gradient by differentiating

$$ $J(u_{0:T-1})\simeq r(x_{0},u_{0})+r\{\underbrace{\tilde{f}(x_{0},u_{0})}_{ \tilde{x}_{1}},u_{1}\}+\dots+r_{T}\{\underbrace{\tilde{f}(\tilde{f}(\cdots \tilde{f}(\tilde{f}(x_{0},u_{0}),u_{1})\cdots),u_{T-1})}_{\tilde{x}_{T}}\}$ $$

with respect to the actions $u_{0:T-1}$ using the backpropagation algorithm.
In Appendix C, we show that this approach is exactly equivalent to an approximation of Algorithm 1 where, in addition to setting $A_{t}=\nabla_{x}\tilde{f}(x_{t},u_{t})$ and $B_{t}=\nabla_{u}\tilde{f}(x_{t},u_{t})$, the forward pass of Algorithm 1 is replaced by an imagined forward pass through the model $\tilde{f}$.
In Section 4, we empirically demonstrate that this planning method, whose convergence is not guaranteed by Theorem 3.4, is much less robust to modeling errors than the open-loop RL approach.

### 3.3 Model-free on-trajectory open-loop RL

Access to a reasonably accurate model may not always be feasible, and as Algorithm 1 only requires the Jacobians of the dynamics along the current trajectory, a global model is also not necessary.
In the following two sections, we propose two methods that directly estimate the Jacobians $\nabla_{x}f_{t}$ and $\nabla_{u}f_{t}$ from rollouts in the environment.
We call these methods *model-free*, as the estimated Jacobians are only valid along the current trajectory, and thus cannot be used for planning.

Our goal is to estimate the Jacobians $\nabla_{x}f(\bar{x}_{t},\bar{u}_{t})$ and $\nabla_{u}f(\bar{x}_{t},\bar{u}_{t})$ that lie along the trajectory induced by the action sequence $\bar{u}_{0:T-1}$.
These Jacobians measure how the next state ($\bar{x}_{t+1}$) changes if the current state or action ($\bar{x}_{t}$, $\bar{u}_{t}$) are slightly perturbed.
More formally, the dynamics $f$ may be linearized about the reference trajectory $(\bar{u}_{0:T-1},\bar{x}_{0:T})$ as

$$ $\underbrace{f(x_{t},u_{t})-f(\bar{x}_{t},\bar{u}_{t})}_{\Delta x_{t+1}}\, \simeq\,\nabla_{x}f(\bar{x}_{t},\bar{u}_{t})^{\top}\underbrace{(x_{t}-\bar{x}_ {t})}_{\Delta x_{t}}+\nabla_{u}f(\bar{x}_{t},\bar{u}_{t})^{\top}\underbrace{(u _{t}-\bar{u}_{t})}_{\Delta u_{t}}\text{,}$ $$

which is a valid approximation if the perturbations $\Delta x_{0:T}$ and $\Delta u_{0:T-1}$ are small.
By collecting a dataset of $M\in\mathbb{N}$ rollouts with slightly perturbed actions, we can thus estimate the Jacobians by solving the (analytically tractable) least-squares problem

$$ $\operatorname*{arg\,min}_{[A_{t}^{\top}\ B_{t}^{\top}]\in\mathbb{R}^{D\times(D +K)}}\sum_{i=1}^{M}\lVert A_{t}^{\top}\Delta x_{t}^{(i)}+B_{t}^{\top}\Delta u_ {t}^{(i)}-\Delta x_{t+1}^{(i)}\rVert^{2}\text{.}$ (4) $$

This technique is illustrated in LABEL:fig:jacobian:a (dashed purple line).
Using these estimates in Algorithm 1 yields a model-free method we call *on-trajectory*, as the gradient estimate relies only on data generated based on the current trajectory (see Algorithm 3 for details).
We see a connection to on-policy methods in closed-loop reinforcement learning, where the policy gradient estimate (or the Q-update) similarly depends only on data generated under the current policy.
Like on-policy methods, on-trajectory methods will benefit greatly from the possibility of parallel environments, which could reduce the effective complexity of the forward pass stage from $M+1$ rollouts to that of a single rollout.

Figure: Figure 2: (a) The Jacobians of $f$ (slope of the green linearization) at the reference point $(\bar{x}_{t},\bar{u}_{t})$ can be estimated from the transitions $\{(x_{t}^{(i)},u_{t}^{(i)},x_{t+1}^{(i)})\}_{i=1}^{M}$ of $M$ perturbed rollouts. (b) The Jacobians of subsequent trajectories (indexed by $k$) remain close. To estimate the Jacobian at iteration $k$, the most recent iterate ($k-1$) is more relevant than older iterates.
Refer to caption: x1.png

#### Exploiting the Markovian structure.

Consider a direct linearization of the objective function $J$ about the current trajectory.
Writing the action sequence as a vector $\bar{\bm{u}}\doteq\operatorname{vec}(\bar{u}_{0:T-1})\in\mathbb{R}^{TK}$, this linearization is given, for $\bm{u}\in\mathbb{R}^{TK}$ close to $\bar{\bm{u}}$, by

$$ $J(\bm{u})\simeq J(\bar{\bm{u}})+\nabla J(\bar{\bm{u}})^{\top}(\bm{u}-\bar{\bm{ u}}).$ $$

We can thus estimate the gradient of the objective function by solving the least squares problem

$$ $\nabla J(\bar{\bm{u}})\simeq\operatorname*{arg\,min}_{\bm{g}\in\mathbb{R}^{TK} }\sum_{i=1}^{M}\{J(\bm{u}_{i})-J(\bar{\bm{u}})-\bm{g}^{\top}(\bm{u}_{i}-\bar{ \bm{u}})\}^{2}\text{,}$ $$

where $\{\bm{u}_{i}\}$ are $M\in\mathbb{N}$ slightly perturbed action sequences.
Due to the dimensionality of $\bar{\bm{u}}$, this method requires $\mathcal{O}(TK)$ rollouts to estimate the gradient.
In contrast to this, our approach leverages the Markovian structure of the problem, including the fact that we observe the states $x_{0:T}$ in each rollout.
As the Jacobians at all time steps are estimated jointly, we can expect to get a useful gradient estimate from only $\mathcal{O}(D^{2}+DK)$ rollouts, which significantly reduces the sample complexity if $T$ is large.
This gain in efficiency is demonstrated empirically in Section 4.

### 3.4 Model-free off-trajectory open-loop RL

The on-trajectory algorithm is sample-efficient in the sense that it leverages the problem structure, but a key inefficiency remains: the rollout data sampled at each iteration is discarded after the action sequence is updated.
In this section, we propose an *off-trajectory* method that implicitly uses the data from previous trajectories to construct the Jacobian estimates.
Our approach is based on the following observation.
If the dynamics $f$ are smooth and the step size $\eta$ is small, then the updated trajectory $(u_{0:T-1}^{(k)},x_{0:T}^{(k)})$ will remain close to the previous iterate $(u_{0:T-1}^{(k-1)},x_{0:T}^{(k-1)})$.
Furthermore, the Jacobians along the updated trajectory will be similar to the previous Jacobians, as illustrated in LABEL:fig:jacobian:b.
Thus, we propose to estimate the Jacobians along the current trajectory from *a single rollout only* by bootstrapping our estimates using the Jacobian estimates from the previous iteration.

Consider again the problem of estimating the Jacobians from multiple perturbed rollouts, illustrated in LABEL:fig:jacobian:a.
Instead of relying on a reference trajectory and Eq. 4, we can estimate the Jacobians by fitting a linear regression model to the dataset of $M$ perturbed transitions.
Solving

$$ $\operatorname*{arg\,min}_{[A_{t}^{\top}\ B_{t}^{\top}\ c_{t}]\in\mathbb{R}^{D \times(D+K+1)}}\sum_{i=1}^{M}\lVert A_{t}^{\top}x_{t}^{(i)}+B_{t}^{\top}u_{t}^ {(i)}+c_{t}-x_{t+1}^{(i)}\rVert^{2}$ (5) $$

yields an approximate linearization $f(x_{t},u_{t})\simeq A_{t}^{\top}x_{t}+B_{t}^{\top}u_{t}+c_{t}=F_{t}z_{t}$,
with $F_{t}\doteq[A_{t}^{\top}\ B_{t}^{\top}\ c_{t}]$ and $z_{t}\doteq(x_{t},u_{t},1)\in\mathbb{R}^{D+K+1}$.
This approximation is also shown in LABEL:fig:jacobian:a (dotted gray line).(^2^22If we replace Eq. 4 by Eq. 5 in Algorithm 3, we get a slightly different on-trajectory method that has a similar performance.)
At iteration $k$, given the estimate $F_{t}^{(k-1)}$ and a new point $z_{t}^{(k)}=(x_{t}^{(k)},u_{t}^{(k)},1)$ and corresponding target $x_{t+1}^{(k)}$, computing the new estimate $F_{t}^{(k)}$ is a problem of online linear regression.
We solve this regression problem using an augmented version of the *recursive least squares* (RLS) algorithm (e.g., Ljung, , Sec. 11.2).
By introducing a prior precision matrix $Q_{t}^{(0)}\doteq q_{0}I$ for each time $t$, where $q_{0}>0$, in Algorithm 4 we compute the update at iteration $k\in\mathbb{N}$ as

$$ $\displaystyle Q_{t}^{(k)}$ $\displaystyle=\alpha Q_{t}^{(k-1)}+(1-\alpha)q_{0}I+z_{t}^{(k)}\{z_{t}^{(k)}\} ^{\top}$ (6) $\displaystyle F_{t}^{(k)}$ $\displaystyle=F_{t}^{(k-1)}+\{Q_{t}^{(k)}\}^{-1}z_{t}^{(k)}\{x_{t+1}^{(k)}-F_{ t}^{(k-1)}z_{t}^{(k)}\}^{\top}\text{.}$ $$

#### Forgetting and stability.

The standard RLS update of the precision matrix corresponds to Eq. 6 with $\alpha=0$.
In the limit as $q_{0}\to 0$, the RLS algorithm is equivalent to the batch processing of Eq. 5, which treats all points equally.
However, as illustrated in LABEL:fig:jacobian:b, points from recent trajectories should be given more weight, as transitions that happened many iterations ago will give little information about the Jacobians along the current trajectory.
We thus incorporate a *forgetting factor* $\alpha\in(0,1)$ into the precision update with the effect that past data points are exponentially downweighted:

$$ $Q_{t}^{(k)}=\alpha Q_{t}^{(k-1)}+z_{t}^{(k)}\{z_{t}^{(k)}\}^{\top}\quad \leadsto\quad Q_{t}^{(k)}=\alpha^{k}q_{0}I+\sum_{i=1}^{k}\alpha^{k-i}z_{t}^{(i )}\{z_{t}^{(i)}\}^{\top}.$ (7) $$

This forgetting factor introduces a new problem: instability.
If subsequent trajectories lie close to each other, then the sum of outer products may become singular (clearly, if all $z_{i}$ are identical, then the sum has rank $1$).
As the prior $q_{0}I$ is downweighted, at some point $Q$ may become singular.
Our modification in Eq. 6 adds $(1-\alpha)q_{0}I$ in each update, which has the effect of removing the $\alpha^{k}$ coefficient in front of $q_{0}I$ in Eq. 7.
If the optimization procedure converges, then eventually subsequent trajectories will indeed lie close together.
Although Eq. 6 prevents issues with instability, the quality of the Jacobian estimates will still degrade, as this estimation inherently requires perturbations (see Section 3.3).
In Algorithm 4, we thus slightly perturb the actions used in each rollout to get more diverse data.

## 4 Experiments

### 4.1 Inverted pendulum swing-up

Figure: Figure 3: The inverted pendulum swing-up problem. The goal is to control the force $F$ such that the tip of the pendulum swings up above the base. The shown solution was found by the on-trajectory method of Section 3.3.
Refer to caption: x2.png

We empirically evaluate our algorithms on the inverted pendulum swing-up problem shown in Fig. 4.
The state at time $t$ is $x_{t}=(\ell,\dot{\ell},\theta,\dot{\theta})_{t}\in\mathbb{R}^{4}$, where $\ell$ is the position of the cart on the bar and $\theta$ is the pendulum angle.
The action $u_{t}$ is the horizontal force $F$ applied to the cart at time $t$.
Episodes are of length $T=100$, the running reward $r(x,u)\propto-u^{2}$ penalizes large forces, and the terminal reward $r_{T}(x)=-\lVert x\rVert_{1}$ defines the goal state to be at rest in the upright position.

#### Performance metrics.

We monitor several performance criteria, all of which are based on the return $J$.
First, we define $J_{\mathrm{max}}\doteq\max_{k\in[N]_{0}}J(u_{0:T-1}^{(k)})$ as the return achieved by the best action sequence over a complete learning process of $N$ optimization steps.
Based on this quantity, we say that the swing-up task is *solved* if $J_{\mathrm{max}}>-0.03$.
This threshold was determined empirically.
If the algorithm or the model is randomized, then $[J_{\mathrm{max}}>-0.03]$ is a Bernoulli random variable whose mean, which we call the *solve rate*, depends on the quality of the learning algorithm.
We repeat all experiments with $100$ random seeds and show $95\%$ bootstrap confidence intervals in all plots.

#### Robustness: model-based open-loop RL.

We start with the model-based method for open-loop RL of Section 3.2 (Algorithm 2).
In Theorem 3.4, we proved that this method can accommodate some model error and still converge to a local maximum of the true objective.
In Fig. 4, we empirically analyze this robustness property on the pendulum system.
This system has five parameters: the masses of the cart and the pendulum tip, the length of the pendulum, and the friction coefficients for linear and rotational motion.
To test the robustness of our algorithm against model misspecification, we use a pendulum system with inaccurate parameters as the model $\tilde{f}$.
Concretely, if $m_{i}$ is the $i$^th parameter of the true system, we sample the corresponding model parameter $\tilde{m}_{i}$ from a log-normal distribution centered at $m_{i}$, such that $\tilde{m}_{i}=\xi m_{i}$, with $\ln\xi\sim\mathcal{N}(0,s^{2})$.
The severity of the model error is then controlled by the scale parameter $s$.
In Fig. 4, we compare the performance of our method with the planning procedure described in Section 3.2, in which the forward pass is performed through the model $\tilde{f}$ instead of the real system $f$.
Whereas the planning method only solves the pendulum reliably with the true system as the model ($s=0$), the open-loop RL method can accommodate a considerable model misspecification.

In a second experiment, we represent the model $\tilde{f}$ by a small multi-layer perceptron (MLP).
The model is learned from $1000$ rollouts on the pendulum system, with the action sequences sampled from a pink noise distribution, as suggested by Eberhard et al. ().
Figure 4 shows the performance achieved with this model by our proposed algorithm and by the planning method.
As the MLP model represents a considerable misspecification of the true dynamics, only the open-loop RL method manages to solve the pendulum task.

Figure: Figure 5: The on-trajectory open-loop RL method is more sample-efficient than the finite-difference and cross-entropy methods. It is also much less sensitive to the noise scale $\sigma$.
Refer to caption: x4.png

#### Structure: on-trajectory open-loop RL.

In Section 3.3, we proposed a model-free approach (Algorithm 3) that uses rollouts to directly estimate the Jacobians needed to update the action sequence.
It is clear from Eq. 4 that more rollouts (i.e., larger $M$) will give more accurate Jacobian estimates, and therefore increase the quality of the gradient approximation.
In Fig. 6, we analyze the sample efficiency of the on-trajectory OLRL algorithm by comparing the performance achieved at different values of $M$, where the number $N$ of optimization steps remains fixed.
We compare our method to the finite-difference approach described at the end of Section 3.3 and to the gradient-free cross-entropy method (CEM; Rubinstein, ).
Both these methods also update the action sequence on the basis of $M$ perturbed rollouts in the environment.
As in our method, the $M$ action sequences are perturbed using Gaussian white noise with noise scale $\sigma$.
We describe both baselines in detail in Appendix F.
The *oracle* performance shown in Fig. 6 corresponds to Algorithm 1 with the true gradient, i.e., $A_{t}=\nabla_{x}f_{t}$ and $B_{t}=\nabla_{u}f_{t}$.

We note two things in Fig. 6.
First, the performance of both the finite-difference method and CEM heavily depends on the choice of the noise scale $\sigma$, whereas our method performs identically for all three values of $\sigma$.
Second, even for tuned values of $\sigma$, the finite-difference method and CEM still need approximately twice as many rollouts per iteration as the open-loop RL method to reliably swing up the pendulum.
At $10$ rollouts per iteration, our method matches the oracle’s performance, while both baselines are below the *solved* threshold of $J_{\mathrm{max}}=-0.03$.
This empirically confirms our theoretical claims at the end of Section 3.3, where we argue that exploiting the Markovian structure of the problem leads to increased sample efficiency.

#### Efficiency: off-trajectory open-loop RL.

Finally, we turn to the method proposed in Section 3.4 (Algorithm 4), which promises increased sample efficiency by estimating the Jacobians in an off-trajectory fashion.
The performance of this algorithm is shown in Fig. 6, where the learning curves of all our methods as well as the two baselines and the oracle are plotted.
For the on-trajectory methods compared in Fig. 6, we chose for each the minimum number of rollouts $M$ such that, under the best choice for $\sigma$, the method would reliably solve the swing-up task.
The hyperparameters for all methods are summarized in Appendix G.
It can be seen that the off-trajectory method, which only requires one rollout per iteration, converges much faster than the on-trajectory open-loop RL method.

### 4.2 MuJoCo

Figure: Figure 7: Learning curves of our off-trajectory open-loop RL method and soft actor-critic for two MuJoCo tasks. All experiments were repeated with $20$ random seeds, and we show $95\%$-bootstrap confidence intervals for the average return. The horizon is fixed to $T=100$.
Refer to caption: x6.png

While the inverted pendulum system is an illustrative example for exploring the different merits of our algorithms, it is a relatively simple task with smooth, low-dimensional, and deterministic dynamics.
In this section, we test our method in two considerably more challenging environments: the Ant-v4 and HalfCheetah-v4 tasks provided by the OpenAI Gym library (Brockman et al., ; Towers et al., ), implemented in MuJoCo (Todorov et al., ).
These environments are high-dimensional, they exhibit non-smooth contact dynamics, and the initial state is randomly sampled at the beginning of each episode.

We tackle these two tasks with our model-free off-trajectory method (Algorithm 4).
The results are shown in Fig. 7, where we compare to the closed-loop RL baseline soft actor-critic (SAC; Haarnoja et al., ).
It can be seen that the open-loop RL method performs comparably to SAC, even though SAC learns a closed-loop policy that is capable of adapting its behavior to the initial condition.(^3^33In this comparison, our method is further disadvantaged by the piecewise constant “health” terms in the reward function of Ant-v4. Our method, exclusively relying on the gradient of the reward function, ignores these.)
In the figure, we also analyze the open-loop performance achieved by SAC.
Whereas the closed-loop performance is the return obtained in a rollout where the actions are taken according to the mean of the Gaussian policy, the open-loop return is achieved by blindly executing exactly the same actions in a new episode.
The discrepancy in performance is thus completely due to the stochasticity in the initial state.
In Appendix E, we show that our method also works with a longer horizon $T$.

The results demonstrate that the open-loop RL method is robust to a certain level of stochasticity in the initial state of stable dynamical systems.
Additionally, while our convergence analysis depends on the assumption of smooth dynamics, these experiments empirically demonstrate that the algorithms are also able to tackle non-smooth contact dynamics.
Finally, we see that the high dimensionality of the MuJoCo systems is handled without complications.
While soft actor-critic is an elegant and powerful algorithm, the combination with deep function approximation can make efficient learning more difficult.
Our methods are considerably simpler and, because they are based on Pontryagin’s principle rather than dynamic programming, they evade the curse of dimensionality by design, and thus do not require any function approximation.

## 5 Related work

Our work is inspired by numerical optimal control theory (Betts, ; Geering, ), which deals with the numerical solution of trajectory optimization problems, a setting that has also been studied in machine learning (Schaal and Atkeson, ; Howe et al., ).
As in our approach, an important aspect of solution methods is to exploit the Markovian structure of the dynamics to reduce computation (Carraro et al., ; Schäfer et al., ).
However, all these methods deal with situations where the dynamics are known, whereas our algorithms only requires an approximate model (model-based open-loop RL) or no model at all (model-free open-loop RL).
Another set of related methods is known as *iterative learning control* (Moore, ; Ma et al., , ), which is a control-theoretic framework that iteratively improves the execution of a task by optimizing over feedforward trajectories.
However, these methods are often formulated for trajectory tracking tasks, while we consider a more general class of reinforcement learning problems.
Chen and Braun () explore an idea similar as in our Algorithm 2; their model-based control algorithm combines a rollout in a real system with an inaccurate model to construct an iterative LQR feedback controller.

Recently, deep neural networks have been used to learn representations of complex dynamical systems (Fragkiadaki et al., ) and Pontryagin’s principle was leveraged in the optimization of control tasks based on such models (Jin et al., ; Böttcher et al., ).
However, these methods only consider the setting of closed-loop control.
The combination of an exact forward pass with an approximate backward pass, which our methods are based on, has also been explored in different settings in the deep learning literature, such as spiking (Lee et al., ) or physical (Wright et al., ) neural networks, or networks that include nondifferentiable procedures, for example used for rendering (Niemeyer et al., ) or combinatorial optimization (Vlastelica et al., ).

## 6 Discussion

While open-loop control is a well-established field with countless applications (Diehl et al., ; van Zundert and Oomen, ; Sferrazza et al., ), the setting of incompletely-known dynamics has received little attention.
This paper makes an important first step towards understanding how principles from open-loop optimal control can be combined with ideas from reinforcement learning while preserving convergence guarantees.
We propose three algorithms that address this *open-loop RL* problem, from robust trajectory optimization with an approximate model to sample-efficient learning under fully unknown dynamics.
This work focuses on reinforcement learning in continuous state and action spaces, a class of problems known to be challenging (Recht, ).
Although this setting allows us to leverage continuous optimization techniques, we expect that most ideas will transfer to the discrete setting and would be interested to see further research on this topic.

It is interesting to note that there are many apparent parallels between our open-loop RL algorithms and their closed-loop counterparts.
The distinction between model-based and model-free methods is similar as in closed-loop RL.
Similarly, the on-trajectory and off-trajectory methods we present show a tradeoff between sample efficiency and stability that is reminiscent of the tradeoffs between on-policy and off-policy methods in closed-loop RL.
The question of exploration, which is central to reinforcement learning, also arises in our case.
We do not address this complex problem thoroughly here but instead rely on additive Gaussian noise to sample diverse trajectories.

#### Limitations of Open-Loop RL.

Another important open question is how open-loop methods fit into the reinforcement learning landscape.
An inherent limitation of these methods is that an open-loop controller can, by definition, not react to unexpected changes in the system’s state, be it due to random disturbances or an adversary.
If these disturbances are small, and the system is not sensitive to small changes in the initial condition or the action sequence (roughly speaking, if the system is stable and non-chaotic), then such a reaction is not necessary.
In this situation, open-loop RL works even for long time-horizons $T$, as we highlight in our MuJoCo experiments (see Appendix E).
However, an open-loop controller cannot balance an inverted pendulum in its unstable position(^4^44Except with a clever trick called *vibrational control* (Meerkov, ).), track a reference trajectory in noisy conditions, or play Go, where reactions to the opponent’s moves are constantly required. In these situations open-loop RL is not viable or only effective over a very small horizon $T$.

Open-loop control can be viewed as a special case of closed-loop control, and therefore it is clear that closed-loop control is much more powerful. Historically, control theory has dealt with both closed-loop and open-loop control (Åström and Murray, ; Skogestad and Postlethwaite, ; Åström and Hägglund, ) and there is a broad consensus in the control community that both are important (Betts, ; Verscheure et al., ; Horn et al., ).
However, the setting of open-loop control with unknown dynamics, which is naturally formulated through the lens of reinforcement learning, has so far received much less consideration from the community.
Our algorithms provide a first solution to the open-loop RL problem and are not intended to replace any of the existing closed-loop RL algorithms.
Instead, we think open-loop and closed-loop methods should complement each other.
In control engineering, it is common practice to combine feedback and feedforward techniques, and such approaches are also thinkable in RL.
For example, a high-level policy could execute low-level feedforward trajectories using the options framework (Sutton et al., ); a related idea is explored by Hansen et al. ().
We believe that ultimately a combination of open-loop and closed-loop techniques will be fruitful in reinforcement learning and think that this is an important direction for future research.

### Acknowledgments

We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for their support.
C. Vernade is funded by the German Research Foundation (DFG) under both the project 468806714 of the Emmy Noether Programme and under Germany’s Excellence Strategy – EXC number 2064/1 – Project number 390727645.
M. Muehlebach is funded by the German Research Foundation (DFG) under the project 456587626 of the Emmy Noether Programme.

## Appendix A Algorithms

In this section, we provide detailed descriptions of the three open-loop RL algorithms presented in the main text.
The model-based algorithm of Section 3.2 is listed in Algorithm 2, the model-free on-trajectory method of Section 3.3 is listed in Algorithm 3, and the off-trajectory method of Section 3.4 is listed in Algorithm 4.
The hyperparameters we use in these algorithms are discussed in Appendix G.

Figure: Algorithm 2 Model-based open-loop RL

Figure: Algorithm 3 Model-free on-trajectory open-loop RL

Figure: Algorithm 4 Model-free off-trajectory open-loop RL

## Appendix B Derivation of Pontryagin’s principle

In this section, we will derive Pontryagin’s principle, Eqs. 1, 2 and 3, using the method of Lagrange multipliers.
In the following we view the objective $J$ as a function of states and actions, that is

$$ $J(x_{0:T},u_{0:T-1})\doteq\sum_{t=0}^{T-1}r(x_{t},u_{t})+r_{T}(x_{T}).$ $$

We maximize $J$ with respect to $x_{0:T}$ and $u_{0:T-1}$ subject to the constraint that $x_{t+1}=f(x_{t},u_{t})$ for all $t=[T-1]_{0}$.
The corresponding Lagrangian is

$$ $L(x_{0:T},u_{0:T-1},\lambda_{1:T})\doteq\sum_{t=0}^{T-1}\{r(x_{t},u_{t})+ \lambda_{t+1}^{\top}(f(x_{t},u_{t})-x_{t+1})\}+r_{T}(x_{T})\text{,}$ $$

where the constraints are included through the multipliers $\lambda_{1:T}$.
The costate equations are then obtained by setting the partial derivatives of the Lagrangian with respect to $x_{0:T}$ to zero:

$$ $\displaystyle\nabla_{x_{t}}L$ $\displaystyle\,=\,\nabla_{x}r(x_{t},u_{t})+\nabla_{x}f(x_{t},u_{t})\lambda_{t+ 1}-\lambda_{t}\doteq 0$ $\displaystyle\implies\quad$ $\displaystyle\lambda_{t}$ $\displaystyle\,=\,\nabla_{x}r(x_{t},u_{t})+\nabla_{x}f(x_{t},u_{t})\lambda_{t+1}$ $\displaystyle\nabla_{x_{T}}L$ $\displaystyle\,=\,\nabla r_{T}(x_{T})-\lambda_{T}\doteq 0$ $\displaystyle\implies\quad$ $\displaystyle\lambda_{T}$ $\displaystyle\,=\,\nabla r_{T}(x_{T}).$ $$

Setting the partial derivatives of the Lagrangian with respect to $\lambda_{1:T}$ to zero yields the dynamics equations, and the partial derivatives of the Lagrangian with respect to $u_{0:T-1}$ are

$$ $\nabla_{u_{t}}L=\nabla_{u}r(x_{t},u_{t})+\nabla_{u}f(x_{t},u_{t})\lambda_{t+1} \text{,}$ $$

which is the same expression for the gradient of the objective as in Eq. 1.

## Appendix C Pontryagin’s principle from backpropagation

In Section 3.2, we mention that computing the gradient of

$$ $\displaystyle J(u_{0:T-1})$ $\displaystyle=\sum_{t=0}^{T-1}r(x_{t},u_{t})+r_{T}(x_{T})$ $\displaystyle=\begin{multlined}r(x_{0},u_{0})+r\{\underbrace{f(x_{0},u_{0})}_{ x_{1}},u_{1}\}+r\{\underbrace{f(f(x_{0},u_{0}),u_{1})}_{x_{2}},u_{2}\}+\cdots \\ +r\{\underbrace{f(f(\cdots f(f(x_{0},u_{0}),u_{1})\cdots),u_{T-2})}_{x_{T-1}}, u_{T-1}\}\\ +r_{T}\{\underbrace{f(f(\cdots f(f(x_{0},u_{0}),u_{1})\cdots),u_{T-1})}_{x_{T} }\}\end{multlined}r(x_{0},u_{0})+r\{\underbrace{f(x_{0},u_{0})}_{x_{1}},u_{1} \}+r\{\underbrace{f(f(x_{0},u_{0}),u_{1})}_{x_{2}},u_{2}\}+\cdots\\ +r\{\underbrace{f(f(\cdots f(f(x_{0},u_{0}),u_{1})\cdots),u_{T-2})}_{x_{T-1}}, u_{T-1}\}\\ +r_{T}\{\underbrace{f(f(\cdots f(f(x_{0},u_{0}),u_{1})\cdots),u_{T-1})}_{x_{T}}\}$ $$

by means of the backpropagation algorithm, i.e. a repeated application of the chain rule, leads naturally to Pontryagin’s principle.
The chain rule states that for $g:\mathbb{R}^{n}\to\mathbb{R}^{k}$, $h:\mathbb{R}^{k}\to\mathbb{R}^{m}$ and $x\in\mathbb{R}^{n}$,

$$ $\nabla(h\circ g)(x)=\nabla g(x)\,\nabla h\{g(x)\}\text{,}$ $$

where $\nabla g:\mathbb{R}^{n}\to\mathbb{R}^{n\times k}$, $\nabla h:\mathbb{R}^{k}\to\mathbb{R}^{k\times m}$ and $\nabla(h\circ g):\mathbb{R}^{n}\to\mathbb{R}^{n\times m}$.
From this, we can compute the gradient of the objective function with respect to the action $u_{t}$ at time $t\in[T-1]_{0}$ as

$$ $\displaystyle\nabla_{u_{t}}J(u_{0:T-1})$ $\displaystyle=\begin{aligned} &\nabla_{u}r(x_{t},u_{t})+\nabla_{u}f(x_{t},u_{t }){\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}\nabla_{x} r(x_{t+1},u_{t+1})}\\ &\quad+\nabla_{u}f(x_{t},u_{t}){\color[rgb]{0,0,1}\definecolor[named]{ pgfstrokecolor}{rgb}{0,0,1}\nabla_{x}f(x_{t+1},u_{t+1})\nabla_{x}r(x_{t+2},u_{ t+2})}\\ &\quad+\cdots\\ &\quad+\nabla_{u}f(x_{t},u_{t}){\color[rgb]{0,0,1}\definecolor[named]{ pgfstrokecolor}{rgb}{0,0,1}\nabla_{x}f(x_{t+1},u_{t+1})\cdots\nabla_{x}f(x_{T- 2},u_{T-2})\nabla_{x}r(x_{T-1},u_{T-1})}\\ &\quad+\nabla_{u}f(x_{t},u_{t}){\color[rgb]{0,0,1}\definecolor[named]{ pgfstrokecolor}{rgb}{0,0,1}\nabla_{x}f(x_{t+1},u_{t+1})\cdots\nabla_{x}f(x_{T- 1},u_{T-1})\nabla r_{T}(x_{T})}\end{aligned}$ $\displaystyle=\nabla_{u}r(x_{t},u_{t})+\nabla_{u}f(x_{t},u_{t})\lambda_{t+1} \text{,}$ $$

where we have introduced the shorthand $\lambda_{t+1}$ for the blue part.
This is the same expression for the gradient as in Eq. 1, and it can easily be seen that this definition of $\lambda_{t}$ satisfies the costate equations (2) and (3).

## Appendix D Proof of Theorem 3.4

In this section, we prove Theorem 3.4, our convergence result of Algorithm 1.
The main part of the proof is contained in the proof of Theorem D.3, which provides a lower bound for the inner product between the approximate and true gradients as well as an upper bound for the norm of the approximate gradients.
Intuitively, this theorem turns Assumption 3.2, which is a statement about the error of the approximate Jacobians, into a statement about the error of the approximate gradient.
We then show that Theorem 3.4 follows by making use of the $L$-smoothness (Assumption 3.3) of the objective function.
This latter part is a standard result in the analysis of stochastic gradient methods [e.g., Bottou et al., ].

Before coming to the main result, we introduce the following shorthand notation.
Given a fixed trajectory $(u_{0:T-1},x_{0:T})$, we define

$$ $\nabla J_{t}\doteq\nabla_{u}f_{t}\lambda_{t+1}\text{,}\quad\varepsilon_{t} \doteq A_{t}-\nabla_{x}f_{t}\text{,}\quad\varepsilon_{t}^{\prime}\doteq B_{t}- \nabla_{u}f_{t}\quad\text{and}\quad\delta_{t+1}\doteq\tilde{\lambda}_{t+1}- \lambda_{t+1}$ $$

for all times $t\in[T-1]_{0}$.
By Eqs. 1 and 3.1, the first quantity defines the true gradient and the approximate gradient is given by $g_{t}=B_{t}\tilde{\lambda}_{t+1}$.
We also state two small lemmas, which we will use routinely in the following proof.

###### Lemma D.1 .

Let $x,y\in\mathbb{R}^{n}$ for $n\in\mathbb{N}$ and $\alpha\in\mathbb{R}$ such that $\lVert x\rVert\leq\alpha\lVert y\rVert$. Then, $|x^{\top}y|\leq\alpha\lVert y\rVert^{2}$.

###### Proof.

$\lVert x\rVert\leq\alpha\lVert y\rVert\implies\lVert x\rVert\lVert y\rVert\leq
\alpha\lVert y\rVert^{2}\implies|x^{\top}y|\leq\alpha\lVert y\rVert^{2}$ (by Cauchy-Schwarz).
∎

###### Lemma D.2 .

Let $A,B\in\mathbb{R}^{m\times n}$ for some $m,n\in\mathbb{N}$ and $x,y\in\mathbb{R}^{n}$ such that $\bar{\sigma}(A)\lVert x\rVert\leq\underaccent{\bar}{\sigma}(B)\lVert y\rVert$. Then, $\lVert Ax\rVert\leq\lVert By\rVert.$

###### Proof.

This is a simple corollary of the Courant-Fischer (min-max) theorem. The min-max theorem states that, for a symmetric matrix $C\in\mathbb{R}^{n\times n}$, the minimum and maximum eigenvalues $\underaccent{\bar}{\lambda}(C)$ and $\bar{\lambda}(C)$ are characterized in the following way:

$$ $\underaccent{\bar}{\lambda}(C)=\min_{\begin{subarray}{c}z\in\mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}z^{\top}Cz\quad\text{and}\quad\bar{\lambda}(C)= \max_{\begin{subarray}{c}z\in\mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}z^{\top}Cz.$ $$

This can be extended to a characterization of the singular values $,\bar{\sigma}(A)$ and $\underaccent{\bar}{\sigma}(B)$ by relating them to the eigenvalues of $A^{\top}A$ and $B^{\top}B$, respectively:

$$ $\displaystyle\bar{\sigma}(A)$ $\displaystyle=\sqrt{\bar{\lambda}(A^{\top}A)}=\max_{\begin{subarray}{c}z\in \mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}\sqrt{z^{\top}A^{\top}Az}=\max_{\begin{subarray }{c}z\in\mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}\lVert Az\rVert\geq\frac{1}{\lVert x\rVert} \lVert Ax\rVert\text{,}$ $\displaystyle\underaccent{\bar}{\sigma}(B)$ $\displaystyle=\sqrt{\underaccent{\bar}{\lambda}(B^{\top}B)}=\min_{\begin{ subarray}{c}z\in\mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}\sqrt{z^{\top}B^{\top}Bz}=\min_{\begin{subarray }{c}z\in\mathbb{R}^{n}\\ \lVert z\rVert=1\end{subarray}}\lVert Bz\rVert\leq\frac{1}{\lVert y\rVert} \lVert By\rVert.$ $$

Combining these inequalities, we get:

$$ $\lVert Ax\rVert\leq\bar{\sigma}(A)\lVert x\rVert\leq\underaccent{\bar}{\sigma} (B)\lVert y\rVert\leq\lVert By\rVert.$ $$

∎

###### Theorem D.3 .

Suppose Assumptions 3.1 and 3.2 hold with $\gamma$ and $\zeta$ and define $\mu\doteq 1-\gamma-\zeta-\gamma\zeta$ and $\nu\doteq 1+\gamma+\zeta+\gamma\zeta$. Then,

$$ $g_{t}^{\top}\nabla J_{t}\geq\mu\lVert\nabla J_{t}\rVert^{2}\quad\text{and} \quad\lVert g_{t}\rVert\leq\nu\lVert\nabla J_{t}\rVert,$ $$

for all $t\in[T-1]_{0}$.

###### Proof.

Let $t\in[T-1]_{0}$ be fixed.
Decomposing the left-hand side of the first inequality, we get

$$ $\displaystyle g_{t}^{\top}\nabla J_{t}$ $\displaystyle=\tilde{\lambda}_{t+1}^{\top}B_{t}^{\top}\nabla_{u}f_{t}\lambda_{ t+1}$ $\displaystyle=(\lambda_{t+1}+\delta_{t+1})^{\top}(\nabla_{u}f_{t}+\varepsilon_ {t}^{\prime})^{\top}\nabla_{u}f_{t}\lambda_{t+1}$ $\displaystyle=\lVert\nabla J_{t}\rVert^{2}+\underbrace{\lambda_{t+1}^{\top} \varepsilon_{t}^{\prime\top}\nabla_{u}f_{t}\lambda_{t+1}}_{a}+\underbrace{ \delta_{t+1}^{\top}\nabla_{u}f_{t}^{\top}\nabla_{u}f_{t}\lambda_{t+1}}_{b}+ \underbrace{\delta_{t+1}^{\top}\varepsilon_{t}^{\prime\top}\nabla_{u}f_{t} \lambda_{t+1}}_{c}$ $\displaystyle\geq\lVert\nabla J_{t}\rVert^{2}-|a|-|b|-|c|.$ $$

We will now show that

$$ $|a|\leq\zeta\lVert\nabla J_{t}\rVert^{2}\quad\text{and}\quad|b|\leq\gamma \lVert\nabla J_{t}\rVert^{2}\quad\text{and}\quad|c|\leq\gamma\zeta\lVert\nabla J _{t}\rVert^{2}\text{,}$ $$

which, when taken together, will give us

$$ $g_{t}^{\top}\nabla J_{t}\geq(1-\gamma-\zeta-\gamma\zeta)\lVert\nabla J_{t} \rVert^{2}=\mu\lVert\nabla J_{t}\rVert^{2}.$ $$

We first derive the bound on $|a|$:

$$ $\displaystyle\bar{\sigma}(\varepsilon_{t}^{\prime})$ $\displaystyle\,\leq\,\zeta\underaccent{\bar}{\sigma}(\nabla_{u}f_{t})$ ( Assumption 3.2 ) $\displaystyle\implies\quad$ $\displaystyle\lVert\varepsilon_{t}^{\prime}\lambda_{t+1}\rVert$ $\displaystyle\,\leq\,\zeta\lVert\nabla_{u}f_{t}\lambda_{t+1}\rVert$ ( Lemma D.2 ) (8) $\displaystyle\implies\quad$ $\displaystyle|\underbrace{\lambda_{t+1}^{\top}\varepsilon_{t}^{\prime\top} \nabla_{u}f_{t}\lambda_{t+1}}_{a}|$ $\displaystyle\,\leq\,\zeta\lVert\nabla J_{t}\rVert^{2}.$ ( Lemma D.1 ) $$

The expression for $b$ involves $\delta_{t+1}$, which is the error of the approximate costate $\tilde{\lambda}_{t+1}$.
This error comes from the cumulative error build-up due to $\varepsilon_{t+1:T-1}$, the errors of the approximate Jacobians used in the backward pass.
To bound $|b|$ we therefore first need to bound this error build-up.
To this end, we now show that for all $s\in[T-t]$,

$$ $\lVert\delta_{t+s}\rVert\leq\frac{\gamma}{3^{s-1}}\kappa^{-1}(\nabla_{u}f_{t}) \prod_{i=1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\lambda_{t+s}\rVert\text{,}$ (9) $$

where we write the inverse condition number of a matrix $A$ as $\kappa^{-1}(A)\doteq\underaccent{\bar}{\sigma}(A)/\bar{\sigma}(A)$.
To prove this bound, we perform a backward induction on $s$. First, consider $s=T-t$. The right-hand side of Eq. 9 is clearly nonnegative. The left-hand side is

$$ $\lVert\delta_{T}\rVert=\lVert\tilde{\lambda}_{T}-\lambda_{T}\rVert=0\text{,}$ $$

as $\tilde{\lambda}_{T}=\lambda_{T}$.
Thus, the inequality holds for $s=T-t$.
We now complete the induction by showing that it holds for any $s\in[T-t-1]$, assuming that it holds for $s+1$.
We start by decomposing $\delta_{t+s}$:

$$ $\displaystyle\delta_{t+s}$ $\displaystyle=\tilde{\lambda}_{t+s}-\lambda_{t+s}$ $\displaystyle=A_{t+s}\tilde{\lambda}_{t+s+1}-\nabla_{x}f_{t+s}\lambda_{t+s+1}$ $\displaystyle=(\nabla_{x}f_{t+s}+\varepsilon_{t+s})(\lambda_{t+s+1}+\delta_{t+ s+1})-\nabla_{x}f_{t+s}\lambda_{t+s+1}$ $\displaystyle=\varepsilon_{t+s}\lambda_{t+s+1}+\nabla_{x}f_{t+s}\delta_{t+s+1} +\varepsilon_{t+s}\delta_{t+s+1}.$ $$

Now, we can bound $\lVert\delta_{t+s}\rVert$ by bounding these individual contributions:

$$ $\lVert\delta_{t+s}\rVert\leq\lVert\underbrace{\varepsilon_{t+s}\lambda_{t+s+1} }_{a^{\prime}}\rVert+\lVert\underbrace{\nabla_{x}f_{t+s}\delta_{t+s+1}}_{b^{ \prime}}\rVert+\lVert\underbrace{\varepsilon_{t+s}\delta_{t+s+1}}_{c^{\prime}}\rVert.$ $$

We start with $\lVert a^{\prime}\rVert$:

$$ $\displaystyle\bar{\sigma}(\varepsilon_{t+s})$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\underaccent{\bar}{\sigma}(\nabla_{x}f_{ t+s})$ ( Assumption 3.2 ) $\displaystyle\implies\quad$ $\displaystyle\lVert\underbrace{\varepsilon_{t+s}\lambda_{t+s+1}}_{a^{\prime}}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\underbrace{\nabla_{x}f_{t+s} \lambda_{t+s+1}}_{\lambda_{t+s}}\rVert.$ ( Lemma D.2 ) $$

Now, $\lVert b^{\prime}\rVert$:

$$ $\displaystyle\lVert\delta_{t+s+1}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\lambda_{t+s+1}\rVert$ (Induction hypothesis) $\displaystyle\iff\quad$ $\displaystyle\bar{\sigma}(\nabla_{x}f_{t+s})\lVert\delta_{t+s+1}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\underaccent{\bar}{\sigma}(\nabla_{x}f_{ t+s})\lVert\lambda_{t+s+1}\rVert$ (Definition of $\kappa^{-1}$ ) $\displaystyle\implies\quad$ $\displaystyle\lVert\underbrace{\nabla_{x}f_{t+s}\delta_{t+s+1}}_{b^{\prime}}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\underbrace{\nabla_{x}f_{t+s} \lambda_{t+s+1}}_{\lambda_{t+s}}\rVert.$ ( Lemma D.2 ) $$

And finally, $\lVert c^{\prime}\rVert$:

$$ $\displaystyle\bar{\sigma}(\varepsilon_{t+s})$ $\displaystyle\,\leq\,\underaccent{\bar}{\sigma}(\nabla_{x}f_{t+s})\,\leq\,\bar {\sigma}(\nabla_{x}f_{t+s})$ (10) $\displaystyle\implies\quad$ $\displaystyle\bar{\sigma}(\varepsilon_{t+s})\lVert\delta_{t+s+1}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s}\kappa^{-1}(\nabla_{x}f_{t+i})\bar{\sigma}(\nabla_{x}f_{t+s})\lVert \lambda_{t+s+1}\rVert$ (Induction hypothesis) $\displaystyle\iff\quad$ $\displaystyle\bar{\sigma}(\varepsilon_{t+s})\lVert\delta_{t+s+1}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\underaccent{\bar}{\sigma}(\nabla_{x}f_{ t+s})\lVert\lambda_{t+s+1}\rVert$ $\displaystyle\implies\quad$ $\displaystyle\lVert\underbrace{\varepsilon_{t+s}\delta_{t+s+1}}_{c^{\prime}}\rVert$ $\displaystyle\,\leq\,\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_{t})\prod_{i= 1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\underbrace{\nabla_{x}f_{t+s} \lambda_{t+s+1}}_{\lambda_{t+s}}\rVert.$ $$

Here, Eq. 10 follows from Assumption 3.2 by noting that that the constant before $\underaccent{\bar}{\sigma}(\nabla_{x}f_{t+s})$ on the right-hand side is not greater than $1$. We can now put all three bounds together to give us Eq. 9:

$$ $\lVert\delta_{t+s}\rVert\leq\lVert a^{\prime}\rVert+\lVert b^{\prime}\rVert+ \lVert c^{\prime}\rVert\leq 3\cdot\frac{\gamma}{3^{s}}\kappa^{-1}(\nabla_{u}f_ {t})\prod_{i=1}^{s-1}\kappa^{-1}(\nabla_{x}f_{t+i})\lVert\lambda_{t+s}\rVert.$ $$

Equipped with a bound on $\delta_{t+s}$, we are ready to bound $|b|$ and $|c|$.
Starting with $|b|$, we have:

$$ $\displaystyle\lVert\delta_{t+1}\rVert$ $\displaystyle\,\leq\,\gamma\kappa^{-1}(\nabla_{u}f_{t})\lVert\lambda_{t+1}\rVert$ ( Eq. 9 for $s=1$ ) $\displaystyle\iff\quad$ $\displaystyle\bar{\sigma}(\nabla_{u}f_{t})\lVert\delta_{t+1}\rVert$ $\displaystyle\,\leq\,\gamma\underaccent{\bar}{\sigma}(\nabla_{u}f_{t})\lVert \lambda_{t+1}\rVert$ (Definition of $\kappa^{-1}$ ) $\displaystyle\implies\quad$ $\displaystyle\lVert\nabla_{u}f_{t}\delta_{t+1}\rVert$ $\displaystyle\,\leq\,\gamma\lVert\nabla_{u}f_{t}\lambda_{t+1}\rVert$ ( Lemma D.2 ) (11) $\displaystyle\implies\quad$ $\displaystyle|\underbrace{\delta_{t+1}^{\top}\nabla_{u}f_{t}^{\top}\nabla_{u}f _{t}\lambda_{t+1}}_{b}|$ $\displaystyle\,\leq\,\gamma\lVert\nabla J_{t}\rVert^{2}.$ ( Lemma D.1 ) $$

And finally, we can bound $|c|$:

$$ $\displaystyle\bar{\sigma}(\varepsilon_{t}^{\prime})\,\leq\,\zeta\underaccent{ \bar}{\sigma}(\nabla_{u}f_{t})$ $\displaystyle\,\leq\,\zeta\bar{\sigma}(\nabla_{u}f_{t})$ ( Assumption 3.2 ) $\displaystyle\implies\quad$ $\displaystyle\bar{\sigma}(\varepsilon_{t}^{\prime})\kappa^{-1}(\nabla_{u}f_{t} )\lVert\lambda_{t+1}\rVert$ $\displaystyle\,\leq\,\zeta\underaccent{\bar}{\sigma}(\nabla_{u}f_{t})\lVert \lambda_{t+1}\rVert$ (Definition of $\kappa^{-1}$ ) $\displaystyle\implies\quad$ $\displaystyle\bar{\sigma}(\varepsilon_{t}^{\prime})\lVert\delta_{t+1}\rVert$ $\displaystyle\,\leq\,\gamma\zeta\underaccent{\bar}{\sigma}(\nabla_{u}f_{t}) \lVert\lambda_{t+1}\rVert$ ( Eq. 9 for $s=1$ ) $\displaystyle\implies\quad$ $\displaystyle\lVert\varepsilon_{t}^{\prime}\delta_{t+1}\rVert$ $\displaystyle\,\leq\,\gamma\zeta\lVert\nabla_{u}f_{t}\lambda_{t+1}\rVert$ ( Lemma D.2 ) (12) $\displaystyle\implies\quad$ $\displaystyle|\underbrace{\delta_{t+1}^{\top}\varepsilon_{t}^{\prime\top} \nabla_{u}f_{t}\lambda_{t+1}}_{c}|$ $\displaystyle\,\leq\,\gamma\zeta\lVert\nabla J_{t}\rVert^{2}.$ ( Lemma D.1 ) $$

This concludes the proof of the first inequality showing that

$$ $g_{t}^{\top}\nabla J_{t}\geq\mu\lVert\nabla J_{t}\rVert^{2}.$ $$

The second inequality,

$$ $\lVert g_{t}\rVert\leq\nu\lVert\nabla J_{t}\rVert\text{,}$ $$

follows easily from the work we have already done. To show this, we start by decomposing $g_{t}$:

$$ $\displaystyle g_{t}$ $\displaystyle=B_{t}\tilde{\lambda}_{t+1}$ $\displaystyle=(\nabla_{u}f_{t}+\varepsilon^{\prime}_{t})(\lambda_{t+1}+\delta_ {t+1})$ $\displaystyle=\nabla J_{t}+\nabla_{u}f_{t}\delta_{t+1}+\varepsilon_{t}^{\prime }\lambda_{t+1}+\varepsilon_{t}^{\prime}\delta_{t+1}.$ $$

To bound the norm of $g_{t}$, we again make use of the triangle inequality:

$$ $\displaystyle\lVert g_{t}\rVert$ $\displaystyle\leq\lVert\nabla J_{t}\rVert+\lVert\nabla_{u}f_{t}\delta_{t+1} \rVert+\lVert\varepsilon_{t}^{\prime}\lambda_{t+1}\rVert+\lVert\varepsilon_{t} ^{\prime}\delta_{t+1}\rVert$ $\displaystyle\leq(1+\gamma+\zeta+\gamma\zeta)\lVert\nabla J_{t}\rVert$ $\displaystyle=\nu\lVert\nabla J_{t}\rVert\text{,}$ $$

where we have used Eqs. 11, 8 and 12.
∎

###### Lemma D.1 .

###### Proof.

###### Lemma D.2 .

###### Proof.

###### Theorem D.3 .

###### Proof.

#### Proof of Theorem 3.4 .

Let $N\in\mathbb{N}$ and $t\in[T-1]_{0}$ be fixed.
In Algorithm 2, the iterates are computed, for all $k\in[N-1]_{0}$, as

$$ $u_{t}^{(k+1)}=u_{t}^{(k)}+\eta g_{t}^{(k)}\text{,}$ $$

where $g_{t}^{(k)}$ is the approximate gradient at iteration $k$.
We denote the true gradient at iteration $k$ by $\nabla J_{t}^{(k)}$.
From the $L$-smoothness of the objective function (Assumption 3.3), it follows that

$$ $\displaystyle J(u_{0:T-1}^{(k+1)})$ $\displaystyle\,\geq\,J(u_{0:T-1}^{(k)})+\nabla_{u_{t}}J(u_{0:T-1}^{(k)})^{\top }(u_{t}^{(k+1)}-u_{t}^{(k)})-\frac{L}{2}\lVert u_{t}^{(k+1)}-u_{t}^{(k)}\rVert ^{2}$ $\displaystyle\,=\,J(u_{0:T-1}^{(k)})+{\nabla J_{t}^{(k)}}^{\top}(\eta g_{t}^{( k)})-\frac{L}{2}\lVert\eta g_{t}^{(k)}\rVert^{2}$ $\displaystyle\,\geq\,J(u_{0:T-1}^{(k)})+\eta\mu\lVert\nabla J_{t}^{(k)}\rVert^ {2}-\frac{\eta^{2}L\nu^{2}}{2}\lVert\nabla J_{t}^{(k)}\rVert^{2}$ ( Theorem D.3 ) $\displaystyle\,=\,J(u_{0:T-1}^{(k)})+\eta\bigg{(}\underbrace{\mu-\frac{\eta L \nu^{2}}{2}}_{\alpha}\bigg{)}\lVert\nabla J_{t}^{(k)}\rVert^{2}.$ $$

Theorem 3.4 demands that $\eta>0$ is set small enough such that $\alpha>0$, which is possible because $0<\mu<\nu$ and $L>0$.
Thus, we get

$$ $\displaystyle\eta\alpha\lVert\nabla J_{t}^{(k)}\rVert^{2}$ $\displaystyle\,\leq\,J(u_{0:T-1}^{(k+1)})-J(u_{0:T-1}^{(k)})$ $\displaystyle\implies\quad$ $\displaystyle\frac{1}{N}\sum_{k=0}^{N-1}\lVert\nabla J_{t}^{(k)}\rVert^{2}$ $\displaystyle\,\leq\,\frac{1}{\alpha\eta N}\sum_{k=0}^{N-1}\left\{J(u_{0:T-1}^ {(k+1)})-J(u_{0:T-1}^{(k)})\right\}$ $\displaystyle\,=\,\frac{1}{\alpha\eta N}\left\{J(u_{0:T-1}^{(N)})-J(u_{0:T-1}^ {(0)})\right\}$ $\displaystyle\,\leq\,\frac{J^{\star}-J(u_{0:T-1}^{(0)})}{\alpha\eta N},$ $$

where $J^{\star}\doteq\sup_{u\in\mathcal{U}^{T}}J(u)$ is the optimal value of the initial state.
∎

## Appendix E Further experiments

In this section, we repeat the MuJoCo experiments of Section 4.2 with longer time-horizons $T$.
The results are shown in Fig. 8.
Our algorithms are sensitive to the horizon $T$, as the costates, which are propagated backward in time, attain some error at each propagation step due to the approximation errors of the Jacobians.
For this reason, Theorem 3.4 demands (through Assumption 3.2) more accurate Jacobians at later time steps.
Thus, for large $T$, our convergence result requires more accurate Jacobian estimates.
However, in Fig. 8, we see that Algorithm 4 is able to cope with longer horizons for the two MuJoCo environments.
The reason for this discrepancy between our theoretical and empirical result is that Theorem 3.4 does not consider the stability of the system under consideration.
The two MuJoCo systems, Ant-v4 and HalfCheetah-v4, are stable along the trajectories encountered during training, which prevents an exponential build-up of error in the costate propagation.

Figure: Figure 8: Learning curves of our off-trajectory algorithm for the two MuJoCo tasks. All experiments were repeated with $20$ random seeds, and we show $95\%$-bootstrap confidence intervals for the average return.
Refer to caption: x7.png

## Appendix F Baselines

We compare our algorithms against two baselines: the finite-difference approach discussed at the end of Section 3.3 and the gradient-free cross-entropy method [CEM; Rubinstein, ].
These methods are listed in Algorithms 5 and 6.

Similarly to the finite-difference method and our on-trajectory algorithm, in CEM, we also perform $M\in\mathbb{N}$ rollouts of perturbed action sequences $\{\bm{u}_{i}\sim\mathcal{N}(\bar{\bm{u}},\sigma I)\}_{i=1}^{M}$.
Here, $\bar{\bm{u}}$ is the current action sequence and $\sigma>0$ is a noise scale parameter.
We then construct the *elite* set $S$ of the $L<M$ perturbed action sequences with the highest returns, where $L\in\mathbb{N}$ is a hyperparameter.
Finally, the current action sequence $\bar{\bm{u}}$ is updated to be the mean of the elite sequences, such that $\bar{\bm{u}}\leftarrow\frac{1}{L}\sum_{\bm{u}\in S}\bm{u}$.

This method can be considerably more efficient than the simple finite-difference method.
Here, we are not trying to estimate the gradient anymore, so we can potentially improve the action sequence with far fewer rollouts than would be needed in the finite-difference approach.
However, this method suffers from the same fundamental deficiency as the finite-difference method: it ignores the Markovian structure of the RL problem and treats the objective function $J$ as a black box.
CEM is commonly used in model-based closed-loop reinforcement learning for planning.
In this setting, the rollouts are hallucinated using the approximate model.
Instead of executing the complete open-loop trajectory, the model-predictive control framework is typically employed.
The planning procedure is repeated after each step in the real environment with the executed action being the first item in the planned action sequence.
Thus, this setting is very different from our open-loop RL objective.
For this reason, we slightly modify the CEM algorithm to better fit our requirements.
In model-based RL, typically both mean $\bar{u}$ and standard variation $\sigma$ are adapted in CEM [Hafner et al., , Pinneri et al., ].
In our experiments, this approach led to very fast convergence ($\sigma\to 0$) to suboptimal trajectories.
We thus only fit the mean and keep the noise scale fixed, which we empirically observed to give much better results.

Figure: Algorithm 5 Finite-difference method

Figure: Algorithm 6 Cross-entropy method

## Appendix G Hyperparameters

Unless stated otherwise, we used the hyperparameters listed in Table 2 in the inverted penulum experiments of Section 4.1, and those listed in Table 2 in the MuJoCo experiments of Sections 4.2 and E.
In each experiment, all actions in the initial action trajectory $u_{0:T-1}^{(0)}$ are sampled from a zero-mean Gaussian distribution with standard deviation $0.01$.
We use the Adam optimizer [Kingma and Ba, ] both for training the MLP model and for performing the gradient ascent steps in Algorithms 2, 3, 4 and 5.
We did not optimize the hyperparameters of soft actor-critic (SAC), but kept the default values suggested by Haarnoja et al. [], as these are already optimized for the MuJoCo environments.
The entropy coefficient of the SAC algorithm is tuned automatically according to the procedure described by Haarnoja et al. [].
In our experiments, we make use of the Stable-Baselines3 [Raffin et al., ] implementation of SAC.

For our off-trajectory method, we found it worthwile to tune the forgetting factor $\alpha$ to the specific task at hand.
Large $\alpha$ means that data is retained for longer, which both makes the algorithm more sample efficient (i.e., faster convergece) and the Jacobian estimates more biased (i.e., convergence to a worse solution).
In Fig. 9, we show this trade-off in the learning curves for the MuJoCo tasks (with the horizon $T=200$).
We found that the performance is much less senstitive to the choice of noise scale $\sigma$ and initial precision $q_{0}$ than to the choice of the forgetting factor $\alpha$.

**Table 1: Pendulum experiments hyperparameters**
| Parameter | Value |
| --- | --- |
| Number of optimization steps $N$ | $50000$ |
| Step size $\eta$ | $0.001$ |
| Noise scale $\sigma$ | $0.001$ |
| Number of perturbed rollouts $M$ | $10$ |
| Forgetting factor $\alpha$ | $0.8$ |
| Initial precision $q_{0}$ | $0.001$ |
| Cross-entropy method: $M$(^5^55 This value was chosen on the basis of the experiment presented in Fig. 6.) | $20$ |
| Finite-difference method: $M$^5 | $20$ |
| Finite-difference method: $\sigma$^5 | $0.0001$ |
| MLP model: hidden layers | $[16,16]$ |
| MLP model: training rollouts | $1000$ |
| MLP model training: epochs | $10$ |
| MLP model training: batch size | $100$ |
| MLP model training: step size | $0.002$ |
| MLP model training: weight decay | $0.001$ |

Figure: Figure 9: Analysis of the influence of the forgetting factor $\alpha$ on the performance of the off-trajectory method (Algorithm 4) in the MuJoCo environments ($T=200$). All experiments were repeated with $20$ random seeds, and we show $95\%$-bootstrap confidence intervals for the average return.
Refer to caption: x8.png

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: Minor issues and questions:

Section 3.3 and 3.4: Are "ON-TRAJECTORY" and "OFF-TRAJECTORY" RL similar to on policy and on policy learning? I see you comment on this on line 243 but I believe you can simply call them that, unless you see a significant reason to mark a distinction.

Assumption 3.2: I am unable to fully grasp this assumption and would like to understand it. In this assumption you are doing away with the Markov assumption for the rewards but then you propose to exploit Markov structure in section 3.3 (line 248).
soundness: 2
strengths: The paper is well written and provides connection from control theory to existing RL concepts very well. They also analyze their methods efficacy using a toy example and do a great job explaining it. They provide both model-free and model-based algorithms using Pontryagin’s principle.
summary: The authors present a new framework for incorporating control theoretic methods into reinforcement learning (RL). They propose the use of the Pontryagin’s principle which computes the Jacobian of the value to apply it in RL. They provide a theoretically sound algorithm that converges to the optimal control asymptotically under certain assumptions. They present an algorithm that estimates the Jacobian of transition function (consequently the value function) in a model free manner by solving a least squares method both in on-policy and off-policy setups. They demonstrate the effects of model mis-specification in a toy environment and show performance improvements in two MuJoCo environments (Ant and Cheetah).
weaknesses: Major issues:

I see three major issues.

**Comparison to previous work:** I believe there are similarities to PILCO [1] in terms of how you estimate the Jacobian of the dynamics (lines 125-132). This a fairly popular model based method in RL and I believe you could compare against it [1,2]. Moreover, you assume deterministic dynamics whereas PILCO is more general purpose with stochastic dynamics. I believe there is some analogue of the Jacobian estimate in PILCO for deterministic dynamics that follows closely what you describe as the Jacobian estimate. I would look at equations 26-28 in the PILCO paper available online. I would also expect some kind of comparison to this method in the experimental section.

**Assumption 3.3 is very strong:** while this $L$-smooth assumption might be common in convex optimization it might not be so in RL. As you might be well aware in dynamical systems the Gronwall's inequality leads to an exponential upper bound for small deviations in the dynamics determined by an ordinary differential equation. Intuitively, a small deviation in the control output can lead to exponential deviation in the cumulative reward/cost. If you dont think this is the case then please let me know why. Is there a parallel for this assumption in control theory or RL? Moreover, can you empirically or analytically verify whether or not this assumption holds for the cartpole swing-up toy problem in section 4.1 since the dynamics are known to you?

**Limited experimentation:** In Section 4.2 the authors only present results in two MuJoCo environments. I believe a broader test across more environments (like DM control suite and other MuJoCo) environments will be beneficial to the community. I would also expect ablations with respect to the hyper-parameters in the MuJoCo setting, especially the forgetting factor $\alpha$.

--------

**References**

[1] PILCO: A model-based and data-efficient approach to policy search, Deisenroth, Marc and Rasmussen, Carl 

[2] Improving PILCO with Bayesian neural network dynamics models, Gal, Yarin and McAllister, Rowan and Rasmussen, Carl Edward

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 3
questions: Please see the above.
soundness: 3
strengths: It is interesting how the authors bridge differential dynamic programming into RL, brining a new perspective onto policy learning. 
The presentation of the paper is good, easy to follow, and in general nicely written. 
The theoretical analysis is nicely done, with satisfactory results, and validated through numerical experiments.
summary: This work propose a trajectory optimization method for RL problems where the (deterministic) differential dynamics are approximated. A naive approximation or linear approximation using least squares. On top of this, the algorithm find a "stateless" policy, or control, through vanilla gradient descent to achieve the necessary first order optimality condition (Pontryagin's principle) of the trajectory optimization problem.
weaknesses: Novelty:
In light of the literature in trajectory optimization, specifically Differential Dynamic Programming (DDP), the content of this work has already been studied extensively, e.g. [1]. The elements in the proposed method seem neither new (using samples to approximate the transition probabilities, and solving a finite-horizon deterministic control problem with first order method such as gradient descent); or particularly novel, as either 1) the control community has extensively studied effective method in the unknown dynamics setting, or 2) the model-based RL community has proposed far more capable "world models" that better capture the environment dynamics beyond linear. I have to ask the authors to provide a more extensive related work section to discuss the novelty of this work. To my understanding, the main idea (Pontryagin's principle) is exactly the first order necessary condition for the trajectory optimization problem in this finite horizon MDP setting, and Algorithm1 is merely performing standard gradient descent. 

Formulation: 
The proposed open loop RL can be subsumed as RL with state space being the time stamp in the control sequence, i.e., $\mathcal{S}=\{1,2,...,T\}$. In view of this, I am not sure how the name open-loop makes sense, as the training requires interaction with the environment to collect rollouts. 
Furthermore, the authors empathized that the proposed method is significantly different from MPC, while the algorithm has no real difference than a MPC, except that the proposed method can't handle variable starting state (i.e., due to "open loop").

Applicability:
The entire algorithm seems to require the horizon to be relatively short, as all experiments seems to truncate the original environment length down to 1/10 (and up to 3/10 in the ablation studies). This brings concerns with the applicability of this method, as in real applications, where any reasonable control rate approaches 30-50Hz, 100 steps equals to less than 3 seconds. If the learned policy need to re-plan, then it most definitely need to take in the new state as input, which is not achievable under the current framework. 

1. Yamaguchi, Akihiko, and Christopher G. Atkeson. "Neural networks and differential dynamic programming for reinforcement learning problems." 2016 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2016.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: see weakness and please justify
soundness: 3
strengths: 1. The paper contributes to reinforcement learning by addressing the relatively underexplored area of open-loop RL, which has potential benefits in environments with deterministic or predictable dynamics.

2. The authors provide a convergence proof for their proposed algorithms, enhancing the theoretical rigor and assuring readers of the stability of the methods under specified conditions.
summary: The paper presents an interesting perspective on open-loop RL and includes theoretical convergence guarantees. However, a lack of contextual depth in related work, an unclear justification for the choice of Pontryagin’s principle, and limited baseline comparisons in the experiments reduce the strength of its contributions. Expanding the literature review, clarifying the theoretical approach, and incorporating additional baselines would enhance the impact and relevance of this work.
weaknesses: 1. The introduction and related work sections would benefit from a more comprehensive review of existing research on open-loop control and open-loop reinforcement learning, especially high-impact studies. By not including these, the paper risks underselling the importance of its contributions in the context of current research. Citing influential works would help position this study within the broader field and underscore the significance of open-loop RL.

2. The paper introduces both open-loop RL and Pontryagin’s principle but does not clearly articulate the relationship between these two concepts. It is unclear whether Pontryagin’s principle is essential for the open-loop RL problems tackled in this paper or if similar outcomes could be achieved with alternative optimization techniques. Additionally, the term "Pontryagin’s principle" is unprofessional; traditionally, this concept is referred to as "Pontryagin’s maximum principle" or "minimum principle."  In the paper it appears to be a direct application to the definition of value function, which reduces the reduced theoretical novelty.

3. Although the work is positioned within reinforcement learning, the empirical section only compares the proposed algorithms against a single baseline (SAC). This limited comparison does not fully contextualize the performance of the new methods within RL. Expanding the baselines to include other established RL algorithms, such as PPO or DDPG, would provide a more comprehensive assessment and better validate the contribution of the new methods.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Can the proposed methods be applied in environments with terminal states (i.e., variable trajectory lengths)?
2. The SAC results in Figure 7 seem somewhat low. How does SAC perform in HalfCheetah at T=1000?
soundness: 2
strengths: The authors approach the decision-making problem from a relatively novel perspective and design multiple feasible algorithms and experiments within this framework, demonstrating the advantages of OLRL over closed-loop RL.
summary: This paper investigates open-loop reinforcement learning (OLRL) and proposes three algorithmic variants based on the meta algorithm (Alg.1) to address OLRL problems: model-based, on-trajectory, and off-trajectory. Each of these methods estimates the gradient of the action sequence from a different perspective. The authors conducted experiments on the pendulum, Ant, and HalfCheetah environments, revealing several properties of OLRL, including its robustness to model error and noise, as well as its sample efficiency in off-trajectory scenarios.
weaknesses: 1. Aside from the benefits of reduced sensor and computation costs, I still struggle to understand the practical advantages of OLRL compared to closed-loop RL. I also have questions about certain statements made in the introduction. For instance, in line 49, the authors claim that OLRL is more robust if the environment changes. However, in unforeseen environment changes, it's difficult to determine whether OLRL or closed-loop RL would perform better. Furthermore, if the environmental change was encountered during training, closed-loop RL can adapt to it, whereas OLRL cannot. Real-world scenarios are always changing, which gives closed-loop RL with adaptive capabilities a clear advantage.
2. In model-based open-loop RL, the gradient is propagated along the dynamics model, leveraging the differentiable nature of the dynamics model. However, this gradient propagation across the entire trajectory, as done in SVG($\infty$) [1], may cause training instability, especially with long trajectories. In contrast, [2] and [3] reduce this trajectory length via a value function, thereby improving training stability. I think the authors could discuss these prior works.
3. In the model-free approach, the authors approximate the gradient using samples, which is a linear approximation and might limit the algorithm’s performance.

[1] Heess et al. "Learning continuous control policies by stochastic value gradients." NeurIPS 2015.

[2] Clavera et al. "Model-augmented actor-critic: Backpropagating through paths." ICLR 2020.

[3] Amos et al. "On the model-based stochastic value gradient for continuous reinforcement learning." L4DC 2021.