SandHouse
Pages and contents

DeepMDP

https://proceedings.mlr.press/v97/gelada19a/gelada19a.pdf 2019

Problem
High-dimensional RL observations often contain much more information than is actually necessary for control. An Atari frame may contain tens of thousands of pixels even though the behaviorally relevant state may be described by only a few variables. The goal is therefore to learn an embedding Ο•(s) that compresses the original state while preserving the information necessary to make good decisions.

Classical state abstraction and bisimulation give principled definitions of which states may be treated as equivalent, but are difficult to scale to high-dimensional observations and neural function approximation. DeepMDP proposes a continuous latent MDP that can be learned with gradient descent. Rather than reconstructing observations, the representation is trained to preserve reward and transition dynamics, which are exactly the quantities needed for predicting value.

Method

Latent MDP

Begin with the original MDP

β„³=⟨S,A,R,P,γ⟩

and construct a latent MDP

β„³β€Ύ=⟨Sβ€Ύ,A,Rβ€Ύ,Pβ€Ύ,γ⟩

together with an embedding

Ο•:Sβ†’Sβ€ΎβŠ†β„D

The original and latent MDPs share the same action space. A state s is first compressed into Ο•(s) , and the latent MDP attempts to reproduce the reward and transition behavior of the original environment.

The central idea is that Ο• should not preserve every detail of s . It only needs to preserve distinctions that matter for reward and future dynamics.

Reward Prediction Loss

The latent reward model Rβ€Ύ should predict the reward of the original MDP:

LRβ€Ύ(s,a)=|R(s,a)βˆ’Rβ€Ύ(Ο•(s),a)|

If this loss is small, the latent representation preserves information necessary for predicting immediate reward.

Transition Prediction Loss

The latent transition model Pβ€Ύ should also predict the distribution of the next latent state.

The true environment generates

sβ€²βˆΌP(β‹…βˆ£s,a)

which can then be embedded as Ο•(sβ€²) . This induces the pushed-forward distribution Ο•P(β‹…βˆ£s,a) over latent states.

The transition loss compares this distribution with the transition distribution predicted directly by the latent MDP:

LPβ€Ύ(s,a)=W(Ο•P(β‹…βˆ£s,a),Pβ€Ύ(β‹…βˆ£Ο•(s),a))

where W is the Wasserstein distance.

Thus the complete learning objective encourages

R(s,a)β‰ˆRβ€Ύ(Ο•(s),a)

and

Ο•P(β‹…βˆ£s,a)β‰ˆPβ€Ύ(β‹…βˆ£Ο•(s),a)

The representation is therefore trained around controlled consequences, not pixel reconstruction.

Wasserstein Distance

The Wasserstein-1 distance measures how different two probability distributions are while respecting the geometry of their state space:

Wd(P,Q)=infΞ»βˆˆΞ“(P,Q)⁑∫d(x,y)Ξ»(x,y),dx,dy

where Ξ“(P,Q) is the set of couplings between P and Q .

One useful property is that for a K \-Lipschitz function f ,

|𝔼x∼P[f(x)]βˆ’π”Όy∼Q[f(y)]|≀KW(P,Q)

This is important because value functions are expectations over future rewards. If transition distributions are close under Wasserstein distance and the value function is sufficiently smooth, then their expected future values must also be close.

Lipschitz MDPs

The theoretical guarantees assume the latent MDP has smooth rewards and transitions. A (KR,KP) \-Lipschitz MDP satisfies

|R(s1,a)βˆ’R(s2,a)|≀KRd(s1,s2)

and

W(P(β‹…βˆ£s1,a),P(β‹…βˆ£s2,a))≀KPd(s1,s2)

Nearby latent states should therefore have similar rewards and similar future transition distributions.

Under suitable assumptions, the optimal value function is also Lipschitz, with approximately

KV≀KR1βˆ’Ξ³KP

This connects geometric distance in the learned latent space to differences in value.

Value Preservation

A central result is that small DeepMDP losses imply that values computed in the latent MDP approximate values in the original MDP.

For a sufficiently smooth policy,

|QΟ€(s,a)βˆ’Qβ€ΎΟ€(Ο•(s),a)|≀LRβ€Ύβˆž+Ξ³KVLPβ€Ύβˆž1βˆ’Ξ³

where LRβ€Ύβˆž and LPβ€Ύβˆž are the maximum reward and transition errors.

The interpretation is straightforward:

accurate reward model+accurate latent dynamics⇒accurate values

The transition error matters in proportion to how sensitive the future value function is to changes in latent state.

Representation Quality

The same result gives a reason why the learned embedding is a useful state representation.

For two original states s1 and s2 ,

|QΟ€(s1,a)βˆ’QΟ€(s2,a)|≀KV|Ο•(s1)βˆ’Ο•(s2)|2+2(LRβ€Ύβˆž+Ξ³KVLPβ€Ύβˆž)1βˆ’Ξ³

If the DeepMDP losses are close to zero, states that map to nearby latent vectors must have similar values.

In the ideal case,

Ο•(s1)=Ο•(s2)β‡’QΟ€(s1,a)=QΟ€(s2,a)

for the policies covered by the theory.

This prevents the representation from collapsing behaviorally distinct states into the same latent state.

Policy Suboptimality

The latent MDP can also be solved directly. Let Ο€β€Ύβˆ— be the optimal policy in the learned DeepMDP. Its performance when executed in the original MDP is bounded by the DeepMDP modeling errors:

Vβˆ—(s)βˆ’VΟ€β€Ύβˆ—(s)≀2LRβ€Ύβˆž+Ξ³KVLPβ€Ύβˆž1βˆ’Ξ³

Thus, if the latent reward and transition models are accurate, solving the compressed MDP produces approximately optimal behavior in the original environment.

Local DeepMDP Losses

The global losses require accurate modeling everywhere in the state-action space, which is unrealistic in large environments.

The authors therefore define local losses under some state-action distribution ΞΎ :

LRβ€ΎΞΎ=𝔼s,a∼ξ[|R(s,a)βˆ’Rβ€Ύ(Ο•(s),a)|]
LPβ€ΎΞΎ=𝔼s,a∼ξ[W(Ο•P(β‹…βˆ£s,a),Pβ€Ύ(β‹…βˆ£Ο•(s),a))]

These can be estimated from sampled transitions and optimized with SGD.

The resulting guarantee is local as well: the DeepMDP accurately represents values in regions of state-action space frequently visited by the policy. It does not necessarily provide guarantees for states the agent rarely encounters.

This makes the practical objective approximately

β„’DeepMDP=β„’reward+Ξ»β„’transition

alongside the normal RL loss.

Connection to Bisimulation

DeepMDP is closely connected to bisimulation.

Two states s1 and s2 are bisimilar if, for every action, they have the same reward and transition into the same equivalence classes:

R(s1,a)=R(s2,a)
P(G∣s1,a)=P(G∣s2,a)βˆ€G∈S/B

Bisimulation metrics relax the binary equivalence relation into a continuous measure of behavioral difference:

d∼(s1,s2)=maxa⁑[(1βˆ’Ξ³)|R(s1,a)βˆ’R(s2,a)|+Ξ³Wd∼(P(β‹…βˆ£s1,a),P(β‹…βˆ£s2,a))]

So two states are close when they produce similar rewards and transition into states that are themselves close.

DeepMDP effectively learns a continuous geometry |Ο•(s1)βˆ’Ο•(s2)| whose structure is related to this bisimulation metric. It replaces explicit computation of bisimulation over the original state space with tractable neural reward and latent-transition prediction losses.

Practical Implementation

For deterministic environments, the Wasserstein transition loss simplifies substantially. If the next state is deterministic, the authors use

LPβ€Ύ(s,a)=|Ο•(sβ€²)βˆ’Pβ€Ύ(Ο•(s),a)|2

where sβ€² is the observed successor state.

In Atari, DeepMDP is not actually used for planning. Instead, the reward and transition objectives are auxiliary losses added to a C51 model-free RL agent. The encoder Ο• is shared between the RL objective and DeepMDP losses.

The authors compare this against reconstructing the current observation, predicting the next observation, and predicting future value logits. Predicting the next latent state performs better in their experiments. Their interpretation is that reconstructing pixels forces the representation to retain information that may be visually important but irrelevant for control.


The theoretical results rely on fairly strong smoothness assumptions. In particular, the transition dynamics are assumed to have a sufficiently small Lipschitz constant, roughly KP<1/Ξ³, so nearby states cannot rapidly develop very different futures. The authors acknowledge that this assumption is restrictive. Computing and differentiating the Wasserstein distance between stochastic transition distributions is also difficult; their experiments avoid much of this problem by assuming deterministic transitions. The local guarantees only apply to regions frequently visited by the policy, meaning poor exploration can leave important portions of the environment badly represented.

DeepMDP is closely related to classical bisimulation metrics, which define behavioral similarity through reward and transition equivalence, but converts that principle into losses compatible with deep neural networks. It also relates to latent world models, successor features, value prediction networks, and representation-learning auxiliary tasks. Unlike autoencoder-style world models, DeepMDP explicitly avoids requiring reconstruction of the original observation. The paper itself uses the latent dynamics only as an auxiliary representation-learning objective rather than for planning, and identifies model-based planning, exploration, different action spaces, and hierarchical latent models as future directions.