I NFORMATION ASYMMETRY IN KL- REGULARIZED RL
Anonymous authors
Paper under double-blind review
A BSTRACT
Many real world tasks exhibit rich structure that is repeated across different parts of the state space or in time.
In this work we study the possibility of leveraging such repeated structure to speed up and regularize learning.
We start from the KL regularized expected reward objective which introduces an additional component, a default policy.
Instead of relying on a ﬁxed default policy, we learn it from data.
But crucially, we restrict the amount of information the default policy receives, forcing it to learn reusable behaviours that help the policy learn faster.
We formalize this strategy and discuss connections to information bottleneck approaches and to the variational EM algorithm.
We present empirical results in both discrete and continuous action domains and demonstrate that, for certain tasks, learning a default policy alongside the policy can signiﬁcantly speed up and improve learning.
I NTRODUCTION
For many interesting reinforcement learning tasks, good policies exhibit similar behaviors in different contexts, behaviors that need to be modiﬁed only slightly or occasionally to account for the speciﬁc task at hand or to respond to information becoming available.
For example, a simulated humanoid in navigational tasks is usually required to walk – independently of the speciﬁc goal it is aiming for.
Similarly, an agent in a simulated maze tends to primarily move forward with occasional left/right turns at intersections.
This intuition has been explored across multiple ﬁelds, from cognitive science (e.g. Kool & Botvinick, 2018) to neuroscience and machine learning.
For instance, the idea of bounded rationality (e.g. Simon, 1956) emphasizes the cost of information processing and the presence of internal computational constraints.
This implies that the behavior of an agent minimizes the need to process information, and more generally trades off task reward with computational effort, resulting in structured repetitive patterns.
Computationally, these ideas can be modeled using tools from information and probability theory (e.g. Tishby & Polani, 2011; Ortega & Braun, 2011; Still & Precup, 2012;
Rubin et al., 2012;
Ortega & Braun, 2013; Tiomkin & Tishby, 2017), for instance, via constraints on the channel capacity between past states and future actions in a Markov decision process.
In this paper we explore this idea, starting from the KL regularized expected reward objective (e.g.
Todorov, 2007; Toussaint, 2009; Kappen et al., 2012;
Rawlik et al., 2012; Levine & Koltun, 2013; Teh et al., 2017), which encourages an agent to trade off expected reward against deviations from a prior or default distribution over trajectories.
We explore how this can be used to inject subjective knowledge into the learning problem by using an informative default policy that is learned alongside the agent policy This default policy encodes default behaviours that should be executed in multiple contexts in absence of additional task information and the objective forces the learned policy to be structured in alignment with the default policy.
To render this approach effective, we introduce an information asymmetry between the default and agent policies, preventing the default policy from accessing certain information in the state.
This prevents the default policy from collapsing to the agent’s policy.
Instead, the default policy is forced to generalize across a subset of states, implementing a form of default behavior that is valid in the absence of the missing information, and thereby exerting pressure that encourages sharing of behavior across different parts of the state space.
Figure 1 illustrates the proposed setup, with asymmetry imposed by hiding parts of the state from the default policy.
We investigate the proposed approach empirically on a variety of challenging problems including both continuous action problems such as controlling simulated high-dimensional physical embodied agents, as well as discrete action visual mazes.
We ﬁnd that even when the agent and default policies are learned at the same time, signiﬁcant speed-ups can be achieved on a range of tasks.
We consider several variations of the formulation, and discuss its connection to several ideas in the wider literature, including information bottleneck, and variational formulations of the
EM algorithm for learning generative models.
KL AND ENTROPY REGULARIZED REINFORCEMENT LEARNING
Throughout this paper we use s t and a t to denote the state and action at time step t , and r p s, a q the instantaneous reward for the agent if it executes action a in state s .
We denote the history up to time t by x t “ p s 1 , a 1 , . . .
, s t q , and the whole trajectory by τ “ p s 1 , a 1 , s 2 , . . .
q .
Our starting point is the
KL regularized expected reward objective
[Equation]
where π is the agent policy (parameterized by θ and to be learned), π 0 the default policy, and E π τ r¨s is taken with respect to the distribution π τ over trajectories deﬁned by the agent policy and system dynamics:
π τ p τ q “ p p s 1 q ś t π p a t | x t q p p s t ` 1 | s t , a t q .
Note that our policies are history-dependent.
[Equation]
t qs is the Kullback-Leibler (KL) divergence between the agent policy π and a default or prior policy π 0 given history x t .
The discount factor is γ P r 0 , 1 s and α is a hyperparameter scaling the relative contributions of both terms.
Intuitively, this objective expresses the desire to maximize the reward while also staying close to a reference behaviour deﬁned by π 0 .
As discussed later, besides being a convenient way to express a regularized RL problem, it also has deep connections to probabilistic inference.
One particular instantiation of eq.
(1) is when π 0 is the uniform distribution (assuming a compact action space).
In this case one recovers, up to a constant, the entropy regularized objective (e.g. Ziebart, 2010;
Fox et al., 2015; Haarnoja et al., 2017; Schulman et al., 2017a; Hausman et al., 2018):
[Equation]
This objective has been motivated in various ways: it prevents the policy from collapsing to a deterministic solution thus improving exploration, it encourages learning of multiple solutions to a task which can facilitate transfer, and it provides robustness to perturbations and model mismatch.
One approximation of the entropy regularized objective is for the history dependent entropy to be used as an additional (auxiliary) loss to the RL loss; this approach is widely used in the literature (e.g. Williams & Peng, 1991; Mnih et al., 2016).
While the motivations for considering the entropy regularized objective are intuitive and reasonable, the choice of regularizing towards an uniform policy is less obvious, particularly in cases with large or high dimensional action spaces.
In this work we explore whether regularization towards more sophisticated default policies can be advantageous.
Both objectives (1) and (2) can be generalized beyond the typical Markov assumption in MDPs.
In particular, additional correlations among actions can be introduced, e.g. using latent variables
Hausman et al.
This can be useful when, as discussed below, either π 0 or π are not given full access to the state, rendering the setup partially observed.
In the following we will not explore such extensions, though note that we do work with policies π p a t | x t q and π 0 p a t | x t q that depend on history x t .
L EARNING DEFAULT POLICIES
Many works that consider the KL regularized objective either employ a simple or ﬁxed default policy or directly work with the entropy formulation (e.g. Rubin et al., 2012;
Fox et al., 2015; Haarnoja et al., 2017; Hausman et al., 2018).
In contrast, here we will be studying the possibility of learning the default policy itself, and the form of the subjective knowledge that this introduces to the learning system.
Our guiding intuition, as described earlier, is the notion of a default behaviour that is executed in the absence of additional goal-directed information.
Instances which we explore in this paper include a locomotive body navigating to a goal location where the locomotion pattern depends largely on the body conﬁguration and less so on the goal, and a 3D visual maze environment with discrete actions, where the typical action includes forward motion, regardless of the speciﬁc task at hand.
To express the notion of a default behavior, which we also refer to as “goal-agnostic” (although the term should be understood very broadly), we consider the case where the default policy π 0 is a function (parameterized by φ ) of a subset of the interaction history up to time t , i.e. π 0 p a t | x t q “ π 0 p a t | x D t q , where x D t is a subset of the full history x t and is the goal-agnostic information that we allow the default policy to depend on.
We denote by x G t the other (goal-directed) information in x t and assume that the full history is the disjoint union of both.
The objective (1) specializes to:
[Equation]
To give a few examples: If x D t is empty then the default policy does not depend on the history at all (e.g. uniform policy).
If x D t “ a 1: t ´ 1 then it depends only on past actions.
In multitask learning x G t can be the task identiﬁer, while x D t the state history.
And ﬁnally, in continuous control x D t can contain proprioceptive information about the body, while x G t contains exteroceptive (goal-directed) information (e.g. vision).
By hiding information from the default policy, the system forces the default policy to learn the average behaviour over histories x t with the same value of x D t .
If x D t hides goal-directed information, the default policy will learn behaviour that is generally useful regardless of the current goal.
We can make this precise by noting that optimizing the objective (1) with respect to π 0 amounts to supervised learning of π 0 on trajectories generated by π τ , i.e. this is a distillation process from π τ to π 0 (Hinton et al., 2015; Rusu et al., 2016; Parisotto et al., 2016;
Teh et al., 2017).
In the nonparametric case, the optimal default policy π 0 ˚ can be derived as:
[Equation]
where π τ p ˜ x
˜ t q is the probability of seeing history ˜
x ˜ t at time step ˜ t under the policy π , and the indicatorp x D t “ ˜ x D ˜ t q is 1 if the goal-agnostic information of the two histories matches and 0 otherwise.
It is also worth considering the effect of the objective eq.
(3) on the learned policy π .
Since π 0 is learned alongside π and not speciﬁed in advance, this objective does not favor any particular behavior a priori.
Instead it will encourage a solution in which similar behavior will be executed in different parts of the state space that are similar as determined by x D t , since the policy π is regularized towards the default policy π 0 .
More generally, during optimization of π the default policy effectively acts like a shaping reward while the entropy contained in the KL discourages deterministic solutions.
C ONNECTION TO INFORMATION BOTTLENECK AND VARIATIONAL EM 4. I NFORMATION BOTTLENECK
Reinforcement learning objectives with information theoretic constraints have been considered by multiple authors (Tishby & Polani, 2011; Still & Precup, 2012; Tiomkin & Tishby, 2017).
Such constraints can be motivated by the internal computational limitations of the agent, which limit the rate with which information can be extracted from states (or observations) and translated into actions.
Such capacity constraints can be expressed via an information theoretic regularization term that is added to the expected reward.
Specializing to our scenario, where the “information ﬂow” to be controlled is between the goal-directed history information x Gt and action a t (so that the agent prefers default, goal-agnostic, behaviour), consider the objective:
[Equation]
where MI r x G t , a t | x D t s is the conditional mutual information between x G t and a t given x D t .
The conditional mutual information can be upper bounded:
[Equation]
where the inequality is from the fact that the KL divergence KL r π τ p a t | x D t q} π 0 p a t | x D t qs is positive (see Alemi et al., 2016).
Re-introducing this into (5) we ﬁnd that the KL regularized objective in eq.
(3) can be seen as a lower bound to eq.
(5), where the agent has a capacity constraint on the channel between goal-directed history information and (future) actions.
See section A in the appendix for a generalization including latent variables.
In this light, we can see our work as a particular implementation of the information bottleneck principle, where we penalize the dependence on the information that is hidden from the default policy.
4. V ARIATIONAL EM
The above setup also bears signiﬁcant similarity to the training of variational autoencoders (Kingma & Welling, 2013; Rezende et al., 2014) and, more generally the variational EM framework for learning latent variable models (Dempster et al., 1977; Neal & Hinton, 1999).
The setup is as follows.
Given observations X “ t x 1 , . . .
x N u the goal is to maximize the log marginal likelihood log p θ p X q “ ř i log p θ p x i q where p θ p x q “ ş p θ p x, z q dz .
This marginal likelihood can be bounded from below by ř i
E q φ p z | x i q r log p θ p x i | z q´ log q φ p z
| x i q p θ p z q s with q φ p z | x i q being a learned approximation to the true posterior p θ p z
| x i q .
This lower bound exhibits a similar information asymmetry between q and p as the one introduced between π and π 0 in the objective in eq.
In particular, in the multi-task case discussed in section 3 with one task per episode, x i can be seen to take the role of the task, log p p x i | z
q that of the task reward, q p z | x i q that of task conditional policy, and p p
z q the default policy.
Therefore maximizing eq.
(3) can then be thought of as learning a generative model of behaviors that can explain the solution to different tasks.
A LGORITHM
In practice the objective in eq.
3 can be optimized in different ways.
A simple approach is to perform alternating gradient ascent in π 0 and π .
Optimizing L with respect to π 0 amounts to supervised learning with π as the data distribution (distilling π into π 0 ).
Optimizing π given π 0 requires solving a regularized expected reward problem which can be achieved with a variety of algorithms (Schulman et al., 2017a;
Teh et al., 2017; Haarnoja et al., 2017; Hausman et al., 2018; Haarnoja et al., 2018).
The speciﬁc algorithm choice in our experiments depends on the type of environment.
For the continuous control domains we use SVG(0)
(Heess et al., 2015) with experience replay and a modiﬁcation for the KL regularized setting (Hausman et al., 2018; Haarnoja et al., 2018).
The SVG(0) algorithm learns stochastic policies by backpropagation from the action-value function.
We estimate the action value function using K -step returns and the Retrace operator for low-variance off-policy correction (see Munos et al.
(2016); as well as Hausman et al.
Riedmiller et al.
(2018b)).
For discrete action spaces we use a batched actor-critic algorithm (see Espeholt et al.
The algorithm employs a learned state-value function and obtains value estimates for updating the value function and advantages for computing the policy gradient using K -step returns in combination with the V-trace operator for off-policy correction.
All algorithms are implemented in batched distributed fashion with a single learner and multiple actors.
In algorithm 1 we provide pseudo-code for actor-critic version of the algorithm with K -step returns.
Details of the off-policy versions of the algorithms for continuous and discrete action spaces can be found in the appendix (section D).
R ELATED WORK
There are several well established connections between certain formulations of the reinforcement learning literature and concepts from the probabilistic modeling literature.
The formalisms are often closely related although derived from different intuitions, and with different intentions.
Maximum entropy reinforcement learning , stochastic optimal control, and related approaches build on the observation that some formulation of the reinforcement learning problem can be interpreted as exact or approximate variational inference in a probabilistic graphical model in which the reward function takes the role of log-likelihood (e.g. Ziebart, 2010; Kappen et al., 2012; Toussaint, 2009).
While the exact formulation and algorithms vary, they result in an entropy or KL regularized expected reward objective.
These algorithms were originally situated primarily in the robotics and control literature but there has been a recent surge in interest in deep reinforcement learning community (e.g. policy: π θ , initial parameters θdefault policy: π 0 φ ; initial parameters φ
Q-function: Q ψ ; initial parameters ψfor j=1, ... do for t = 0, K, 2K, ...
T do rollout partial trajectory: τ t : t ` K “ p s t , a t , r t . . .
r t ` K q compute KL: x KL
[Table]
“ KL
[Table]
p¨
[Table]
q
[Table]
p¨
[Table]
qs
Estimate boostrap value: ˆ V “ E
[Table]
x
[Table]
Estimate Q targets: ˆ Q
[Table]
Agent policy loss: ˆ L
[Table] [Table]
Q-value loss: ˆ L
[Table]
[Table] [Table]
Default policy loss: ˆ L
[Table] [Table]
x
[Table]
ψ
[Table]
end for end for
Fox et al., 2015; Schulman et al., 2017a; Nachum et al., 2017a; Haarnoja et al., 2017; Hausman et al., 2018; Haarnoja et al., 2018).
Related but often seen as distinct is the familiy of expectation maximization policy search algorithms (e.g. Peters et al., 2010; Rawlik et al., 2012; Levine & Koltun, 2013; Montgomery & Levine, 2016; Chebotar et al., 2016; Abdolmaleki et al., 2018).
These cast policy search as an alternating optimization problem similar to the EM algorithm for learning probabilistic models.
They differ in the speciﬁc implementation of the equivalents of the E and M steps; intuitively the default policy is repeatedly replaced by a new version of the policy.
The DISTRAL algorithm (Teh et al., 2017) as well as the present paper can be seen as taking an intermediate position: unlike in the class of RL-as-inference algorithms the default policy is not ﬁxed but learned, but unlike in the classical EM policy search the ﬁnal result of the optimization remains regularized since the default policy is constrained relative to the policy.
As explained above this can be seen as analogous to the relative roles of learned model and observation speciﬁc posterior in ﬁtting a generative model.
Similar to DISTRAL, Divide and Conquer (Ghosh et al., 2018) learns an ensemble of policies, each specializing to a particular context, which are regularized towards one another via a symmetric KL penalty, with the behavior of the ensemble distilled to a single ﬁxed policy.
An important feature of EM policy search and other policy gradient algorithms is the presence of a KL constraint that limits the relative change of the policy to some older version across iterations to control for the rate of change in the policy (e.g. Schulman et al., 2015; Heess et al., 2015; Schulman et al., 2017b;
Heess et al., 2017; Nachum et al., 2017b).
The constraint can be implemented in different ways, and collectively the algorithms are often classiﬁed as “trust region” methods.
Note that for a KL regularized objective to be a trust region (Nocedal & Wright, 2006), additional assumptions need to hold.
In principle, as an optimization technique, the critical points of the KL regularized objective for some function f p θ q have to be, provably, the same as for the non-regularized objective.
This is not trivial to show unless the trust region for step k is around θ k .
In our case, there is no such guarantee even if we remove the asymmetry in information between default policy and policy or make the default policy be an old copy of the policy.
Other related works motivated from an optimization perspective include Deep Mutual Learning (Zhang et al., 2018) applied in supervised learning, where KL-regularization is used with a learned prior that receives the same amount of information as the trained model.
Kirkpatrick et al.
(2017) introduces EWC to address catastrophic forgetting, where a second order Taylor expansion of the
KL, in a KL-regularized objective, forces the main policy to stay close to solutions of previously encountered tasks.
Czarnecki et al.
(2018) also relies on a KL-regularized objective to ensure policies explored in a curriculum stay close to each other.
Conceptually distinct but formally closely related to maximum entropy and KL-regularized formulations are computational models of bounded rationality (e.g. Tishby & Polani, 2011; Ortega &
Braun, 2011; Still & Precup, 2012; Rubin et al., 2012; Tiomkin & Tishby, 2017) which introduce information constraints to account for the agent’s internal computational constraints on its ability to process information.
As discussed in section 4 the present formulation can be seen as a more general formulation of the idea.
C ONTINUOUS CONTROL EXPERIMENTS
In our experiments, we study the effect of using a learned default policy to regularize the behavior of our agents, across a wide range of environments spanning sparse and dense reward tasks.
In particular, we evaluate the impact of conditioning the default policy on various information sets x D on the learning dynamics, and evaluate the potential of pretrained default policies for transfer learning.
In these experiments, we consider two streams of information which are fed to our agents: task speciﬁc information (task) and proprioception (proprio), corresponding to walker (body) speciﬁc observations (joint angles etc.).
[Figure]
We consider three walkers: jumping ball with 3 degrees of freedom (DoF) and 3 actuators; quadruped with 12 DoF and 8 actuators; humanoid with 28 DoF and 21 actuators.
The task is speciﬁed to the agent either via an additional feature vector (referred to as feature-tasks ) or in the form of visual input ( vision-task ).
The tasks differ in the type of reward: in sparse reward tasks a non-zero reward is only given when a (sub-)goal is achieved (e.g. the target was reached); in dense reward tasks smoothly varying shaping reward is provided (e.g. negative distance to the target).
We consider the following tasks.
Walking task , a dense-reward task based on features .
The walker needs to move in one of four randomly sampled directions, with a ﬁxed speed; the direction being resampled half-way through the episode.
Walls task , a dense-reward vision-task .
Here the walker has to traverse a corridor while avoiding walls.
Go to one of K targets task , a sparse-reward feature-based task.
The walker has to go to one of K randomly sampled targets.
For K=1, the target can either reappear within the episode (referred to as the moving target task) or the episode can end upon reaching the target.
Move one box to one of K targets , a sparse-reward feature-based-task .
The walker has to move a box to one of K targets, and optionally, go on to one of the remaining targets.
The latter is referred to as the move one box to one of K targets and go to another target ).
Foraging in the maze task , a sparse-reward vision-task .
The walker collects apples in a maze.
Figure 2 shows visualizations of the walkers and some of the tasks.
Refer to appendix C for more details.
Experimental Setup As baseline, we consider policies trained with standard entropy regularization.
When considering the full training objective of eq.
1, the default policy network shares the same structure as the agent’s policy.
In both cases, hyper-parameters are optimized on a per-task basis.
We employ a distributed actor-learner architecture (Espeholt et al., 2018): actors execute recent copies of the policy and send data to a replay buffer of ﬁxed size; while the learner samples short trajectory windows from the replay and computes updates to the policy, value, and default policy.
We experimented with a number of actors in t 32 , 64 , 128 , 256 u (depending on the task) and a single learner.
Results with a single actor are presented in appendix B.
Unless otherwise mentioned, we is
We consider three information sets passed to the default policy: proprioceptive , receiving only proprioceptive information; task-subset , receiving proprioceptive and a subset of task-speciﬁc information; full-information , receiving the same information as the policy.
[Figure]
v
[Figure]
r a g
[Figure]
e p i s o d
[Figure]
r
[Figure]
t u r n [Figure] The main ﬁnding of our experiments is that the default policy with limited task information provides considerable speed-up in terms of learner steps for the sparse-reward tasks with complex walkers ( quadruped , humanoid ).
The results on these tasks are presented in ﬁgure 3.
More cases are covered in the appendix E.
Overall, the proprioceptive default policy is very effective and gives the biggest gains in the majority of tasks.
Providing additional information to the default policy, leads to an improvement only in a small number of cases (ﬁgure 3, right and appendix E.3).
In these cases, the additional information (e.g. box position), adds useful inductive bias for the policy learning.
For the dense-reward tasks or for a simple walker body adding the default policy has limited or no effect (see appendix E.1, E.2).
We hypothesize that the absence of gain is due to the relative simplicity of the regular policy learning versus the KL-regularized setup. In the case of dense-reward tasks the agent has a strong reward signal. For simple walkers, the action space is too simple to require sophisticated exploration provided by the default policy. Finally, with full information in the default policy, the optimal default policy would exactly copy the agent policy, which would not provide additional learning signal beyond the regular policy learning.
In all these cases, the default policy will not be forced to generalize across different contexts and hence not provide a meaningful regularization signal.
We analyze the agent behavior on the go to moving target task with a quadruped walker.
We illustrate the agent trajectory for this task in ﬁgure 4, left.
The red dot corresponds to the agent starting position.
The green stars on the left and central ﬁgures correspond to the locations of the targets with blue numbers indicating the order of achieving the targets.
The yellow dots on the left and central curves indicate the segment (of 40 time steps) near the target.
In ﬁgure 4, center, we show the KL divergence, KL r π } π 0 s , from the agent policy to the proprioceptive default policy.
We observe that for the segments which are close to the target (yellow dots near green star), the value of the KL divergence is high.
In these segments the walker has to stop and turn in order to go to another target.
It represents a deviation from the standard, walking behavior, and we can observe it as spikes in the
KL.
Furthermore, for the segments between the targets, e.g. 4 –> 5, the KL is much lower.
Default Policy Transfer We additionally explore the possibility of reusing pretrained default policies to regularize learning on new tasks.
Our transfer task is moving one box to one of 2 targets and going to another target task with the quadruped .
We consider different default policies: GTT
− − −    6 X − − −
Y 2         800 Steps
K L 13    0 1 2 3 4 5 6 7 8 9 Agent steps 1e
A v e r a g e e p i s o d e r e t u r n [Figure] proprio : proprioceptive information only trained on going to moving target task ( GTT ); MB proprio : proprioceptive information only trained on moving one box to one target task ( MB ); MB box : similar
MB proprio , but with box position information as additional input.
The results are given in ﬁgure 4, right.
We observe a signiﬁcant improvement in learning speed transferring the pretrained default policies to the new task.
Performance improves as the trajectory distribution modeled by the default policy is closer to the one appropriate for the transfer task (compare GTT proprio with MB proprio; and MB proprio with MB box).
[Figure]
[-K L 13    0 
-]
[Figure] [Figure]
A v e r a g e e p i s o d e r e t u
[Figure]
Ablative Analysis To gain deeper insights into our method, we compare different forms of regularization of the standard RL objective: entropy bonus - adding an entropy term H p
π p¨| s t qq to the per-timestep actor loss; entropy regularization - optimizing the objective (2); KL bonus - adding the KL-divergence term KL
[Equation]
‰ from the agent policy to the default one to the per-timestep actor loss; KL-regularization - optimizing the objective (1); KL-regularization to the old policy - optimization of the objective 1 where regularization is done wrt.
an older version of the main policy (updated every 100 steps).
The default policy receives only proprioceptive information in these experiments.
The task is go to moving target .
As can be seen in Figure 5 left, all three KL-based variants improve performance over the baseline, but regularizing against the information restricted default policy outperforms regularization against an old version of the policy.
Figure 5 center, demonstrates that the beneﬁt of the default policy depends on the reward structure.
When replacing the sparse reward with a dense shaping reward, proportional to the inverse distance from the walker to the target, our method and the baseline perform similarly, which is consistent with dense-reward results.
Finally, we assess the beneﬁt of the KL-regularized objective 1 when used with an idealized default policy.
We repeat the go-to-target experiment with a pretrained default policy on the same task.
Figure 5 right, shows a signiﬁcant difference between the baseline and different regularization variants: using the pretrained default policy, learning the default policy alongside the main policy or using a pretrained expert (default policy with access to the full state).
This suggests that large gains may be achievable in situations when a good default policy is known a priori .
We performed the same analysis for the dense reward but we did not notice any gain.
The speed-up from regularizing to the pretrained expert is signiﬁcant, however it corresponds to regularizing against an existing solution and can thus primarily be used as a method to speed-up the experiment cycles, as it was demonstrated in kickstarting framework (Schmitt et al., 2018).
Finally, we study impact of the direction of the KL in objective 1 on the learning dynamics.
Motivated by the work in policy distillation (Rusu et al., 2016) we ﬂip the KL and use KL
[Equation]
instead of the described before KL
[Equation]
The experiments showed that there was no signiﬁcant difference between these regularization schemes, which suggests that the idea of learned default policy can be viewed from student-teacher perspective, where default policy plays the role of the teacher.
This teacher can be used in a new task.
For the details, please refer to the appendix E.6.
D ISCRETE ACTION SPACES EXPERIMENTS
We also evaluate our method on the DMLab-30 set of environments.
DMLab (Beattie et al., 2016) provides a suite of rich, ﬁrst-person environments with tasks ranging from complex navigation and laser-tag to language-instructed goal ﬁnding.
Recent works on multitask training (Espeholt et al., 2018) in this domain have used a form of batched-A2C with the V-trace algorithm to maximize an approximation of the entropy regularized objective described earlier, where the default policy is a uniform distribution over the actions.
Typically, the agent receives visual information at each step, along with an instruction channel used in a subset of tasks.
The agent receives no task identiﬁer.
We adopt the architecture employed in previous work (Espeholt et al., 2018) in which frames, past actions and rewards are passed successively through a deep residual network and LSTM, ﬁnally predicting a policy and value function.
All our experiments are tuned with population-based training (Jaderberg et al., 2017).
Further details are provided in appendix D.1.
DMLab exposes a large action space, speciﬁcally the cartesian product of atomic actions along seven axes.
However, commonly a human-engineered restricted subset of these actions is used at training and test time, simplifying the exploration problem for the agent.
For example, the used action space has a forward bias , with more actions resulting in the agent moving forward rather than backwards.
This helps with exploration in navigation tasks, where even a random walk can get the agent to move away from the starting position.
The uniform default policy is used on top of this human engineered small action space, where its semantics are clear.
In this work, we instead consider a much larger combinatorial space of actions.
We show that a pure uniform default policy is in fact unhelpful when human knowledge is removed from deﬁning the right subset of actions to be uniform over, and the agent under-performs.
Learning the default policy, even in the extreme case when the default policy is not conditioned on any state information, helps recovering which actions are worth exploring and leads to the emergence of a useful action space without any hand engineering.
Figure 6 shows the results of our experiments.
We consider a ﬂat action space of 648 actions, each moving the agent in different spatial dimensions.
We run the agent from (Espeholt et al., 2018) as baseline which is equivalent to considering the default policy to be a uniform distribution over the 648 actions, and three variants of our approach, where the default policy is actually learnt.
For feed forward default policy , while the agent is recurrent, the default policy is not.
That is the policy π is conditioned on the full trace of observed states s 1 , a 1 , ..
s t , while the default policy π 0 is conditioned only on the current frame a t ´ 1 , s t .
Given that most of the 30 tasks considered require memory in order to be solvable, the default policy has to generalize over important task details.
LSTM default policy on the other hand, while being recurrent as the agent, it observes only the previous action a t ´ 1 and does not receive any other state information.
In this instance, the default policy can only model the most likely actions given recent behaviour a 1 , ..a t ´ 1 in absence of any visual stimuli.
For example, if previous actions are moving forward , the default policy might predict moving forward as the next action too.
This is because the agent usually moves consistently in any given direction in order to navigate efﬁciently.
Finally, the vector default policy refers to a default policy that is independent of actions and states (i.e. average behaviour over all possible histories of states and actions).
Using any of the default policies outperforms the baseline, with LSTM default policy slightly underperforming compared with the others.
The vector default policy performs surprisingly well, highlighting that for DMLab deﬁning a meaningful action space is extremely important for solving the task.
Our approach can provide a mechanism for identifying this action space without requiring human expert knowledge on the tasks.
Note in middle plot, ﬁgure 6, that the entropy of the default policy over learning frames goes down, indicating that the default policy becomes peaky and is quite different from the uniform distribution which the baseline assumes.
Note that when running the same experiments with the original human-engineered smaller action space, no gains are observed.
This is similar to the continuous control setup, corresponding to changing the walker to a simple one and hence converting the task into a denser reward one.
Additionally, in ﬁgure 6 right, for the vector default policy, we show the probability of a few actions of interest by marginalizing over all other actions.
We notice that the agent has a tendency of moving forward 70% , while moving backwards is quite unlikely 10% .
The default policy discovers one element of the human deﬁned action space, namely forward-bias which is quite useful for exploring the map.
The uniform bias would put same weight for moving forward as for moving backwards, making exploration harder.
We also note that the agent has a tendency to turn right and look right.
Given that each episode involves navigating a new sampled map, such a bias provides a meaningful exploration boost, as it suggest a following the wall strategy, where at any new intersection the agent always picks the same turning direction (e.g. right) to avoid moving in circles.
But as expected, since neither looking up or looking down provides any advantage, these actions are equally probable.
D ISCUSSION AND C ONCLUSIONS
In this work we studied the inﬂuence of learning the default policy in the KL-regularized RL objective.
Speciﬁcally we looked at the scenario where we enforce information asymmetry between the default policy and the main one.
In the continuous control, we showed empirically that in the case of sparse-reward tasks with complex walkers, there is a signiﬁcant speed-up of learning compared to the baseline.
In addition, we found that there was no signiﬁcant gain in dense-reward tasks and/or with simple walkers.
Moreover, we demonstrated that signiﬁcant gains can be achieved in the discrete action spaces.
We provided evidence that these gains are mostly due to the information asymmetry between the agent and the default policy.
Best results are obtained when the default policy sees only a subset of information, allowing it to learn task-agnostic behaviour.
Furthermore, these default polices can be reused to signiﬁcantly speed-up learning on new tasks.
A KL- REGULARIZED RL AND INFORMATION BOTTLENECK
In this appendix we derive the connection between KL-regularized RL and information bottleneck in detail.
For simplicity we assume that x D t is empty, consider dependence only on current state s t and do not use subscript by t in detailed derivations for notational convenience.
We also apologize for some notational inconsistencies
[Equation]
and will ﬁx them in a later draft
[Equation]
A. M INIMIZING INFORMATION FLOW FROM S t TO A t FOR UNSTRUCTURED POLICIES
The simple formulation of the information bottleneck corresponds to maximizing reward while minimizing the per-timestep information between actions and state (or a subset of state, like the goal):
[Equation] [Equation]
Upper-bounding the mutual information term:
[Equation]
Thus
[Equation]
15) i.e. the problem turns into one of KL-regularized RL.
A. M INIMIZING INFORMATION FLOW FROM S t TO A t FOR POLICIES WITH LATENT VARIABLES
For policies with latent variables such as π p a | s q “
[Equation]
we obtain:
[Equation]
as before.
We choose π 0 p
[Equation]
q
[Equation]
p
[Equation]
|
[Equation]
q
[Equation]
p z q dz , then:
[Equation]
and thus
[Equation]
Therefore:
[Equation]
Thus, the KL regularized objective discussed above can be seen as implementing an information bottleneck.
Different forms of the default policy correspond to restricting the information ﬂow between different components of the interaction history (past states or observations), and to different approximations to the resulting mutual information penalties.
This perspective suggests two different interpretations of the KL regularized objective discussed above: We can see the role of the default policy implementing a way of restricting information ﬂow between (past) states and (future) actions.
An alternative view, more consistent with the analogy between RL and probabilistic modeling invoked above is that of learning a “default” behavior that is independent of some aspect of the state.
(Although the information theoretic view has recently gained more hold in the probabilistic modeling literature, too (e.g. Alemi et al., 2016; 2017)).
B D ISTRIBUTED LEARNING SETUP
We use a distributed off-policy setup similar to Riedmiller et al.
(2018a).
There is one learner and multiple actors.
These are essentially the instantiations of the main agent used for different purposes.
Each actor is the main agent version which receives the copy of parameters from the learner and unrolls the trajectories in the environment, saving it to the replay buffer of ﬁxed size 1 e 6 .
The learner is the agent version which samples a batch of short trajectories windows (window size is deﬁned by unroll length ) from the replay buffer, calculates the gradients and updates the parameters.
The updated parameters are then communicated to the actors.
Such a setup speeds-up learning signiﬁcantly and makes the ﬁnal performance of the policy better.
We compare the performance of on go to moving target task with 1 and 32 actors.
From ﬁgure 7, we see that the effect of the default policy does not disappear when the number of actor decreases to 1, but the learning becomes much slower, noisier and weaker.
[Figure] [Figure]
1e
A v e r a g e e p i s o d e r e t u r n     5 Agent
[Figure]
1e
A v e r a g e e p i s o d e r e t u r n
Baseline
[Figure] [Figure]
C C ONTINUOUS CONTROL : W ALKERS AND TASK DETAILS
Walkers visualization is provided in ﬁgure 8.
Below we give a detaatiled description of each continuous control task we studied.
Walking task .
Type .
Dense-reward feature-based-task
Description .
Each half of the episode, a random direction among 4 (left, right, forward and backwards) is sampled.
Task information is speciﬁed via a one-hot encoding of the required direction.
The walker is required to move in this direction with the target speed v t and receives the reward r .
Reward .
r “ exp ´| v cur ´ v t | 2 .
Technical details .
Target speed, v t “ 3 .
The episode length is 10 seconds.
For the humanoid task we use the absolute head height termination criteria: h ă 0 .
Walls .
Type .
Dense-reward vision-task .
Description .
Walker is required to run through a terrain and avoid the walls.
The task-speciﬁc information is a vision input.
It receives the reward r deﬁned as a difference between the current walker speed v cur and the target speed v t along the direction of the track.
Reward .
r “ exp ´| v cur ´ v t | 2 .
Technical details .
Target speed, v t “ 3 .
The episode length is 45 seconds.
For the humanoid task we use the absolute head height termination criteria: h ă 0 . 9 .
Go to one of K single targets .
Type
Sparse-reward feature-based-task
Description .
On an inﬁnite ﬂoor, there is a ﬁnite area of size 8x8 with K randomly placed targets.
The walker is also randomly placed in a ﬁnite area.
The walker’s initial position is also randomly placed on the ﬁnite area.
The walker is required to one of the K targets, speciﬁed via command vector.
Once it achieves the target, the episode terminates and the walker receives the reward r .
Reward .
r “ 60 .
Technical details .
The episode length is 20 seconds.
Go to one moving target .
Type .
Sparse
-reward feature-based-task
Description .
Similar to the previous one, but there is only one target and once the walker achieves it, the target reappears in a new random place.
The walker receives r for 10 consecutive steps staying on the target before the target reappears in a new random position.
Reward .
r “ 1 .
Technical details .
The episode length is 25 seconds.
Move one box to one of the K targets .
Type .
Sparse-reward feature-based-task
Description .
There is a ﬁnite ﬂoor of size 3x3 padded with walls with K randomly placed targets and one box.
The walker is required to move this box to one of the speciﬁed targets.
Once the box is placed on the target, the episode terminates and the walker receives the reward r .
Reward .
r “ 60 .
Technical details .
The episode length is 30 seconds.
Control timestep is 0.05 for quadruped and 0.025 for jumping ball .
Move one box to one of the K targets and go to another .
Type
Sparse-reward feature-based-task
Description .
Similar to the previous one, but the walker is also required to go to another target (which is different from the one where it must place the box on).
The walker receives the a r task for each task solved, and a r end if it solves both tasks.
The other parameters are the same.
Reward .
r task “ 10 , r end “
Technical
details .
Same
as in the previous task
Foraging in the maze .
Type .
Sparse-reward vision-task .
Description .
There is a maze with 8 apples which walker must collect.
For each apple, it receives reward r .
The episode terminates once the walker collects all the apples or the time is elapsed.
Reward .
r “ 1 .
Technical details .
The episode length is 90 seconds.
Control timestep is 0.025 for jumping ball , and 0.05 for quadruped .
D A LGORITHMS , BASELINE AND HYPERPARAMETERS
Our agents run in off-policy regime sampling the trajectories from the replay buffer.
In practice, it means that the trajectories are coming from the behavior (replay buffer) policy π b , and thus, the correction must be applied (speciﬁed below).
Below we provide architecture details, baselines, hyperparmaeters as well as algorithm details for discrete and continuous control cases.
D. D ISCRETE CASE
In discrete experiments, we use V-trace off-policy correction as in Espeholt et al.
We reuse all the hyperparameters for DMLab from the mentionned paper.
At the top of that, we add default policy network and optimize the corresponding α parameter using population-base training.
The difference with the setup in Espeholt et al.
(2018) is that they use the human prior over actions (table
D.2 in the mentionned paper), which results in 9-dimensional action space.
In our work, we take the rough DMLab action space, consisting of all possible rotations, and moving forward/backward, and "ﬁre" actions.
It results in the action space of dimension 648.
It make the learning much more challenging, as it has to explore in much larger space.
D. C ONTINUOUS CASE
The agent network (see ﬁgure 1) is divided into actor and critic networks without any parameter sharing.
In the case of feature-based-task , the task-speciﬁc information is encoded by one layer MLP with ELU activations.
For the vision-task , we use a 3-layer ResNet He et al.
The encoded task information is then concatenated with the proprioceptive information and passed to the agent network.
The actor network encodes a Gaussian policy, N p ˜ µ, ˜ σ q , by employing a two-layer MLP, with mean µ and log variance log σ as outputs and applying the following processing procedures:
[Equation]
where f is a sigmoid function:
[Equation]
The critic network is a two-layer MLP and a linear readout.
The default policy network has the same structure as actor network, but receives a concatenation of the proprioceptive information with only a subset (potentially, empty) of a task-speciﬁc information.
There is no parameter sharing between the agent and the default policy.
ELU is used as activation everywhere.
The exact actor, critic and default policy network architectures are described below.
We tried to use LSTM for the default policy network instead of MLP, but did not see a difference.
We use separate optimizers and learning rates β π , β Q , β π 0 for the actor, critic and default policy networks correspondingly.
For each network (which we call online ), we also deﬁne the target network, similar to the target Q -networks (Mnih et al., 2015).
The target networks are updated are updated in a slower rate than the online ones by copying their parameters.
We assume that the trajectories are coming from the replay buffer B .
To correct for being off-policy, we make use of the Retrace operator (see Munos et al.
This operator is applied to the Q function essentially introducing the importance weights.
We will note R Q the action for this operator.
Algorithm 2 is an off-policy version with retraced Q function of the initial algorithm 1.
We use the same update period for actor and critic networks, P a and a different period for the default network P d .
The baseline is the agent network (see ﬁgure 1) without the default policy with an entropy bonus λ .
All the hyperparameters of the baseline are tuned for each task.
For each best baseline hyperparameters conﬁguration, we tune the default policy parameters.
When we use the default policy, we do not have the entropy bonus.
Instead, we have a regularisation parameter α .
The other parameteres which we consider are: batch size , unroll length .
Below we provide the hyperparameters for each of the task.
The following default hyperparameters are used unless some particular one is speciﬁed.
Default hyperparameters .
Actor learning rate , β π “ 0 . 0005 .
Critic learning rate , β Q “ 0 . 0005 .
Default policy learning rate , β π 0 “ 0 . 0005 .
Agent target network update period : P a “ 100 .
Default policy target network update period : P d “ 100 .
Actor network : MLP with sizes p 300 , 200 q .
Critic network : MLP with sizes
p 400 , 300 q .
Default policy network : MLP with sizes p 300 , 200 q .
Command encoder network : 1-layer MLP of size 50 .
Image encoder :
ResNet with ﬁlter sizes p 16 , 32 , 32 q .
Gaussian
policy maximum noise : σ max “ 1 . 0 .
Batch size : 512.
Unroll length : 10.
Entropy bonus : λ “ 0 . 0001 .
Regularization constant : α “ 0 . 01 .
Number of actors : 128.
Algorithm online policy: π O,θ O , initial parameters θ O target policy: π T,θ T , initial parameters θ T online default policy: π 0 O,φ O ; initial parameters φ O target default policy: π 0 T,φ T ; initial parameters φ T online Q-function: Q O,ψ O ; initial parameters ψ O target Q-function: Q T,ψ T ; initial parameters ψ T target update period: P replay buffer: B unroll length: K for j=1, ... do
Sample partial trajectory from replay buffer B : τ t : t ` K “ p s t , a t , r t . . .
r t ` K q compute online KL: x KL O,t 1 “ KL r π O p¨| s t 1 q} π 0 O p¨| s t 1 qs compute target KL: x KL T,t 1 “ KL r π O p¨| s t
1 q} π 0 T p¨| s t 1 qs
Estimate boostrap value: ˆ V “ E π T p¨| s t ` K q r Q T p s t ` K , a qs
´
α x KL T,t ` K
Estimate Q targets: ˆ Q t 1 “ r t 1 ` ˆ V
Apply Retrace operator: ˆ Q Rt 1 “ R ˆ Q t
Agent policy loss: ˆ L π “ ř t ` K ´ 1 t 1 “ t
E π O p¨| s t 1 q r Q T p s t 1 , a qs ´ α y KL T,t
Q-value loss: ˆ L Q “ ř t ` K ´ 1 t 1 “ t } ˆ Q
Rt 1 ´ Q
O p s t 1 , a t 1 q}
Default policy loss: ˆ L π 0 “ ř t ` K ´ 1 t 1 “ t x KL O,tθ O Ð θ O ` β π ∇ θ ˆ L π φ O Ð φ O ` β π 0 ∇ φ ˆ L πψ O Ð ψ O ´ β Q ∇ ψ ˆ L Q if j mod P “ 0 then θ T Ð θ O φ
T Ð φ O ψ
T Ð ψ O end if end for
Walking quadruped
Actor network : MLP with sizes p 400 , 300 , 200 q .
Critic network : MLP with sizes p 400 , 400 , 300 q .
default policy network : MLP with sizes p 400 , 300 , 200 q .
Regularization constant : α “ 0 . 0001 .
Number of actors : 256.
Walking humanoid
Entropy bonus : λ “ 0 . 005 .
Regularization constant : α “ 0 . 0001 .
The rest is similar to Walking quadruped .
Walls quadruped
Actor and critic learning rate : β π , β Q “ 5 e ´ 5 .
Batch size : 48.
Regularization constant : α “ 0 . 001 .
Number of actors : 64.
Walls humanoid
Actor and critic learning rate : β π , β Q “ 0 . 0001 .
Batch size : 48.
Regularization constant : α “ 0 . 001 .
Number of actors : 64.
Go to moving target quadruped
Regularization constant : α “ 0 . 006 .
Number of actors : 32.
Go to moving target humanoid
Regularization constant : α “ 0 . 1 .
Go to K targets quadruped
Actor and critic learning rate : β π , β Q “ 0 . 0001 .
default policy target network update period : P d “ 50 .
Regularization constant : α “ 0 . 006 .
Move 1 box to 1 target jumping ball
Default
Move 1 box to 1 target quadruped
Actor and critic learning rate : β π , β Q “ 0 . 0001 .
Move 1 box to one of 2 targets quadruped
Actor and critic learning rate : β π , β Q “ 0 . 0001 .
default policy target network update period : P d “ 50 .
Move 1 box to one of 2 targets with go to another one quadruped
Same as previous task.
Move 1 box to one of 3 targets quadruped
Same as previous task.
Foraging jumping ball
Actor and critic learning rate : β π , β Q “ 0 . 0001 .
Actor network : LSTM with one hidden unit of size 128 .
Critic network : LSTM with one hidden unit of size 128 .
Batch size : 48.
Number of actors : 64.
Foraging quadruped
Unroll length :
Regularization constant
For the Foraging quadruped task, the initial agent did not learn, so we used a slightly different version of the agent.
In algorithm 2, we essentially learn a Q function and update the policy by sampling actions from it and backpropagating through Q .
In this algorithm, we learn a value function
V using V-trace (Espeholt et al., 2018) and the policy is updated using an off-policy corrected policy gradient with empirical returns.
E C ONTINUOUS C ONTROL : A DDITIONAL RESULTS E. D ENSE REWARD TASKS
[Figure]
The results for the dense-reward tasks are given in ﬁgure 9.
We observe little difference of using default policy comparing to the baseline.
In the walls task, we also consider the default policy with global information, such as the orientation, position and speed in the global coordinates.
We do not observe a signiﬁcant difference between using the default policy and the baseline.
The reason for this, we believe, is that the agent is being trained very quickly by seeing a strong reward signal, so the default policy cannot catch it up.
E. S PARSE REWARD JUMPING BALL
The results for the sparse reward tasks with jumping ball are given in ﬁgure 9.
We see little difference of using default policy comparing to the baseline.
Our hypothesis consists in the fact that since the default policy affects the policy by regularizing the state-conditional action distribution (policy), for too simple actions space such is given here (3 actions), this effect is not strong enough.
[Figure]
v e r a g e e p i s o d e r
[Figure]
t
[Figure]
r n
[Figure]
E. S PARSE REWARD WITH QUADRUPED ADDITIONAL RESULTS
In this section
[Figure]
we provide more results for the sparse reward tasks.
In ﬁgure 11 the results for going to one of K targets task with quadruped are presented.
The proprioceptive default policy gives signiﬁcant gains comparing to others.
What interesting is that when the number of targets K increases, the baseline performance drops dramatically, whereas the proprioceptive default policy solve the task reliably.
Our hypothesis is that the default policy learns quickly the default walking behavior which becomes very helpful for the agent to explore the ﬂoor and search for the target.
[Figure]
r a g
[Figure]
p i s o d e r
[Figure]
t u r
[Figure]
We also provide the results for move box to one of K targets task, where K “ 1 , 2 , 3 , and move box to one of two targets task with go to another.
The results are given in ﬁgure 12.
Similar effect occurs here.
[Figure]
p i s o d e r e t u r n
[Figure]
A v e r a g e e p i s o d e r e t u r n
[Figure]
1e
A v e r a g e e p i s o d e r e t u r n
[Figure]
E. A DDITIONAL TRANSFER RESULTS
In this section, we provide additional transfer experiment results for the range of the tasks.
They are given in ﬁgure 13.
In the ﬁrst two cases we see that proprioceptive default policy from the go to target task gives a signiﬁcant boost to the performance comparing to the learning from scratch.
We also observe, that for the box pushing tasks , the default policy with the box position signiﬁcantly speeds up learning comparing to other cases.
We believe it happens because this default policy learns the best default behavior for these tasks possible: going to the box and push it.
For the most complicated task, move one box to one of two targets and go to another one , 13, right, the box default policy makes a big difference: it makes the policy avoid being stuck in go to target behavior (line with reward of 10).
Additional results for the transfer experiments are given in ﬁgure 13.
We observe the same effect happening: whereas the baseline performance drops signiﬁcantly, the agent with default policy stays
E. A BLATION W ALLS QUADRUPED
Ablations for the walls quadruped are given in ﬁgure 14.
[Figure] [Figure]
E. O RDER OF THE DEFAULT POLICY IN THE KL- TERM
The results for having the different order of the default policy in the KL-term ( KL r π || π 0 s or
KL r π 0 || π s ) for go to moving target task with quadruped walker are shown in ﬁgure 15.
We use this term either in per time step actor loss (auxiliary loss) or as a regularizer by optimizing the objective(with different order of KL).
We do not observe signiﬁcant difference.
[Figure]