Unit 2 of 12 · about 4 hours · explain, implement
Counts, pseudocounts, curiosity and intrinsic rewards versus shaping
Sparse tasks give no gradient until the first success. Intrinsic rewards manufacture a signal from novelty, but the same signal can trap the agent in front of noise.
You'll be able to
- Explain counts, pseudocounts and prediction-error novelty, and when each bonus stays informative.
- Derive the total-reward mix of extrinsic and intrinsic reward and show how changes the objective.
- Implement a tabular count bonus and an RND-style predictor error on a small task without counting the bonus as task reward.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Berkeley CS 285 Lecture 19: counts, pseudocounts and bonus formsBerkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Exploration and Off-Policy Actor-Critic
Lecture 19, Part 2: the trouble with counts, fitting generative models, pseudocounts after Bellemare et al., bonus forms UCB, MBIE-EB and BEB, and heuristic counts via errors after Burda et al.
- RND: prediction error against a fixed random targetExploration by Random Network Distillation
arXiv:1810.12894v1 Sections 1 to 3: fixed random target network with trained predictor, prediction error as intrinsic reward with the MNIST toy and Montezuma Figure 1; Section 2.3: separate extrinsic and intrinsic value heads and episodic versus non-episodic intrinsic return
- Pseudocounts from a density modelUnifying Count-Based Exploration and Intrinsic Motivation
arXiv:1606.01868v2 Sections 2 to 3: density model over states, learning-positive Definition 1, prediction gain and Theorem 1 relating pseudocounts to information gain, and the bonus built on the pseudocount form
- Hands-on Modern RL 12.1: ICM and RND conceptsHands-on Modern RL - DDPG, TD3, SAC and Intrinsic Motivation
Sections 1 to 3.1: sparse-reward motivation with total-reward mix, ICM state-prediction error with inverse and forward models, RND target and predictor with its intrinsic reward, and the ICM versus RND comparison (page read 2026-10-14)
Concepts only. The UCB line on this page drops the square root, so use the CS234 form with the root. Treat the 10-18 Montezuma probability and the Atari score claims as unverified author reports, not targets.
Focus on
- Total reward is : with extrinsic 0, intrinsic 0.4 and , the update sees 0.04, and changing changes the optimum.
- A usable bonus is computable from visited data and exhaustible: visited states must decay toward zero bonus or the agent farms novelty forever.
- Pseudocounts generalize tabular counts through a density model, while RND skips densities and uses error against a frozen random target.
- RND trains two value heads because extrinsic and intrinsic returns have different horizons: episodic task return versus non-episodic novelty return.
Common mistakes · 3
- Counting the bonus as task performance. Success rates and task returns must use extrinsic reward only; the bonus is training signal.
- Trusting novelty from a representation without checking it. A bonus depends on features or densities, so a new encoder can flip which states look novel.
- Treating episodic and non-episodic novelty as interchangeable. RND Section 2.3 makes intrinsic return non-episodic because an episodic one drops to zero at game over and makes the agent overly risk averse, and it keeps extrinsic return episodic so the agent cannot farm an early reward by restarting. Two value heads combine the two streams.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Extrinsic reward is 0, intrinsic reward is 0.4 and . What update signal does the agent see, and what happens as grows?Answer
It sees 0.04. Larger pushes the policy toward novelty and away from the task optimum; the bonus weight is part of the objective.
2.Why does ICM get stuck on a noisy TV while RND is more robust?Answer
ICM rewards forward-model error, which stays high on unpredictable noise. RND rewards error against a fixed finite-complexity target, so the error is bounded and decays with visits.
3.Why does RND fit two value heads instead of one mixed return?Answer
Extrinsic return is episodic and intrinsic return is non-episodic with its own scale and horizon. One head would mix incompatible targets; two heads keep each bootstrap correct.
4.A density model assigns high likelihood to a new state. What does its pseudocount say?Answer
High pseudocount, hence low bonus. The state looks familiar to the model whether or not a tabular count ever saw it, which is exactly the representation dependence to check.
You're done when
You compute the mixed-reward example by hand, derive when each bonus decays, and keep bonus and task reward in separate columns of your results.
Only when you can do this without notes.
Leads to
Notes
Resources · 4 for this unit, 10 more in the 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.pyon InvertedPendulum and Hopper; HalfCheetah needs hours on a GPU). The homework pinsgym==0.25.2, which fails on NumPy 2, so port it to Gymnasium (terminatedandtruncated) or pinnumpy<2in its own environment, and turn off its forced WandB logging. - 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.
- 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/chapterNNfolders do not follow the site chapter numbers.
Also in this section
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.