Abstract
Reinforcement learning (RL) agents frequently struggle in environments with sparse rewards and high-dimensional observations, particularly when the environment layout changes between episodes. We present Episodic Novelty Through Temporal Distance (ETD), a method that leverages temporal distance—the expected number of steps between states—as a robust metric for exploration. By utilizing contrastive learning to estimate these distances, ETD provides an intrinsic reward that is resilient to observational noise and generalizes across procedurally generated tasks. Our results across MiniGrid, Crafter, and MiniWorld demonstrate that ETD significantly outperforms existing curiosity-based methods in sample efficiency and robustness.
Introduction
In sparse reward environments, an agent may navigate for thousands of steps without receiving any external feedback. To overcome this, researchers often employ intrinsic motivation, providing the agent with a "curiosity" bonus for discovering novel states. However, traditional curiosity-based methods face two significant hurdles: the Generalization Gap and the Noisy-TV Problem.
The Generalization Gap occurs in Contextual Markov Decision Processes (CMDPs), where environment layouts change every episode. In these settings, a state that was novel in one episode may be common in the next, causing global curiosity trackers to become ineffective. The Noisy-TV Problem arises when agents become trapped by stochastic elements in the environment (e.g., a flickering screen) that are technically "novel" at the pixel level but irrelevant to the task. ETD addresses these issues by shifting the novelty metric from state frequency or pixel-wise difference to temporal distance.
Methodology
Temporal Distance as a Metric
The core innovation of ETD is the use of temporal distance to define novelty. Instead of measuring how often a state has been visited, ETD asks: "How many steps, on average, would it take to reach this state from my previous experiences in this episode?"
This approach utilizes a successor distance, a type of "quasimetric." Unlike standard Euclidean distance, a quasimetric accounts for asymmetry in the environment—for example, it may be easy to jump down a ledge but impossible to jump back up. This asymmetry allows the agent to more accurately model the directional constraints of physical environments.
Learning the Distance Function
To estimate these distances without a predefined map, the authors employ contrastive learning via a symmetrized InfoNCE loss. The agent compares a current state with its "future self" (sampled using a geometric distribution) against random "negative" states. The learning task is decomposed into a "potential network" and a "quasimetric network," a mathematical parameterization that allows the model to recover true temporal distances from the contrastive signal.
The Episodic Bonus
The intrinsic reward $b_t$ is defined as the minimum temporal distance between the current state and all previous states stored in the agent's episodic memory. If the "closest" state the agent has previously seen is still many temporal steps away, the reward is high. This encourages the agent to push the boundaries of its current trajectory, prioritizing states that are difficult to reach.
Experimental Evaluation
The authors evaluated ETD across a diverse suite of challenging RL benchmarks designed to test exploration and robustness:
- MiniGrid: A 2D grid-world featuring complex tasks like
ObstructedMaze. Noisy variants with Gaussian noise were used to test resilience to the Noisy-TV problem. - Crafter: A pixel-based survival game requiring long-term planning and resource management.
- MiniWorld: A 3D first-person navigation environment testing partial observability.
- Continuous Control: Tasks in DeepMind Control (DMC) and MetaWorld to verify scalability to non-discrete action spaces.
Key Results
- Sample Efficiency: In the
ObstructedMaze-Fulltask, ETD reached near-optimal performance in 20 million steps, doubling the efficiency of the previous state-of-the-art method, NovelD. - Robustness to Noise: When Gaussian noise was introduced to the
DoorKeyenvironment, count-based methods failed as they became obsessed with the noise. ETD maintained its performance, demonstrating that temporal distance is representation-invariant; random noise does not help an agent reach distant states faster. - High-Dimensional Success: ETD outperformed baselines in
CrafterandMiniWorld, proving it can scale to complex visual observations where simple distance metrics typically fail.
Discussion and Limitations
While ETD offers a powerful signal for exploration, it is not without limitations. The authors note that adding an episodic bonus technically transforms a standard Markov process into a Partially Observable MDP (POMDP), as the reward becomes dependent on the agent's history. This can introduce bias into the value function.
Furthermore, the method assumes ergodicity—the idea that any state can eventually be reached. In environments with permanent failures or "dead ends," the temporal distance may become ill-defined. Finally, ETD is currently purely episodic; it does not retain knowledge of "boring" areas across different episodes. Future work may involve combining ETD with global long-term memory bonuses to further refine exploration.
Conclusion
Episodic Novelty Through Temporal Distance (ETD) provides a robust, mathematically grounded framework for exploration in reinforcement learning. By focusing on the temporal cost of reaching states rather than their visual appearance or global frequency, ETD overcomes the primary weaknesses of existing curiosity-based methods, offering a scalable solution for complex, noisy, and procedurally generated environments.
Summary updated