NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Curiosity in hindsight

Daniel Jarrett, Corentin Tallec, Florent Altché, Thomas Mesnard, Rémi Munos, Michal Valko

Abstract

Consider the problem of exploration in sparse-reward or reward-free environments, such as in Montezuma's Revenge. In the curiosity-driven paradigm, the agent is rewarded for how much each realized outcome differs from their predicted outcome. But using predictive error as intrinsic motivation is fragile in stochastic environments, as the agent may become trapped by high-entropy areas of the state-action space, such as a "noisy TV". In this work, we study a natural solution derived from structural causal models of the world: Our key idea is to learn representations of the future that capture precisely the unpredictable aspects of each outcome -- which we use as additional input for predictions, such that intrinsic rewards only reflect the predictable aspects of world dynamics. First, we propose incorporating such hindsight representations into models to disentangle "noise" from "novelty", yielding Curiosity in Hindsight: a simple and scalable generalization of curiosity that is robust to stochasticity. Second, we instantiate this framework for the recently introduced BYOL-Explore algorithm as our prime example, resulting in the noise-robust BYOL-Hindsight. Third, we illustrate its behavior under a variety of different stochasticities in a grid world, and find improvements over BYOL-Explore in hard-exploration Atari games with sticky actions. Notably, we show state-of-the-art results in exploring Montezuma's Revenge with sticky actions, while preserving performance in the non-sticky setting.

Introduction

In reinforcement learning (RL), agents often struggle when external rewards are sparse. A popular solution is "curiosity," where the agent receives an intrinsic reward for visiting states where its world model makes poor predictions. However, this approach has a fatal flaw: the Noisy TV Problem. If an environment contains inherent randomness (aleatoric uncertainty)—like a TV screen showing static—a curiosity-driven agent will get stuck staring at it forever. Because the static is unpredictable, the prediction error remains high, and the agent "thinks" it is constantly discovering something new, even though it is learning nothing useful.

The challenge is to distinguish between novelty (epistemic uncertainty: things the agent hasn't learned yet but could) and noise (aleatoric uncertainty: things that are fundamentally unpredictable). This paper introduces Curiosity in Hindsight, a framework that uses hindsight representations to disentangle irreducible noise from true novelty, allowing agents to achieve state-of-the-art exploration in stochastic environments.

The Curiosity in Hindsight Framework

The authors propose a solution derived from structural causal models. The core idea is to learn a hindsight representation ($Z_{t+1}$) that captures the unpredictable aspects of a transition after it has occurred. Instead of trying to predict the future a priori, the agent learns to reconstruct the future using three inputs: the current state ($x_t$), the action ($a_t$), and the hindsight vector ($z_{t+1}$).

The framework relies on two primary objectives:

  1. Reconstruction Objective: The model tries to reconstruct the outcome $x_{t+1}$ given $(x_t, a_t, z_{t+1})$. If the agent understands the world's mechanics, the reconstruction error should vanish because $z_{t+1}$ provides the "missing piece" of the puzzle (the noise).
  2. Invariance Objective: To prevent the hindsight vector from simply "copying" the entire outcome, a contrastive loss is used. This ensures that $z_{t+1}$ is independent of the state and action, forcing it to capture only the stochastic noise.

Implementation: BYOL-Hindsight

The authors instantiate this framework on top of BYOL-Explore, a state-of-the-art exploration algorithm that uses bootstrapped latent features. By replacing BYOL-Explore's forward prediction loss with their hindsight reconstruction and invariance losses, they create a "noise-robust" version of the algorithm.

Architecture of BYOL-Hindsight, illustrating the integration of hindsight generator networks to isolate unpredictable environmental noise.

Experimental Evaluation

The method was evaluated across several benchmarks designed to test robustness to stochasticity.

Stochastic Grid Worlds

The authors used the Pycolab Maze to test four specific types of stochasticity: Brownian oscillators (state-dependent noise), random pixel noise (independent noise), and "On-Demand" pixel noise (action-dependent noise). In these environments, standard curiosity methods like Random Network Distillation (RND) and standard BYOL-Explore were significantly degraded or completely trapped by the noise.

The Pycolab Maze environment featuring various stochastic elements (oscillators H and V) designed to simulate 'Noisy TV' distractions.

Atari Benchmarks and Sticky Actions

In hard-exploration Atari games like Montezuma’s Revenge, the authors introduced stochasticity using the "sticky actions" protocol (a 10% chance of repeating the previous action).

  • Montezuma’s Revenge: In the sticky actions setting, standard BYOL-Explore's performance collapses. BYOL-Hindsight, however, achieves state-of-the-art results, exploring nearly the entire map (20+ rooms) while other curiosity methods flatline.
  • Bank Heist: This game contains naturally occurring "stochastic traps" like randomly regenerating banks. BYOL-Hindsight successfully navigated these where others failed.

Key Insights and Conclusion

By providing the model with the "answer" to the noise in hindsight, any remaining error is purely epistemic. This error is what should drive exploration. The paper mathematically proves that the hindsight reward provides an upper bound on the distance between the world's true dynamics and the agent's model.

Crucially, adding hindsight does not hurt performance in deterministic environments; it preserves the strengths of the base algorithm while adding a layer of robustness. While hyperparameters like the hindsight vector dimensionality require careful selection, Curiosity in Hindsight offers a simple and scalable generalization of curiosity that is uniquely robust to environmental stochasticity.

Summary updated

BibTeX
@inproceedings{jarrett2023curiosity,
  author = {Daniel Jarrett and Corentin Tallec and Florent Altché and Thomas Mesnard and Rémi Munos and Michal Valko},
  title = {{Curiosity in hindsight}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=GaQVAVWqe3},
}
Figure