---
title: "Autoregressive Policies for Continuous Control Deep Reinforcement Learning"
authors:
  - "Dmytro Korenkevych"
  - "A. Rupam Mahmood"
  - "Gautham Vasan"
  - "James Bergstra"
doi: "10.24963/ijcai.2019/382"
url: "https://ijcai.org/proceedings/2019/382"
pdf: "https://ijcai.org/proceedings/2019/0382.pdf"
venue: "Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence"
year: 2019
pages: "2754-2762"
track: "Main track"
keywords:
  - "Robotics: Learning in Robotics"
  - "Machine Learning: Reinforcement Learning"
---

# Autoregressive Policies for Continuous Control Deep Reinforcement Learning

Dmytro Korenkevych, A. Rupam Mahmood, Gautham Vasan, James Bergstra

*Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence*, pages 2754-2762. DOI: [10.24963/ijcai.2019/382](https://doi.org/10.24963/ijcai.2019/382)

## Abstract

Reinforcement learning algorithms rely on exploration to discover new behaviors, which is typically achieved by following a stochastic policy. In continuous control tasks, policies with a Gaussian distribution have been widely adopted. Gaussian exploration however does not result in smooth trajectories that generally correspond to safe and rewarding behaviors in practical tasks. In addition, Gaussian policies do not result in an effective exploration of an environment and become increasingly inefficient as the action rate increases. This contributes to a low sample efficiency often observed in learning continuous control tasks. We introduce a family of stationary autoregressive (AR) stochastic processes to facilitate exploration in continuous control domains. We show that proposed processes possess two desirable features: subsequent process observations are temporally coherent with continuously adjustable degree of coherence, and the process stationary distribution is standard normal. We derive an autoregressive policy (ARP) that implements such processes maintaining the standard agent-environment interface. We show how ARPs can be easily used with the existing off-the-shelf learning algorithms. Empirically we demonstrate that using ARPs results in improved exploration and sample efficiency in both simulated and real world domains, and, furthermore, provides smooth exploration trajectories that enable safe operation of robotic hardware.

## Full text

## 1 Introduction

Reinforcement Learning (RL) is a promising approach to solving complex real world tasks with physical robots, supported by recent successes [Andrychowicz et al., 2018; Kalashnikov et al., 2018; Haarnoja et al., 2018]. Exploration is an integral part of RL responsible for discovery of new behaviors. It is typically achieved by executing a stochastic behavior policy [Sutton and Barto, 2018]. In continuous control domain, for instance, policies with a parametrized Gaussian distribution have been commonly used [Schulman et al., 2015; Mnih et al., 2016; Schulman et al., 2017;

Haarnoja et al., 2018]. The samples from such policies are temporally coherent only through the distribution mean. In most environments this coherence is not sufficient to provide consistent and effective exploration. In early stages of learning in particular, with randomly initialized policy parameters, exploration essentially relies on a white noise process around zero mean. In environments where actions represent low-level motion control, e.g. velocity or torque, such exploration rarely produces a consistent motion that could lead to discovery of rewarding behaviors. This contributes to low sample efficiency of learning algorithms [Wawrzynski, 2015; Hoof et al., 2017; Plappert et al., 2018]. For real world robotic applications a short reaction time is often desirable, however, as action rate increases, a white noise exploration model becomes even less viable, effectively locking the robot in place [Plappert et al., 2018]. In addition, temporally incoherent exploration results in a jerky movement on physical robots leading to hardware damage and safety concerns [Peters and Schaal, 2007].

In this work we observe that the parameters of policy distribution typically exhibit high temporal coherence, particularly at higher action rates. Specifically, in the case of Gaussian policy distribution, the action can be represented as a sum of deterministic parametrized mean and a scaled white noise component. The mean part typically changes smoothly between subsequent states. It is the white noise part that results in inconsistent exploration behavior. We propose to replace the white noise component with a stationary autoregressive Gaussian process that has stationary standard normal distribution, while exhibiting temporal coherence between subsequent observations. We derive a general form of these processes of an arbitrary order and show how the degree of temporal coherence can be continuously adjusted with a scalar parameter. We demonstrate an advantage of higher orders processes compared to the first order ones used in prior work. Further, we propose an agent's policy structure that directly implements the autoregessive computation in such processes. Temporal action smoothing mechanism therefore is not hidden from the agent but is made explicit through its policy function. In order to achieve this, we require a fixed length history of past states and actions. However, the set of resulting history-dependent policies contains the set of Markov deterministic policies, and those contain the optimal policies in many tasks [Puterman, 2014, Section 4.4]. We find that, in practical applications, the search for such optimal policies can be more efficient and safe in a space of history-dependent stochastic policies with special structure, compared to conventional search in a space of Markov stochastic policies.

Empirically we show that proposed autoregressive policies can be used with off-the-shelf learning algorithms and result in superior exploration and learning in sparse reward tasks compared to conventional Gaussian policies, while achieving similar or slightly better performance in tasks with dense reward. We also show that the drop in learning performance due to increasing action rate can be greatly mitigated by increasing the degree of temporal coherence in the underlying autoregressive process. In the real world robotic experiments we demonstrate that the autoregressive policies result in a smoother and safer movement. 1

## 2 RelatedWork

The problem of exploration in Reinforcement Learning has been studied extensively. One approach has been to modify the environment by changing its reward function to make it easier for an agent to obtain any rewards or to encourage the agent to visit new environment states. This approach includes work on reward shaping [Ng et al., 1999] and auxiliary reward components such as curiosity [Oudeyer et al., 2007; Pathak et al., 2017; Burda et al., 2018]. Note that regardless of chosen reward function temporally consistent behavior would still be beneficial in most tasks as it would discover rewarding behaviors more efficiently. A randomly initialized agent is unaware of the reward function and for example will not exhibit curiosity until after some amount of learning, which already requires visiting new states and discovering rewarding behaviors in the first place.

A second approach, particularly common in practical robotic applications, has been to directly enforce temporal coherence between subsequent motion commands. In the most simple case a low-pass filter is applied, e.g. the agent actions are exponentially averaged over the fixed or infinite length window [Benbrahim and Franklin, 1997]. A similar alternative is to employ a derivative control where agent's actions represent higher order derivatives of the control signal [Mahmood et al., 2018a]. Both of these approaches correspond to acting in a modified MDP with different state and action spaces and result in a less direct connection between agent's action and its consequence in the environment, which can make the learning problem harder. They also make the process less observable unless the agent has access to the history of past actions used in smoothing and to the structure of a smoothing mechanism itself, which is typically not the case. As in the case with modified reward function, the optimal policies in the new MDP generally may not correspond to the optimal policies in the original MDP.

A third approach has been to learn parameters of predefined parametrized controllers, such as motor primitives, instead of learning control directly in the actuation space [Peters and Schaal, 2008]. This approach is attractive, as it allows to ensure safe robot behavior and often results in an easier learning problem [ Hoof et al., 2017]. However, it requires expert knowledge to define appropriate class of controllers and limits possible policies to those, representable within the selected class. In complex tasks [Andrychowicz et al., 2018; Kalashnikov et al., 2018] it may be non-trivial to design a sufficiently rich primitives set.

1 See accompanying video at https://youtu.be/NCpyXBNqNmw

Several studies have considered applying exploration noise to policy distribution parameters such as network weights and hidden units activations. Plappert et al. [2017] applied Gaussian exploration noise to policy parameters at the beginning of each episode, demonstrating a more coherent and efficient exploration behavior compared to only adding Gaussian noise to the action itself. Fortunato et al. [2017] similarly applied independent Gaussian noise to policy parameters, where the scale of the noise was also learned via gradient descent. Both of these works demonstrated improved learning performance compared to baseline Gaussian action space exploration, in particular in tasks with sparse rewards. Our approach is fully complimentary to auxiliary rewards and parametric noise ideas, as both still rely on exploration noise in the action space in addition to other noise sources and can benefit from consistent and temporally smooth exploration trajectories provided by our method.

In the context of continuous control deep RL our work is most closely related to the use of temporally coherent Gaussian noise during exploration. Wawrzynski [2015] used moving average process for exploration where temporal smoothness of exploration trajectories was determined by the integer size of an averaging window. They showed that learning with such process results in a similar final performance as with standard Gaussian exploration, while providing smoother behavior suitable for physical hardware applications. Hoof et al. [2017] proposed a stationary first order AR exploration process in parameters space. Lillicrap et al. [2015] and Tallec et al. [2019] used Ornstein-Uhlenbeck (OU) process for exploration in off-policy learning. The latter work showed that adjusting process parameters according to the time step duration helps to maintain exploration performance at higher action rates. It can be shown that in a discrete time form OU process is a first order Gaussian AR process, which makes it a particular case of our model. AR processes derived in this work generalize the processes used in these studies, providing a wider space of possible exploration trajectories. In addition, the current work proposes policy structure that directly implements autoregressive computation, in contrast to the above studies, where the agent was unaware of the noise structure. Due to this explicit policy formulation, autoregressive exploration can be used in both, on-policy and off-policy learning.

Autoregressive architectures have been proposed in the context of high-dimensional discrete or discretized continuous action spaces [Metz et al., 2017; Vinyals et al., 2017] with regression defined over action components. The objective of such architectures was to reduce dimensionality of the action space. In contrast, we draw on autoregressive stochastic processes literature, and define regression over time steps directly in a multidimensional continuous action space with the objective of enforcing temporally coherent behavior.

## 3 Background

## 3.1 Reinforcement Learning

Reinforcement Learning (RL) framework [Sutton and Barto, 2018] describes an agent interacting with an environment at discrete time steps. At each step t the agent receives the environment state st ∈ S and a scalar reward signal rt ∈ R. The agent selects an action at ∈ A according to a policy defined by a probability distribution π(a|s) := P {at = a|st = s}. At the next time step t + 1 in part due to the agent's action, the environment transitions to a new state st+1 and produces a new reward rt+1 according to a transition probability distribution p(s′ , r|s, a) := Pr {st+1 = s′ , rt+1 = r|st = s, at = a}. The objective of the agent is to find a policy that maximizes the expected return defined as the future accumulated rewards Gt := ∑∞k=t γ k-t rk+1, where γ ∈ [0, 1] is a discount factor. In practice, the agent observes the environment's state partially through a real-valued observation vector ot.

## 3.2 Autoregressive Processes

An autoregressive process of order p ∈ N (AR-p) is defined as

<!-- formula-not-decoded -->

where φk ∈ R, k = 1, . . . , p are real coefficients, and Zt is a white noise with zero mean and finite variance, Zt ∼ WN(0, σ2Z ), σ2Z &lt;∞.

An autoregressive process {Xt} is called weakly stationary, if its mean function µX(t) = E[Xt] is independent of t and its covariance function γX(t + h, t) = cov(Xt+h, Xt) is independent of t for each h. In the future we will use the term stationary implying this definition. The process (1) is stationary if the roots Gi, i = 1, . . . , p (possibly complex) of its characteristic polynomial

<!-- formula-not-decoded -->

lie within a unit circle, e.g. |Gi| &lt; 1, i = 1, . . . , p (see e.g. [Brockwell et al., 2002, Section 3.1]).

An autocovariance function γk is defined as γk = cov(Xt,Xt-k), k = 0,±1,±2, . . .. From definition, γ0 = var(Xt) = σ2X . For a stationary AR-p process a linear system of Yule-Walker equations holds:

<!-- formula-not-decoded -->

and

<!-- formula-not-decoded -->

The system (2) has a unique solution with respect to the variables {γk}, k = 0, . . . , p.

## 4 Stationary Autoregressive Gaussian Processes

In this section we derive a family of stationary AR-p Gaussian processes for any p ∈ N, such that Xt ∼ N (0, 1) ∀t, meaning Xt has a marginal standard normal distribution at each t. We also show how the degree of temporal smoothness of trajectories formed by subsequent observations of such processes can be continuously tuned with a scalar parameter.

Proposition 4.1. For any p ∈ N and for any αk ∈ [0, 1), k = 1, . . . , p consider a set of coefficients

<!-- formula-not-decoded -->

The Yule-Walker system (2) with coefficients {˜ φk} has a unique solution with respect to (˜ γ0, ˜ γ1, . . . , ˜ γp, ˜σ2Z ), such that ˜ γ0 = 1 and ˜σ2Z &gt; 0. Furthermore, the autoregressive process

<!-- formula-not-decoded -->

is a stationary Gaussian process with zero mean and unit variance, meaning Xt ∼ N (0, 1) ∀t.

Proof. The proof follows from the observation that {˜ φk} are coefficients of a polynomial P(z) = (z - α1)(z - α2) . . . (z - αp) with roots {αk} that all lie within a unit circle. Since P(z) is a characteristic polynomial of a process (4), the process is stationary. The existence of a unique solution to the system (2) with ˜ γ0 = 1, ˜σ2Z &gt; 0 follows from the observation that for any ˜σ2Z &gt; 0 the system (2) has a unique solution with respect to (˜ γ0, ˜ γ1, . . . , ˜ γp), while it is homogeneous with respect to (˜ γ0, ˜ γ1, . . . , ˜ γp, ˜σ2Z ). The result then follows from observing that ˜ γ0 &gt; 0, and scaling the solution (˜ γ0, ˜ γ1, . . . , ˜ γp, ˜σ2Z ) by 1/˜ γ0. A complete proof can be found in Supplementary Materials A available at https://bit.ly/2BQqWMx.

Corollary 4.1.1. For any p ∈ N and for any α ∈ [0, 1) let {Xt} be the autoregressive process:

<!-- formula-not-decoded -->

where (p k) = p! k!(p-k)! is a binomial coefficient, ˜σ2Z is a solution to the system (2) with {φk = ˜ φk}pk=1 and γ0 = 1. Then Xt ∼ N(0, 1) ∀t.

<!-- formula-not-decoded -->

An example of a third order process AR-3 defined by (4) is given in Supplementary Materials B.

Proposition 4.1 allows to formulate stationary autoregressive processes of an arbitrary order p for arbitrary values

Figure 1: Realizations of processes (5) for different p and α and the same set of 3 random seeds.

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000000_0c424a2cad266c9c5f8e70758ab640e947568987a361ce2b7877d435b1ef2a16.png)

αk ∈ [0, 1), k = 1, . . . , p, such that the marginal distributions of realizations of these processes are standard normal at each time step. This gives us great flexibility and power in defining properties of these processes, such as the degree of temporal coherence between process realizations at various time lags. If we were to use these processes as a source of exploration behavior in RL algorithms, this flexibility would translate into a flexibility in defining the shape and smoothness of exploration trajectories. Note, that the process (4) trivially generalizes to a vector form by defining Zt a multivariate white noise with a diagonal covariance.

Autoregressive processes in the general form (4) possess a number of interesting properties that can be utilized in reinforcement learning. However, for the purposes of the discussion in the following sections, from now on we will consider a simpler subfamily of processes, defined by (5). Notice, that α = 0 results in ˜ φk = 0 ∀k, and Xt becomes a white Gaussian noise. On the other hand, α → 1 results in σ2Z → 0, and Xt becomes a constant function. Therefore, tuning a single scalar parameter α from 0 to 1 continuously adjusts temporal smoothness of Xt ranging from white noise to a constant function. Figure 1 shows realizations of such processes at different values of p and α. The realizations are initialized from the same set of 3 random seeds for each p, α pair.

## 5 Autoregressive Policies

In continuous control RL a policy is often defined as a parametrized diagonal Gaussian distribution:

<!-- formula-not-decoded -->

where st is a state at time t, µθ(st) and σ2 θ (st) are vectors parametrized by deep neural networks. The actions, sampled from such distribution, can be represented as at = µθ(st) + σθ(st)εt, where εt ∼ N(0, I) is a white Gaussian noise. We propose to replace εt with observations of an AR-p process {Xt} defined by (5) for some p ∈ N and α ∈ [0, 1):

<!-- formula-not-decoded -->

Both εt and Xt follow marginal standard normal distribution at each step t, therefore such substitution does not change the network output to noise ratio in sampled actions, however for α &gt; 0 the sequence {Xt} possesses temporal coherence and can provide a more consistent exploration behavior.

We would like to build an agent that implements stochastic policy with samples, defined by (7). From definition (5) of the process {Xt}, (7) can be expanded as

<!-- formula-not-decoded -->

From (7) also, Xt = (at - µθ(st))/σθ(st) ∀t, hence (8) can be rewritten as

<!-- formula-not-decoded -->

Denote fθ,t = ∑pk=1 ˜ φk at-k-µθ(st-k) σθ (st-k) the auto-regressive "history" term in (9). Note that fθ,t is a function of past p states and actions, fθ,t = f({st-k, at-k}pk=1 , θ). Then at follows the distribution:

<!-- formula-not-decoded -->

In order to implement such action distribution, we need to define a history-dependent policy π(at|st, hpt ), where hpt = (st-p, at-p, . . . , st-1, at-1) is a history of past p states and actions. In general, history-dependent policies do not induce Markov stochastic processes, even if the environment transition probabilities are Markovian [Puterman, 2014, Section 2.1.6]. However when the dependence is only on a history of a fixed size, such policy induces a Markov stochastic process in an extended state space, where states are defined as pairs (hpt , st). In order to be able to lean on existing theoretical results, such as Policy Gradient Theorem [Sutton et al., 2000], and to use existing learning algorithms, we will talk about learning policies in this extended MDP.

More formally, let M = (S,A, P(·|a, s), r(s, a)) be a given MDP with S and A denoting state and action sets, and P and r denoting transition probability and reward functions respectively. Let p be an arbitrary integer number. We define a modified MDP ˜M p = ( ˜ S, ˜ A, ˜ P (·|a, ˜ s), ˜ r(˜ s, a)) with the elements ˜ S = {S × A}p × S, where {C}p denotes Cartesian product of set C with itself p times, ˜ A = A, and ˜ P and ˜ r defined as follows:

<!-- formula-not-decoded -->

In other words, transitions in a modified MDP ˜M p correspond to transitions in the original MDP M with states in ˜M p containing also the history of past p states and actions in M. The interaction between the agent and the environment, induced by ˜M p , occurs in the following way. At each time t the agent is presented with the current state ˜ st = (st-p, at-p, . . . , st-1, at-1, st). Based on this state and its policy, it chooses an action at from the set A and sends it to the environment. Internally, the environment propagates the action at to the original MDP M, currently in state st, which responds with a reward value rt+1 and transitions to a new state st+1. At this moment, theMDP ˜M p transitions to a new state ˜ st+1 = (st-p+1, at-p+1, . . . , st, at, st+1) and presents it to the agent together with the reward rt+1. Let s0 be an element of the set of the initial states of M. A corresponding initial state of ˜M p is defined as ˜ s0 = (s0, a0, . . . , s0, a0 ︸ ︷︷ ︸ p repetitions , s0),

where a0 is any element of an action set A, for example zero vector in the case of continuous space. The particular choice of a0 is immaterial, since it does not affect future transitions and rewards (more details in Supplementary Materials F). We define an autoregressive policy (ARP) over ˜M p as:

<!-- formula-not-decoded -->

where µθ(·) and σθ(·) are parametrized function approximations, such as deep neural networks. For notation brevity, we omitted dependence of policy πθ on {˜ φk} and ˜σZ, since these values are constant once the autoregressive model {Xt} is selected. In this parametrization, µθ(st-k), k = 0, . . . , p should be thought of as the same parametrized function µθ(·) applied to different parts of the state vector ˜ st, therefore each occurence of µθ(·) in (11) contributes to the gradient w.r.t. parameters θ. Similarly, each occurence of σθ(·) contributes to the gradient w.r.t. θ. Note, that including history of states and actions does not affect the dimensionality of the input to the function approximations, as both µθ(·) and σθ(·) accept only states from the original space as inputs.

The history-dependent policy (11) results in the desired action distribution (10) in the original MDPM, at the same time with respect to ˜M p it is just a particular case of a Gaussian policy (6). Formally, we will perform learning in ˜M p , where πθ is Markov, and therefore all the related theoretical results apply, and any off-the-shelf learning algorithm, applicable to policies of type (6), can be used. In particular, the value function in e.g. actor-critic architectures is learned with usual methods. Empirically we found that conditioning value function only on a current state st from the original MDP instead of an entire vector ˜ st gives more stable learning performance. It also helps to maintain the critic network size invariant to the AR process order p.

By design, for each sample path (˜ s0, a0, ˜ s1, a1, . . .) in ˜M p there is a corresponding sample path (s0, a0, s1, a1, . . .) in M

with identical rewards. Therefore, improving the policy and the obtained rewards in ˜M p results in identical improvement of a corresponding history-dependent policy in M. Notice also, that if σθ(st) → 0 in (11), then πθ reduces to a Markov deterministic policy at = µθ(st) in M. Therefore, the optimal policy in the set of ARPs defined by (11) is at least as good, as the best deterministic policy in the set of policies at = µθ(st). This is in contrast with action averaging approaches, where temporal smoothing is typically imposed on the entire action vector and not just on the exploration component, limiting the space of possible deterministic policies.

It is important to point out that for any history-dependent policy there exists an equivalent Markov stochastic policy with identical expected returns [Puterman, 2014, Theorem 5.5.1]. For the policy (11), for example, it can be constructed as πM θ (a|s) = ∑ hp∈Hp πθ(a|s, hp )p(hp |s, πθ) ∀(a, s), where

Hp is a set of all histories of size p. However, πM θ (a|s) is a non-trivial function of a state s, unknown to us at the beginning of learning. It is certainly not given by a random initialization of (6), while a random initialization of (11) already provides consistent and smooth behavior. πM (a|s) also cannot be derived analytically from (11), since computing p(hp |s, πθ) requires knowledge of environment transition probabilities, which we cannot expect to have for each given task. From these considerations, the particular form of policy parametrization defined by (11) can also be thought of as an additional structure, enforced upon the general class of Markov policies, such as policies defined by (6), restricting possible behaviors to temporally coherent ones.

Although autoregressive term fθ(˜ st) in (11) is formally a part of the distribution mean, numerically it corresponds to a stationary zero mean random process Ft = ∑pk=1 ˜ φkXt-k, where {Xt} is an underlying AR process defined by (5). Therefore, fθ(˜ st) can be thought of as a part of an action exploration component around the deterministic mean, given by µθ(st). It is this part that ensures a consistent and smooth exploration, as will be demonstrated in the next section.

In principle, one could define πθ in (11) using arbitrary values of coefficients {˜ φk} and ˜σ2Z . The role of particular values of {˜ φk} computed according to (5) is to make sure, that the underlying AR process {Xt} is stationary and the autoregressive part fθ(˜ st) does not explode. The role of ˜σ2Z computed by solving (2) with coefficients {φk = ˜ φk} and γ0 = 1 is to make sure, that the variance of the underlying process {Xt} is 1. The total variance around µθ(st) is then conveniently defined by an agent controlled σθ(st).

Since linear system (2) with coefficients (3) and γ0 = 1 has a unique solution according to the Proposition 4.1, its matrix has a full rank, and therefore the system is well-determined and can be solved numerically to an arbitrary precision. In practice we solve it with numpy.linalg.solve function.

## 6 Experiments

We compared conventional Gaussian policy with ARPs on a set of tasks with both, sparse and dense reward functions, in simulation and the real world. In the following learning experiments we used the Open AI Baselines PPO algorithm implementation [Schulman et al., 2017]. The results with Baselines TRPO [Schulman et al., 2015] are provided in Supplementary Materials C available at https://bit. ly/2BQqWMx. For each experiment we used identical algorithm hyper-parameters and neural network structures to parametrize µθ, σθ and the value networks for both Gaussian and ARP policies. We used the same set of random seeds to initialize neural networks and the same set of random seeds to initialize environments that involve uncertainty. Detailed parameters for each task are included in Supplementary Materials E. We did not perform a hyper-parameter search to optimize for ARP performance, as our primary objective is to demonstrate the advantage of temporally coherent exploration even in the setting, tuned for a standard Gaussian policy. The video of agent behaviors can be found at https: //youtu.be/NCpyXBNqNmw. The code to reproduce experiments is available at https://github.com/kindredresearch/arp.

Figure 2: a) Autocorrelation function ρτ for autoregressive processes (5) with different orders p but the same value of ρ1 = 0.99. b) Realizations of processes (5) with the same ρ1 = 0.99.

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000001_f4d11e3217e118e23110e1f416545d58a1570932598cabae31aeaa8b5dc5bb81.png)

## 6.1 The Order of an Autoregressive Process

From Figure 1 one can notice that the temporal smoothness of realizations of AR processes (5) empirically increases with both, parameter α and order p. Why do we need higher order processes if we can simply increase α to achieve a higher degree of temporal coherence? To answer this question it is helpful to consider an autocorrelation function (ARF) ρτ = cov(Xt,Xt+τ)/var(Xt) = γτ/γ0 of these processes. White Gaussian noise by definition has autocorrelation function equal to zero at any τ other than 0. An autoregressive process with non-zero coefficients generally has non-zero values of autocorrelation function at all τ .

One of the reasons we are interested in autoregressive processes for exploration is that they provide smooth trajectories that do not result in jerky movement and do not damage physical robot hardware. Intuitively, the smoothness of the process realization is defined by a correlation between subsequent observations corr(Xt, Xt+1) = ρ1, which for a given p increases with increasing α. However, given the same value ρ1, processes of different orders p behave differently. Figure 2a shows ARFs for different processes defined by (5) and their corresponding values of α with the same value of ρ1 = 0.99, while Figure 2b shows realizations of these processes. ARF values at higher orders p decrease much faster with increasing time lag τ compared to the 1st order process, where correlation between past and future observations lingers over long periods of time. As shown on Figure 2b, the 1st order AR process produces nearly a constant function, while the 5th order process exhibits a much more diverse exploratory behavior. Given the same value of correlation between subsequent realizations, higher order autoregressive processes exhibit lower correlation between observations distant in time, resulting in trajectories with better exploration potential. In robotics applications where smoothness of the trajectory can be critical, higher order autoregressive processes may be a preferable choice. Empirically we found that the 3-rd order processes provide sufficiently smooth trajectories while exhibiting a good exploratory behavior, and used p = 3 in all our subsequent learning experiments varying only the smoothing parameter α.

Figure 3: a) Average time to target in Square environment as a function of an action rate for Gaussian policy and ARPs with varied α. b) 10 seconds long exploration trajectories at 10Hz (left column) and 100Hz (right column) action rate using Gaussian policy (top row) and ARPs with p = 3 and α values 0.8 and 0.95 (bottom row).

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000002_72c5c459b127a5eb39b334358638b8646b21e55490f9e1c7cffdad1981d2f40a.png)

## 6.2 Toy Environment with Sparse Reward

To demonstrate the advantage of temporally consistent exploration, in particular at high action rates, we designed a toy Square environment with a 2D continuous state space bounded by a 10x10 square arena. The agent controls a dot through a continuous direct velocity control. The agent is initialized in the middle of the arena at the start of each episode and receives a -1 reward at each time step scaled by time step duration. The target is generated at a random location on a circle of diameter 5 centered at the middle of the arena to make episodes homogenous in difficulty. The episode is over when the agent approaches the target to within a distance of 0.5. The action space is bounded within a two-dimensional [-1, 1]2 interval. The observation vector contains the agent's position, velocity, and the vector difference between agent position and the target position.

To compare exploration efficiency we ran random ARP (p = 3) and Gaussian agents with µθ(·), σθ initialized to ⃗0 and ⃗1 respectively for 10 million simulated seconds at different action rates. Figure 3a shows average time to reach the target as a function of an action rate. The results show that the optimal degree of temporal coherence depends on the environment properties, such as action rate. At low control frequency a white Gaussian exploration is more effective than ARPs with high α, as in the latter the agent quickly reaches the boundary of the state space and gets stuck there. The efficiency of Gaussian exploration drops dramatically with the increase of action rate. However it is possible to maintain a consistent exploration performance in ARP across wide range of action rates by increasing accordingly the α parameter. This effect is visualized on Figure 3b which shows five 10 seconds long exploration trajectories at 10Hz and 100Hz control for Gaussian and ARP policies. Although run for the same amount of simulated time, Gaussian exploration at 100Hz covers substantially smaller area of state space compared to 10Hz control, while increasing α from 0.8 to 0.95 (the values were chosen empirically) results in ARP trajectories covering similar space at both action rates. Note that the issue with Gaussian policy can not be fixed by simply increasing the variance, as most actions will just be clipped at the [-1, 1]2 boundary, resulting in a similarly poor exploration. Figure 3b top right plot shows exploration trajectories for σ(θ) = ⃗1 (blue) and σ(θ) = ⃗ 10 (gray). To the contrary of the common intuition, in bounded action spaces Gaussian exploration with high variance does not produce a diverse stateaction visitation.

Figure 4: Learning curves in a toy 2D environment with sparse reward. White noise exploration (Gaussian policy) leads to ineffective learning at higher action rates. Temporally smoother processes are capable to learn an effective behavior at wide range of action rates.

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000003_bbe710182763e1fa53cf2a79f8ac89feea1c70c62da514107c32360e69a003f6.png)

The advantage of ARPs in exploration translates into an advantage in learning. Figure 4 shows learning curves (averaged over 5 random seeds) on Square environment at different action rates ran for 50,000 seconds of total simulated time with episodes limited to 1000 simulated seconds. Not only ARPs exhibit better learning at most action rates, but the initial random behavior gives much higher returns compared to initial Gaussian agent behaviour. At higher action rates ARPs with higher α produce better results. At the same time at the lowest action rate Gaussian policy (corresponding to ARP with α = 0) outperforms policies with higher α values. In a Square environment the fast reaction time is not essential and an effective policy can be achieved at low action rates, since the target is stationary and there are no safety hazards. In practical applications however this is rarely the case. The robots often share workspace with other robots and humans and the environment changes dynamically. A fast reaction time of the agent is often necessary to have both safe and effective behaviour. In Supplementary Materials D we provide learning results in a modified Square environment with a mobile target where an effective behaviour cannot be achieved at low action rate.

In the formulation of the AR-1 process used in Lillicrap et al. [2015] and in Tallec et al. [2019], parameter α corresponds to 1 - κdt, where dt is a time step duration. Hence, in that formulation α naturally approaches 1 as dt approaches zero. Note, that in order to achieve the best performance on each given task, parameter κ still needs to be tuned, just as parameter α needs to be tuned in our formulation. The optimal values of these parameters depend not only on action rate, but also on environment properties, such as a size of a state space relative to the typical size of an agent step. For example, in the defined here Square environment increasing the size of the arena and the initial distance to the target k-fold is equivalent to keeping the arena size the same but decreasing time step durartion k-fold. Therefore, given the same value of dt, bigger arena would require a larger value of α or a smaller value of κ parameters respectively.

Notice that ARP, although having better performance than a Gaussian policy, still degrades at higher action rates (e.g.

Figure 5: Learning curves in Mujoco-based environments.

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000004_ea3d9d5498689b5e8bce23e71dc30cb9e276400b999b9467afe3459d91bfd93f.png)

α = 0.5 at 10Hz vs α = 0.95 at 100Hz control). There are two main challenges in learning at high action rates: one being an effective exploration and the other being a problem of credit assignment (i.e. at higher action rates the information about returns needs to be propagated through a larger number of steps and the effect of each individual action is less perceptible to e.g. neural network approximations). Our method addresses the first challenge but not the second one, and therefore its performance still suffers from very high action rates.

## 6.3 Mujoco Experiments

Figure 5 shows the learning results on standard OpenAI Gym Mujoco environments [Brockman et al., 2016]. These environments have dense rewards, so consistent exploration is less crucial here compared to tasks with sparse rewards. Nevertheless, we found that ARPs perform similarly or slightly better, than a standard Gaussian policy. On a Swimmer-v2 environment ARP resulted in a much better performance compared to Gaussian policy, possibly because in this environment smooth trajectories are highly rewarded. Note that different Mujoco environments are defined with different simulated time step durations (shown on Figure 5), which partially define the best value of α for each task. In addition, as we discussed in the previous subsection, the optimal value of alpha is defined by other aspects of the simulation, such as torque limits, joint space limits, and the reward function. The results suggest that fot the best performance α generally needs to be tuned separately on each given domain.

## 6.4 Physical Robot Experiments

On a UR5 robotic arm we were able to obtain results similar to those in the toy environment. We designed a sparse reward version of a UR5 Reacher 2D task introduced in [Mahmood et al., 2018b]. In a modified task at each time step the agent receives a -1 reward scaled by a time step duration. The episode is over when the agent reaches the target within a distance of 0.05. In order to provide sufficient time for exploration in a sparse reward setting we doubled the episode time duration to 8 seconds. Figure 6 shows the learning curves for 25Hz and 125Hz control. Each curve is an average across 4 random seeds. The Gaussian policy fails to learn in a 125Hz control setting within a 5 hours time limit, while ARP was able to find an effective policy in 50% of the runs, and the effectiveness at higher α increased at a higher action rate.

Figure 6: Learning curves on a UR5 Reacher 2D environment with sparse reward at 25Hz and 125Hz velocity control.

![Image](https://ijcai.org/proceedings/2019/fulltext/382/image_000005_9db1da2d249fb6d37a7d98b0a58926cde076acd842fdfa19d3a488e3b740a255.png)

## 7 Conclusions

We introduced autoregressive policies (ARPs) for temporally coherent exploration in continuous control deep reinforcement learning. The policy form is grounded in the theory of stationary autoregressive stochastic processes. We derived a family of stationary Gaussian autoregressive stochastic processes for an arbitrary order p with continuously adjustable degree of temporal coherence between subsequent observations. We derived an agent policy that implements these processes with a standard agent-environment interface. Empirically we showed that ARPs result in a superior exploration and learning in sparse reward tasks and perform on par or better compared to standard Gaussian policies in dense reward tasks. On physical hardware, ARPs result in smooth trajectories that are safer to execute compared to the trajectories provided by conventional Gaussian exploration.

## References

1. [Andrychowicz et al., 2018] Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand ma- nipulation. arXiv preprint arXiv:1808.00177, 2018.
2. [Benbrahim and Franklin, 1997] Hamid Benbrahim and Judy A Franklin. Biped dynamic walking using rein- forcement learning. Robotics and Autonomous Systems, 22(3-4):283-302, 1997.
3. [Brockman et al., 2016] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
4. [Brockwell et al., 2002] Peter J Brockwell, Richard A Davis, and Matthew V Calder. Introduction to time series and forecasting, volume 2. Springer, 2002.
5. [Burda et al., 2018] Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018.
6. [Fortunato et al., 2017] Meire Fortunato, Moham- mad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017.
7. [Haarnoja et al., 2018] Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018.
8. [van Hoof et al., 2017] Herke van Hoof, Daniel Tanneberg, and Jan Peters. Generalized exploration in policy search. Machine Learning, 106(9-10):1705-1724, 2017.
9. [Kalashnikov et al., 2018] Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vin- cent Vanhoucke, and Sergey Levine. Scalable deep rein- forcement learning for vision-based robotic manipulation. In Aude Billard, Anca Dragan, Jan Peters, and Jun Mo- rimoto, editors, Proceedings of The 2nd Conference on Robot Learning, volume 87 of Proceedings of Machine Learning Research, pages 651-673. PMLR, 29-31 Oct 2018.
10. [Lillicrap et al., 2015] Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous con- trol with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
11. [Mahmood et al., 2018a] A Rupam Mahmood, Dmytro Ko- renkevych, Brent J Komer, and James Bergstra. Setting up a reinforcement learning task with a real-world robot. In 2018 IEEE/RSJ International Conference on Intelli- gent Robots and Systems (IROS), pages 4635-4640. IEEE, 2018.
12. [Mahmood et al., 2018b] A. Rupam Mahmood, Dmytro Ko- renkevych, Gautham Vasan, William Ma, and James Bergstra. Benchmarking reinforcement learning algo- rithms on real-world robots. In CoRL, 2018.
13. [Metz et al., 2017] Luke Metz, Julian Ibarz, Navdeep Jaitly, and James Davidson. Discrete sequential prediction of continuous actions for deep rl. arXiv preprint arXiv:1705.05035, 2017.
14. [Mnih et al., 2016] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asyn- chronous methods for deep reinforcement learning. In In- ternational conference on machine learning, pages 1928- 1937, 2016.
15. [Ng et al., 1999] Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, vol- ume 99, pages 278-287, 1999.
16. [Oudeyer et al., 2007] Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for au- tonomous mental development. IEEE transactions on evo- lutionary computation, 11(2):265-286, 2007.
17. [Pathak et al., 2017] Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017.
18. [Peters and Schaal, 2007] Jan Peters and Stefan Schaal. Re- inforcement learning by reward-weighted regression for operational space control. In Proceedings of the 24th inter- national conference on Machine learning, pages 745-750. ACM, 2007.
19. [Peters and Schaal, 2008] Jan Peters and Stefan Schaal. Re- inforcement learning of motor skills with policy gradients. Neural networks, 21(4):682-697, 2008.
20. [Plappert et al., 2017] Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017.
21. [Plappert et al., 2018] Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
22. [Puterman, 2014] Martin L Puterman. Markov decision pro- cesses: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
23. [Schulman et al., 2015] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pages 1889-1897, 2015.
24. [Schulman et al., 2017] John Schulman, Filip Wolski, Pra- fulla Dhariwal, Alec Radford, and Oleg Klimov. Prox- imal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
25. [Sutton and Barto, 2018] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
26. [Sutton et al., 2000] Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approxi- mation. In Advances in neural information processing sys- tems, pages 1057-1063, 2000.
27. [Tallec et al., 2019] Corentin Tallec, Léonard Blier, and Yann Ollivier. Making deep q-learning methods robust to time discretization. arXiv preprint arXiv:1901.09732, 2019.
28. [Vinyals et al., 2017] Oriol Vinyals, Timo Ewalds, Sergey Bartunov, Petko Georgiev, Alexander Sasha Vezhnevets, Michelle Yeo, Alireza Makhzani, Heinrich Küttler, John Agapiou, Julian Schrittwieser, et al. Starcraft ii: A new challenge for reinforcement learning. arXiv preprint arXiv:1708.04782, 2017.
29. [Wawrzynski, 2015] Pawel Wawrzynski. Control policy with autocorrelated noise in reinforcement learning for robotics. International Journal of Machine Learning and Computing, 5(2):91, 2015.
