TL;DR
DeepMind researchers have introduced Curiosity in Hindsight, a framework that prevents curiosity-driven agents from getting stuck in stochastic "traps" (like a noisy TV). By learning to "explain away" unpredictable noise using hindsight representations, the agent can focus its exploration on novel but learnable parts of the environment, achieving state-of-the-art results on challenging Atari games like Montezuma’s Revenge even with stochastic "sticky actions."
What Problem Does This Paper Address?
In reinforcement learning, agents often face "sparse reward" environments where the goal is far away and feedback is rare. To solve this, researchers use intrinsic motivation (curiosity). A common approach is to reward the agent for prediction error: if the agent can’t predict the next state, that state must be "novel," so the agent should go there.
However, this fails in stochastic environments. Imagine a "Noisy TV" in a maze. The TV displays random static that is inherently unpredictable. A standard curiosity-driven agent will be perpetually "surprised" by the random pixels and stay glued to the TV forever, failing to explore the rest of the world. This is the distinction between aleatoric uncertainty (irreducible noise) and epistemic uncertainty (lack of knowledge that can be reduced through exploration). The challenge is to reward the latter while ignoring the former.
Methods
The authors propose a solution rooted in structural causal models. Their framework, Curiosity in Hindsight, modifies the standard prediction task into a reconstruction task using two key components:
- Hindsight Representations ($Z$): After a transition occurs, a generator looks at the outcome and produces a latent vector $Z$ that captures the "unpredictable" aspects of that specific transition (the "noise").
- Reconstructive Model: Instead of predicting the future from the past, the model tries to reconstruct the future using the current state, action, and the hindsight vector $Z$.
To prevent the hindsight vector from simply "cheating" by copying the entire future state, they introduce an Invariance Loss (using contrastive learning/InfoNCE). This ensures $Z$ is independent of the current state and action, forcing it to capture only the irreducible noise.
The intrinsic reward then becomes the reconstruction error. In the limit, if the environment is well-understood, the reconstruction error vanishes because the "noise" is handled by $Z$ and the "dynamics" are handled by the model. They instantiate this specifically as BYOL-Hindsight, building on the state-of-the-art BYOL-Explore algorithm.
Datasets
The authors evaluated their method across several settings to test its robustness to different types of noise:
- Pycolab Maze: A controlled grid-world environment where they introduced four types of noise: Baseline (none), Brownian Oscillators (state-dependent), Random Pixel Noise (independent), and On-Demand Pixel Noise (action-dependent).
- Atari "Hard Exploration" Games: Including Montezuma’s Revenge, Pitfall!, Private Eye, and Bank Heist.
- Sticky Actions: They used the "sticky actions" protocol (where an action has a 10% chance of being repeated) to introduce stochasticity into otherwise deterministic Atari environments.
Key Insights and Ideas
- Disentangling Noise from Novelty: The core "aha" moment is that we can use the future to explain the past. By allowing a model to see the outcome after the fact, it can identify which parts of the error were due to random chance (aleatoric) versus a lack of model knowledge (epistemic).
- Optimistic Exploration: Theoretically, the authors show that their hindsight reward provides an upper bound on the distance between the agent's model and the true world dynamics. Driving this reward to zero effectively means the agent has learned everything "learnable."
- Generality: Unlike previous methods that relied on specific features (like inverse dynamics) to filter noise, Curiosity in Hindsight is a "drop-in" modification that works with any representation space (pixels, latents, or bootstrapped features).
Key Results
- Robustness to Stochastic Traps: In the Pycolab "On-Demand Noise" test, standard BYOL-Explore and RND (Random Network Distillation) were immediately trapped by the noise. BYOL-Hindsight ignored the noise and successfully explored the entire maze.
- State-of-the-Art in Atari: On Montezuma’s Revenge with sticky actions, BYOL-Hindsight reached significantly more rooms and achieved higher scores than previous methods, which often "flatlined" due to the added randomness.
- No Penalty for Determinism: Crucially, in standard non-sticky Atari environments, the hindsight mechanism didn't hurt performance, proving it is a safe generalization of standard curiosity.
Limitations and Future Work
- Computational Overhead: The method requires training an additional hindsight generator and a contrastive critic, increasing the complexity of the architecture.
- Hyperparameter Sensitivity: While the authors found a fixed dimensionality for $Z$ (256) worked well, they note that if $Z$ is too small, it may not capture all the noise; if it's too large, it might "leak" predictable information and dampen exploration.
- Future Directions: The authors suggest exploring this framework in even more complex domains like NetHack or multi-agent settings where stochasticity is rampant and unpredictable.
Summary updated