Paper commentary
Curiosity-driven Exploration by Self-supervised Prediction
Curiosity from prediction error in a learned feature space helps agents explore
- Problem Sparse rewards leave agents with nothing to learn from for long stretches. Prediction error on raw pixels is a poor curiosity signal, because it rewards changes the agent cannot control, like moving leaves.
- Method Curiosity-driven Exploration by Self-supervised Prediction learns a feature space with an inverse dynamics model that predicts the agent's action. A forward model then predicts the next features, and its error becomes the intrinsic reward for A3C.
- Results On the sparse VizDoom setup the agent reached a 100.0% mean score at convergence. A3C alone reached 0.0%.
Why extrinsic reward alone stalls exploration
Reinforcement learning ties learning to the reward the environment supplies, and that signal can be missing for most of an episode. When the reward arrives only on reaching one pre-specified goal state, a policy is updated only if random behaviour happens to reach that state, which rarely happens outside very simple environments. Curiosity is therefore treated as a reward the agent generates for itself, so that learning can continue while the environment is silent.
Existing intrinsic rewards fall into two groups: rewards for visiting novel states, and rewards for actions that reduce the agent's error in predicting the consequences of its own actions. Novelty needs a model of the distribution over states, while prediction error needs a model of dynamics that predicts the next state from the current state and action, and both are hard to build when states are images.
Stochastic factors make this harder, because noise in actuation, shadows, distractor objects and other agents whose motion is irrelevant to the goal all produce changes the agent cannot use.
Pixel-space prediction error fails even in a benign setting. In the tree-leaves example, the leaf motion is never predictable and does not matter to the agent, so the error stays high and the agent keeps returning to the leaves. Count-based novelty over visited states shares this problem, and learning progress would avoid it but has no known computationally feasible implementation.
A feature space that keeps only what the agent can affect
The design moves prediction out of raw pixels into a learned feature space, so the first question is which features to keep. The causes of change in an observation are split into three groups: changes the agent controls, changes it does not control but that still affect it, and changes that are neither controlled nor consequential for it.
A useful feature space should represent the first two groups and be insensitive to the third, because the agent has no reason to represent a source of variation that does not matter to it.
The features are learned with a self-supervised inverse dynamics model that predicts the agent's action from the features of two consecutive states. Since the action is the prediction target, the encoder keeps the information that helps explain the agent's own actions and has no reason to keep the rest. A forward dynamics model then predicts the next feature vector from the current feature vector and the action, and its error in this space is the curiosity reward.
Because the encoder has no incentive to keep factors that are not influenced by the agent's actions, those factors should not produce reward.
Agrawal et al. (2016) built a joint inverse and forward model, but used the forward model only as a regularizer for the inverse features. Here the forward model's error is the quantity that drives the policy, which is the step that connects the feature space to exploration.
Reward computation and the joint objective
The inverse model outputs a predicted action \(\hat{a}_t = g(s_t, s_{t+1}; \theta_I)\), and its loss \(L_I\) measures how far that prediction is from the executed action. For discrete actions, the output is a softmax over the actions, so minimizing \(L_I\) amounts to maximum likelihood under a multinomial distribution. The forward model predicts \(\hat{\phi}(s_{t+1}) = f(\phi(s_t), a_t; \theta_F)\), and its loss \(L_F\) is a squared error between this prediction and the actual feature vector.
The intrinsic reward \(r^i_t\) is the squared feature error scaled by a factor \(\eta > 0\).
The policy, the inverse model and the forward model are optimized jointly by minimizing \(-\lambda \mathbb{E}_{\pi}[\sum_t r_t] + (1-\beta)L_I + \beta L_F\), with \(0 \le \beta \le 1\) and \(\lambda > 0\). The minus sign on the expected sum of rewards means the policy is trained to maximize return, while \(\beta\) balances the inverse and forward losses and \(\lambda\) sets the weight of the policy gradient against learning the reward signal.
The encoder receives the current gray-scale frame at 42×42 stacked with the three previous frames. It has four convolution layers with 32 filters, 3×3 kernels, stride 2 and padding 1, with ELU after each, giving a 288-dimensional feature vector. The inverse model concatenates two encodings, passes them through a 256-unit fully connected layer, and outputs four actions in the VizDoom setup.
The forward model concatenates the encoding with the action and passes it through fully connected layers with 256 and 288 units.
The policy is trained with A3C using twenty asynchronous workers, and its convolutional body feeds a 256-unit LSTM. During training, action repeat is four in VizDoom and six in Mario, while at inference the policy is sampled without action repeat.
Environments and baselines
The DoomMyWayHome-v0 map has 9 rooms joined by corridors, and the agent gets a sparse terminal reward of +1 for finding the vest and zero otherwise. An episode ends when the vest is found or after 2100 time steps.
The generalization experiments pre-train on a different map with different random textures, using episodes of 2100 time steps. On that map an optimal policy needs approximately 350 steps to reach the vest from the farthest room.
Super Mario Bros is trained on Level-1 and tested on later levels, with the action space reparametrized into 14 actions. A long jump may need the same action predicted up to 12 times in a row, and all Mario experiments use the curiosity signal only.
The comparisons use three baselines: vanilla A3C with ε-greedy exploration, ICM-pixels, which removes the inverse model and predicts the next observation in pixel space, and VIME trained with TRPO. ICM-pixels is intended to represent earlier methods that compute information gain directly on the observation space.
Sparse extrinsic reward results
The dense case spawns the agent in any of 17 locations, while the sparse and very sparse cases always start in Room-13 or Room-17. Under an optimal policy, Room-13 is 270 steps from the goal and Room-17 is 350 steps from it.
In the dense case, curious agents learn faster than the ε-greedy baseline, and as rewards get sparser the baseline A3C degrades while curious A3C agents remain superior in all cases. The curves come from three independent runs per algorithm, shown as mean with standard error of the mean, and the authors did not tune random seeds.
In the very sparse case, A3C and ICM-pixels never succeed, while ICM reaches a perfect score in 66% of random runs. The authors offer one possible explanation for the weaker ICM-pixels result: the agent starts in one of seventeen differently textured rooms, which makes a pixel-prediction model hard to learn.
To test robustness, 40% of the observation was replaced by white noise in the sparse setup. The ICM agent still reached a perfect score, whereas ICM-pixels suffered, even though it had succeeded in the sparse setup without the noise.
The TRPO and VIME numbers come from concurrent work (Fu et al., 2017), and the authors note that TRPO and A3C have different setups. On the sparse setup, the mean score at convergence was 100.0% for ICM + A3C, 26.0% for TRPO, 0.0% for A3C and 46.1% for VIME + TRPO. The medians were 100.0% for ICM + A3C, 0.0% for TRPO, 0.0% for A3C and 27.1% for VIME + TRPO.
As a sanity check, uniform, Gaussian and Laplacian random noise replaced the curiosity network as reward. None of these agents reached the goal, which the authors take as evidence that the curiosity module does not learn a degenerate reward.
Exploring with no extrinsic reward
With no extrinsic reward, the VizDoom agent learned to follow corridors, walk between rooms and visit many rooms. Figure 7 compares this visitation with a random agent, which often gets stuck against walls and cannot move.
Trained only on curiosity, the Mario agent crosses over 30% of Level-1. It received no reward for killing or dodging enemies, yet it learned to do both. The authors reason that dying reveals only a small part of the game, so the curiosity reward saturates, and that learning to handle enemies keeps the agent exploring.
The authors claim, to their knowledge, that this is the first demonstration of an agent that learns to navigate a 3-D environment and to play a game from pixels with no extrinsic reward. They contrast this with prior work that uses reinforcement learning from pixels but relies on external rewards.
Transfer to later Mario levels and a new VizDoom map
The Level-1 policy was reused in three ways: run as is, fine-tuned with curiosity only, and fine-tuned with extrinsic reward. Run as is, it holds up on Level-3, which has different structures and enemies, but does not do well on Level-2. The authors attribute the Level-2 result to visual appearance, since Level-2 is a night world while Level-1 and Level-3 share a daytime look.
Fine-tuning on Level-2 with curiosity only overcame the appearance mismatch and gave a higher distance than training from scratch with the same 1.5M iterations, with mean distance 97.5 against 11.8. The authors also note that scratch training on Level-2 is worse than the fine-tuned policy, and attribute this to Level-2 being harder to learn from scratch.
Fine-tuning the Level-1 policy on Level-3 made performance worse than running it as is. The authors explain that the agent hits a curiosity blockade, receives almost no curiosity reward, and its policy slowly degrades, which they liken to boredom.
On the very sparse VizDoom test map with new textures, an ICM agent pre-trained with curiosity only and then fine-tuned with extrinsic reward learned faster and reached higher reward than an ICM + A3C agent trained from scratch. The pixel-prediction variant did not generalize to this test environment, and the authors read the transfer result as evidence that the learned exploratory behavior is useful when goals come from the environment.
Limits of the reported evidence
The Mario agent cannot get past a pit at 38% of the game, which needs a specific sequence of 15-20 key presses to cross. If the agent fails to jump, it falls and receives no further reward, so the policy gets no gradient indicating a world beyond the pit. The authors describe this as largely separate from the modelling of curiosity and as a policy learning problem.
The approach does not directly extend to scenarios where opportunities for interaction are also rare. Saving such events in a replay memory is suggested as a possibility, and the authors leave it for future work.
The main curves rest on three independent runs per algorithm, and random seeds were not tuned. The TRPO and VIME comparison uses numbers from concurrent work with a different setup, so it is not a controlled comparison with ICM + A3C.
The Mario generalization table covers the ICM agent and the scratch and reuse variants, while the pixel-prediction variant appears only in the VizDoom transfer experiment. The VizDoom transfer uses one training map and one test map, so transfer across more maps was not tested.
Where the design sits among exploration methods
Curiosity-driven exploration has earlier work built on surprise, compression progress, empowerment and state visitation counts. Bootstrapped value functions and information-gain methods are other routes to exploration in that literature.
The closest relatives jointly train forward and inverse models, but those works use the learned dynamics for planning rather than exploration. The proxy task of predicting from a pair of frames has also been used to learn semantic features in computer vision.
Paper info
- Authors
- Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, Trevor Darrell
- Venue
- arXiv · Preprint
- First published
- 2017-5-15
- Added
- 2026-11-12
- Updated
- 2017-5-15
- Version
- v1
- arXiv
- 1705.05363
- Category
- cs.LG · cs.AI · cs.CV · cs.RO · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, Trevor Darrell (2017). Curiosity-driven Exploration by Self-supervised Prediction. arXiv:1705.05363v1. https://arxiv.org/abs/1705.05363v1
BibTeX
@misc{pathak2017curiosity,
title = {{Curiosity-driven Exploration by Self-supervised Prediction}},
author = {Deepak Pathak and Pulkit Agrawal and Alexei A. Efros and Trevor Darrell},
year = {2017},
eprint = {1705.05363},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1705.05363v1}
}