We study the problem of programmatic reinforcement learning, in whichpolicies are represented as short programs in a symbolic language. Programmaticpolicies can be more interpretable, generalizable, and amenable to formalverification than neural policies; however, designing rigorous learningapproaches for such policies remains a challenge. Our approach to thischallenge -- a meta-algorithm called PROPEL -- is based on three insights.First, we view our learning task as optimization in policy space, modulo theconstraint that the desired policy has a programmatic representation, and solvethis optimization problem using a form of mirror descent that takes a gradientstep into the unconstrained policy space and then projects back onto theconstrained space. Second, we view the unconstrained policy space as mixingneural and programmatic representations, which enables employingstate-of-the-art deep policy gradient approaches. Third, we cast the projectionstep as program synthesis via imitation learning, and exploit contemporarycombinatorial methods for this task. We present theoretical convergence resultsfor PROPEL and empirically evaluate the approach in three continuous controldomains. The experiments show that PROPEL can significantly outperformstate-of-the-art approaches for learning programmatic policies.
Quick Read (beta)
Imitation-Projected Programmatic Reinforcement Learning
Appendix: Imitation-Projected Programmatic Reinforcement Learning
We study the problem of programmatic reinforcement learning, in which policies are represented as short programs in a symbolic language. Programmatic policies can be more interpretable, generalizable, and amenable to formal verification than neural policies; however, designing rigorous learning approaches for such policies remains a challenge. Our approach to this challenge — a meta-algorithm called Propel— is based on three insights. First, we view our learning task as optimization in policy space, modulo the constraint that the desired policy has a programmatic representation, and solve this optimization problem using a form of mirror descent that takes a gradient step into the unconstrained policy space and then projects back onto the constrained space. Second, we view the unconstrained policy space as mixing neural and programmatic representations, which enables employing state-of-the-art deep policy gradient approaches. Third, we cast the projection step as program synthesis via imitation learning, and exploit contemporary combinatorial methods for this task. We present theoretical convergence results for Propel and empirically evaluate the approach in three continuous control domains. The experiments show that Propel can significantly outperform state-of-the-art approaches for learning programmatic policies.
Imitation-Projected Programmatic Reinforcement Learning
Abhinav Verma††thanks: Equal contribution Rice University [email protected] Hoang M. Le Caltech [email protected] Yisong Yue Caltech [email protected] Swarat Chaudhuri Rice University [email protected]
noticebox[b]33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada.\[email protected]
A growing body of work [58, 8, 60] investigates reinforcement learning (RL) approaches that represent policies as programs in a symbolic language, e.g., a domain-specific language for composing control modules such as PID controllers . Short programmatic policies offer many advantages over neural policies discovered through deep RL, including greater interpretability, better generalization to unseen environments, and greater amenability to formal verification. These benefits motivate developing effective approaches for learning such programmatic policies.
However, programmatic reinforcement learning (PRl) remains a challenging problem, owing to the highly structured nature of the policy space. Recent state-of-the-art approaches employ program synthesis methods to imitate or distill a pre-trained neural policy into short programs [58, 8]. However, such a distillation process can yield a highly suboptimal programmatic policy — i.e., a large distillation gap — and the issue of direct policy search for programmatic policies also remains open.
In this paper, we develop Propel (Imitation-Projected Programmatic Reinforcement Learning), a new learning meta-algorithm for PRl, as a response to this challenge. The design of Propel is based on three insights that enables integrating and building upon state-of-the-art approaches for policy gradients and program synthesis. First, we view programmatic policy learning as a constrained policy optimization problem, in which the desired policies are constrained to be those that have a programmatic representation. This insight motivates utilizing constrained mirror descent approaches, which take a gradient step into the unconstrained policy space and then project back onto the constrained space. Second, by allowing the unconstrained policy space to have a mix of neural and programmatic representations, we can employ well-developed deep policy gradient approaches [55, 36, 47, 48, 19] to compute the unconstrained gradient step. Third, we define the projection operator using program synthesis via imitation learning [58, 8], in order to recover a programmatic policy from the unconstrained policy space. Our contributions can be summarized as:
We present Propel, a novel meta-algorithm that is based on mirror descent, program synthesis, and imitation learning, for PRl.
On the theoretical side, we show how to cast Propel as a form of constrained mirror descent. We provide a thorough theoretical analysis characterizing the impact of approximate gradients and projections. Further, we prove results that provide expected regret bounds and finite-sample guarantees under reasonable assumptions.
On the practical side, we provide a concrete instantiation of Propel and evaluate it in three continuous control domains, including the challenging car-racing domain Torcs . The experiments show significant improvements over state-of-the-art approaches for learning programmatic policies.
2 Problem Statement
The problem of programmatic reinforcement learning (PRl) consists of a Markov Decision Process (Mdp) and a programmatic policy class . The definition of is standard , with being the state space, the action space, the probability density function of transitioning from a state-action pair to a new state, the state-action cost function, a distribution over starting states, and the discount factor. A policy (stochastically) maps states to actions. We focus on continuous control problems, so and are assumed to be continuous spaces. The goal is to find a programmatic policy such that:
with the expectation taken over the initial state distribution , the policy decisions, and the transition dynamics . One can also use rewards, in which case (1) becomes a maximization problem.
Programmatic Policy Class. A programmatic policy class consists of policies that can be represented parsimoniously by a (domain-specific) programming language. Recent work [58, 8, 60] indicates that such policies can be easier to interpret and formally verify than neural policies, and can also be more robust to changes in the environment.
In this paper, we consider two concrete classes of programmatic policies. The first, a simplification of the class considered in Verma et al. , is defined by the modular, high-level language in Figure 1. This language assumes a library of parameterized functions representing standard controllers, for instance Proportional-Integral-Derivative (PID)  or bang-bang controllers . Programs in the language take states as inputs and produce actions as output, and can invoke fully instantiated library controllers along with predefined arithmetic, boolean and relational operators. The second, “lower-level" class, from Bastani et al. , consists of decision trees that map states to actions.
Example. Consider the problem of learning a programmatic policy, in the language of Figure 1, that controls a car’s accelerator in the Torcs car-racing environment . Figure 2 shows a program in our language for this task. The program invokes PID controllers , where identifies the sensor (out of 29, in our experiments) that provides inputs to the controller, and , , and are respectively the real-valued coefficients of the proportional, integral, and derivative terms in the controller. We note that the program only uses the sensors and . While (for the position of the car relative to the track axis) is used to decide which controller to use, only the sensor is needed to calculate the acceleration.
Learning Challenges. Learning programmatic policies in the continuous RL setting is challenging, as the best performing methods utilize policy gradient approaches [55, 36, 47, 48, 19], but policy gradients are hard to compute in programmatic representations. In many cases, may not even be differentiable. For our approach, we only assume access to program synthesis methods that can select a programmatic policy that minimizes imitation disagreement with demonstrations provided by a teaching oracle. Because imitation learning tends to be easier than general RL in long-horizon tasks , the task of imitating a neural policy with a program is, intuitively, significantly simpler than the full programmatic RL problem. This intuition is corroborated by past work on programmatic RL , which shows that direct search over programs often fails to meet basic performance objectives.
[t] \[email protected]@algorithmic \STATEInput: Programmatic & Neural Policy Classes: & . \STATEInput: Either initial or initial \STATEDefine joint policy class: // defined as \IFgiven initial \STATE //program synthesis via imitation learning \ENDIF\FOR \STATE //policy gradient in neural policy space with learning rate \STATE //program synthesis via imitation learning \ENDFOR\STATEReturn: Policy
3 Learning Algorithm
To develop our approach, we take the viewpoint of (1) being a constrained optimization problem, where resides within a larger space of policies . In particular, we will represent using a mixing of programmatic policies and neural polices . Any mixed policy can be invoked as . In general, we assume that is a good approximation of (i.e., for each there is some that approximates it well), which we formalize in Section 4.
We can now frame our constrained learning problem as minimizing (1) over , that alternate between taking a gradient step in the general space and projecting back down onto . This “lift-and-project” perspective motivates viewing our problem via the lens of mirror descent . In standard mirror descent, the unconstrained gradient step can be written as for step size , and the projection can be written as for divergence measure .
Our approach, Imitation-Projected Programmatic Reinforcement Learning (Propel), is outlined in Algorithm 2 (also see Figure 3). Propel is a meta-algorithm that requires instantiating two subroutines, Update and Project, which correspond to the standard update and projection steps, respectively. Propel can be viewed as a form of functional mirror descent with some notable deviations from vanilla mirror descent.
. Since policy gradient methods are well-developed for neural policy classes (e.g., [36, 47, 48, 30, 24, 19]) and non-existent for programmatic policy classes , Propel is designed to leverage policy gradients in and avoid policy gradients in . Algorithm 3 shows one instantiation of . Note that standard mirror descent takes unconstrained gradient steps in rather than , and we discuss this discrepancy between and in Section 4.
. Projecting onto can be implemented using program synthesis via imitation learning, i.e., by synthesizing a to best imitate demonstrations provided by a teaching oracle . Recent work [58, 8, 60] has given practical heuristics for this task for various programmatic policy classes. Algorithm 3 shows one instantiation of (based on DAgger ). One complication that arises is that finite-sample runs of such imitation learning approaches only return approximate solutions and so the projection is not exact. We characterize the impact of approximate projections in Section 4.
Practical Considerations. In practice, we often employ multiple gradient steps before taking a projection step (as also described in Algorithm 3), because the step size of individual (stochastic) gradient updates can be quite small. Another issue that arises in virtually all policy gradient approaches is that the gradient estimates can have very high variance [55, 33, 30]. We utilize low-variance policy gradient updates by using the reference as a proximal regularizer in function space .
For the projection step (Algorithm 3), in practice we often retain all previous roll-outs from all previous projection steps. It is straightforward to query the current oracle to provide demonstrations on the states from previous roll-outs, which can lead to substantial savings in sample complexity with regards to executing roll-outs on the environment, while not harming convergence.
[t] \[email protected]@algorithmic \STATEInput: Neural Policy Class . Input: Reference programmatic policy: \STATEInput: Step size: . Input: Regularization parameter: \STATEInitialize neural policy: //any standard randomized initialization \FOR \STATE //using DDPG , TRPO , etc., holding fixed \ENDFOR\STATEReturn:
[t] \[email protected]@algorithmic \STATEInput: Programmatic Policy Class: . Input: Oracle policy: \STATERoll-out on environment, get trajectory: \STATECreate supervised demonstration set: from \STATEDerive from via program synthesis //e.g., using methods in [58, 8] \FOR \STATERoll-out , creating trajectory: \STATECollect demonstration data: \STATE //DAgger-style imitation learning  \STATEDerive from via program synthesis //e.g., using methods in [58, 8] \ENDFOR\STATEReturn:
4 Theoretical Analysis
We start by viewing Propel through the lens of online learning in function space, independent of the specific parametric representation. This start point yields a convergence analysis of Alg. 2 in Section 4.1 under generic approximation errors. We then analyze the issues of policy class representation in Sections 4.2 and 4.3, and connect Algorithms 3 and 3 with the overall performance, under some simplifying conditions. In particular, Section 4.3 characterizes the update error in a possibly non-differentiable setting; to our knowledge, this is the first such analysis of its kind for reinforcement learning.
Preliminaries. We consider and to be subspaces of an ambient policy space , which is a vector space equipped with inner product , induced norm , dual norm , and standard scaling & addition: for and . The cost functional of a policy is , where is the distribution of states induced by . The joint policy class is , by .11 1 The operator is not a direct sum, since and are not orthogonal. Note that is a subspace of , and inherits its vector space properties. Without affecting the analysis, we simply equate for the remainder of the paper.
We assume that is convex in , which implies that subgradient exists (with respect to ) . Where is differentiable, we utilize the notion of a Fréchet gradient. Recall that a bounded linear operator is called a Fréchet functional gradient of at if . By default, (or for emphasis) denotes the gradient with respect to , whereas defines the gradient in the restricted subspace .
4.1 Propel as (Approximate) Functional Mirror Descent
For our analysis, Propel can be viewed as approximating mirror descent in (infinite-dimensional) function space over a convex set .22 2 can be convexified by considering randomized policies, as stochastic combinations of (cf. ). Similar to the finite-dimensional setting , we choose a strongly convex and smooth functional regularizer to be the mirror map. From the approximate mirror descent perspective, for each iteration :
Obtain a noisy gradient estimate:
in space: (Note )
Obtain approximate projection:
is a Bregman divergence. Taking will recover projected functional gradient descent in -space. Here Update becomes , and Project solves for . While we mainly focus on this choice of in our experiments, note that other selections of lead to different Update and Project operators (e.g., minimizing KL divergence if is negative entropy).
The functional mirror descent scheme above may encounter two additional sources of error compared to standard mirror descent . First, in the stochastic setting (also called bandit feedback ), the gradient estimate may be biased, in addition to having high variance. One potential source of bias is the gap between and . Second, the Project step may be inexact. We start by analyzing the behavior of Propel under generic bias, variance, and projection errors, before discussing the implications of approximating and by Algs. 3 & 3, respectively. Let the bias be bounded by , i.e., almost surely. Similarly let the variance of the gradient estimate be bounded by , and the projection error norm . We state the expected regret bound below; more details and a proof appear in Appendix A.2.
Theorem 4.1 (Expected regret bound under gradient estimation and projection errors).
Let be a sequence of programmatic policies returned by Algorithm 2, and be the optimal programmatic policy. Choosing learning rate , we have the expected regret over iterations:
The result shows that error from Project and the bias do not accumulate and simply contribute an additive term on the expected regret.33 3 Other mirror descent-style analyses, such as in , lead to accumulation of errors over the rounds of learning . One key difference is that we are leveraging the assumption of convexity of in the (infinite-dimensional) function space representation. The effect of variance of gradient estimate decreases at a rate. Note that this regret bound is agnostic to the specific Update and Project operations, and can be applied more generically beyond the specific algorithmic choices used in our paper.
4.2 Finite-Sample Analysis under Vanilla Policy Gradient Update and DAgger Projection
Next, we show how certain instantiations of Update and Project affect the magnitude of errors and influence end-to-end learning performance from finite samples, under some simplifying assumptions on the Update step. For this analysis, we simplify Alg. 3 into the case . In particular, we assume programmatic policies in to be parameterized by a vector , and is differentiable in (e.g., we can view where is parameterized in ). We further assume the trajectory roll-out is performed in an exploratory manner, where action is taken uniformly random over finite set of actions, thus enabling the bound on the bias of gradient estimates via Bernstein’s inequality. The Project step is consistent with Alg. 3, i.e., using DAgger  under convex imitation loss, such as loss. We have the following high-probability guarantee:
Theorem 4.2 (Finite-sample guarantee).
At each iteration, we perform vanilla policy gradient estimate of (over ) using trajectories and, use DAgger algorithm to collect roll-outs for the imitation learning projection. Setting the learning rate , after rounds of the algorithm, we have that:
holds with probability at least , with being the task horizon, the cardinality of action space, the variance of policy gradient estimates, and the dimension ’s parameterization.
The expanded result and proof are included in Appendix A.3. The proof leverages previous analysis from DAgger  and the finite sample analysis of vanilla policy gradient algorithm . The finite-sample regret bound scales linearly with the standard deviation of the gradient estimate, while the bias, which is the very last component of the RHS, scales linearly with the task horizon . Note that the standard deviation can be exponential in task horizon in the worst case , and so it is important to have practical implementation strategies to reduce the variance of the Update operation. While conducted in a stylized setting, this analysis provides insight in the relative trade-offs of spending effort in obtaining more accurate projections versus more reliable gradient estimates.
4.3 Closing the gap between and
Our functional mirror descent analysis rests on taking gradients in : involves estimating in the space. On the other hand, Algorithm 3 performs only in the neural policy space . In either case, although may be differentiable in the non-parametric ambient policy space, it may not be possible to obtain a differentiable parametric programmatic representation in . In this section, we discuss theoretical motivations to addressing a practical issue: How do we define and approximate the gradient under a parametric representation? To our knowledge, we are the first to consider such a theoretical question for reinforcement learning.
Defining a consistent approximation of . The idea in (Line 8 of Alg. 2) is to approximate by , which has a differentiable representation, at some close to (under the norm). Under appropriate conditions on , we show that this approximation is valid.
Assume that (i) is Fréchet differentiable on , (ii) is also differentiable on the restricted subspace , and (iii) is dense in (i.e., the closure ). Then for any fixed policy , define a sequence of policies , ), that converges to : . We then have .
Since the Fréchet gradient is unique in the ambient space , we have as (by Proposition 4.3). We thus have an asymptotically unbiased approximation of via differentiable space as: .44 4 We do not assume to be differentiable when restricting to the policy subspace , i.e., may not exist under policy parameterization of . Connecting to the result from Theorem 4.1, let be an upper bound on the policy gradient estimates in the neural policy class , under an asymptotically unbiased approximation of , the expected regret bound becomes .
Bias-variance considerations of To further theoretically motivate a practical strategy for in Algorithm 3, we utilize an equivalent proximal perspective of mirror descent , where is equivalent to solving for .
Proposition 4.4 (Minimizing a relaxed objective).
For a fixed programmatic policy , with sufficiently small constant , we have that
Thus, a relaxed step is obtained by minimizing the RHS of (3), i.e., minimizing over . Each gradient descent update step is now , corresponding to Line 5 of Algorithm 3. For fixed and small , this relaxed optimization problem becomes regularized policy optimization over , which is significantly easier. Functional regularization in policy space around a fixed prior controller has demonstrated significant reduction in the variance of gradient estimate , at the expense of some bias. The below expected regret bound summarizes the impact of this increased bias and reduced variance, with details included in Appendix A.5.
Proposition 4.5 (Bias-variance characterization of ).
Assuming is -strongly smooth over , i.e., is -Lipschitz continuous, approximating by per Alg. 3 leads to the expected regret bound: .
Compared to the idealized unbiased approximation in Proposition 4.3, the introduced bias here is related to the inherent smoothness property of cost functional over the joint policy class , i.e., how close is to its linear under-approximation around .
We demonstrate the effectiveness of Propel in synthesizing programmatic controllers in three continuous control environments. For brevity and focus, this section primarily focuses on Torcs 55 5 The code for the Torcs experiments can be found at: https://bitbucket.org/averma8053/propel, a challenging race car simulator environment . Empirical results on two additional classic control tasks, Mountain-Car and Pendulum, are provided in Appendix B; those results follow similar trends as the ones described for Torcs below, and further validate the convergence analysis of Propel.
Experimental Setup. We evaluate over five distinct tracks in the Torcs simulator. The difficulty of a track can be characterized by three properties; track length, track width, and number of turns. Our suite of tracks provides environments with varying levels of difficulty for the learning algorithm. The performance of a policy in the Torcs simulator is measured by the lap time achieved on the track. To calculate the lap time, the policies are allowed to complete a three-lap race, and we record the best lap time during this race. We perform the experiments with twenty-five random seeds and report the median lap time over these twenty-five trials. Some of the policies crash the car before completing a lap on certain tracks, even after training for episodes. Such crashes are recorded as a lap time of infinity while calculating the median. If the policy crashes for more than half the seeds, this is reported as Cr in Tables 1 & 2. We choose to report the median because taking the crash timing as infinity, or an arbitrarily large constant, heavily skews other common measures such as the mean.
Baselines. Among recent state-of-the-art approaches to learning programmatic policies are Ndps  for high-level language policies, and Viper  for learning tree-based policies. Both Ndps and Viper rely on imitating a fixed (pre-trained) neural policy oracle, and can be viewed as degenerate versions of Propel that only run Lines 4-6 in Algorithm 2. We present two Propel analogues to Ndps and Viper: (i) PropelProg: Propel using the high-level language of Figure 1 as the class of programmatic policies, similar to Ndps. (ii) PropelTree: Propel using regression trees, similar to Viper. We also report results for Prior, which is a (sub-optimal) PID controller that is also used as the initial policy in Propel. In addition, to study generalization ability as well as safety behavior during training, we also include Ddpg, a neural policy learned using the Deep Deterministic Policy Gradients  algorithm, with episodes of training for each track. In principle, Propel and its analysis can accommodate different policy gradient subroutines. However, in the Torcs domain, other policy gradient algorithms such as PPO and TRPO failed to learn policies that are able to complete the considered tracks. We thus focus on Ddpg as our main policy gradient component.
|Prior||312.92 / 0.0||322.59 / 0.0||244.19 / 0.0||340.29 / 0.0||402.89 / 0.0|
|Ddpg||78.82 / 0.24||89.71 / 0.28||101.06 / 0.40||Cr / 0.68||Cr / 0.92|
|Ndps||108.25 / 0.24||126.80 / 0.28||163.25 / 0.40||Cr / 0.68||Cr / 0.92|
|Viper||83.60 / 0.24||87.53 / 0.28||110.57 / 0.40||Cr / 0.68||Cr / 0.92|
|PropelProg||93.67 / 0.04||119.17 / 0.04||147.28 / 0.12||124.58 / 0.16||256.59 / 0.16|
|PropelTree||78.33 / 0.04||79.39 / 0.04||109.83 / 0.16||118.80 / 0.24||236.01 / 0.36|
Evaluating Performance. Table 1 shows the performance on the considered Torcs tracks. We see that PropelProg and PropelTree consistently outperform the Ndps  and Viper  baselines, respectively. While Ddpg outperforms Propel on some tracks, its volatility causes it to be unable to learn in some environments, and hence to crash the majority of the time. Figure 4 shows the consistent improvements made over the prior by PropelProg, over the iterations of the Propel algorithm. Appendix B contains similar results achieved on the two classic control tasks, MountainCar and Pendulum. Figure 5 shows that, compared to Ddpg, our approach suffers far fewer crashes while training in Torcs.
Evaluating Generalization. To compare the ability of the controllers to perform on tracks not seen during training, we executed the learned policies on all the other tracks (Table 2). We observe that Ddpg crashes significantly more often than PropelProg. This demonstrates the generalizability of the policies returned by Propel. Generalization results for the PropelTree policy are given in the appendix. In general, PropelTree policies are more generalizable than Ddpg but less than PropelProg. On an absolute level, the generalization ability of Propel still leaves much room for improvement, which is an interesting direction for future work.
Verifiability of Policies. As shown in prior work [8, 58], parsimonious programmatic policies are more amenable to formal verification than neural policies. Unsurprisingly, the policies generated by PropelTree and PropelProg are easier to verify than Ddpg policies. As a concrete example, we verified a smoothness property of the PropelProg policy using the Z3 SMT-solver  (more details in Appendix B). The verification terminated in seconds.
Initialization. In principle, Propel can be initialized with a random program, or a random policy trained using Ddpg. In practice, the performance of Propel depends to a certain degree on the stability of the policy gradient procedure, which is Ddpg in our experiments. Unfortunately, Ddpg often exhibits high variance across trials and fares poorly in challenging RL domains. Specifically, in our Torcs experiments, Ddpg fails on a number of tracks (similar phenomena have been reported in previous work that experiments on similar continuous control domains [30, 19, 58]). Agents obtained by initializing Propel with neural policies obtained via Ddpg also fail on multiple tracks. Their performance over the five tracks is reported in Appendix B. In contrast, Propel can often finish the challenging tracks when initialized with a very simple hand-crafted programmatic prior.
|G-Track||-||124 / Cr||Cr / Cr||Cr / Cr||Cr / Cr|
|E-Road||102 / 92||-||Cr / Cr||Cr / Cr||Cr / Cr|
|Aalborg||201 / 91||228 / Cr||-||217 / Cr||Cr / Cr|
|Ruudskogen||131 / Cr||135 / Cr||Cr / Cr||-||Cr / Cr|
|Alpine-2||222 / Cr||231 / Cr||184 / Cr||Cr / Cr||-|
6 Related Work
Program Synthesis. Program synthesis is the problem of automatically searching for a program within a language that fits a given specification . Recent approaches to the problem have leveraged symbolic knowledge about program structure , satisfiability solvers [50, 31], and meta-learning techniques [39, 41, 22, 7] to generate interesting programs in many domains [3, 42, 4]. In most prior work, the specification is a logical constraint on the input/output behavior of the target program. However, there is also a growing body of work that considers program synthesis modulo optimality objectives [13, 15, 43], often motivated by machine learning tasks [39, 57, 26, 23, 58, 8, 60]. Synthesis of programs that imitates an oracle has been considered in both the logical  and the optimization [58, 8, 60] settings. The projection step in Propel builds on this prior work. While our current implementation of this step is entirely symbolic, in principle, the operation can also utilize contemporary techniques for learning policies that guide the synthesis process [39, 7, 49].
Constrained Policy Learning. Constrained policy learning has seen increased interest in recent years, largely due to the desire to impose side guarantees such as stability and safety on the policy’s behavior. Broadly, there are two approaches to imposing constraints: specifying constraints as an additional cost function [1, 35], and explicitly encoding constraints into the policy class [2, 34, 19, 20, 12]. In some cases, these two approaches can be viewed as duals of each other. For instance, recent work that uses control-theoretic policies as a functional regularizer [34, 19] can be viewed from the perspective of both regularization (additional cost) and an explicitly constrained policy class (a specific mix of neural and control-theoretic policies). We build upon this perspective to develop the gradient update step in our approach.
RL using Imitation Learning. There are two ways to utilize imitation learning subroutines within RL. First, one can leverage limited-access or sub-optimal experts to speed up learning [44, 18, 14, 51]. Second, one can learn over two policy classes (or one policy and one model class) to achieve accelerated learning compared to using only one policy class [38, 17, 52, 16]. Our approach has some stylistic similarities to previous efforts [38, 52] that use a richer policy space to search for improvements before re-training the primary policy to imitate the richer policy. One key difference is that our primary policy is programmatic and potentially non-differentiable. A second key difference is that our theoretical framework takes a functional gradient descent perspective — it would be interesting to carefully compare with previous analysis techniques to find a unifying framework.
RL with Mirror Descent. The mirror descent framework has previously used to analyze and design RL algorithms. For example, Thomas et al.  and Mahadevan and Liu  use composite objective mirror descent, or Comid , which allows incorporating adaptive regularizers into gradient updates, thus offering connections to either natural gradient RL  or sparsity inducing RL algorithms . Unlike in our work, these prior approaches perform projection into the same native, differentiable representation. Also, the analyses in these papers do not consider errors introduced by hybrid representations and approximate projection operators. However, one can potentially extend our approach with versions of mirror descent, e.g., Comid, that were considered in these efforts.
7 Conclusion and Future Work
We have presented Propel, a meta-algorithm based on mirror descent, program synthesis, and imitation learning, for programmatic reinforcement learning (PRl). We have presented theoretical convergence results for Propel, developing novel analyses to characterize approximate projections and biased gradients within the mirror descent framework. We also validated Propel empirically, and show that it can discover interpretable, verifiable, generalizable, performant policies and significantly outperform the state of the art in PRl.
The central idea of Propel is the use of imitation learning and combinatorial methods in implementing a projection operation for mirror descent, with the goal of optimization in a functional space that lacks gradients. While we have developed Propel in an RL setting, this idea is not restricted to RL or even sequential decision making. Future work will seek to exploit this insight in other machine learning and program synthesis settings.
Acknowledgements. This work was supported in part by United States Air Force Contract # FA8750-19-C-0092, NSF Award # 1645832, NSF Award # CCF-1704883, the Okawa Foundation, Raytheon, PIMCO, and Intel.
-  Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 22–31. JMLR. org, 2017.
-  Mohammed Alshiekh, Roderick Bloem, Rüdiger Ehlers, Bettina Könighofer, Scott Niekum, and Ufuk Topcu. Safe reinforcement learning via shielding. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
-  Rajeev Alur, Rastislav Bodík, Eric Dallal, Dana Fisman, Pranav Garg, Garvit Juniwal, Hadas Kress-Gazit, P. Madhusudan, Milo M. K. Martin, Mukund Raghothaman, Shambwaditya Saha, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. Syntax-guided synthesis. In Dependable Software Systems Engineering, pages 1–25. 2015.
-  Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. Scaling enumerative program synthesis via divide and conquer. In Tools and Algorithms for the Construction and Analysis of Systems - 23rd International Conference, TACAS 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, Part I, pages 319–336, 2017.
-  Kiam Heong Ang, Gregory Chong, and Yun Li. Pid control system analysis, design, and technology. IEEE transactions on control systems technology, 13(4):559–576, 2005.
-  Karl Johan Åström and Tore Hägglund. Automatic tuning of simple regulators with specifications on phase and amplitude margins. Automatica, 20(5):645–651, 1984.
-  Matej Balog, Alexander L. Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. Deepcoder: Learning to write programs. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
-  Osbert Bastani, Yewen Pu, and Armando Solar-Lezama. Verifiable reinforcement learning via policy extraction. In Advances in Neural Information Processing Systems, pages 2494–2504, 2018.
-  Heinz H Bauschke, Patrick L Combettes, et al. Convex analysis and monotone operator theory in Hilbert spaces, volume 408. Springer, 2011.
-  Amir Beck and Marc Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167–175, 2003.
-  Richard Bellman, Irving Glicksberg, and Oliver Gross. On the “bang-bang” control problem. Quarterly of Applied Mathematics, 14(1):11–18, 1956.
-  Felix Berkenkamp, Matteo Turchetta, Angela Schoellig, and Andreas Krause. Safe model-based reinforcement learning with stability guarantees. In Advances in neural information processing systems, pages 908–918, 2017.
-  Roderick Bloem, Krishnendu Chatterjee, Thomas A. Henzinger, and Barbara Jobstmann. Better quality in synthesis through quantitative objectives. In Computer Aided Verification, 21st International Conference, CAV 2009, Grenoble, France, June 26 - July 2, 2009. Proceedings, pages 140–156, 2009.
-  Kai-Wei Chang, Akshay Krishnamurthy, Alekh Agarwal, Hal Daumé III, and John Langford. Learning to search better than your teacher. In International Conference on Machine Learning (ICML), 2015.
-  Swarat Chaudhuri, Martin Clochard, and Armando Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In POPL, pages 207–220, 2014.
-  Ching-An Cheng, Xinyan Yan, Nathan Ratliff, and Byron Boots. Predictor-corrector policy optimization. In International Conference on Machine Learning (ICML), 2019.
-  Ching-An Cheng, Xinyan Yan, Evangelos Theodorou, and Byron Boots. Accelerating imitation learning with predictive models. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2019.
-  Ching-An Cheng, Xinyan Yan, Nolan Wagener, and Byron Boots. Fast policy learning through imitation and reinforcement. In Uncertainty in artificial intelligence, 2019.
-  Richard Cheng, Abhinav Verma, Gabor Orosz, Swarat Chaudhuri, Yisong Yue, and Joel Burdick. Control regularization for reduced variance reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
-  Gal Dalal, Krishnamurthy Dvijotham, Matej Vecerik, Todd Hester, Cosmin Paduraru, and Yuval Tassa. Safe exploration in continuous action spaces. arXiv preprint arXiv:1801.08757, 2018.
-  Leonardo Mendonça de Moura and Nikolaj Bjørner. Z3: An Efficient SMT Solver. In TACAS, pages 337–340, 2008.
-  Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 990–998. JMLR. org, 2017.
-  Tao Du, Jeevana Priya Inala, Yewen Pu, Andrew Spielberg, Adriana Schulz, Daniela Rus, Armando Solar-Lezama, and Wojciech Matusik. Inversecsg: automatic conversion of 3d models to CSG trees. ACM Trans. Graph., 37(6):213:1–213:16, 2018.
-  Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pages 1329–1338, 2016.
-  John C Duchi, Shai Shalev-Shwartz, Yoram Singer, and Ambuj Tewari. Composite objective mirror descent. In COLT, pages 14–26, 2010.
-  Kevin Ellis, Daniel Ritchie, Armando Solar-Lezama, and Josh Tenenbaum. Learning to infer graphics programs from hand-drawn images. In Advances in Neural Information Processing Systems, pages 6059–6068, 2018.
-  John K. Feser, Swarat Chaudhuri, and Isil Dillig. Synthesizing data structure transformations from input-output examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, June 15-17, 2015, pages 229–239, 2015.
-  Abraham D Flaxman, Adam Tauman Kalai, and H Brendan McMahan. Online convex optimization in the bandit setting: gradient descent without a gradient. In Proceedings of the sixteenth annual ACM-SIAM symposium on Discrete algorithms, pages 385–394. Society for Industrial and Applied Mathematics, 2005.
-  Sumit Gulwani, Oleksandr Polozov, and Rishabh Singh. Program synthesis. Foundations and Trends in Programming Languages, 4(1-2):1–119, 2017.
-  Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
-  Susmit Jha, Sumit Gulwani, Sanjit A Seshia, and Ashish Tiwari. Oracle-guided component-based program synthesis. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering-Volume 1, pages 215–224. ACM, 2010.
-  Sham Machandranath Kakade et al. On the sample complexity of reinforcement learning. PhD thesis, University of London London, England, 2003.
-  Vijay R Konda and John N Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pages 1008–1014, 2000.
-  Hoang M. Le, Andrew Kang, Yisong Yue, and Peter Carr. Smooth imitation learning for online sequence prediction. In International Conference on Machine Learning (ICML), 2016.
-  Hoang M Le, Cameron Voloshin, and Yisong Yue. Batch policy learning under constraints. In International Conference on Machine Learning (ICML), 2019.
-  Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
-  Sridhar Mahadevan and Bo Liu. Sparse q-learning with mirror descent. In Proceedings of the Twenty-Eighth Conference on Uncertainty in Artificial Intelligence, pages 564–573. AUAI Press, 2012.
-  William H Montgomery and Sergey Levine. Guided policy search via approximate mirror descent. In Advances in Neural Information Processing Systems, pages 4008–4016, 2016.
-  Vijayaraghavan Murali, Swarat Chaudhuri, and Chris Jermaine. Neural sketch learning for conditional program generation. In ICLR, 2018.
-  Arkadii Semenovich Nemirovsky and David Borisovich Yudin. Problem complexity and method efficiency in optimization. 1983.
-  Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. arXiv preprint arXiv:1611.01855, 2016.
-  Oleksandr Polozov and Sumit Gulwani. Flashmeta: a framework for inductive program synthesis. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SPLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, pages 107–126, 2015.
-  Veselin Raychev, Pavol Bielik, Martin T. Vechev, and Andreas Krause. Learning programs from noisy data. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pages 761–774, 2016.
-  Stephane Ross and J Andrew Bagnell. Reinforcement and imitation learning via interactive no-regret learning. arXiv preprint arXiv:1406.5979, 2014.
-  Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pages 627–635, 2011.
-  Stéphane Ross, Geoffrey J. Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2011, Fort Lauderdale, USA, April 11-13, 2011, pages 627–635, 2011.
-  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.
-  John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
-  Xujie Si, Yuan Yang, Hanjun Dai, Mayur Naik, and Le Song. Learning a meta-solver for syntax-guided program synthesis. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
-  Armando Solar-Lezama, Liviu Tancau, Rastislav Bodík, Sanjit A. Seshia, and Vijay A. Saraswat. Combinatorial sketching for finite programs. In ASPLOS, pages 404–415, 2006.
-  Wen Sun, J Andrew Bagnell, and Byron Boots. Truncated horizon policy search: Combining reinforcement learning & imitation learning. In International Conference on Learning Representations (ICLR), 2018.
-  Wen Sun, Geoffrey J Gordon, Byron Boots, and J Bagnell. Dual policy iteration. In Advances in Neural Information Processing Systems, pages 7059–7069, 2018.
-  Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggrevated: Differentiable imitation learning for sequential prediction. In International Conference on Machine Learning (ICML), 2017.
-  Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
-  Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pages 1057–1063, 2000.
-  Philip S Thomas, William C Dabney, Stephen Giguere, and Sridhar Mahadevan. Projected natural actor-critic. In Advances in neural information processing systems, pages 2337–2345, 2013.
-  Lazar Valkov, Dipak Chaudhari, Akash Srivastava, Charles Sutton, and Swarat Chaudhuri. Houdini: Lifelong learning as program synthesis. In Advances in Neural Information Processing Systems, pages 8687–8698, 2018.
-  Abhinav Verma, Vijayaraghavan Murali, Rishabh Singh, Pushmeet Kohli, and Swarat Chaudhuri. Programmatically interpretable reinforcement learning. In International Conference on Machine Learning, pages 5052–5061, 2018.
-  Bernhard Wymann, Eric Espié, Christophe Guionneau, Christos Dimitrakakis, Rémi Coulom, and Andrew Sumner. TORCS, The Open Racing Car Simulator. http://www.torcs.org, 2014.
-  He Zhu, Zikang Xiong, Stephen Magill, and Suresh Jagannathan. An inductive synthesis framework for verifiable reinforcement learning. In ACM Conference on Programming Language Design and Implementation (SIGPLAN), 2019.
Appendix A Theoretical Analysis
A.1 Preliminaries and Notations
We formally define an ambient control policy space to be a vector space equipped with inner product , which induces a norm , and its dual norm defined as . While multiple ways to define the inner product exist, for concreteness we can think of the example of square-integrable stationary policies with . The addition operator between two policies is defined as for all state . Scaling is defined similarly for scalar .
The cost functional of a control policy is defined as , or , where is the distribution of states induced by policy . This latter example is equivalent to the standard notion of value function in reinforcement learning.
Separate from the parametric representation issues, both programmatic policy class and neural policy class , and by extension - the joint policy class , are considered to live in the ambient vector space . We thus have a common and well-defined notion of distance between policies from different classes.
We make an important distinction between differentiability of in the ambient policy space (non-parametric), versus differentiability in parameterization (parametric). For example, if is a class of decision-tree based policy, policies in may not be differentiable under representation. However, policies might still be differentiable when considered as points in the ambient vector space .
We will use the following standard notion of gradient and differentiability from functional analysis:
Definition A.1 (Subgradients).
The subgradient of at , denoted , is the non-empty set
Definition A.2 (Fréchet gradient).
A bounded linear operator is called Fréchet functional gradient of at if
The notions of convexity, smoothness and Bregman divergence are analogous to finite-dimensional setting:
Definition A.3 (Strong convexity).
A differentiable function is strongly convex w.r.t norm if
Definition A.4 (Lipschitz continuous gradient smoothness).
A differentiable function is strongly smooth w.r.t norm if
Definition A.5 (Bregman Divergence).
For a strongly convex regularizer , is the Bregman divergence between and (not necessarily symmetric)
The following standard result for Bregman divergence will be useful:
 For all we have the identity . Since Bregman divergence is non-negative, a consequence of this identity is that
A.2 Expected Regret Bound under Noisy Policy Gradient Estimates and Projection Errors
In this section, we show regret bound for the performance of the sequence of returned programs of the algorithm. The analysis here is agnostic to the particular implementation of algorithm 3 and algorithm 3.
Let be a strongly convex and smooth functional with respect to norm on . The steps from algorithm 2 can be described as follows.
Initialize . For each iteration :
Obtain a noisy estimate of the gradient
Update in the space:
Obtain approximate projection
This procedure is an approximate functional mirror descent scheme under bandit feedback. We will develop the following result, which is a more detailed version of 4.1 in the main paper.
In the statement below, is the diameter on with respect to defined norm (i.e., ). is the Lipschitz constant of the functional on . are the bound on the bias and variance of the gradient estimate at each iteration, respectively. and are the strongly convex and smooth coefficients of the functional regularizer . Finally, is the bound on the projection error with respect to the same norm .
Theorem A.2 (Regret bound of returned policies).
Let be a sequence of programmatic policies returned by algorithm 2 and be the optimal programmatic policy. We have the expected regret bound:
In particular, choosing the learning rate , the expected regret is simplified into:
At each round , let be the conditional expectation of the gradient estimate. We will use the shorthand notation . Denote the upper-bound on the bias of the estimate by , i.e., almost surely. Denote the noise of the gradient estimate by , and is the variance of gradient estimate .
The projection operator is approximate in the sense that with some constant , which reflects the statistical error of the imitation learning procedure. This projection error in general is independent of the choice of function classes and .We will use the shorthand notation for the true Bregman projection of onto .
Due to convexity of over the space (which includes ), we have for all :
We proceed to bound the RHS, starting with bounding the inner product where the actual gradient is replaced by the estimated gradient.
Equation (5) is due to the gradient update rule in space. Equation (6) is derived from definition of Bregman divergence. Equation (7) is due to the generalized Pythagorean theorem of Bregman projection . The RHS of equation (7) are decomposed into three components that will be bounded separately.
Bounding projection error. By lemma (A.1) we have
Bounding relative improvement. This follows standard argument from analysis of mirror descent algorithm.
Equation (13) is from the strong convexity property of regularizer . Equation (14) is by definition of the gradient update. Combining the bounds on the three components and taking expectation, we thus have
Next, the difference between estimated gradient and actual gradient factors into the bound via Cauchy-Schwarz:
Unbiased gradient estimates. For the case when the gradient estimate is unbiased, assume the variance of the noise of gradient estimates is bounded by , we have the expected regret bound for all
here to clarify, is the smoothness coefficient of regularizer (i.e., the gradient of is -Lipschitz, is Lipschitz constant of , is the diameter of under norm , is the upper-bound on the variance of gradient estimates, and is the error from the projection procedure (i.e., imitation learning loss).
We can set learning rate to observe that the expected regret is bounded by .
Similar to before, we can set learning rate to observe that on the expected regret is bounded by . Compared to the bound on (18), in the biased case, the extra regret incurred per bound is simply a constant, and does not depend on . ∎
A.3 Finite-Sample Analysis
In this section, we provide overall finite-sample analysis for Propel under some simplifying assumptions. We first consider the case where exact gradient estimate is available, before extending the result to the general case of noisy policy gradient update. Combining the two steps will give us the proof for the following statement (theorem 4.2 in the main paper)
Theorem A.3 (Finite-sample guarantee).
At each iteration, we perform vanilla policy gradient estimate of (over ) using trajectories and use DAgger algorithm to collect roll-outs. Setting the learning rate , after rounds of the algorithm, we have that
holds with probability at least , with the task horizon, the cardinality of action space, the variance of policy gradient estimates, and the dimension ’s parameterization.
Exact gradient estimate case. Assuming that the policy gradients can be calculated exactly, it is straight-forward to provide high-probability guarantee for the effect of the projection error. We start with the following result, adapted from  for the case of projection error bound. In this version of DAgger, we assume that we only collect a single (state, expert action) pair from each trajectory roll-out. Result is similar, with tighter bound, when multiple data points are collected along the trajectory.
Lemma A.4 (Projection error bound from imitation learning procedure).
Using DAgger as the imitation learning sub-routine for our Project operator in algorithm 3, let be the number of trajectories rolled-out for learning, and be the horizon of the task. With probability at least , we have
where is the result of Project, is the true Bregman projection of onto , and is the maximum value of the imitation learning loss function
The bound in lemma A.4 is simpler than previous imitation learning results with cost information ([44, 45]. The reason is that the goal of the Project operator is more modest. Since we only care about the distance between the empirical projection and the true projection , the loss objective in imitation learning is simplified (i.e., this is only a regret bound), and we can disregard how well policies in can imitate the expert , as well as the performance of relative to the true cost from the environment .
A consequence of this lemma is that for the number of trajectories at each round of imitation learning , we have with probability at least . Applying union bound across rounds of learning, we obtain the following guarantee (under no gradient estimation error)
Proposition A.5 (Finite-sample Projection Error Bound).
To simplify the presentation of the result, we consider to be known constants. Using DAgger algorithm to collect roll-outs at each iteration, we have the following regret guarantee after rounds of our main algorithm:
with probability at least . Consequently, setting , we have that
with probability at least
Note that the dependence on the time horizon of the task is sub-linear. This is different from standard imitation learning regret bounds, which are often at least linear in the task horizon. The main reason is that our comparison benchmark does live in the space , whereas for DAgger, the expert policy may not reside in the same space.
Noisy gradient estimate case. We now turn to the issue of estimating the gradient of . We make the following simplifying assumption about the gradient estimation:
The is parameterized by vector (such as a neural network). The parameterization is differentiable with respect to (Alternatively, we can view as a differentiable subspace of , in which case we have )
At each Update loop, the policy is rolled out times to collect the data, each trajectory has horizon length
For each visited state , the policy takes a uniformly random action . The action space is finite with cardinality .
The gradient is bounded by
The gradient estimate is performed consistent with a generic policy gradient scheme, i.e.,
where is the estimated cost-to-go .
Taking uniform random exploratory actions ensures that the samples are i.i.d. We can thus apply Bernstein’s inequality to obtain the bound between estimated gradient and the true gradient. Indeed, with probability at least , we have that the following bound on the bias component-wise:
which leads to similar bound with respect to (here we leverage the equivalence of norms in finite dimensional setting):
Applying union bound of this result over rounds of learning, and combining with the result from proposition (A.5), we have the following finite-sample guarantee in the simplifying policy gradient update. This is also the more detailed statement of theorem 4.2 in the main paper.
Proposition A.6 (Finite-sample Guarantee under Noisy Gradient Updates and Projection Error).
At each iteration, we perform policy gradient estimate using trajectories and use DAgger algorithm to collect roll-outs. Setting the learning rate , after rounds of the algorithm, we have that
with probability at least .
Consequently, we also have the following regret bound:
holds with probability at least , where again is the task horizon, is the cardinality of action space, and is the dimension of function class ’s parameterization.
(For both proposition (A.6) and (A.5)). The results follow by taking the inequality from equation (19), and by solving for and explicitly in terms of relevant quantities. Based on the specification of and , we obtain the necessary precision for each round of learning in terms of number of trajectories:
Setting the learning rate and rearranging the inequalities lead to the desired bounds. ∎
The regret bound depends on the variance of the policy gradient estimates. It is well-known that vanilla policy gradient updates suffer from high variance. We instead use functional regularization technique, based on CORE-RL, in the practical implementation of our algorithm. The CORE-RL subroutine has been demonstrated to reduce the variance in policy gradient updates .
A.4 Defining a consistent approximation of - Proof of Proposition 4.3
We are using the notion of Fréchet derivative to define gradient of differentiable functional. Note that while Gateaux derivative can also be utilized, Fréchet derivative ensures continuity of the gradient operator that would be useful for our analysis.
Definition A.6 (Fréchet gradient).
A bounded linear operator is called Fréchet functional gradient of at if
We make the following assumption about and . One interpretation of this assumption is that the space of policies and that we consider have the property that a programmatic policy can be well-approximated by a large space of neural policies .
is Fréchet differentiable on . is also differentiable on the restricted subspace . And is dense in (i.e., the closure )
It is then clear that the Fréchet gradient , restricted to the subspace is equal to the gradient of in the ambient space (since Fréchet gradient is unique). In general, given and , is not necessarily in . However, the restricted gradient on subspace of can be defined asymptotically.
Fixing a policy , define a sequence of policies , that converges to : , we then have
Since Fréchet derivative is a continuous linear operator, we have . By the reasoning above, for , the gradient defined via restriction to the space does not change compared to , the gradient defined over the ambient space . Thus we also have . By the same argument, we also have that for any given and , even if , the gradient with respect to the can be approximated similarly. ∎
Note that we are not assuming to be differentiable when restricting to the policy subspace .
We consider the case where is not differentiable by parameterization. Note that this does not preclude for to be differentiable in the non-parametric function space. Two complications arise compared to our previous approximate mirror descent procedure. First, for each , estimating the gradient (which may not exist under certain parameterization, per section 4.3) can become much more difficult. Second, the update rule may not be in the dual space of , as in the simple case where , thus making direct gradient update in the space inappropriate.
is convex in .
By convexity of in , sub-gradients exists for all . In particular, exists for all . Note that reflects sub-gradient of with respect to the ambient policy space .
We will make use of the following equivalent perspective to mirror descent, which consists of two-step process for each iteration
We will show how this version of the algorithm motivates our main algorithm. Consider step 1 of the main loop of Propel, where given a fixed , the optimization problem within is
Due to convexity of and the objective, problem is equivalent to:
where depends on . Since is fixed, this optimization problem can be relaxed by choosing , and a set of candidate policies , for all , such that is satisfied (Selection of is possible with bounded spaces). Since this constraint set is potentially a restricted set compared to the space of policies satisfying inequality (22), the optimization problem (20) is relaxed into:
Due to convexity property of , we have
The original problem is thus upper bounded by:
Thus, a relaxed version of original optimization problem can be obtained by miniziming over (note that is fixed). This naturally motivates using functional regularization technique, such as CORE-RL algorithm , to update the parameters of differentiable function via policy gradient descent update:
where the gradient of is taken with respect to the parameters of (neural networks). This is exactly the update step in algorithm 3 (also similar to iterative updte of CORE-RL algorithm), where the neural network policy is regularized by a prior controller .
Statement and Proof of Proposition 4.5
Proposition A.8 (Regret bound for the relaxed optimization objective).
Assuming is -strongly smooth over , i.e., is -Lipschitz continuous, approximating by per Alg. 3 leads to the expected regret bound:
Instead of focusing on the bias of the gradient estimate , we will shift our focus on the alternative proximal formulation of mirror descent, under optimization and projection errors. In particular, at each iteration , let and let the optimization error be defined as where . Note here that this is different from (but related to) the notion of bias from gradient estimate of used in theorem 4.1 and theorem A.2. The projection error from imitation learning procedure is defined similarly to theorem 4.1: is the true projection, and .
We start with similar bounding steps to the proof of theorem 4.1:
The bound on relative improvement is slightly different:
Next, we want to bound . Choose regularizer to be (consistent with the pseudocode in algorithm 3). We have that:
which is equivalent to:
Let . Taking the gradient over , we can see that . Let be the minimizer of . We then have and . Thus .
On one hand, we have
due to optimality of and strong smoothness property of . On the other hand, since is convex, we also have the first-order condition:
Combine with the inequality above, and subtract from both sides, and using the relationship , we have that:
Since this is true , rearrange and choose such that , namely , and complete the square, we can establish the bound that:
Since is convex in , we have . Similar to theorem 4.1, setting and taking expectation on both sides, we have:
Note that unlike regret bound from theorem 4.1 under general bias, variance of gradient estimate and projection error, here explicitly refers to the bound on neural-network based policy gradient variance. The variance reduction of , at the expense of some bias, was also similarly noted in a recent functional regularization technique for policy gradient . ∎
Appendix B Additional Experimental Results and Details
We generate controllers for cars in The Open Racing Car Simulator (Torcs) . In its full generality Torcs provides a rich environment with input from up to sensors, and optionally the 3D graphic from a chosen camera angle in the race. The controllers have to decide the values of parameters during game play, which correspond to the acceleration, brake, clutch, gear and steering of the car.
Apart from the immediate challenge of driving the car on the track, controllers also have to make race-level strategy decisions, like making pit-stops for fuel. A lower level of complexity is provided in the Practice Mode setting of TORCS. In this mode all race-level strategies are removed. Currently, so far as we know, state-of-the-art Drl models are capable of racing only in Practice Mode, and this is also the environment that we use. Here we consider the input from sensors, and decide values for the acceleration, steering, and braking actions.
We chose a suite of tracks that provide varying levels of difficulty for the learning algorithms. In particular, for the tracks Ruudskogen and Alpine-2, the Ddpg agent is unable to reliably learn a policy that would complete a lap. We perform the experiments with twenty-five random seeds and report the median lap time over these twenty-five trials. However we note that the Torcs simulator is not deterministic even for a fixed random seed. Since we model the environment as a Markov Decision Process, this non-determinism is consistent with our problem statement.
For our Deep Reinforcement Learning agents we used standard open source implementations (with pre-tuned hyper-parameters) for the relevant domain.
All experiments were conducted on standard workstation with a 2.5 GHz Intel Core i7 CPU and a GTX 1080 Ti GPU card.
The code for the Torcs experiments can be found at: https://bitbucket.org/averma8053/propel
In Table 3 we show the lap time performance and crash ratios of Propel agents initialized with neural policies obtained via Ddpg. As discussed in Section 5, Ddpg often exhibits high variance across trials and this adversely affects the performance of the Propel agents when they are initialized via Ddpg. In Table 4 we show generalization results for the PropelTree agent. As noted in Section 5, the generalization results for PropelTree are in between those of Ddpg and PropelProg.
Verified Smoothness Property. For the program given in Figure 2 we proved using symbolic verification techniques, that . Here the function takes in a history/sequence of sensor or action values and returns the value at position , . Intuitively, the above logical implication means that if the sum of the consecutive differences of the last six sensor values is less than , then the acceleration actions calculated at the last and penultimate step will not differ by more than .
|PropelProg-Ddpg||97.76/.12||108.06/.08||140.48/.48||Cr / 0.68||Cr / 0.92|
|PropelTree-Ddpg||78.47/0.16||85.46/.04||Cr / 0.56||Cr / 0.68||Cr / 0.92|
B.2 Classic Control
We present results from two classic control problems, Mountain-Car (with continuous actions) and Pendulum, in Table 5. We use the OpenAI Gym implementations of these environments. More information about these environments can be found at the links: MountainCar and Pendulum.
In Mountain-Car the goal is to drive an under-powered car up the side of a mountain in as few time-steps as possible. In Pendulum, the goal is to swing a pendulum up so that it stays upright. In both the environments an episode terminates after a maximum of time-steps.
In Table 5 we report the mean and standard deviation, over twenty-five random seeds, of the average scores over episodes for the listed agents and environments. In Figure 7 and Figure 7 we show the improvements made over the prior by the PropelProg agent in MountainCar and Pendulum respectively, with each iteration of the Propel algorithm.