When should agents explore?

Miruna Pislar, David Szepesvari, Georg Ostrovski, Diana L Borsa, Tom Schaul

Introduction

In reinforcement learning (RL), exploration is typically treated as a constant background noise. Methods like $\epsilon$-greedy take a random action with some fixed probability at every single step. This "monolithic" approach contrasts sharply with how humans and animals learn. When mastering a new skill, humans do not inject random twitches into their movements every few seconds; instead, they dedicate specific, prolonged periods to exploring new techniques while exploiting their existing knowledge the rest of the time.

This paper shifts the focus of RL exploration from how much to explore to when to explore. By moving away from monolithic policies and instead switching between dedicated "explore" and "exploit" modes within a single episode, the authors demonstrate that the temporal structure of exploration is a powerful, underutilized lever for improving agent performance on complex tasks.

The Limits of Monolithic Exploration

While previous research has extensively covered the volume of exploration (tuning $\epsilon$) and the type of exploration (random vs. intrinsic motivation), the specific timing and duration of exploratory bursts have been largely ignored.

Visualizing different exploration strategies across episodes. Pink segments represent explore mode, while blue segments represent exploit mode.

The authors introduce a framework for intra-episodic exploration, where an agent dynamically switches between two distinct modes:

  1. Exploit Mode ($\mathcal{G}$): The agent follows its current best (greedy) policy to maximize known rewards.
  2. Explore Mode ($\mathcal{X}$): The agent follows an exploratory policy, such as uniform random actions ($\mathcal{X}_U$) or an intrinsically motivated policy like Random Network Distillation ($\mathcal{X}_I$).

Mechanisms for Mode-Switching

The core innovation lies in how and when the agent decides to switch between these modes. The paper proposes several switching mechanisms:

  • Blind Switching: Switches occur based on fixed counters or probabilities (e.g., "explore for 10 steps every 100 steps"). While simple, this provides a baseline for structured exploration.
  • Informed Switching: Switches are triggered dynamically by the agent's internal state. The authors propose a "Value Promise Discrepancy" ($D_{promise}$) signal. If the actual reward significantly deviates from what the value function predicted several steps prior, it signals environmental uncertainty, triggering a switch to "explore" mode.
  • Bandit Adaptation: To avoid manual hyperparameter tuning for switching frequencies, a multi-armed bandit meta-controller is employed to adapt the frequency and duration of exploration periods on the fly.
  • Homeostasis: Because the scale of "surprise" signals (like $D_{promise}$) changes as the agent learns, a "homeostasis" mechanism adaptively adjusts the switching threshold. This ensures the agent maintains a target exploration rate even as it becomes more proficient and absolute prediction errors decrease.

Key Results on Atari

The researchers evaluated their approach using the Atari Learning Environment (ALE), focusing on hard-exploration games like Montezuma’s Revenge, Gravitar, and Frostbite.

Learning curves showing intrinsic reward exploration. The intra-episodic switching method (red dashed line) consistently outperforms step-level and episode-level baselines.

The results demonstrate that intra-episodic exploration consistently outperforms both step-level ($\epsilon$-greedy) and episode-level switching baselines.

  • Concentrated Bursts: The temporal structure of exploration matters more than the total budget. Concentrated bursts of exploration proved far more effective than diluted noise injected at every step.
  • Surgical Exploration: The informed trigger ($D_{promise}$) was particularly effective. By "knowing when it doesn't know," the agent can deploy exploration surgically precisely when it is confused by the environment.
  • Behavioral Diversity: The bandit meta-controller learned highly diverse strategies across different games, such as exploring heavily at the beginning of an episode in some environments, but reserving exploration for later stages in others.

Limitations and Future Directions

While promising, mode-switching introduces new challenges. Switching modes creates a highly "off-policy" data distribution. Although standard corrections weren't strictly necessary for the architectures tested in this study, off-policy learning could become a hurdle for more complex setups.

Furthermore, the current framework is limited to two modes. Future work could expand this to include multiple specialized modes, such as "novelty-seeking," "mastery-seeking," and "safety-constrained" behaviors. Refining the trigger signals—perhaps using ensemble discrepancy or density models—could also provide even more precise indicators for when an agent should abandon its greedy path and start exploring.

Summary updated

BibTeX
@inproceedings{pislar2022when,
  author = {Miruna Pislar and David Szepesvari and Georg Ostrovski and Diana L Borsa and Tom Schaul},
  title = {{When should agents explore?}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=dEwfxt14bca},
}
Figure