The Importance of Non-Markovianity in Maximum State Entropy Exploration

Mirco Mutti, Riccardo De Santi, Marcello Restelli

In the realm of Reinforcement Learning (RL), the "Markov property"—the assumption that the current state contains all necessary information to make an optimal decision—is a foundational pillar. However, a compelling paper presented at ICML 2022 challenges this ubiquitous assumption. It argues that if an agent's goal is to explore an environment as thoroughly as possible within a strictly limited timeframe, relying solely on the present state is insufficient; the agent must remember where it has been.

While Markovian policies are theoretically sound for maximizing state entropy over infinite trials, they prove sub-optimal for exploration within a single, finite episode. This research demonstrates that non-Markovian (history-dependent) policies are essential for efficient finite-sample exploration, even though finding the mathematically optimal one is computationally NP-hard.

The Hidden Catch in Maximum State Entropy

Unsupervised RL agents frequently employ Maximum State Entropy (MSE) exploration to learn about an environment in the absence of a specific reward signal. The objective is straightforward: visit every state as uniformly as possible.

Existing literature generally asserts that Markovian policies—where decisions are based exclusively on the current state $s_t$—are sufficient to achieve this. However, the authors highlight a critical caveat: these theoretical proofs rely on an "infinite-sample" regime. A Markovian policy might explore perfectly on average over a million trials, but in any single trial, its performance can be highly erratic because it relies on randomization rather than memory.

Consider a robot navigating a two-room house. To efficiently explore both rooms in a single trip, a human would naturally visit Room A, remember that visit, and then proceed to Room B. A Markovian agent standing at the connecting doorway, possessing no memory of which room it just exited, is forced to essentially flip a coin. Consequently, it might visit Room A twice and completely ignore Room B.

Illustrative two-rooms domain showing how memory helps choose the unvisited room.

Bridging Theory and Practice: Finite-Sample MSE

To address this discrepancy, the authors introduce a finite-sample MSE objective. Rather than maximizing the entropy of the expected state distribution over infinite time, they focus on maximizing the expected entropy of the actual visitation frequencies within a single, finite trajectory.

To analyze this new objective, the paper introduces several key concepts:

  1. Regret-to-go: A metric quantifying how much potential entropy an agent sacrifices by making a sub-optimal decision given its current trajectory history.
  2. Complexity Analysis: Through a reduction from the 3-Satisfiability (3SAT) problem, the authors prove that determining the optimal history-dependent policy is computationally NP-hard.
  3. Extended MDPs: A theoretical construct where the "state" is redefined to encompass the entire history of the trajectory. While this makes the problem theoretically solvable, it incurs an exponential computational cost.

Experimental Insights: Memory vs. Randomization

The paper evaluates its theoretical claims using two classic, discrete RL environments:

  • 3State: A minimal abstraction of the two-room problem where the agent starts in the center and must choose to move left or right.
  • River Swim: A benchmark for "hard exploration" where an agent must swim against a current to reach states offering higher potential information.

A crucial insight from the research is the relationship between randomization and efficiency. Markovian policies must be randomized to achieve high entropy on average across many trials. However, randomization is highly inefficient in a single trial. Conversely, a non-Markovian policy can be deterministic and optimal because it leverages its history to systematically "fill in the blanks" of its exploration map. The paper formally proves that for any environment where the optimal Markovian policy is stochastic, a non-Markovian policy will strictly outperform it in a single trial.

Comparison of Average Entropy and State Visitation Frequency between Markovian and Non-Markovian policies.

The theoretical proofs are robustly supported by numerical simulations. In the 3State domain, the non-Markovian policy ($\pi_{NM}$) consistently achieves the maximum possible entropy. In contrast, the Markovian policy ($\pi_M$) lags significantly because it cannot "remember" which side it has already explored. Similarly, in the River Swim task, while both policies eventually reach the far end of the river, only the non-Markovian policy perfectly balances its visits to intermediate states on the return trip, yielding a substantially higher overall entropy score.

Limitations and the Path Forward

The primary limitation of this approach is the computational explosion associated with tracking history. As the history length $T$ increases, the number of possible histories grows exponentially, rendering the "Extended MDP" approach impractical for complex, real-world tasks. This complexity wall explains why most practical algorithms continue to rely on Markovian approximations despite their inherent limitations.

To overcome this hurdle, the authors propose several tractable avenues for future research:

  • Finite-Length Histories: Implementing a sliding window of the last $H$ steps rather than tracking the entire episode history.
  • Deep Recurrent Policies: Utilizing architectures like LSTMs or GRUs to learn compact, compressed representations of history. This practice is already common in Deep RL, but this paper provides a much stronger theoretical justification for its use in exploration.
  • Monte-Carlo Tree Search (MCTS): Employing simulation-based look-ahead strategies to determine the next best exploratory action without explicitly calculating the full, exponentially large policy.

Ultimately, this paper serves as a vital reminder that while the Markov assumption simplifies computation, true exploratory efficiency in finite time fundamentally requires the capacity to remember the past.

Summary updated

BibTeX
@inproceedings{mutti2022importance,
  author = {Mirco Mutti and Riccardo De Santi and Marcello Restelli},
  title = {{The Importance of Non-Markovianity in Maximum State Entropy Exploration}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=9m_DMd9eMz8},
}
Figure