Introduction
In Reinforcement Learning (RL), "exploration" is the challenge of trying new actions to discover rewards. This is incredibly difficult in "sparse-reward" environments, where an agent might wander for thousands of steps before receiving any feedback. Standard exploration methods often rely on visual novelty (e.g., "have I seen this exact pixel configuration before?"). However, pixels change for many reasons: a cloud moves, an enemy patrols, or the agent moves its own character.
This paper introduces a self-supervised method for RL agents to identify which parts of their environment they actually control—a concept called contingency-awareness. The authors argue that an ideal representation for exploration should focus on controllable dynamics: knowing where "I" am and what "I" can change. Without this self-awareness, agents struggle to distinguish between meaningful progress and environmental noise. By using an "Attentive Dynamics Model" to locate themselves within a game, agents can perform much more effective count-based exploration, achieving state-of-the-art results on notoriously difficult, sparse-reward Atari games like Montezuma’s Revenge.
The CoEX Framework
To solve the exploration problem, the authors propose a framework called CoEX (Contingency-aware Exploration), which consists of several main components:
- Attentive Dynamics Model (ADM): This is an inverse dynamics model trained in a self-supervised fashion. It takes two consecutive video frames and tries to predict which action the agent took to get from the first to the second. To do this accurately, the model must learn to "attend" to the part of the screen that changes based on the agent's input (usually the player's character).
- Self-Localization: The spatial attention map from the ADM provides $(x, y)$ coordinates of the "contingent region." This effectively allows the agent to track its own position without any external labels or access to the game's internal RAM.
- State Abstraction for Counting: The agent builds a state representation $\psi(s) = (x, y, c, R)$, where $(x, y)$ is the agent's learned location, $c$ is a "context" (e.g., which room the agent is in) learned via simple clustering of image embeddings, and $R$ is the cumulative reward collected in the current episode.
- Count-Based Exploration: The agent keeps a counter for how many times it has visited each abstract state. It receives an "intrinsic reward" (an exploration bonus) that is inversely proportional to the square root of this count. This encourages the agent to visit locations and contexts it hasn't explored thoroughly.
Key Insights
- The Power of "Where am I?": Simply knowing its own $(x, y)$ position is a much more robust signal for exploration than raw pixel-based novelty. It allows the agent to realize it is in a "new" place even if the background looks similar.
- Inverse Dynamics as a Teacher: You don't need a supervisor to tell the agent where it is. By forcing a neural network to predict actions, the network naturally learns to ignore "distractor" animations (like moving cars in Freeway) and focus on the controllable avatar.
- Context Matters: In games with multiple rooms, $(x, y)$ isn't enough. By adding a "context" variable (the room ID) and the current score to the state representation, the agent understands that being at $(10, 10)$ in Room A is different from being at $(10, 10)$ in Room B, or being there after picking up a key.
Results on Hard Exploration Games
The researchers evaluated their method using the Arcade Learning Environment (ALE), specifically focusing on 8 "hard exploration" Atari 2600 games: Montezuma’s Revenge, Venture, Freeway, Frostbite, Hero, PrivateEye, Qbert, and Seaquest.
- State-of-the-Art on Montezuma’s Revenge: When combined with the PPO algorithm, the agent achieved a score of >11,000 points. Crucially, it did this without using expert demonstrations, human intervention, or access to the game's internal RAM states.
- Significant Baseline Improvements: On games like Venture and PrivateEye, where standard A2C (Advantage Actor-Critic) scores near zero, the CoEX-augmented agent achieved thousands of points.
- Interpretability: Because the model uses an attention mechanism, researchers can visually verify that the agent has "discovered" itself. The attention maps clearly highlight the player's character across different games.
Limitations and Future Work
While highly effective, the current implementation is tailored for 2D environments where $(x, y)$ coordinates are a natural abstraction. Extending this to 3D environments (like first-person navigators) would require more complex spatial representations. Additionally, the method for identifying "rooms" (context) uses a relatively simple clustering approach; more sophisticated forward dynamics models could learn even better abstractions. Finally, while the model learns what it can control, it doesn't explicitly model complex uncontrollable elements (like enemy AI patterns) that might also be important for high-level strategy. This remains an open area for future contingency-aware research.
Summary updated