Potential-based Shaping in Model-based Reinforcement Learning

John Asmuth, Michael L. Littman, Robert Zinkov

Abstract

Reinforcement learning (RL) agents often struggle with high experience complexity, requiring numerous interactions to learn optimal behaviors. This paper presents a novel integration of potential-based reward shaping with model-based RL, specifically the Rmax algorithm. By utilizing "admissible" potential functions to guide exploration in unknown states, the proposed "Rmax with Shaping" algorithm maintains PAC-MDP guarantees while significantly accelerating convergence. Empirical evaluations on grid-world benchmarks, including a complex 15x15 maze and a treacherous "Bridge" maze, demonstrate that our approach is both faster than standard model-based methods and more robust than heuristic-driven alternatives.

Introduction

A fundamental challenge in Reinforcement Learning is the "exploration-exploitation" trade-off, often leading to high experience complexity. Agents must explore unknown states to find rewards, but excessive exploration is inefficient. Model-based RL algorithms like Rmax address this by building an internal model and being "optimistic" about unknown states, assigning them a maximum possible value ($v_{max}$). Reward shaping offers another solution by providing a potential function $\Phi(s)$—a set of "hints" that guide the agent toward goals.

This paper explores whether these two orthogonal approaches can be combined. Specifically, can we use shaping to provide a more nuanced, "sloped" optimism in model-based learning without losing the theoretical guarantees that the agent will eventually find the optimal policy?

Methods: Rmax with Shaping

The authors introduce a shaped variant of the Rmax algorithm. In standard Rmax, unknown state-action pairs are treated as transitions to a virtual state with value $v_{max}$. In the shaped version, the agent uses the potential function $\Phi(s)$ to estimate the value of these unknown states.

Admissibility and PAC-MDP Guarantees

A critical requirement for the shaping function is admissibility. Borrowing from search theory, a shaping function is admissible if it never underestimates the true optimal value of a state ($\Phi(s) \geq V^*(s)$). The authors prove that as long as the shaping function is admissible, the algorithm remains Probably Approximately Correct in Markov Decision Processes (PAC-MDP). This ensures that the agent is guaranteed to find a near-optimal policy within a polynomial number of steps. Conversely, "inadmissible" (overly pessimistic) hints can lead the agent to permanently ignore optimal paths.

Experimental Evaluation

The approach was tested on two custom grid-world environments:

  1. 15x15 Maze: A navigation task with walls and terminal pits.
  2. 4x6 "Bridge" Maze: A smaller but more difficult environment featuring a narrow bridge flanked by high-penalty pits, designed to test the robustness of exploration strategies.

Key Results

The experiments revealed significant advantages for the shaped Rmax approach in terms of both speed and reliability.

Accelerated Learning

In the 15x15 maze, Rmax with shaping reached an optimal policy in approximately half the number of episodes required by the standard Rmax baseline. By replacing the flat $v_{max}$ with a sloped potential function, the agent's exploration was directed more efficiently toward the goal.

Figure 4: Cumulative reward in the 15x15 maze environment. Rmax with shaping (blue triangles) converges to the optimal policy significantly faster than standard Rmax (green x).

Robustness in Tricky Environments

The "Bridge" maze highlighted the importance of theoretical guarantees. Algorithms like ARTDP, which rely on heuristics but lack PAC-MDP properties, were prone to failure. In this environment, a single negative experience in a pit could cause such algorithms to permanently label the bridge as a "dead end." In contrast, Rmax with shaping remained robust, consistently finding the optimal path.

Figure 5: Cumulative reward in the 4x6 Bridge maze environment. While some heuristic methods fail to recover from early penalties (e.g., ARTDP, cyan diamonds), Rmax with shaping (green triangles) maintains a robust path to the goal.

Discussion and Key Insights

  • Complementary Strengths: Shaping provides domain-specific "background knowledge," while model-based learning provides "structural efficiency." Their combination is more effective than either technique alone.
  • Nuanced Optimism: Standard Rmax is essentially a special case of shaped Rmax with a constant potential function $\Phi(s) = v_{max}$. The shaped version allows for a more informed exploration strategy.
  • The Danger of Bad Advice: The paper emphasizes that while good hints accelerate learning, inadmissible (pessimistic) hints are catastrophic, as they can lead a model-based agent to believe a goal is unreachable.

Conclusion

By integrating potential-based shaping into the Rmax framework, the authors have created a learner that is both theoretically sound and practically efficient. This work paves the way for incorporating human expertise into autonomous agents more effectively, with future work focusing on automating the discovery of admissible potential functions and scaling to continuous, high-dimensional environments.

Summary updated

BibTeX
@inproceedings{asmuth2008potential,
  author = {John Asmuth and Michael L. Littman and Robert Zinkov},
  title = {{Potential-based Shaping in Model-based Reinforcement Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2008},
}
Figure