Seyed Masoud Hosseini · Overview · Study log · Weekly summaries · Ideas · Search · Transcript · RSS feed

Deep Reinforcement Learning · Lecture 95 of 99 · 13:26

Lecture 22, Part 5: Meta-RL as Partially Observed MDPs

CS 285: Lecture 22, Part 5: Transfer Learning & Meta-Learning on YouTube

Study guide

What this lecture covers

This closing segment on meta-reinforcement learning reframes everything covered so far as a single unifying problem: solving a partially observed MDP (POMDP) in which the hidden state includes an unknown task variable Z. Once you accept that the policy needs to act on s and Z, and that Z must be inferred from a history of states, actions and rewards, meta-learning becomes a special case of POMDP solving, solvable by explicit state estimation or memory-based policies.

The lecture introduces PEARL, a method that trains a variational encoder to infer a distribution over Z from experience and explores by sampling from that posterior, connecting to the earlier discussion of posterior sampling in exploration. It then closes the meta-RL unit by comparing the three perspectives covered across this lecture series (RNN-based, gradient-based, and inference-based) and discusses emergent phenomena linking meta-RL to cognitive science.

Key ideas

  • Meta-RL as a POMDP: augmenting the state with an unobserved task variable Z turns solving new tasks into standard POMDP inference: infer Z from history, then act.
  • Two ways to handle partial observability: explicit state estimation (estimating a distribution over Z) or memory-based policies (the RNN approach from earlier parts).
  • PEARL algorithm: trains a policy conditioned on state and Z, plus an inference network that predicts Z from a history of transitions, using variational inference similar to a variational autoencoder.
  • Exploration via posterior sampling: PEARL explores by sampling a Z from its current belief, acting as if that Z were correct, and updating its belief as more data arrives, echoing posterior sampling from the exploration lectures.
  • Simple permutation-invariant encoder: PEARL's encoder featurizes each transition independently and averages the features, which works because value-based learning does not depend on transition order.
  • Sub-optimality of posterior sampling: this exploration strategy is good but not optimal, since a single well-planned sweep can sometimes find the goal faster than repeated posterior sampling.
  • Unifying the three meta-RL perspectives: the RNN approach, gradient-based (MAML) approach, and inference-based approach are all instances of the same F_theta(M_i) template, differing mainly in architecture and whether adaptation is a forward pass, a gradient step, or posterior inference.
  • Trade-offs between approaches: RNNs are simple but prone to meta-overfitting with no recourse at test time; gradient-based methods extrapolate well with more test-time gradient steps but are harder to apply beyond policy gradients; inference-based methods give elegant exploration but share the overfitting risk.

Walkthrough

Meta-RL as a partially observed MDP (0:00)

The lecture recaps POMDPs and argues that conditioning a policy on state and an unknown context Z is exactly the POMDP problem: the augmented state includes Z, but only s and the reward are observed. Solving this modified POMDP is shown to be equivalent to meta-learning.

PEARL: variational inference for task context (5:00)

PEARL trains a policy conditioned on s and Z alongside an inference network that predicts a posterior over Z from a history of transitions, using variational inference to maximize expected post-adaptation reward while keeping the posterior close to a prior. Because the encoder is stochastic, sampling Z from it provides a natural, if sometimes sub-optimal, exploration strategy, illustrated with a 2D point-mass task where the agent searches a semicircle of possible goals.

Encoder design and training (8:00)

A simple permutation-invariant encoder, averaging featurized transitions, is shown to work well because off-policy value-based learning treats transitions independently. PEARL is meta-trained with an off-policy actor-critic algorithm such as soft actor-critic, updating the encoder alongside the policy using sampled histories from a replay buffer.

Comparing the three perspectives on meta-RL (9:00)

The lecture closes by comparing the RNN-based, gradient-based, and inference-based approaches as different architectural instantiations of the same F_theta(M_i) framework, discussing their relative strengths around meta-overfitting, extrapolation at test time, and ease of optimization, and noting that a stochastic version of MAML starts to resemble the inference-based approach.

Emergent phenomena and cognitive science connections (12:02)

The lecture ends by connecting meta-RL to cognitive science, noting research showing that meta-RL training can give rise to emergent behaviors resembling episodic recall, model-based adaptation, and even causal reasoning, even when the meta-learning algorithm itself was not designed to produce those specific behaviors.

Before you watch

  • Watch Parts 2 through 4 of this lecture, which introduce the RNN-based and gradient-based meta-RL approaches that this segment unifies.
  • Review the posterior sampling exploration strategy from the exploration lectures, since PEARL's exploration mechanism builds directly on it.
  • Familiarity with variational inference and variational autoencoders helps with the PEARL training objective.

Check your understanding

  1. How does framing meta-RL as a POMDP unify the RNN-based and inference-based approaches?
  2. Why does PEARL's encoder average featurized transitions rather than processing them sequentially like an RNN?
  3. In what sense is posterior sampling exploration sub-optimal, as illustrated by the point-mass example?
  4. What are the relative trade-offs between the RNN-based, gradient-based, and inference-based meta-RL approaches discussed at the end of the lecture?

Vocabulary

unify (verb)
To bring several separate ideas together under one shared framework.
The lecture unifies three meta-RL approaches as one framework.
state estimation (noun)
The process of inferring a hidden state from available observations.
Explicit state estimation infers a distribution over the task variable.
PEARL (noun)
A meta-RL algorithm that infers a task variable using a variational encoder.
PEARL explores by sampling from its belief about the task.
posterior sampling (noun)
An exploration strategy that samples a belief and acts as if it were true.
Posterior sampling picks a plausible task and commits to it briefly.
permutation-invariant (adjective)
Giving the same result no matter what order the inputs are processed in.
PEARL's encoder is permutation-invariant across transitions.
sub-optimal (adjective)
Not the best possible option available.
Posterior sampling exploration is good but sub-optimal.
overfitting (noun)
Learning patterns too specific to training data that fail to generalize.
Meta-overfitting can hurt performance on new tasks.
cognitive science (noun)
The scientific study of the mind and how it processes information.
Meta-RL connects to ideas from cognitive science.
causal reasoning (noun)
Understanding cause-and-effect relationships between events.
Meta-RL training can give rise to causal reasoning behavior.
partially observed (adjective)
Describing a system where only some of the true state is visible.
Meta-RL is framed as solving a partially observed MDP.
hidden state (noun)
A part of a system's true state that cannot be directly seen.
The unknown task variable Z is part of the hidden state.
variational encoder (noun)
A network trained to output a probability distribution over a hidden variable.
PEARL trains a variational encoder to infer Z.
replay buffer (noun)
A stored collection of past experience used to train a policy again later.
PEARL samples histories from a replay buffer.
actor-critic (noun)
An RL method that trains a policy (actor) alongside a value estimator (critic).
PEARL is meta-trained with an off-policy actor-critic algorithm.
off-policy (adjective)
Describes learning from data collected by a policy different from the current one.
PEARL uses off-policy value-based learning.
belief (noun)
A probability distribution representing current uncertainty about a hidden variable.
PEARL samples a Z from its current belief and updates it over time.
emergent (adjective)
Arising naturally from a system without being directly designed in.
Meta-RL training produces emergent behaviors like episodic recall.
template (noun)
A general pattern or structure that specific cases follow.
All three approaches are instances of the same F_theta template.
recourse (noun)
An option available to fix a problem when it occurs.
RNNs have no recourse for meta-overfitting at test time.
elegant (adjective)
Pleasingly simple and effective in design.
The inference-based approach gives elegant exploration.
sweep (noun)
A single complete pass through a search or planning process.
A well-planned sweep can sometimes find the goal faster than sampling.
extrapolate (verb)
To go beyond directly trained conditions in a related, useful way.
Gradient-based methods extrapolate well with extra test-time steps.
featurize (verb)
To convert raw data into a set of useful numeric features.
PEARL's encoder featurizes each transition independently.
context (noun)
Surrounding information that helps determine the right action or meaning.
The policy is conditioned on state and task context Z.
instantiation (noun)
One specific concrete version of a more general idea.
Each approach is an instantiation of the same general framework.

Chapters

← Lecture 22, Part 4: Gradient-Based Meta-Reinforcement Learning · Lecture 23, Part 1: Challenges and Open Problems in Deep RL →