Abstract
In a reward-free environment, what is a suitable intrinsic objective for an agent to pursue so that it can learn an optimal task-agnostic exploration policy? In this paper, we argue that the entropy of the state distribution induced by finite-horizon trajectories is a sensible target. Especially, we present a novel and practical policy-search algorithm, Maximum Entropy POLicy optimization (MEPOL), to learn a policy that maximizes a non-parametric, $k$-nearest neighbors estimate of the state distribution entropy. In contrast to known methods, MEPOL is completely model-free as it requires neither to estimate the state distribution of any policy nor to model transition dynamics. Then, we empirically show that MEPOL allows learning a maximum-entropy exploration policy in high-dimensional, continuous-control domains, and how this policy facilitates learning a variety of meaningful reward-based tasks downstream.
Introduction
Traditional Reinforcement Learning (RL) agents are typically reward-driven, optimized to maximize a specific signal defined by human designers. However, hand-crafting rewards is notoriously difficult, and policies trained for specific tasks often fail to generalize. This paper addresses the challenge of task-agnostic exploration: how can an agent learn to navigate an environment effectively before a specific goal is known?
Effective exploration builds foundational skills—primitives like standing, jumping, or navigating—that can be leveraged for various downstream tasks. Previous approaches often relied on environment models or explicit density estimation, which frequently struggle in high-dimensional, continuous state spaces.
MEPOL: Maximum Entropy Policy Optimization
The proposed algorithm, MEPOL, seeks to maximize the entropy of the state distribution. By maximizing entropy, the agent is incentivized to visit as many distinct states as possible with uniform frequency, ensuring broad coverage of the environment.
Technical Innovations
- Non-Parametric Entropy Estimation: Instead of learning a parametric model of state density, MEPOL utilizes a $k$-nearest neighbors ($k$-NN) estimator. This approach measures the distance between samples in a batch; larger distances indicate higher entropy. This method is significantly more robust in high-dimensional spaces compared to traditional Kernel Density Estimation (KDE).
- Importance-Weighted Gradient: To maintain stability and a model-free nature, the authors derived a novel gradient for an importance-weighted version of the $k$-NN estimator. This enables off-policy updates, which substantially improves sample efficiency.
- Trust-Region Optimization: MEPOL incorporates a trust-region constraint, similar to TRPO, to limit policy updates. This prevents the exploration strategy from collapsing during training.
Experimental Evaluation
MEPOL was evaluated across a range of continuous control environments of increasing complexity:
- Illustrative Benchmarks: 2D GridWorld and MountainCar.
- MuJoCo Suite: High-dimensional tasks including Ant (29D), Humanoid (47D), and HandReach (63D).
- Stress Tests: A 200D GridWorld and an AntMaze environment.
Results and Discussion
MEPOL demonstrates superior performance in both state space coverage and downstream task learning.
Superior State Coverage
In high-dimensional environments like Humanoid and Ant, MEPOL achieved significantly higher entropy values than existing state-of-the-art methods like MaxEnt. While MaxEnt often converged prematurely to low-entropy behaviors, MEPOL continued to expand the agent's reach.
Downstream Task Performance
When used as an initialization for standard RL algorithms (e.g., TRPO), MEPOL-trained policies allowed agents to solve sparse-reward tasks—such as "Ant Jump"—much faster than starting from scratch or using other intrinsic motivation methods like ICM or SMM. In some instances, the exploration policy was so effective it achieved "zero-shot" success on downstream tasks.
Scaling to High Dimensions
A key strength of the $k$-NN approach is its scalability. MEPOL successfully explored a 200-dimensional GridWorld, a task that is computationally prohibitive for density-based methods.
Conclusion and Future Work
MEPOL provides a robust, model-free framework for task-agnostic exploration. While highly effective, current limitations include the reliance on Euclidean distance for $k$-NN, which may not be ideal for raw pixel inputs. Future work will explore learning latent embeddings for more complex observations and implementing adaptive exploration horizons to further enhance efficiency.
Summary updated