P OPULATION -G
UIDED
P ARALLEL
P OLICY
S EARCH
FOR R EINFORCEMENT L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
In this paper, a new population-guided parallel learning scheme is proposed to enhance the performance of off-policy reinforcement learning (RL).
In the proposed scheme, multiple identical learners with their own value-functions and policies share a common experience replay buffer, and search a good policy in collaboration with the guidance of the best policy information.
The key point is that the information of the best policy is fused in a soft manner by constructing an augmented loss function for policy update to enlarge the overall search region by the multiple learners.
The guidance by the previous best policy and the enlarged range enable faster and better policy search. Monotone improvement of the expected cumulative return by the proposed scheme is proved theoretically.
Working algorithms are constructed by applying the proposed scheme to the twin delayed deep deterministic (TD3) policy gradient algorithm. Numerical results show that the constructed algorithm outperforms most of the current state-of-the-art RL algorithms, and the gain is signiﬁcant in the case of sparse reward environment.
I NTRODUCTION
RL is an active research ﬁeld and has been applied successfully to games, simulations, and actual environments.
With the success of RL in relatively easy tasks, more challenging tasks such as sparse reward environments (Oh et al.
; Zheng et al.
; Burda et al.
(2018)) are emerging, and developing good RL algorithms for such challenging tasks is of great importance from both theoretical and practical perspectives.
In this paper, we consider parallel learning, which is an important line of RL research to enhance the learning performance by having multiple learners for the same environment.
Parallelism in learning has been investigated widely in distributed RL (Nair et al.
; Mnih et al. (2016); Horgan et al.
; Barth-Maron et al.
; Espeholt et al.
(2018)), evolutionary algorithms (Salimans et al.
Choromanski et al.
; Khadka & Tumer (2018); Pourchot & Sigaud (2019)), concurrent RL (Silver et al. (2013); Guo & Brunskill (2015); Dimakopoulou & Van Roy (2018);
Dimakopoulou et al.
and population-based training (PBT) (Jaderberg et al.
Conti et al.
In this paper, in order to enhance the learning performance, we apply parallelism to RL based on a population of policies, but the usage is different from the previous methods.
One of the advantages of using a population is the capability to evaluate policies in the population.
Once all policies in the population are evaluated, we can use information of the best policy to enhance the performance.
One simple way to exploit the best policy information is that we reset the policy parameter of each learner with that of the best learner at the beginning of the next M time steps; make each learner perform learning from this initial point for the next M time steps; select the best learner again at the end of the next M time steps; and repeat this procedure every M time steps in a similar way that PBT does (Jaderberg et al.
We will refer to this method as the resetting method in this paper.
However, this resetting method has the problem that the search area covered by all N policies in the population collapses to one point at the time of parameter copying and thus the search area can be narrow around the previous best policy point.
To overcome such disadvantage, instead of resetting the policy parameter with the best policy parameter periodically, we propose using the best policy information in a soft manner.
In the proposed scheme, the shared best policy information is used only to guide other learners’ policies for searching a better policy.
The chief periodically determines the best policy among all learners and distributes the best policy parameter to all learners so that the learners search for better policies with the guidance of the pre- vious best policy.
The chief also enforces that the N policies are spread in the policy space with a given distance from the previous best policy point so that the search area by all N learners maintains a wide area and does not collapse into a narrow region.
The proposed Population-guided Parallel Policy Search (P3S) learning method can be applied to any off-policy RL algorithms and implementation is easy.
Furthermore, monotone improvement of the expected cumulative return by the P3S scheme is theoretically proved.
We apply our P3S scheme to the TD3 algorithm, which is a state-of-the-art off-policy algorithm, as our base algorithm.
Numerical result shows that the P3S-TD3 algorithm outperforms the baseline algorithms both in the speed of convergence and in the ﬁnal steady-state performance.
B ACKGROUND AND R ELATED W ORKS
Distributed RL Distributed RL is an efﬁcient way of taking advantage of parallelism to achieve fast training for large complex tasks (Nair et al.
Most of the works in distributed RL assume a common structure composed of multiple actors interacting with multiple copies of the same environment and a central system which stores and optimizes the common Q-function parameter or the policy parameter shared by all actors.
The focus of distributed RL is to optimize the Q-function parameter or the policy parameter fast by generating more samples for the same wall clock time with multiple actors.
For this goal, researchers investigated various techniques for distributed RL, e.g., asynchronous update of parameters (Mnih et al.
; Babaeizadeh et al.
(2017)), sharing an experience replay buffer (Horgan et al.
(2018)), GPU-based parallel computation (Babaeizadeh et al.
(2017); Clemente et al.
, GPU-based simulation (Liang et al.
and V-trace in case of on-policy algorithms (Espeholt et al.
Distributed RL yields performance improvement in terms of the wall clock time but it does not consider the possible enhancement by interaction among a population of policies of all learners like in PBT or our P3S. The proposed P3S uses a similar structure to that in (Nair et al. (2015); Espeholt et al.
(2018)): that is, P3S is composed of multiple learners and a chief.
The difference is that each learner in P3S has its own Q or value function parameter and policy parameter, and optimizes the parameters in parallel to search in the policy space.
Population-Based Training Parallelism is also exploited in ﬁnding optimal parameters and hyperparameters of training algorithms in PBT (Jaderberg et al.
Conti et al.
PBT trains neural networks, using a population with different parameters and hyperparameters in parallel at multiple learners.
During the training, in order to take advantage of the population, it evaluates the performance of networks with parameters and hyperparameters in the population periodically.
Then,
PBT selects the best hyperparameters, distributes the best hyperparameters and the corresponding parameters to other learners, and continues the training of neural networks.
Recently, PBT is applied to competitive multi-agent RL (Jaderberg et al.
and novelty search algorithms (Conti et al.
The proposed P3S uses a population to search a better policy by exploiting the best policy information similarly to PBT, but the way of using the best policy information is different.
In P3S, the parameter of the best learner is not copied but used in a soft manner to guide the population for better search in the policy space.
Our P3S method is also related to guided policy search (Levine & Koltun (2013); Levine et al.
Teh et al.
(2017); Ghosh et al.
Teh et al.
(2017) proposed a guided policy search method for joint training of multiple tasks in which a common policy is used to guide local policies and the common policy is distilled from the local policies.
Here, the local policies’ parameters are updated to maximize the performance and minimize the KL divergence between the local policies and the common distilled policy.
The proposed P3S is related to guided policy search in the sense that multiple policies are guided by a common policy.
However, the difference is that the goal of P3S is not learning multiple tasks but learning optimal parameter for a common task as in PBT. Hence, the guiding policy is not distilled from multiple local policies but chosen as the best performing policy among multiple learners.
Exploiting Best Information Exploiting best information has been considered in the previous works (White & Sofge (1992);
Oh et al.
; Gangwani et al.
In particular, Oh et al.
Gangwani et al.
(2019) exploited past good experiences to obtain a better policy, whereas P3S exploits the current good policy among multiple policies to obtain a better policy.
P OPULATION -G UIDED P ARALLEL P OLICY S EARCH
[Table]
[Figure]
The overall structure of the proposed P3S scheme is described in Fig.
We have N identical parallel learners with a shared common experience replay buffer D , and all N identical learners employ a common base algorithm which can be any off-policy RL algorithm.
The execution is in parallel.
The i -th learner has its own environment E i , which is a copy of the common environment E , and has its own value function (e.g., Q-function)
parameter θ i and policy parameter φ i .
The i -th learner interacts with the environment copy E i with additional interaction with the chief, as shown in
Fig.
At each time step, the i -th learner performs an action a it to its environment copy E i by using its own policy π φ i , stores its experience ( s it , a it , r it , s it +1 ) to the shared common replay buffer D for all i
= 1 , 2 , · · · , N .
Then, each learner updates its value function parameter and policy parameter once by drawing a mini-batch of size B from the shared common replay buffer D by minimizing its own value loss function and policy loss function, respectively.
Due to parallel update of parameters, the policies of all learners compose a population of N different policies.
In order to take advantage of this population, we exploit the policy information from the best learner periodically during the training like in PBT (Jaderberg et al.
Suppose that the Q-function parameter and policy parameter of each learner are initialized and learning is performed as described above for M time steps.
At the end of the M time steps, we determine who is the best learner based on the average of the most recent E r episodic rewards for each learner.
Let the index of the best learner be b .
Then, the policy parameter information φ b of the best learner can be used to enhance the learning of other learners for the next M time steps.
Instead of copying φ b to other learners like in PBT, we propose using the information φ b in a soft manner.
That is, during the next M time steps, while we set the loss function (cid:101)
L ( θ i ) for the Q-function to be the same as the loss L ( θ i ) of the base algorithm, we set the loss function (cid:101) L ( φ i ) for the policy parameter φ i of the i -th learner as the following augmented version:
[Equation]
where L ( φ i ) is the policy loss function of the base algorithm, 1 {·} denotes the indicator function, β ( > 0) is a weighting factor, D ( π, π (cid:48) ) be some distance measure between two policies π and π (cid:48) .
3. T HEORETICAL G UARANTEE OF M ONOTONE I MPROVEMENT OF E XPECTED C UMULATIVE R ETURN
In this section, we analyze the performance of the proposed soft-fusion approach theoretically and show the effectiveness of the proposed soft-fusion approach.
Consider the current update period and its previous update period.
Let π oldφ i be the policy of the i -th learner at the end of the previous update period and let π φ b be the best policy among all policies π oldφ i , i = 1 , · · · , N .
Now, consider any learner i who is not the best in the previous update period.
Let the policy of learner i in the current update period be denoted by π φ i , and let the policy loss function of the base algorithm be denoted as L ( π φ i ) .
In order to analyze the performance, we consider L ( π φ i ) in the form of L ( π φ i ) =
E s ∼D ,a ∼ π φi ( ·| s ) (cid:104)
− Q π oldφi ( s, a ) (cid:105) .
The reason behind this choice is that most of actorcritic methods update the value (or Q-)function and the policy iteratively.
That is, for given π oldφ i , the Q-function is ﬁrst updated to approximate Q π oldφi .
Then, with the approximation Q π oldφi , the policy is updated to yield an updated policy
π newφ i . This procedure is repeated iteratively.
Such loss function is used in many RL algorithms such as SAC and TD3 (Haarnoja et al.
; Fujimoto et al.
For the distance measure D ( π, π (cid:48) ) between two policies π and π (cid:48) , we consider the KL divergence
KL ( π || π (cid:48) ) for analysis.
Then, by eq.
(1) the augmented loss function for non-best learner i at the current update period is expressed as
[Equation]
Let π
newφ
i be a solution that minimizes the augmented loss function eq.
We assume the following conditions.
Assumption 1.
For all s ,
[Equation]
Assumption 2.
For some ρ, d > 0 ,
[Equation]
Assumption 1 means that if we draw the ﬁrst time step action a from π φ b and the following actions from π oldφ i , then this yields better performance on average than the case that we draw all actions including the ﬁrst time step action from π oldφ i .
This makes sense because of the deﬁnition of π φ b .
Assumption 2 is about the distance relationship among the policies to ensure a certain level of spreading of the policies for the proposed soft-fusion approach.
With the two assumptions above, we have the following theorem regarding the proposed soft-fusion parallel learning scheme:
Theorem 1.
Under Assumptions 1 and 2, the following inequality holds: [Equation] where
[Equation]
Here, inequality (a) requires Assumption 1 only and inequality (b) requires Assumption 2.
Proof.
See Appendix A.
Theorem 1 states that the new solution
π newφ i for the current update period with the augmented loss function yields better performance (in the expected reward sense) than the best policy π φ b of the previous update period for any non-best learner i of the previous update period.
Hence, the proposed parallel learning scheme yields monotone improvement of expected cumulative return.
3. I MPLEMENTATION
The proposed P3S method can be applied to any off-policy base RL algorithms whether the base RL algorithms have discrete or continuous actions.
For implementation, we assume that the best policy update period consists of M time steps.
We determine the best learner at the end of each update period based on the average of the most recent E r episodic rewards of each learner.
The key point in implementation is adaptation of β so that the improvement gap β E s t +1 : s ∞ ∼ π b (cid:2)(cid:80) ∞ k = t +1 γ k − t ∆( s k ) (cid:3) in (4) becomes non-negative and is maximized for given ρ and d .
The gradient of the improvement gap with respect to β is given by ¯∆ :=
E s t +1 : s ∞ ∼ π b (cid:2)(cid:80) ∞ k = t +1 γ k − t ∆( s k ) (cid:3) , and ¯∆ is the average (with forgetting) of ∆( s k ) by using samples from π b .
Hence, if ¯∆ > 0 , i.e., KL (cid:0) π inew ( ·| s ) || π b [Equation]
·| s ) (cid:1) > max (cid:8)
[Equation]
KL max (cid:0) π inew || π iold (cid:1) , d (cid:9) on average, then β should be increased to maximize the performance gain. Otherwise, β should be decreased. Therefore, we adopt the following adaptation rule for β which is common for all non-best learners:
[Equation] [Equation]
[Figure] Here, (cid:98) D spread = 1 N
[Equation]
(cid:80)
[Equation]
E s ∼D (cid:104) D ( π newφ i , π φ b ) (cid:105) is the estimated distance between π newφ i and π φ b , and (cid:98) D change = {+
+}
N − 1 (cid:80) i ∈ I −
b E s ∼D (cid:104) D
( π newφ i , π oldφ i ) (cid:105) is the estimated distance between π newφ i and π old φ i averaged over all N − 1 non-best laerners, where d min and ρ are predetermined hyperparameters.
(cid:98) D spread and max { ρ (cid:98) D change , d min } are our practical implementations of the left-hand side (LHS) and the right-hand side (RHS) of eq. (A2), respectively.
This adaptation method is similar to that used in PPO (Schulman et al.
[Figure]
The update (6) of β is done every M time steps and the updated β is used for the next M time steps.
As time steps elapse, β is settled down so that (cid:98) D spread is around d search = max { ρ (cid:98) D change , d min } and this implements Assumption 2 with equality.
Hence, the proposed P3S scheme searches a spread area with rough radius d search around the best policy in the policy space, as illustrated in Fig.
The search radius d search is determined proportionally to (cid:98) D change that represents the speed of change in each learner’s policy.
In the case of being stuck in local optima, the change (cid:98) D change can be small, making the search area narrow.
Hence, we set a minimum search radius d min to encourage escaping out of local optima.
We applied P3S to TD3 as the base algorithm.
The constructed algorithm is named P3S-TD3.
The details of TD3 is explained in Appendix G. We used the mean square difference given by
D ( π ( s ) , π (cid:48) ( s ))
= 12 (cid:107) π
( s ) − π (cid:48) ( s ) (cid:107) 22 as the distance measure between two policies for P3S-TD3.
Note that if we consider two deterministic policies as two stochastic policies with same standard deviation, the KL divergence between the two stochastic policies is the same as the mean square difference.
For initial exploration P3S-TD3 uses a uniform random policy and does not update all policies over the ﬁrst T initial time steps.
The pseudocode of the P3S-TD3 is given in Appendix H.
E XPERIMENTS 4. P ARAMETER S ETTING
All hyperparameters we used for evaluation are the same as those in the original papers (Schulman et al.
; Wu et al.
(2017); Haarnoja et al.
; Fujimoto et al.
Here, we provide the hyperparameters of the P3S-TD3 algorithm only, while details of the parameters for
TD3 are provided in Appendix I.
On top of the parameters for the base algorithm TD3, we used N = 4 learners for P3S-TD3.
To update the best policy and β , the period M = 250 is used.
The number of recent episodes E r =was used to determine the best learner b .
For the search range, we used the parameter ρ = 2 , and tuned d min among d min = { 0 . 02 , 0 . 05 } for all environments.
Details on d min for each environment is shown in Appendix I.
The time steps for initial exploration T initial is set as 2500 for HalfCheetahv1 and Ant-v1, and as 2500 for other environments.
4. C OMPARISON TO BASELINES
In this section, we provide numerical results on performance comparison between the proposed
P3S-TD3 algorithm and current state-of-the-art on-policy and off-policy baseline algorithms on several MuJoCo environments (Todorov et al.
The baseline algorithms are Proximal Policy
Optimization (PPO) (Schulman et al.
Actor Critic using Kronecker-Factored Trust Region (ACKTR) (Wu et al.
Soft Q-learning (SQL) (Haarnoja et al.
(2017)), (clipped double Q)
Soft Actor-Critic (SAC) (Haarnoja et al.
(2018)), and TD3 (Fujimoto et al.
Fig.
3 shows the learning curves over one million time steps for several MuJoCo tasks: Hopper-v1,
Walker2d-v1, HalfCheetah-v1, and Ant-v1.
In order to have sample-wise fair comparison among the considered algorithms, the time steps in the x -axis in Fig.
3 for P3S-TD3 is the sum of time steps of all N users.
For example, in the case that N = 4 and each learner performs 100 time steps in P3S-TD3, the corresponding x -axis value is 400 time steps.
Since each learner performs parameter update once with one interaction with environment per each time step in P3S-TD3, the total number of parameter updates at the same x -axis value in Fig.
3 is the same for all algorithms including P3S-TD3, and the total number of interactions with environment at the same x -axis value in Fig.
3 is also the same for all algorithms including P3S-TD3.
Here, the performance is obtained through the evaluation method which is similar to those in Haarnoja et al.
; Fujimoto et al.
Evaluation of the policies is conducted every R eval = 4000 time steps for all algorithms.
At each evaluation instant, the agent (or learner) ﬁxes its policy as the one at the evaluation instant, and interacts with the same environment separate for the evaluation purpose with the ﬁxed policy to obtain 10 episodic rewards.
The average of these 10 episodic rewards is the performance at the evaluation instant.
In the case of P3S-TD3 and other parallel learning schemes, each of the
N learners ﬁxes its policy as the one at the evaluation instant, and interacts with the environment with the ﬁxed policy to obtain 10 episodic rewards.
First, the 10 episodic rewards are averaged for each learner and then the maximum of the 10-episode-average rewards of the N learners is taken as the performance at that evaluation instant.
We performed this operation for ﬁve different random seeds, and the mean and variance of the learning curve are obtained from these ﬁve simulations.
The policies used for evaluation are stochastic for PPO and ACKTR, and deterministic for the others.
In Fig.
3, it is observed that all baseline algorithms is similar to that in the original papers (Schulman et al.
(2017); Haarnoja et al.
; Fujimoto et al.
With this veriﬁcation, we proceed to compare P3S-TD3 with the baseline algorithms.
It is seen that the P3S-TD3 algorithm outperforms the state-of-the-art RL algorithms in terms of both the speed of convergence with respect to time steps and the ﬁnal steady-state performance (except in Walker2d-v1, the initial convergence is a bit slower than TD3.)
Especially, in the cases of Hopper-v1 and Ant-v1, TD3 has large variance and this implies that the performance of TD3 is quite dependent on the initialization and it is not easy for TD3 to escape out of bad local minima resulting from bad initialization in certain environments.
However, it is seen that P3S-TD3 yields much smaller variance than TD3.
This implies that the wide area search by P3S in the policy space helps the learners escape out of bad local optima.
4. C OMPARISON WITH OTHER PARALLEL LEARNING SCHEMES AND ABLATION STUDY
In the previous subsection, we observed that P3S enhances the performance and reduces dependence on initialization as compared to the single learner case with the same complexity.
In fact, this should be accomplished by any properly-designed parallel learning scheme.
Now, in order to demonstrate the true advantage of P3S, we compare P3S with other parallel learning schemes.
P3S has several components to improve the performance based on parallelism: 1) sharing experiences from multiple policies, 2) using the best policy information, and 3) soft fusion of the best policy information for wide search area.
We investigated the impact of each component on the performance improvement.
For comparison we considered the following parallel policy search methods gradually incorporating more techniques:
Original Algorithm
The original algorithm (TD3) with one learner 2.
Distributed RL (DRL) N actors obtain samples from N environment copies.
The common policy and the experience replay buffer are shared by all N actors.
Experience-Sharing-Only (ESO) N learners interact with N environment copies and update their own policies using experiences drawn from the shared experience replay buffer.
[Figure] Resetting (Re) At every M (cid:48) time steps, the best policy is determined and all policies are initialized as the best policy,
i
e., the best learner’s policy parameter is copied to all other learners.
The rest of the procedure is the same as experience-sharing-only algorithm.
P3S
At every M time steps, the best policy information is determined and this policy is used in a soft manner based on the augmented loss function.
Note that the resetting method also exploits the best policy information from N learners.
The main difference between P3S and the resetting method is the way the best learner’s policy parameter is used.
The resetting method initializes all policies with the best policy parameter every M (cid:48) time steps like in PBT (Jaderberg et al.
(2017)), whereas P3S algorithm uses the best learner’s policy parameter information determined every M time steps to construct an augmented loss function.
For fair comparison, M and M (cid:48) are determined independently and optimally for P3S and Resetting, respectively, since the optimal period can be different for the two methods.
We tuned M (cid:48) among { 2000 , 5000 , 10000 } (MuJoCo environments) and { 10000 , 20000 , 50000 } (Delayed MuJoCo envi- ronments) for Re-TD3, whereas M = 250 was used for P3S-TD3.
The speciﬁc parameters used for
Re-TD3 are in Appendix I. Since all N policies collapse to one point in the resetting method at the beginning of each period, we expect that a larger period is required for resetting to have sufﬁciently spread policies at the end of each best policy selection period.
We compared the performance of the aforementioned parallel learning methods combined with TD3 on two classes of tasks; MuJoCo environments, and Delayed sparse reward MuJoCo environments.
MuJoCo environments
The upper part of Fig. 4 shows the learning curves of the considered parallel learning methods combined with TD3 for the four tasks (Hopper-v1, Walkerd-v1, HalfCheetah-v1 and Ant v1).
It is seen that P3S-TD3 outperforms other parallel methods: DRLTD3, ESO-TD3 and Re-TD3 except the case that ESO-TD3 or Re-TD3 slightly outperforms P3STD3 in Hopper-v1 and Walker2d-v1.
In the case of Hopper-v1 and Walker2d-v1, ESO-TD3 has better ﬁnal (steady-state) performance than all other parallel methods.
Note that ESO-TD3 obtains most diverse experiences since the N learners shares the experience replay buffer but there is no interaction among the N learners until the end of training.
So, it seems that this diverse experience is beneﬁcial to Hopper-v1 and Walker2d-v1.
Delayed MuJoCo environments Sparse reward environments especially require more search to obtain a good policy.
To see the performance of P3S in sparse reward environments, we performed experiments on Delayed MuJoCo environments.
Delayed MuJoCo environments are reward-sparsiﬁed versions of MuJoCo environments and used in Zheng et al.
Delayed MuJoCo environments give non-zero rewards periodically with frequency f reward or only at the end of episodes.
That is, in a delayed MuJoCo environment, the environment accumulates rewards given by the corresponding MuJoCo environment while providing zero reward to the agent, and gives the
[Figure]
accumulated reward to the agent.
We evaluated the performance on the four delayed environments with f reward = 20 : Delayed Hopper-v1, Delayed Walker2d-v1, Delayed HalfCheetah-v1 and Delayed Ant-v1.
The lower part of Fig. 4 shows the learning curves of the different parallel learning methods for the four delayed MuJoCo environments.
It is seen that P3S outperforms all other considered parallel learning schemes on all environments except on delayed Hopper-v1.
It seems that the enforced wide-area policy search with the soft-fusion approach in P3S is beneﬁcial to improve performance in sparse reward environments.
Beniﬁts of P3S Delayed Ant-v1 is a case of sparse reward environment in which P3S shows significant improvement as compared to other parallel schemes.
As shown in Fig.
4h, the performance of
TD3 drops below zero initially and converges to zero as time goes.
Similar behavior is shown for other parallel methods except P3S. This is because in Delayed Ant-v1 with zero padding rewards between actual rewards, initial random actions do not generate signiﬁcant positive speed to a forward direction, so it does not receive positive rewards but receives negative actual rewards due to the control cost.
Once its performance less than 0, learners start learning doing nothing to reach zero reward (no positive reward and no negative reward due to no control cost).
Learning beyond this seems difﬁcult without any direction information for parameter update.
This is the interpretation of the behavior of other algorithms in Fig.
4h.
However, it seems that P3S escapes from this local optimum by following the best policy.
This is evident in Fig.
5a, showing that after few time steps, β is increased to follow the best policy more.
Note that at the early stage of learning, the performance difference among the learners is large as seen in the large (cid:98) D spread values in Fig.
5b.
As time elapses, all learners continue learning, the performance improves, and the spreadness among the learners’ policies shrinks.
However, the spreadness among the learners’ policies is kept at a certain level for wide policy search by d min , as seen in Fig.
5b.
Fig.
5c shows the performance of P3S with d min = 0 .
05 and 0 .
It shows that a wide area policy search is beneﬁcial as compared to a narrow area policy search.
However, it may be detrimental to set too large a value for d min due to too large statistics discrepancy among samples from different learners’ policies.
C ONCLUSION
In this paper, we have proposed a new population-guided parallel learning scheme, P3S, to enhance the performance of off-policy RL.
In the proposed P3S scheme, multiple identical learners with their own value-functions and policies sharing a common experience replay buffer search a good policy with the guidance of the best policy information in the previous search interval.
The information of the best policy parameter of the previous search interval is fused in a soft manner by constructing an augmented loss function for policy update to enlarge the overall search region by the multiple learners.
The guidance by the previous best policy and the enlarged search region by P3S enables faster and better search in the policy space, and monotone improvement of expected cumulative return by P3S is theoretically proved.
The P3S-TD3 algorithm constructed by applying the proposed
P3S scheme to TD3 outperforms most of the current state-of-the-art RL algorithms.
Furthermore, the performance gain by P3S over other parallel learning schemes is signiﬁcant on harder environments especially on sparse reward environments by searching wide range in policy space.
A PPENDIX A. P ROOF OF T HEOREM
In this section, we prove Theorem 1.
Let π oldφ i be the policy of the i -th learner at the end of the previous update period and let π φ b be the best policy among all policies π oldφ i , i = 1 , · · · , N .
Now, consider any learner i who is not the best in the previous update period.
Let the policy of learner i in the current update period be denoted by π φ i , and let the policy loss function of the base algorithm be denoted as L ( π φ i ) , given in the form of
[Equation]
The reason behind this choice is that most of actor-critic methods update the value (or Q-)function and the policy iteratively.
That is, for given π oldφ i , the Q-function is ﬁrst updated so as to approximate
Q π oldφi .
Then, with the approximation Q π oldφi the policy is updated to yield an updated policy
π newφ i , and this procedure is repeated iteratively.
Such loss function is used in many RL algorithms such as SAC and TD3 (Haarnoja et al.
; Fujimoto et al.
SAC updates its policy by minimizing E s
[Equation]
] over π (cid:48) .
TD3 updates its policy by minimizing E
[Equation]
With the loss function eq.
(7) and the KL divergence KL ( π || π (cid:48) )
as the distance measure D ( π, π (cid:48) )
between two policies π and π (cid:48) as stated in the main paper, the augmented loss function for non-best learner i at the current update period is expressed as
[Equation]
Let π
newφ
i be a solution that minimizes the augmented loss function eq.
Assumption 1.
For all s ,
[Equation]
Assumption 2.
For some ρ, d > 0 ,
[Equation]
For simplicity of notations
[Equation]
we use the following notations from here on.
• π i for π φ i • π iold for π oldφ i • π inew for π newφ i • π b for π φ b .
A.1. A P RELIMINARY S TEP
Lemma 1.
Let π i new be the solution of the augmented loss function eq.
Then, with Assumption 1, we have the following:
[Equation]
for all s .
Proof.
For all s ,
[Equation]
where Step (a) holds by Assumption 1, (b) holds by the deﬁnition of π inew , and (c) holds since KL divergence is always non-negative.
With Lemma
[Equation]
we prove the following preliminary result before Theorem 1:
Proposition 1.
With Assumption 1, the following inequality holds for all s and a :
[Equation]
Proof of Proposition 1.
For arbitrary s t and a t ,
[Equation]
where p ( ·
| s t , a t ) in eq.
(18) is the environment transition probability, and s t
+1 :
s t +2 ∼ π inew in eq.
(20) means that the trajectory from s t +1 to s t +2 is generated by π inew together with the environment transition probability p ( ·| s t , a t ) .
(Since the use of p ( ·| s t , a t ) is obvious, we omitted p ( ·| s t , a t ) for notational simplicity.)
Steps (a) and (b) hold due to Lemma 1.
A.2. P ROOF OF T HEOREM
Proposition 1 states that for a non-best learner i , the updated policy π inew with the augmented loss function yields better performance than its previous policy π iold , but Theorem 1 states that for a nonbest learner i , the updated policy π inew with the augmented loss function yields better performance than even the previous best policy π b .
To prove Theorem 1, we need further lemmas:
We take Deﬁnition 1 and Lemma 2 directly from reference (Schulman et al. (2015)).
Deﬁnition 1 (From Schulman et al. (2015)) .
Consider two policies π and π (cid:48) .
The two policies π and π (cid:48) are α -coupled if Pr ( a (cid:54) = a (cid:48) )
≤ α , ( a, a (cid:48) ) ∼ ( π ( ·| s ) , π (cid:48) ( ·| s )) for all s .
Lemma 2 (From Schulman et al.
Given α -coupled policies π and π (cid:48) , for all s ,
[Equation]
[Equation] where A π ( s, a ) is the advantage function.
Proof.
(From Schulman et al.
[Equation]
where Step (a) holds since E a ∼ π [ A π ( s, a )]
= 0 for all s by the property of an advantage function.
By modifying the result on the state value function in Schulman et al.
, we have the following lemma on the Q-function:
Lemma 3.
Given two policies π and π (cid:48) , the following equality holds for arbitrary s 0 and a 0 :
[Equation]
where E τ ∼ π (cid:48) is expectation over trajectory τ which start from a state s 1 drawn from the transition probability p ( ·| s 0 , a 0 ) of the environment.
Proof.
Note that
[Equation]
Hence
[Equation]
it is sufﬁcient to show the following equality:
[Equation]
Note that
[Equation]
Then, substituting eq.
(35) into the LHS of eq.
[Equation]
we have
[Equation]
where eq.
(37) is valid since
[Equation]
− E
[Equation]
1 ∼ p
[Equation] [Equation]
0 ,a 0 )
[ V π ( s 1 )] .
Since the RHS of eq.
(38) is the same as the RHS of eq.
(34), the claim holds.
Then, we can prove the following lemma regarding the difference between the Q-functions of two α -coupled policies π and π (cid:48) :
Lemma 4.
Let π and π (cid:48) be α -coupled policies.
Then,
[Equation] [Equation]
where (cid:15) =
max s,a | A π ( s, a ) | and C >
Proof.
From Lemma 3, we have
[Equation]
Then, from eq.
(40) we have
[Equation] [Equation]
where (cid:15) = max s,a | A π ( s, a ) | and C > 0 .
Here, eq.
(43) is valid due to Lemma 2, eq.
(45) is valid since Cα 2 + 1 /C − 2 α = C (cid:0) α − 1 C (cid:1) 2 ≥ 0 , and eq.
(46) is valid since the sum of two terms is less than or equal to two times the maximum of the two terms.
Up to now, we considered some results valid for given two α -coupled policies π and π (cid:48) .
On the other hand, it is shown in Schulman et al.
(2015) that for arbitrary policies π and π (cid:48)
, if we take α as the maximum (over s ) of the total variation divergence max s D TV ( π ( ·| s ) || π (cid:48) ( ·| s )) between π ( ·| s ) and π (cid:48) ( ·| s ) , then the two policies are α -coupled with the α value of α = max s D TV ( π ( ·| s )
||
π (cid:48) ( ·| s )) .
Applying the above facts, we have the following result regarding π inew and π iold :
Lemma 5.
For some constants ρ , d > 0 ,
[Equation]
(47) for all s and a , where KL max ( π || π (cid:48) ) denotes max s KL ( π ( ·| s ) || π (cid:48) ( ·| s )) .
Proof.
For π inew and π iold , take α as the maximum of the total variation divergence between π inew and π iold , i.e., α = max s D TV ( π inew ( ·| s ) ||
π iold ( ·| s )) .
Let this α value be denoted by ˆ α .
Then, by the result of Schulman et al.
(2015) mentioned in the above, π inew and π iold are ˆ α -coupled with ˆ α = max s D TV ( π inew ( ·| s )
||
π iold ( ·| s )) .
Since
[Equation]
by the relationship between the total variation divergence and the KL divergence, we have
[Equation]
Now, substituting π = π inew , π (cid:48)
=
π iold and α = ˆ α into eq.
(39) and applying eq.
(49), we have
[Equation]
Q π inew
[Equation]
s, a
[Equation]
− Q π iold
[Equation]
s
[Equation]
for some ρ, d > 0 .
Here, proper scaling due to the introduction of β is absorbed into ρ and d .
That is, ρ can be set as 2 (cid:15)γC β (1 − γ ) and d can be set as 2 (cid:15)γ β (1 − γ ) C .
Then, by Proposition 1, (cid:12)(cid:12)(cid:12) Q π inew ( s, a ) − Q π iold
( s, a ) (cid:12)(cid:12)(cid:12) in the LHS of eq.
(50) becomes (
cid:12)(cid:12)(cid:12) Q π inew ( s, a ) − Q π iold
( s, a ) (cid:12)(cid:12)(cid:12) =
Q π inew ( s, a ) − Q π iold
( s, a ) .
Hence, from this fact and eq.
(50), we have eq.
This concludes proof.
Proposition 2.
With Assumption
[Equation]
we have
[Equation]
where
[Equation]
Proof.
[Equation]
where step (a) is valid due to Lemma 5, step (b) is valid due to the deﬁnition of π inew
[Equation]
and step (c) is valid due to Proposition
[Equation]
Finally
[Equation]
we prove Theorem
[Equation]
Theorem 1.
Under Assumptions 1 and [Equation] the following inequality holds:
[Equation]
where [Equation] Proof of Theorem 1: Proof of Theorem 1 is by recursive application of Proposition 2.
For arbitrary s t and a t ,
Q
[Equation]
inew
[Equation]
[Equation]
[Equation]
where steps (a) and (b) hold because of Proposition 2. Assumption 2 ensures [Equation] Hence
[Equation]
the second term in (68) is non-negative.
Therefore [Equation] we have [Equation]
A PPENDIX B. I NTUITION OF THE IMPLEMENTATION OF β ADAPTATION
Due to Theorem 1, we have [Equation] where
[Equation]
In deriving eqs. (72) and (73), we only used Assumption 1. When we have Assumption 2, the improvement gap term in (72) becomes non-negative and we have [Equation]
as desired.
However, in practice, Assumption 2 should be implemented so that the improvement gap term becomes non-negative and we have the desired result (74).
The implementation of the condition is through adaptation of β .
We adapt β to maximize the improvement gap β E s t +1 : s ∞ ∼ π b (cid:2)(cid:80) ∞
k = t +1 γ k − t ∆( s k ) (cid:3) in (72) for given ρ and d .
Let us denote
E s t +1 : s ∞ ∼ π b (cid:2)(cid:80) ∞
k = t +1 γ k − t ∆( s k ) (cid:3) by ¯∆ .
Then, the improvement gap is given by β ¯∆ .
Note that ¯∆ is the average (with forgetting) of ∆( s k ) by using samples from π b .
The gradient of the improvement gap with respect to β is given by
[Equation]
Thus, if ¯∆ > 0 , i.e., KL (cid:0) π inew ( ·| s ) || π b ( ·| s ) (cid:1) > max (cid:8) ρ KL max (cid:0) π inew ||
π iold (cid:1) , d (cid:9) on average, then β should be increased to maximize the performance gain.
On the other hand, if ¯∆ < 0 , i.e., KL (cid:0) π inew ( ·| s ) || π b ( ·| s ) (cid:1) ≤ max (cid:8) ρ KL max (cid:0) π inew ||
π iold (cid:1) , d (cid:9) on average, then β should be decreased.
Therefore, we adapt β as follows: [Equation] (76) where (cid:98) D spread and (cid:98) D change are implementations of KL (cid:0) π inew ( ·| s ) ||
π b ( ·| s ) (cid:1) and
KL max (cid:0) π inew || π iold (cid:1) , respectively. A PPENDIX C. C OMPARISON TO B ASELINES ON D ELAYED M U J O C O E NVIRONMENTS In this section, we provide the learning curves of the state-of-the-art single-learner baselines on delayed MuJoCo environments.
Fig. 6 shows the learning curves of P3S-TD3 algorithm and the single-learner baselines on the four delayed MuJoCo environments: Delayed Hopper-v1, Delayed Walker2d-v1, Delayed HalfCheetah-v1, and Delayed Ant-v1.
It is observed that in the delayed Antv1 environment, ACKTR outperforms the P3S-TD3 algorithm. It is also observed that P3S-TD signiﬁcantly outperforms all baselines on all other environments than the delayed Ant-v1 environment. [Figure]
In this section, we compare the performance of TD3 and P3S-TD3 with CEM-TD3 (Pourchot & Sigaud (2019)), which is a state-of-the-art evolutionary algorithm.
CEM-TD3 uses a population to search a better policy as other evolutionary algorithms do. The operation of CEM-TD3 is described as follows: It ﬁrst samples N policies by drawing policy parameters from a Gaussian distribution.
It randomly selects a half of the population.
The selected policies and a common Q function are updated based on minibatches drawn from a common replay buffer.
Both the updated selected policies and the unselected policies are evaluated and the experiences during the evaluation are stored in the common replay buffer. After evaluation of all N policies, it takes the best N/ 2 policies and updates the mean and variance of the policy parameter distribution as the mean and variance of the parameters of the best N/ 2 policies. Steps 1 to 4 are iterated until the time steps reach maximum.
For the performance comparision, we used the implementation of CEM-TD3 in the original paper (Pourchot & Sigaud (2019)) 1 with the hyper-parameters provided therein.
Table 1 shows the steady state performance on MuJoCo and delayed MuJoCo environments.
Fig.
7 in the next page shows the learning curves on MuJoCo and delayed MuJoCo environments.
It is seen that P3S-TD outperforms CEM-TD3 on all environments except delayed HalfCheetah-v1.
Notice that P3S-TD signiﬁcantly outperforms CEM-TD3 on delayed Walker2d-v1 and delayed Ant-v1. [Table]
HalfCheetah-v 11961.
Ant-v 5339.
Delayed Hopper-v 3355.
Delayed Walker2d-v 4058.
Delayed HalfCheetah-v 5754.
Delayed Ant-v 724.
[Figure]
A PPENDIX E. C OMPARISON TO M ETHOD USING C ENTER P OLICY
In this section, we consider a variant of the proposed P3S-TD3 algorithm, named Center-TD3.
This variant uses a center policy like in Distral (Teh et al.
and Divide-and-Conquer (Ghosh et al.
Center-TD3 has N policies and a center policy π c in addition.
The value and policy parameter update procedure is the same as the original TD3 algorithm but the loss functions are newly deﬁned.
That is, the Q function loss is the same as the original TD3 algorithm, but the parameters of the N policies are updated based on the following loss:
[Equation]
The parameter loss function of Center-TD3 is obtained by replacing the best policy with the center policy in the parameter loss function of P3S-TD3.
The center policy is updated in every M time steps to the direction of minimizing the following loss
[Equation]
Center-TD3 follows the spirit of Distral (Teh et al.
and Divide-and-Conquer (Ghosh et al.
(2018)) algorithms.
We tuned and selected the hyperparameters for Center-TD3 from the sets β ∈ { 1 , 10 } and M ∈ { 2 , 20 , 40 , 100 , 200 , 500 } .
We then measured the performance of Center-TD3 by using the selected hyperparameter β
= 1 , M = 40 .
Fig.
8 in the next page and Table 2 show the learning curves and the steady-state performance on MuJoCo and delayed MuJoCo environments, respectively.
It is seen that P3S-TD3 outperforms Center-TD3 on all environments except Delayed HalfCheetah-v1.
[Table]
[Figure]
A PPENDIX F. R ESULT ON S WIMMER - V
Khadka & Tumer (2018); Pourchot & Sigaud (2019) noticed that most deep RL methods suffer from a deceptive gradient problem on the Swimmer-v1 task, and most RL methods could not learn effectively on the Swimmer-v1 task.
Unfortunately, we observed that the proposed P3S-TD3 algorithm could not solve the deceptive gradient problem in the Swimmer-v1 task either.
Fig.
9 shows the learning curves of P3S-TD3 and TD3 algorithm.
In Khadka & Tumer (2018), the authors proposed an effective evolutionary algorithm named ERL to solve the deceptive gradient problem on the Swimmer-v1 task, yielding the good performance on Swimmer-v1, as shown in Fig.
P3S-TD falls short of the performance of ERL on Swimmer-v1.
However, it is known that CEM-TD3 discussed in Appendix D outperforms ERL on other tasks (Pourchot & Sigaud (2019)).
Furthermore, we observed that P3S-TD3 outperforms CEM-TD3 on most environments in Appendix D.
A PPENDIX G. T HE T WIN D ELAYED D EEP D ETERMINISTIC P OLICY G RADIENT (TD3) A LGORITHM
The TD3 algorithm is a current state-of-the-art off-policy algorithm and is a variant of the deep deterministic policy gradient (DDPG) algorithm (Lillicrap et al.
The TD3 algorithm tries to resolve two problems in typical actor-critic algorithms: 1) overestimation bias and 2) high variance in the approximation of the Q-function.
In order to reduce the bias, the TD3 considers two
Q-functions and uses the minimum of the two Q-function values to compute the target value, while in order to reduce the variance in the gradient, the policy is updated less frequently than the Qfunctions.
Speciﬁcally, let Q θ 1 , Q θ 2 and π φ be two current Q-functions and the current deterministic policy, respectively, and let Q θ (cid:48) 1 , Q θ (cid:48) 2 and π φ (cid:48) be the target networks of Q θ 1 , Q θ 2 and π φ , respectively.
The target networks are initialized by the same networks as the current networks.
At time step t , the TD3 algorithm takes an action a t with exploration noise (cid:15) : a t = π φ ( s t ) + (cid:15) , where (cid:15) is zero-mean Gaussian noise with variance σ 2 , i.e., (cid:15) ∼ N (0 , σ 2 ) .
Then, the environment returns reward r t and the state is switched to s t +1 .
The TD3 algorithm stores the experience ( s t , a t , r t , s t +1 ) at the experience replay buffer D .
After storing the experience, the Q-function parameters θ 1 and θare updated by gradient descent of the following loss functions:
[Equation]
where ˆ E ( s,a,r,s (cid:48) )
∼D denotes the sample expectation with an uniform random mini-batch of size B drawn from the replay buffer D , and the target value y is given by
[Equation]
Here, for the computation of the target value, the minimum of the two target Q-functions is used to reduce the bias.
The procedure of action taking and gradient descent for θ 1 and θ 2 are repeated for d times ( d = 2 ), and then the policy and target networks are updated.
The policy parameter φ is updated by gradient descent by minimizing the loss function for φ : [Equation]
[Equation]
and the target network parameters θ (cid:48)
j and φ (cid:48) are updated as
[Equation]
The networks are trained until the number of time steps reaches a predeﬁned maximum.
A PPENDIX H. P SEUDOCODE OF THE P3S-TD3 A LGORITHM
Require: N
T
M
B
1: Initialize φ 1 = · · · = φ N = φ b , θ 1 j = · · · = θ Nj , j = 1 , 2 , randomly.
2: Initialize β
= 1 , t =3: while t < T do 4: t ← t + 1 (one time step) 5: for i = 1 , 2 , · · · , N in parallel do 6: if t < T initial then 7:
Take a uniform random action a it to environment copy E i 8: else 9:
Take an action a it
=
π i (cid:0) s it (cid:1) + (cid:15) , (cid:15) ∼ N (0 , σ 2 ) to environment copy E i 10: end if 11:
Store experience ( s it , a it , r it , s i t +1 ) to the shared common experience replay D 12: end for 13: if t < T initial then 14: continue (i.e., go to the beginning of the while loop) 15: end if 16: for i
= 1 , 2 , · · · , N in parallel do 17:
Sample a mini-batch B = { ( s t l , a t l , r t l , s t l +1 ) } l =1 ,...,B from D 18:
Update θ ij , j = 1 , 2 , by gradient descent for minimizing ˜ L ( θ ij ) in (83) with B 19: if t ≡ 0( mod d ) then 20:
Update φ i by gradient descent for minimizing ˜ L ( φ i ) in (84) with B 21:
Update the target networks: ( θ ij ) (cid:48) ← (
[Equation]
22: end if 23: end for 24: if t ≡ 0( mod M ) then 25:
Select the best learner b 26:
Adapt β 27: end if 28: end while
In P3S-TD3, the i -th learner has its own parameters θ i 1 , θ i 2 , and φ i for its two Q-functions and policy.
Furthermore, it has ( θ i 1 ) (cid:48) , ( θ i 2 ) (cid:48) , and ( φ i ) (cid:48) which are the parameters of the corresponding target networks.
For the distance measure between two policies, we use the mean square difference, given by D ( π ( s ) , ˜ π
( s ))
= 1 2 (cid:107) π
( s ) − ˜ π ( s ) (cid:107) 22 .
For the i -th learner, as in TD3, the parameters θ ij , j = 1 , 2 are updated every time step by minimizing
[Equation]
(83) where
y = r + γ min j =1 , 2 Q ( θ ij )
[Equation]
( s
[Equation]
, π ( φ i )
[Equation]
( s (cid:48) )
+ (cid:15) ) ,
(cid:15) ∼ clip ( N (0 , ˜ σ 2 ) , − c, c ) .
The parameter φ i is updated every d time steps by minimizing the following augmented loss function:
[Equation]
For the ﬁrst T initial time steps for initial exploration we use a random policy and do not update all policies over the initial exploration period.
With these loss functions, the reference policy, and the initial exploration policy, all procedure is the same as the general P3S procedure described in
Section 3.
The pseudocode of the P3S-TD3 algorithm is shown above.
A PPENDIX I. P ARAMETERS
TD3 The networks for two Q-functions and the policy have 2 hidden layers.
The ﬁrst and second layers have sizes 400 and 300, respectively.
The non-linearity function of the hidden layers is ReLU, and the activation functions of the last layers of the Q-functions and the policy are linear and hyperbolic tangent, respectively.
We used the Adam optimizer with learning rate 10 − 3 , discount factor γ = 0 .
99 , target smoothing factor τ = 5 × 10 − 3 , the period d = 2 for updating the policy.
The experience replay buffer size is 10 6 , and the mini-batch size B is 100 .
The standard deviation for exploration noise σ and target noise ˜ σ are 0 .
1 and 0 . 2 , respectively, and the noise clipping factor c is 0 .
P3S-TD
In addition to the parameters for TD3, we used N = 4 learners, the period M =of updating the best policy and β , the number of recent episodes E r = 10 for determining the best learner b .
The parameter d min was chosen among { 0 . 02 , 0 . 05 } for each environment, and the chosen parameter was 0.02 (Walker2d-v1, Ant-v1, Delayed Hopper-v1, Delayed Walker2d-v1,
Delayed HalfCheetah-v1), and 0.05 (Hopper-v1, HalfCheetah-v1, Delayed Ant-v1).
The parameter ρ for the exploration range was 2 for all environments.
The time steps for initial exploration T initial was set as 250 for Hopper-v1 and Walker2d-v1 and as 2500 for HalfCheetah-v1 and Ant-v1.
Re-TD
The period M (cid:48) was chosen among { 2000 , 5000 , 10000 } (MuJoCo environments) and { 10000 , 20000 , 50000 } (Delayed MuJoCo environments) by tuning for each environment.
The chosen period M (cid:48) was 2000 (Ant-v1), 5000 (Hopper-v1, Walker2d-v1, HalfCheetah-v1), 10000 (Delayed
[Table]