Unit 6 of 12 · about 5 hours · explain, implement

Goal-conditioned policies, hindsight relabeling and partial observability

Sparse goal tasks give almost no successes to learn from. Relabeling turns every failure into a success for the goal actually reached, which densifies reward without inventing signal.

You'll be able to

  • Explain goal-conditioned policies and hindsight relabeling with recomputed rewards.
  • Compare final, future, episode and random relabeling strategies and state when each wins.
  • Describe partial observability and the history-as-state remedy, and state what stays at vocabulary depth here.

Covers

Goal-conditioned policies and relabelingHindsight Experience ReplayPartial observability and recurrent policy vocabulary
1

Read

In this order, only the parts listed

0 of 3 done

  1. CS224R Lecture 12: multi-task and goal-conditioned relabelingStanford CS224R Spring 2026 - Off-Policy and Goal-Conditioned RL

    Lecture 12: goal-conditioned setup with the goal as state, the hindsight relabeling loop that stores relabeled data with recomputed rewards, the dynamics-consistency condition across goals, and the future, final and episode strategy question

  2. HER: relabeling strategies and ablationsHindsight Experience Replay

    arXiv:1707.01495v3 Section 3: goal-conditioned setup with the bit-flipping environment and Algorithm 1 relabeling with recomputed rewards; Section 4.5 with Figure 6: final, future, episode and random strategies with future or best

  3. SB3 tips: Markov assumption and history remedyStable-Baselines3 RL Tips and Tricks

    Tips and Tricks when creating a custom environment: do not break the Markov assumption and supply observation history under delay, plus separate timeout truncation handling (page read 2026-10-14)

    Vocabulary only for partial observability. Recurrent policies stay at vocabulary depth in this section; no pool homework trains one.

2

Focus on

  • A relabeled transition is with : the goal is substituted and the reward is recomputed, never copied from the original goal.
  • Relabeling needs an off-policy algorithm because replayed data comes from a different goal and an older policy than the current one.
  • Future relabeling with or goals per transition wins because goals just after the transition stay reachable and informative; random goals from anywhere usually do not.
  • Partial observability means the observation alone is not Markov; stacking history restores information but does not guarantee a Markov state, and recurrent policies are only vocabulary here.
Common mistakes · 3
  • Copying the original reward onto the relabeled goal. The reward function runs again under the substituted goal; a failure for the commanded goal is often a success worth 0 for the achieved one.
  • Relabeling across tasks with different dynamics. CS224R allows relabeling only where dynamics stay consistent; otherwise the stored transition describes an impossible world.
  • Claiming recurrent-policy skill from this section. The pool has no recurrent homework, so history stacking is a baseline and recurrence stays vocabulary.
3

Try it yourself

Closed-book, before checking anything

Closed-book, write one relabeled transition with its recomputed binary reward for a two-step episode. State the four HER strategies and why future with k = 4 wins, plus the dynamics-consistency condition for relabeling across goals.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.An episode aimed at goal g ends at state sT. What exactly is stored for a relabeled goal g' = sT?Answer

    Transitions with . The transition that reaches sT earns 0 under the binary reward where the original goal gave -1; earlier transitions earn 0 only if they were already within tolerance of g'.

  2. 2.Why does HER require an off-policy algorithm?Answer

    Relabeled transitions come from a different goal and an older behavior policy than the current target policy, so an on-policy update would use the wrong distribution.

  3. 3.Which relabeling strategy wins in HER ablations and why?Answer

    Future with k = 4 or 8. Goals observed just after the transition are reachable and informative; final is good but weaker, episode is mixed, and random is worst.

  4. 4.Observations arrive with a one-step delay. What is the first fix and what does it not guarantee?Answer

    Supply observation history as input. It restores information but does not guarantee a Markov state or match a learned recurrent policy.

You're done when

You write a correct relabeled transition with its recomputed reward, rank the four strategies from evidence, and state the history remedy with its limits.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 11 more in the section
  • Stanford CS224R Spring 2026 - Off-Policy and Goal-Conditioned RLStanford University · required

    Study Lecture 05 (off-policy actor-critic) and Lecture 12 (multi-task and goal-conditioned RL) and their DDPG and HER readings. Implement one goal relabeling test on a small task.

  • Hindsight Experience ReplayAndrychowicz et al. (NeurIPS 2017) · required

    Read the goal-conditioned setup and the relabeling strategies (final, future, episode). Implement relabeling on a sparse-reward bit-flipping or goal task and test that relabeled transitions carry the substituted goal and its recomputed reward.

  • Stable-Baselines3 RL Tips and TricksStable-Baselines3 · reference

    Use How to evaluate an RL algorithm for separate test envs, EvalCallback and deterministic eval; Which algorithm should I use for the discrete/continuous/goal picker and HER pointer; the custom-environment section for Markov, normalization and TimeLimit handling; and the seed-variance and RL-zoo tuning advice. Treat SOTA and speedup claims as pointers, not targets.

Also in this section

  • Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Exploration and Off-Policy Actor-CriticUC Berkeley · primary

    Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lecture 19 (exploration) and Lecture 23 (advanced exploration), and the SAC part of Homework 3 (src/agents/sac_agent.py on InvertedPendulum and Hopper; HalfCheetah needs hours on a GPU). The homework pins gym==0.25.2, which fails on NumPy 2, so port it to Gymnasium (terminated and truncated) or pin numpy<2 in its own environment, and turn off its forced WandB logging.

  • Stanford CS234 Winter 2026 - Bandits and ExplorationStanford University · required

    Study Lectures 9 to 12 (bandits, optimism and upper confidence bounds, exploration in MDPs). Rebuild one exploration comparison with matched information, interaction, update and tuning budgets.

  • Soft Actor-Critic Algorithms and ApplicationsBerkeley AI Research · required

    Read the maximum-entropy objective, the soft policy iteration and the actor and critic targets, then the automatic temperature adjustment (this version adds it; the first SAC paper used a fixed temperature). Implement or audit a compact SAC path and compare sample efficiency and wall time with PPO under a matched protocol.

  • Addressing Function Approximation Error in Actor-Critic Methods (TD3)Fujimoto, van Hoof and Meger (ICML 2018) · required

    Read the overestimation analysis for actor-critic methods, clipped double Q-learning, delayed policy updates and target policy smoothing. Ablate one of the three changes on a small continuous task with matched seeds.

  • Exploration by Random Network DistillationBurda et al. (ICLR 2019) · support

    Read the prediction-error bonus, the separate intrinsic and extrinsic value heads and the non-episodic intrinsic return. Use it to explain why a novelty bonus depends on the representation and how it can reward noise.

  • Unifying Count-Based Exploration and Intrinsic MotivationBellemare et al. (NeurIPS 2016) · support

    Read the pseudocount derivation from a density model and the exploration bonus built on it. Compare a tabular count bonus with its pseudocount form on a small grid.

  • Deep Reinforcement Learning at the Edge of the Statistical PrecipiceDeepMind and Google Research · required

    Study the failure of common point estimates and small-seed comparisons. Report interval estimates, aggregate-score sensitivity and performance profiles with the underlying per-run data retained.

  • What Matters in On-Policy Reinforcement Learning? A Large-Scale Empirical StudyAndrychowicz et al. (2020) · support

    Read the experimental protocol and the recommendations on normalization, initialization and hyperparameter sensitivity. Use it to set a tuning budget that is the same for every method you compare.

  • rliableGoogle Research · support

    Use the official repository to compute interquartile means, stratified bootstrap intervals and performance profiles for the track experiments. Verify the input run and task axes and keep plots reproducible from raw run records; check the pandas version it needs in your environment.

  • Hands-on Modern RL - DDPG, TD3, SAC and Intrinsic MotivationWalking Labs · support

    Use the DDPG and TD3 and SAC pages for vocabulary and the intrinsic-motivation page for concepts only. Its displayed TD3 target omits the terminal mask (the code has it), its SAC chart is author-reported, and its multi-agent demo does not learn; do not use those as practice. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its code/chapterNN folders do not follow the site chapter numbers.

  • Gymnasium documentation: API, time limits, vector envs and wrappersFarama Foundation · reference

    Use the Env API page for the reset and step contract, the handling-time-limits tutorial for termination versus truncation bootstrapping, the vector env pages for SyncVectorEnv and AsyncVectorEnv autoreset modes, and the wrappers table for RecordEpisodeStatistics, ClipAction, NormalizeObservation and TimeLimit.