Learning Representations in Reinforcement Learning:An Information Bottleneck Approach

  • 2019-11-12 02:51:55
  • Pei Yingjun, Hou Xinwen
  • 1

Abstract

The information bottleneck principle is an elegant and useful approach torepresentation learning. In this paper, we investigate the problem ofrepresentation learning in the context of reinforcement learning using theinformation bottleneck framework, aiming at improving the sample efficiency ofthe learning algorithms. %by accelerating the process of discarding irrelevantinformation when the %input states are extremely high-dimensional. Weanalytically derive the optimal conditional distribution of the representation,and provide a variational lower bound. Then, we maximize this lower bound withthe Stein variational (SV) gradient method. We incorporate this framework inthe advantageous actor critic algorithm (A2C) and the proximal policyoptimization algorithm (PPO). Our experimental results show that our frameworkcan improve the sample efficiency of vanilla A2C and PPO significantly.Finally, we study the information bottleneck (IB) perspective in deep RL withthe algorithm called mutual information neural estimation(MINE) . Weexperimentally verify that the information extraction-compression process alsoexists in deep RL and our framework is capable of accelerating this process. Wealso analyze the relationship between MINE and our method, through thisrelationship, we theoretically derive an algorithm to optimize our IB frameworkwithout constructing the lower bound.

 

Quick Read (beta)

Learning Representations in Reinforcement Learning: An Information Bottleneck Approach

Yingjun Pei 1Beijing University of Posts and Telecommunications

[email protected]
   Xinwen Hou 2Institute of Automation, Chinese Academy of Sciences
[email protected]
Abstract

The information bottleneck principle in [25] is an elegant and useful approach to representation learning. In this paper, we investigate the problem of representation learning in the context of reinforcement learning using the information bottleneck framework, aiming at improving the sample efficiency of the learning algorithms. We analytically derive the optimal conditional distribution of the representation, and provide a variational lower bound. Then, we maximize this lower bound with the Stein variational (SV) gradient method (originally developed in [14, 15]). We incorporate this framework in the advantageous actor critic algorithm (A2C)[16] and the proximal policy optimization algorithm (PPO) [21]. Our experimental results show that our framework can improve the sample efficiency of vanilla A2C and PPO significantly. Finally, we study the information bottleneck (IB) perspective in deep RL with the algorithm called mutual information neural estimation(MINE) [3]. We experimentally verify that the information extraction-compression process also exists in deep RL and our framework is capable of accelerating this process. We also analyze the relationship between MINE and our method, through this relationship, we theoretically derive an algorithm to optimize our IB framework without constructing the lower bound.

1 Introduction

In training a reinforcement learning algorithm, an agent interacts with the environment, explores the (possibly unknown) state space, and learns a policy from the exploration sample data. In many cases, such samples are quite expensive to obtain (e.g., requires interactions with the physical environment). Hence, improving the sample efficiency of the learning algorithm is a key problem in RL and has been studied extensively in the literature. Popular techniques include experience reuse/replay, which leads to powerful off-policy algorithms (e.g., [17, 23, 26, 18, 7]), and model-based algorithms (e.g., [11, 12]). Moreover, it is known that effective representations can greatly reduce the sample complexity in RL. This can be seen from the following motivating example: In the environment of a classical Atari game: Seaquest, it may take dozens of millions samples to converge to an optimal policy when the input states are raw images (more than 28,000 dimensions), while it takes less samples when the inputs are 128-dimension pre-defined RAM data[24]. Clearly, the RAM data contain much less redundant information irrelevant to the learning process than the raw images. Thus, we argue that an efficient representation is extremely crucial to the sample efficiency.

In this paper, we try to improve the sample efficiency in RL from the perspective of representation learning using the celebrated information bottleneck framework [25]. In standard deep learning, the experiments in [22] show that during the training process, the neural network first ”remembers” the inputs by increasing the mutual information between the inputs and the representation variables, then compresses the inputs to efficient representation related to the learning task by discarding redundant information from inputs (decreasing the mutual information between inputs and representation variables). We call this phenomena ”information extraction-compression process”(information E-C process). Our experiments shows that, similar to the results shown in [22], we first (to the best of our knowledge) observe the information extraction-compression phenomena in the context of deep RL (we need to use MINE[3] for estimating the mutual information). This observation motivates us to adopt the information bottleneck (IB) framework in reinforcement learning, in order to accelerate the extraction-compression process. The IB framework is intended to explicitly enforce RL agents to learn an efficient representation, hence improving the sample efficiency, by discarding irrelevant information from raw input data. Our technical contributions can be summarized as follows:

  1. 1.

    We observe that the ”information extraction-compression process” also exists in the context of deep RL (using MINE[3] to estimate the mutual information).

  2. 2.

    We derive the optimization problem of our information bottleneck framework in RL. In order to solve the optimization problem, we construct a lower bound and use the Stein variational gradient method developed in [15] to optimize the lower bound.

  3. 3.

    We show that our framework can accelerate the information extraction-compression process. Our experimental results also show that combining actor-critic algorithms (such as A2C, PPO) with our framework is more sample-efficient than their original versions.

  4. 4.

    We analyze the relationship between our framework and MINE, through this relationship, we theoretically derive an algorithm to optimize our IB framework without constructing the lower bound.

Finally, we note that our IB method is orthogonal to other methods for improving the sample efficiency, and it is an interesting future work to incorporate it in other off-policy and model-based algorithms.

2 Related Work

Information bottleneck framework was first introduced in [25]. They solve the framework by iterative Blahut Arimoto algorithm, which is infeasible to apply to deep neural networks. [22] tries to open the black box of deep learning from the perspective of information bottleneck, though the method they use to compute the mutual information is not precise. [2] derives a variational information bottleneck framework, yet apart from adding prior target distribution of the representation distribution P(Z|X), they also assume that P(Z|X) itself must be a Gaussian distribution, which limits the capabilities of the representation function. [20] extends this framework to variational discriminator bottleneck to improve GANs[9], imitation learning and inverse RL.

As for improving sample-efficiency, [17, 26, 18] mainly utilize the experience-reuse. Besides experience-reuse, [23, 8] tries to learn a deterministic policy, [7] seeks to mitigate the delay of off-policy. [11, 12] learn the environment model. Some other powerful techniques can be found in [5].

State representation learning has been studied extensively, readers can find some classic works in the overview [13]. Apart from this overview, [19] shows a theoretical foundation of maintaining the optimality of representation space. [4] proposes a new perspective on representation learning in RL based on geometric properties of the space of value function. [1] learns representation via information bottleneck(IB) in imitation/apprenticeship learning. To the best of our knowledge, there is no work that intends to directly use IB in basic RL algorithms.

3 Preliminaries

A Markov decision process(MDP) is a tuple, (𝒳,𝒜,,𝒫,μ), where 𝒳 is the set of states, 𝒜 is the set of actions, :𝒳×𝒜×𝒳 is the reward function, 𝒫:𝒳×𝒜×𝒳[0,1] is the transition probability function(where P(X|X,a) is the probability of transitioning to state X given that the previous state is X and the agent took action a in X), and μ:𝒳[0,1] is the starting state distribution. A policy π:𝒳𝒫(𝒜) is a map from states to probability distributions over actions, with π(a|X) denoting the probability of choosing action a in state X.

In reinforcement learning, we aim to select a policy π which maximizes K(π)=𝔼τπ[t=0γt(Xt,at,Xt+1)], with a slight abuse of notation we denote (Xt,at,Xt+1)=rt. Here γ[0,1) is a discount factor, τ denotes a trajectory (X0,a0,X1,a1,). Define the state value function as Vπ(X)=𝔼τπ[t=0γtrt|X0=X], which is the expected return by policy π in state X. And the state-action value function Qπ(X,a)=𝔼τπ[t=0γtrt|X0=X,a0=a] is the expected return by policy π after taking action a in state X.

Actor-critic algorithms take the advantage of both policy gradient methods and value-function-based methods such as the well-known A2C[16]. Specifically, in the case that policy π(a|X;θ) is parameterized by θ, A2C uses the following equation to approximate the real policy gradient θK(π)=θJ^(θ):

θJ^(θ)t=0θ[logπ(at|Xt;θ)(Rt-b(Xt))+α2H(π(|Xt))]=t=0θJ^(Xt;θ) (1)

where Rt=i=0γirt+i is the accumulated return from time step t, H(p) is the entropy of distribution p and b(Xt) is a baseline function, which is commonly replaced by Vπ(Xt).

A2C also includes the minimization of the mean square error between Rt and value function Vπ(Xt). Thus in practice, the total objective function in A2C can be written as:

J(θ)t=0logπ(at|Xt;θ)(Rt-Vπ(Xt))-α1Rt-Vπ(Xt)2+α2H(π(|Xt))=t=0J(Xt;θ) (2)

where α1,α2 are two coefficients.

In the context of representation learning in RL, J(Xt;θ)(including Vπ(Xt) and Qπ(Xt,at)) can be replaced by J(Zt;θ) where Zt is a learnable low-dimensional representation of state Xt. For example, given a representation function ZPϕ(|X) with parameter ϕ, define Vπ(Zt;Xt,ϕ)ZtPϕ(|Xt)=Vπ(Xt). For simplicity, we write Vπ(Zt;Xt,ϕ)ZtPϕ(|Xt) as Vπ(Zt).

4 Framework

4.1 Information Bottleneck in Reinforcement Learning

The information bottleneck framework is an information theoretical framework for extracting relevant information, or yielding a representation, that an input X𝒳 contains about an output Y𝒴. An optimal representation of X would capture the relevant factors and compress X by diminishing the irrelevant parts which do not contribute to the prediction of Y. In a Markovian structure XZY where X is the input, Z is representation of X and Y is the label of X, IB seeks an embedding distribution P(Z|X) such that:

P(Z|X) =argmaxP(Z|X)I(Y,Z)-βI(X,Z)=argmaxP(Z|X)H(Y)-H(Y|Z)-βI(X,Z)
=argmaxP(Z|X)-H(Y|Z)-βI(X,Z) (3)

for every X𝒳, which appears as the standard cross-entropy loss11 1 Mutual information I(X,Y) is defined as 𝑑X𝑑ZP(X,Z)logP(X,Z)P(X)P(Z), conditional entropy H(Y|Z) is defined as -𝑑Y𝑑ZP(Y,Z)logP(Y|Z). In a binary-classification problem, -logP(Y|Z)=-(1-Y)log(1-Y^(Z))-Ylog(Y^(Z)). in supervised learning with a MI-regularizer, β is a coefficient that controls the magnitude of the regularizer.

Next we derive an information bottleneck framework in reinforcement learning. Just like the label Y in the context of supervised learning as showed in (3), we assume the supervising signal Y in RL to be the accurate value Rt of a specific state Xt for a fixed policy π, which can be approximated by an n-step bootstrapping function Yt=Rt=i=0n-2γirt+i+γn-1Vπ(Zt+n-1) in practice. Let P(Y|Z) be the following distribution:

P(Yt|Zt)exp(-α(Rt-Vπ(Zt))2) (4)

.This assumption is heuristic but reasonable: If we have an input Xt and its relative label Yt=Rt, we now have Xt’s representation Zt, naturally we want to train our decision function Vπ(Zt) to approximate the true label Yt. If we set our target distribution to be Cexp(-α(Rt-Vπ(Zt))2), the probability decreases as Vπ(Zt) gets far from Yt while increases as Vπ(Zt) gets close to Yt.

For simplicity, we just write P(R|Z) instead of P(Yt|Zt) in the following context.

With this assumption, equation (3) can be written as:

P(Z|X) =argmaxP(Z|X)𝔼X,R,ZP(X,R,Z)[logP(R|Z)]-βI(X,Z)
=argmaxP(Z|X)𝔼XP(X),ZP(Z|X),RP(R|Z)[-α(R-Vπ(Z))2]-βI(X,Z) (5)

The first term looks familiar with classic mean squared error in supervisd learning. In a network with representation parameter ϕ and policy-value parameter θ, policy loss J^(Z;θ) in equation(1) and IB loss in (5) can be jointly written as:

L(θ,ϕ)=𝔼XP(X),ZPϕ(Z|X)[J^(Z;θ)+𝔼R[-α(R-Vπ(Z;θ))2]J(Z;θ)]-βI(X,Z;ϕ) (6)

where I(X,Z;ϕ) denotes the MI between X and ZPϕ(|X). Notice that J(Z;θ) itself is a standard loss function in RL as showed in (2). Finally we get the ultimate formalization of IB framework in reinforcement learning:

Pϕ*(Z|X)=argmaxPϕ(Z|X)𝔼XP(X),ZPϕ(Z|X)[J(Z;θ)]-βI(X,Z;ϕ) (7)

The following theorem shows that if the mutual information I(X,Z) of our framework and common RL framework are close, then our framework is near-optimality.

Theorem 1 (Near-optimality theorem).

Policy πr=πθr, parameter ϕr, optimal policy π=πθ and its relevant representation parameter ϕ are defined as following:

θr,ϕr=argminθ,ϕ𝔼Pϕ(X,Z)[logPϕ(Z|X)Pϕ(Z)-1βJ(Z;θ)] (8)
θ,ϕ=argminθ,ϕ𝔼Pϕ(X,Z)[-1βJ(Z;θ)] (9)

Define Jπr as EPϕr(X,Z)[J(Z;θr)] and Jπ as EPϕ(X,Z)[J(Z;θ)]. Assume that for any ϵ>0, |I(X,Z;ϕ)-I(X,Z;ϕr)|<ϵβ, we have |Jπr-Jπ|<ϵ.

4.2 Target Distribution Derivation and Variational Lower Bound Construction

In this section we first derive the target distribution in (7) and then seek to optimize it by constructing a variational lower bound.

We would like to solve the optimization problem in (7):

maxPϕ(Z|X)𝔼XP(X),ZPϕ(Z|X)[J(Z;θ)-βlogPϕ(Z|X)L1(θ,ϕ)+βlogPϕ(Z)L2(θ,ϕ)] (10)

Combining the derivative of L1 and L2 and setting their summation to 0, we can get that

Pϕ(Z|X)Pϕ(Z)exp(1βJ(Z;θ)) (11)

We provide a rigorous derivation of (11) in the appendix(0.A.2). We note that though our derivation is over the representation space instead of the whole network parameter space, the optimization problem (10) and the resulting distribution (11) are quite similar to the one studied in [15] in the context of Bayesian inference. However, we stress that our formulation follows from the information bottleneck framework, and is mathematically different from that in [15]. In particular, the difference lies in the term L2, which depends on the the distribution Pϕ(ZX) we want to optimize (while in [15], the corresponding term is a fixed prior).

The following theorem shows that the distribution in (11) is an optimal target distribution (with respect to the IB objective L). The proof can be found in the appendix(0.A.3).

Theorem 2.

(Representation Improvement Theorem) Consider the objective function L(θ,ϕ)=EXP(X),ZPϕ(Z|X)[J(Z;θ)]-βI(X,Z;ϕ), given a fixed policy-value parameter θ, representation distribution Pϕ(Z|X) and state distribution P(X). Define a new representation distribution: Pϕ^(Z|X)Pϕ(Z)exp(1βJ(Z;θ)). We have L(θ,ϕ^)L(θ,ϕ).

Though we have derived the optimal target distribution, it is still difficult to compute Pϕ(Z). In order to resolve this problem, we construct a variational lower bound with a distribution U(Z) which is independent of ϕ. Notice that 𝑑ZPϕ(Z)logPϕ(Z)𝑑ZPϕ(Z)logU(Z). Now, we can derive a lower bound of L(θ,ϕ) in (6) as follows:

L(θ,ϕ) =𝔼X,Z[J(Z;θ)-βlogPϕ(Z|X)]+β𝑑ZPϕ(Z)logPϕ(Z)
𝔼X,Z[J(Z;θ)-βlogPϕ(Z|X)]+β𝑑ZPϕ(Z)logU(Z)
=𝔼XP(X),ZPϕ(Z|X)[J(Z;θ)-βlogPϕ(Z|X)+βlogU(Z)]=L^(θ,ϕ) (12)

Naturally the target distribution of maximizing the lower bound is:

Pϕ(Z|X)U(Z)exp(1βJ(Z;θ)) (13)

4.3 Optimization by Stein Variational Gradient Descent

Next we utilize the method in [14][15][10] to optimize the lower bound.

Stein variational gradient descent(SVGD) is a non-parametric variational inference algorithm that leverages efficient deterministic dynamics to transport a set of particles {Zi}i=1n to approximate given target distributions Q(Z). We choose SVGD to optimize the lower bound because of its ability to handle unnormalized target distributions such as (13).

Briefly, SVGD iteratively updates the “particles” {Zi}i=1n via a direction function Φ() in the unit ball of a reproducing kernel Hilbert space (RKHS) :

ZiZi+ϵΦ(Zi) (14)

where Φ*() is chosen as a direction to maximally decrease22 2 In fact, Φ* is chosen to maximize the directional derivative of F(P)=-𝔻KL(P||Q), which appears to be the ”gradient” of F the KL divergence between the particles’ distribution P(Z) and the target distribution Q(Z)=Q^(Z)C(Q^ is unnormalized distribution, C is normalized coefficient) in the sense that

Φargmaxϕ{-ddϵ𝔻KL(P[ϵϕ]||Q)s.t.Φ1} (15)

where P[ϵΦ] is the distribution of Z+ϵΦ(Z) and P is the distribution of Z. [14] showed a closed form of this direction:

Φ(Zi)=𝔼ZjP[𝒦(Zj,Zi)Z^logQ^(Z^)Z^=Zj+Z^𝒦(Z^,Zi)Z^=Zj] (16)

where 𝒦 is a kernel function(typically an RBF kernel function). Notice that C has been omitted.

In our case, we seek to minimize 𝔻KL(Pϕ(|X)||U()exp(1βJ(;θ))C)C=𝑑ZU(Z)exp(1βJ(Z;θ)) , which is equivalent to maximize L^(θ,ϕ), the greedy direction yields:

Φ(Zi)=𝔼ZjPϕ(|X)[𝒦(Zj,Zi)Z^(1βJ(Z^;θ)+logU(Z^))Z^=Zj+Z^𝒦(Z^,Zi)Z^=Zj] (17)

In practice we replace logU(Z^) with ζlogU(Z^) where ζ is a coefficient that controls the magnitude of Z^logU(Z^). Notice that Φ(Zi) is the greedy direction that Zi moves towards L^(θ,ϕ)’s target distribution as showed in (13)(distribution that maximizes L^(θ,ϕ)). This means Φ(Zi) is the gradient of L^(Zi,θ,ϕ): L^(Zi,θ,ϕ)ZiΦ(Zi).

Since our ultimate purpose is to update ϕ, by the chain rule, L^(Zi,θ,ϕ)ϕΦ(Zi)Ziϕ. Then for L^(θ,ϕ)=𝔼Pϕ(X,Z)[L^(Z,θ,ϕ)]:

L^(θ,ϕ)ϕ𝔼XP(X),ZiPϕ(|X)[Φ(Zi)Ziϕ] (18)

Φ(Zi) is given in equation(17). In practice we update the policy-value parameter θ by common policy gradient algorithm since:

L^(θ,ϕ)θ=𝔼Pϕ(X,Z)[J(Z;θ)θ] (19)

and update representation parameter ϕ by (18).

4.4 Verify the information E-C process with MINE

This section we verify that the information E-C process exists in deep RL with MINE and our framework accelerates this process.

Mutual information neural estimation(MINE) is an algorithm that can compute mutual information(MI) between two high dimensional random variables more accurately and efficiently. Specifically, for random variables X and Z, assume T to be a function of X and Z, the calculation of I(X,Z) can be transformed to the following optimization problem:

I(X,Z)=maxT𝔼P(X,Z)[T]-log(𝔼P(X)P(Z)[expT]) (20)

The optimal function T(X,Z) can be approximated by updating a neural network T(X,Z;η).

With the aid of this powerful tool, we would like to visualize the mutual information between input state X and its relative representation Z: Every a few update steps, we sample a batch of inputs and their relevant representations {Xi,Zi}i=1n and compute their MI with MINE, every time we train MINE(update η) we just shuffle {Zi}i=1n and roughly assume the shuffled representations {Zishuffled}i=1n to be independent with {Xi}i=1n:

I(X,Z)maxη1ni=1n[T(Xi,Zi;η)]-log(1ni=1n[expT(Xi,Zishuffled;η)]) (21)

Figure(1) is the tensorboard graph of mutual information estimation between X and Z in Atari game Pong, x-axis is update steps and y-axis is MI estimation. More details and results can be found in appendix(0.A.6) and (0.A.7). As we can see, in both A2C with our framework and common A2C, the MI first increases to encode more information from inputs(”remember” the inputs), then decreases to drop irrelevant information from inputs(”forget” the useless information). And clearly, our framework extracts faster and compresses faster than common A2C as showed in figure(1)(b).

(a) MI in A2C
(b) MI in A2C with our framework
Figure 1: Mutual information visualization in Pong

After completing the visualization of MI with MINE, we analyze the relationship between our framework and MINE. According to [3], the optimal function T* in (20) goes as follows:

expT*(X,Z;η)=CPϕ(X,Z)P(X)Pϕ(Z)s.t.C=𝔼P(X)Pϕ(Z)[expT*] (22)

Combining the result with Theorem(2), we get:

expT*(X,Z;η)=CPϕ(Z|X)Pϕ(Z)exp(1βJ(Z;θ)) (23)

Through this relationship, we theoretically derive an algorithm that can directly optimize our framework without constructing the lower bound, we put this derivation in the appendix(0.A.5).

5 Experiments

In the experiments we show that our framework can improve the sample efficiency of basic RL algorithms(typically A2C and PPO). Other results can be found in last two appendices.

In A2C with our framework, we sample Z by a network ϕ(X,ϵ) where ϵ𝒩(;0,0.1) and the number of samples from each state X is 32, readers are encouraged to take more samples if the computation resources are sufficient. We set the IB coefficient as β=0.001. We choose two prior distributions U(Z) of our framework, the first one is uniform distribution, apparently when U(Z) is the uniform distribution, Z^logU(Z^)Z^=Z can be omitted. The second one is a Gaussian distribution, which is defined as follows: for a given state Xi, sample a batch of {Zji}j=1n=32, then: U(Z)=𝒩(Z;μ=1nj=1nZji,σ2=1nj=1n(Zji-μ)2).

We also set ζ as 0.005Z^1βJ(Z^;θ)/Z^logU(Z^)Z^=Z to control the magnitude of Z^logU(Z^)Z^=Z. Following [15], the kernel function in (17) we used is the Gaussian RBF kernel 𝒦(Zi,Zj)=exp(-Zi-Zj2/h) where h=med2/2log(n+1), med denotes the median of pairwise distances between the particles {Zji}i=1n. As for the hyper-parameters in RL, we simply choose the default parameters in A2C of Openai-baselines. In summary, we implement the following four algorithms:

A2C with uniform SVIB: Use ϕ(X,ϵ) as the embedding function, optimize by our framework(algorithm(0.A.4)) with U(Z) being uniform distribution.

A2C with Gaussian SVIB: Use ϕ(X,ϵ) as the embedding function, optimize by our framework(algorithm(0.A.4)) with U(Z) being Gaussian distribution.

A2C:Regular A2C in Openai-baselines with ϕ(X) as the embedding function.

A2C with noise(For fairness):A2C with the same embedding function ϕ(X,ϵ) as A2C with our framework.

Figure(2)(a)-(e) show the performance of four A2C-based algorithms in 5 gym Atari games. We can see that A2C with our framework is more sample-efficient than both A2C and A2C with noise in nearly all 5 games.

(a) A2C-Pong
(b) A2C-AirRaid
(c) A2C-BeamRider
(d) A2C-Qbert
(e) A2C-SpaceInvaders
(f) PPO-Pong
(g) PPO-Qbert
(h) PPO-Breakout
Figure 2: (a)-(e) show the performance of four A2C-based algorithms, x-axis is time steps(2000 update steps for each time step) and y-axis is the average reward over 10 episodes, (f)-(h) show the performance of four PPO-based algorithms, x-axis is time steps(300 update steps for each time step). We make exponential moving average of each game to smooth the curve(In PPO-Pong, we add 21 to all four curves in order to make exponential moving average). We can see that our framework improves sample efficiency of basic A2C and PPO.

Notice that in SpaceInvaders, A2C with Gaussian SVIB is worse. We suspect that this is because the agent excessively drops information from inputs that it misses some information related to the learning process. There is a more detailed experimental discussion about this phenomena in appendix(0.A.7) . We also implement four PPO-based algorithms whose experimental settings are same as A2C except that we set the number of samples as 26 for the sake of computation efficiency. Results can be found in the in figure(2)(f)-(h).

6 Conclusion

We study the information bottleneck principle in RL: We propose an optimization problem for learning the representation in RL based on the information-bottleneck framework and derive the optimal form of the target distribution. We construct a lower bound and utilize Stein Variational gradient method to optimize it. Finally, we verify that the information extraction and compression process also exists in deep RL, and our framework can accelerate this process. We also theoretically derive an algorithm based on MINE that can directly optimize our framework and we plan to study it experimentally in the future work.

7 Acknowledgement

We thank professor Jian Li for paper writing correction.

References

  • [1] D. Abel, D. Arumugam, K. Asadi, Y. Jinnai, M. L. Littman, and L. L. Wong (2019) State abstraction as compression in apprenticeship learning. In Proceedings of the AAAI Conference on Artificial Intelligence. AAAI Press, pp. 3134–3142. Cited by: §2.
  • [2] A. A. Alemi, I. Fischer, J. V. Dillon, and K. Murphy (2016) Deep variational information bottleneck. In Proceedings of the International Conference on Learning Representations. Cited by: §2.
  • [3] M. I. Belghazi, A. Baratin, S. Rajeswar, S. Ozair, Y. Bengio, A. Courville, and R. D. Hjelm (2018) MINE: mutual information neural estimation. arXiv preprint arXiv:1801.04062. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach, item 1, §1, §4.4.
  • [4] M. G. Bellemare, W. Dabney, R. Dadashi, A. A. Taiga, P. S. Castro, N. L. Roux, D. Schuurmans, T. Lattimore, and C. Lyle (2019) A geometric perspective on optimal representations for reinforcement learning. International Conference on Learning Representations. Cited by: §2.
  • [5] M. Botvinick, S. Ritter, J. X. Wang, Z. Kurth-Nelson, C. Blundell, and D. Hassabis (2019) Reinforcement learning, fast and slow. Trends in cognitive sciences 23 (5), pp. 408–422. Cited by: §2.
  • [6] T. Chen, D. J. Mankowitz, and S. Mannor (2018) Reward constrained policy optimization. arXiv preprint arXiv:1805.11074. Cited by: Proof.
  • [7] L. Espeholt, H. Soyer, R. Munos, K. Simonyan, V. Mnih, T. Ward, Y. Doron, V. Firoiu, T. Harley, and I. Dunning (2018) IMPALA: scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561. Cited by: §1, §2.
  • [8] S. Fujimoto, H. Van Hoof, and D. Meger (2018) Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477. Cited by: §2.
  • [9] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, X. Bing, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio (2014) Generative adversarial nets. In International Conference on Neural Information Processing Systems, pp. 2672–2680. Cited by: §2.
  • [10] T. Haarnoja, H. Tang, P. Abbeel, and S. Levine (2017) Reinforcement learning with deep energy-based policies. Proceedings of the 34th International Conference on Machine Learning 70, pp. 1352–1361. Cited by: §4.3.
  • [11] D. Hafner, T. Lillicrap, I. Fischer, R. Villegas, and J. Davidson (2018) Learning latent dynamics for planning from pixels. International Conference on Machine Learning, pp. 2555–2565. Cited by: §1, §2.
  • [12] L. Kaiser, M. Babaeizadeh, P. Milos, B. Osinski, R. H. Campbell, K. Czechowski, D. Erhan, C. Finn, P. Kozakowski, and S. Levine (2019) Model-based reinforcement learning for atari. arXiv preprint arXiv:1903.00374. Cited by: §1, §2.
  • [13] T. e. Lesort, N. D az-Rodr guez, J. F. o. Goudou, and D. Filliat (2018) State representation learning for control: an overview. Neural Networks 108, pp. S0893608018302053–. Cited by: §2.
  • [14] Q. Liu and D. Wang (2016) Stein variational gradient descent: a general purpose bayesian inference algorithm. Advances in Neural Information Processing Systems 29, pp. 2378–2386. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach, §4.3, §4.3.
  • [15] Y. Liu, P. Ramachandran, Q. Liu, and J. Peng (2017) Stein variational policy gradient. arXiv preprint arXiv:1704.02399. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach, item 2, §4.2, §4.3, §5.
  • [16] V. Mnih, A. P. n. Badia, M. Mirza, A. Graves, and K. Kavukcuoglu (2016) Asynchronous methods for deep reinforcement learning. International Conference on Machine Learning, pp. 1928–1937. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach, §3.
  • [17] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller (2013) Playing atari with deep reinforcement learning. Computer Science. Cited by: §1, §2.
  • [18] O. Nachum, S. Gu, H. Lee, and S. Levine (2018) Data-efficient hierarchical reinforcement learning. Neural Information Processing Systems, pp. 3307–3317. Cited by: §1, §2.
  • [19] O. Nachum, S. Gu, H. Lee, and S. Levine (2018) Near-optimal representation learning for hierarchical reinforcement learning. International Conference on Learning Representations. Cited by: §2.
  • [20] X. B. Peng, A. Kanazawa, S. Toyer, P. Abbeel, and S. Levine (2018) Variational discriminator bottleneck: improving imitation learning, inverse rl, and gans by constraining information flow. International Conference on Learning Representations. Cited by: §2.
  • [21] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov (2017) Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach.
  • [22] R. Shwartz-Ziv and N. Tishby (2017) Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810. Cited by: §0.A.6, §1, §2.
  • [23] D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra, and M. Riedmiller (2014) Deterministic policy gradient algorithms. In International Conference on Machine Learning, pp. 387–395. Cited by: §1, §2.
  • [24] J. Sygnowski and H. Michalewski (2016) Learning from the memory of atari 2600. arXiv preprint arXiv:1605.01335. Cited by: §1.
  • [25] N. Tishby, F. C. Pereira, and W. Bialek (2000) The information bottleneck method. University of Illinois 411 (29-30), pp. 368–377. Cited by: Learning Representations in Reinforcement Learning: An Information Bottleneck Approach, §1, §2.
  • [26] H. Van Hasselt, A. Guez, and D. Silver (2015) Deep reinforcement learning with double q-learning. Computer ScienceInternational Conference on Machine Learning, pp. 2094–2100. Cited by: §1, §2.

Appendix 0.A Appendix

0.A.1 Proof of Theorem 1

Theorem.

(Theorem 1 restated)Policy πr=πθr, parameter ϕr, optimal policy π=πθ and its relevant representation parameter ϕ are defined as following:

θr,ϕr=argminθ,ϕ𝔼Pϕ(X,Z)[logPϕ(Z|X)Pϕ(Z)-1βJ(Z;θ)] (24)
θ,ϕ=argminθ,ϕ𝔼Pϕ(X,Z)[-1βJ(Z;θ)] (25)

Define Jπr as EPϕr(X,Z)[J(Z;θr)] and Jπ as EPϕ(X,Z)[J(Z;θ)]. Assume that for any ϵ>0, |I(X,Z;ϕ)-I(X,Z;ϕr)|<ϵβ, we have |Jπr-Jπ|<ϵ. Specifically, in value-based algorithm, this theorem also holds between expectation of two value functions.

Proof.

From equation(24) we can get:

I(X,Z;ϕ)-1βJπI(X,Z;ϕr)-1βJπr (26)

From equation(25) we can get:

-1βJπr-1βJπ (27)

These two equations give us the following inequality:

β(I(X,Z;ϕ)-I(X,Z;ϕr))Jπ-Jπr0 (28)

According to the assumption, naturally we have:

|Jπr-Jπ|<ϵ (29)

Notice that if we use our IB framework in value-based algorithm, then the objective function Jπ can be defined as:

Jπ=Vπ =(1-γ)-1X𝑑Xdπ(X)Rπ(X)
=(1-γ)-1X𝑑Xdπ(X)[Z𝑑ZPϕ(Z|X)Rπ(Z)] (30)

where Rπ(Z)=X{X:ϕ(X)=Z}𝑑XRπ(X) and dπ is the discounted future state distribution, readers can find detailed definition of dπ in the appendix of [6]. We can get:

|Vπr-Vπ|<ϵ (31)

0.A.2 Target Distribution Derivation

We show the rigorous derivation of the target distribution in (11).

Denote P as the distribution of X, PϕZ(Z)=Pϕ(Z) as the distribution of Z. We use Pϕ as the short hand notation for the conditional distribution Pϕ(Z|X). Moreover, we write L(θ,ϕ)=L(θ,Pϕ) and p,qX = 𝑑Xp(X)q(X). Notice that PϕZ(Z)=P(),Pϕ(Z|)X. Take the functional derivative with respect to Pϕ of the first term L1:

δL1(θ,Pϕ)δPϕ,ΦXZ =𝑑Z𝑑XδL1(θ,Pϕ(Z|X))δPϕ(Z|X)Φ(Z,X)=[ddϵL1(θ,Pϕ+ϵΦ)]ϵ=0
=[ddϵdXP(X)Pϕ(|X)+ϵΦ(,X),J(;θ)-βlog(Pϕ(|X)+ϵΦ(,X))Z]ϵ=0
=dXP(X)[Φ(,X),J(;θ)-βlogPϕ(|X)+Pϕ(|X),-βΦ(,X)Pϕ(|X)Z]
=P()[J(;θ)-βlogPϕ(|)-β],Φ(,)XZ

Hence, we can see that

δL1(θ,Pϕ)δPϕ(Z|X)=P(X)[J(Z;θ)-βlogPϕ(Z|X)-β].

Then we consider the second term. By the chain rule of functional derivative, we have that

δL2(θ,Pϕ)δPϕ(Z|X) =δL2(θ,Pϕ)δPϕZ(),δPϕZ()δPϕ(Z|X)Z^=β1+logPϕZ(),δPϕZ()δPϕ(Z|X)Z^
=β𝑑Z^(1+logPϕZ(Z^))δ(Z^-Z)P(X)=βP(X)(1+logPϕZ(Z)) (32)

Combining the derivative of L1 and L2 and setting their summation to 0, we can get that

Pϕ(Z|X)Pϕ(Z)exp(1βJ(Z;θ)) (33)

0.A.3 Proof of Theorem 2

Theorem.

(Theorem 2 restated)For L(θ,ϕ)=EXP(X),ZPϕ(Z|X)[J(Z;θ)]-βI(X,Z;ϕ), given a fixed policy-value parameter θ, representation distribution Pϕ(Z|X) and state distribution P(X), define a new representation distribution:Pϕ^(Z|X)Pϕ(Z)exp(1βJ(Z;θ)), we have L(θ,ϕ^)L(θ,ϕ).

Proof.

Define I(X) as:

I(X)=Z𝑑ZPϕ^(Z|X)=Z𝑑ZPϕ(Z)exp(1βJ(Z;θ)) (34)
L(θ,ϕ^) =𝔼X{𝔼ZPϕ^(Z|X)[J(Z;θ)]-β𝔼ZPϕ^(Z|X)[logPϕ(Z)exp(1βJ(Z;θ))I(X)Pϕ^(Z)]}
=𝔼X{β𝔼ZPϕ^(Z|X)[logI(X)]-β𝔼ZPϕ^(Z|X)[logPϕ(Z)Pϕ^(Z)]}
=β𝔼X[logI(X)]-β𝔼X,ZPϕ^(X,Z)[logPϕ(Z)Pϕ^(Z)]
=β𝔼X[logI(X)]-β𝔼ZPϕ^(Z)[logPϕ(Z)Pϕ^(Z)]
=β𝔼XP(X)[logI(X)]+β𝔻KL(Pϕ^(Z)||Pϕ(Z)) (35)
L(θ,ϕ) =𝔼X{β𝔼ZPϕ(Z|X)[logexp(1βJ(Z;θ))]+β𝔼ZPϕ(Z|X)logPϕ(Z)Pϕ(Z|X)}
=𝔼X{β𝔼ZPϕ(Z|X)[logPϕ(Z)exp(1βJ(Z;θ))Pϕ(Z|X)I(X)]+βlogI(X)}
=β𝔼X[logI(X)]+β𝔼XP(X),ZPϕ(Z|X)[logPϕ^(Z|X)Pϕ(Z|X)]
=β𝔼XP(X)[logI(X)]-β𝔼XP(X)[𝔻KL(Pϕ(Z|X)||Pϕ^(Z|X))] (36)
L(θ,ϕ^) -L(θ,ϕ)=β𝔻KL(Pϕ^(Z)||Pϕ(Z))+β𝔼XP(X)[𝔻KL(Pϕ(Z|X)||Pϕ^(Z|X))] (37)

According to the positivity of the KL-divergence, we have L(θ,ϕ^)L(θ,ϕ).

0.A.4 Algorithm

{algorithm}

Information-bottleneck-based state abstraction in RL \[email protected]@algorithmic \STATEθ,ϕ initialize network parameters \STATEβ,ζ initialize hyper-parameters in (17) \STATEϵ learning rate \STATEM number of samples from Pϕ(|X) \REPEAT\STATEDraw a batch of data {Xt,at,Rt,Xt+1}t=1n from environment \FOReach Xt{Xt}t=1n \STATEDraw M samples {Zit}i=1M from Pϕ(|Xt) \ENDFOR\STATEGet the batch of data 𝒟={Xt,{Zit}i=1M,at,Rt,Xt+1}t=1n \STATECompute the representation gradients ϕL(θ,ϕ) in 𝒟 according to (18) \STATECompute the RL gradients θL(θ,ϕ) in 𝒟 according to (19) \STATEUpdate ϕ: ϕϕ+ϵϕL(θ,ϕ) \STATEUpdate θ: θθ+ϵθL(θ,ϕ) \UNTILConvergence

0.A.5 Integrate MINE to our framework

MINE can also be applied to the problem of minimizing the MI between Z and X where Z is generated by a neural network Pϕ(|X):

I(X,Z)=minϕmaxη𝔼Pϕ(X,Z)[T(X,Z;η)]-log(𝔼P(X)Pϕ(Z)[expT(X,Z;η)]) (38)

Apparently I(X,Z) is 0 without any constraints, yet if we use MINE to optimize our IB framework in (6), I(X,Z) might not be 0. With the help of MINE, like what people did in supervised learning, the objective function in (6) can be written as:

L(θ,ϕ,η)= minη{𝔼Pϕ(X,Z)[J(Z;θ)]RL loss term-β𝔼Pϕ(X,Z)[T(X,Z;η)]
+βlog(𝔼P(X)Pϕ(Z)[expT(X,Z;η)])} (39)

The key steps to optimize L(θ,ϕ,η) is to update θ,ϕ,η iteratively as follows:

ηt+1argminηt-𝔼Pϕt(X,Z)[T(X,Z;ηt)]+log(𝔼P(X)Pϕt(Z)[expT(X,Z;ηt)])mutual information term (40)
θt+1,ϕt+1argmaxθt,ϕtL(θt,ϕt,ηt+1) (41)

Yet in our experiment, these updates of θ,ϕ,η did not work at all. We suspect it might be caused by the unstability of T(X,Z;η). We have also found that the algorithm always tends to push parameter ϕ to optimize the mutual information term to 0 regardless of the essential RL loss J(Z;θ): In the early stage of training process, policy π is so bad that the agent is unable to get high reward, which means that the RL loss is extremely hard to optimize. Yet the mutual information term is relatively easier to optimize. Thus the consequence is that these updates tend to push parameter ϕ to optimize the mutual information term to 0 in the early training stage.

However, MINE’s connection with our framework makes it possible to optimize T(X,Z;η) in a more deterministic way and put the RL loss into mutual information term.

According to equation(23), T(X,Z;η)=1βJ(Z;θ)+C, this implies that we could introduce another function T^ in place of T(X,Z;η) for the sake of variance reduction:

T(X,Z;η)1βJ(Z;θ)+T^(X,Z;η) (42)

in the sense that parameter η only needs to approximate the constant C(T), the optimization steps turn out to be:

θt+1,ϕt+1,ηt+1 argmaxθt,ϕtargminηt{-β𝔼Pϕt(X,Z)[T^(X,Z;ηt)]+
βlog(𝔼P(X)Pϕt(Z)[expT^(X,Z;ηt)+1βJ(Z;θt)])} (43)

This algorithm has the following three potential advantages in summary:

  1. 1.

    We’re able to optimize T(X,Z;η) in a more deterministic way instead of the form like equation(40), which is hard to converge in reinforcement learning.

  2. 2.

    We prevent excessive optimization in mutual information term by putting RL loss J(Z;θ) into this term.

  3. 3.

    We’re able to directly optimize the IB framework without constructing a variational lower bound.

Here we just analyze and derive this algorithm theoretically, implementation and experiments will be left as the future work.

Notice that we say if we directly optimize our IB framework with MINE, one of the problems is that the function T might be unstable in RL, yet in section(4.4) and experiments(0.A.6), we directly use MINE to visualize the MI. This is because when we optimize our framework, we need to start to update T every training step. While when we visualize the MI, we start to update T every 2000 training steps. Considering the computation efficiency, every time we start to update T when we use MINE to optimize our framework, we must update T in one step or a few steps. While when visualizing the MI, we update T in 256 steps. Besides, we reset parameter η every time we begin to update T when we visualize the MI, clearly we can’t do this when optimizing our framework since it’s a min-max optimization problem.

0.A.6 Study the information-bottleneck perspective in RL

Now we introduce the experimental settings of MI visualization. And we show that the agent in RL usually tends to follow the information E-C process.

We compare the MI(I(X,Z)) between A2C and A2C with our framework. Every 2000 update steps(2560 frames each step), we re-initialize the parameter η, then sample a batch of inputs and their relevant representations {Xi,Zi=ϕ(Xi,ϵ)}i=1n,n=64, and compute the MI with MINE. The learning rate of updating η is same as openai-baselines’ A2C: 0.0007, training steps is 256 and the network architecture can be found in our code file ”policy.py”.

Figure(3) is the MI visualization in game Qbert. Note that there is a certain degree of fluctuations in the curve. This is because that unlike supervised learning, the distribution of datasets and learning signals Rπ(X) keep changing in reinforcement learning: Rπ(X) changes with policy π and when π gets better, the agent might find new states, in this case, I(X,Z) might increase again because the agent needs to encode information from new states in order to learn a better policy. Yet finally, the MI always tends to decrease. Thus we can say that the agent in RL usually tends to follow the information E-C process.

(a) MI in A2C
(b) MI in A2C with our framework
Figure 3: Mutual information visualization in Qbert. As policy π gets better, the agent might find new states, in this case, I(X,Z) might increase again because the agent needs to encode information from new states in order to learn a better policy. Yet finally, the MI always tends to decrease. Thus it follows the information E-C process.

We argue that it’s unnecessary to compute I(Z,Y) like [22]: According to (3), if the training loss continually decreases in supervised learning(Reward continually increases as showed in figure(2)(a) in reinforcement learning), I(Z,Y) must increase gradually.

We also add some additional experimental results of MI visualization in the appendix(0.A.7).

0.A.7 Additional experimental results of performance and MI visualization

This section we add some additional experimental results about our framework.

Notice that in game MsPacman, performance of A2C with our framework is worse than regular A2C. According to the MI visualization of MsPacman in figure(5)(b), we suspect that this is because A2C with our framework drops the information from inputs so excessively that it misses some information relative to the learning process. To see it accurately, in figure(5)(b), the orange curve, which denotes A2C with our framework, from step(x-axis) 80 to 100, suddenly drops plenty of information. Meanwhile, in figure(4)(b), from step(x-axis) 80 to 100, the rewards of orange curve start to decrease.

As showed in figure(6), unlike Pong, Breakout, Qbert and some other shooting games, the frame of MsPacman contains much more information related to the reward: The walls, the ghosts and the tiny beans everywhere. Thus if the agent drops information too fast, it may hurt the performance.

(a) A2C-Assault
(b) A2C-MsPacman
(c) A2C-Breakout
Figure 4: Additional results of performance: Average rewards over 10 episodes
(a) MI in Assault
(b) MI in MsPacman
Figure 5: Additional results of MI visualization
(a) MsPacman
Figure 6: The raw frame of MsPacman