Abstract
Reinforcement learning (RL) is a powerful learning paradigm in which agents can learn to maximize sparse and delayed reward signals. Although RL has had many impressive successes in complex domains, learning can take hours, days, or even years of training data. A major challenge of contemporary RL research is to discover how to learn with less data. Previous work has shown that domain information can be successfully used to shape the reward; by adding additional reward information, the agent can learn with much less data. Furthermore, if the reward is constructed from a potential function, the optimal policy is guaranteed to be unaltered. While such potential-based reward shaping (PBRS) holds promise, it is limited by the need for a well-defined potential function. Ideally, we would like to be able to take arbitrary advice from a human or other agent and improve performance without affecting the optimal policy. The recently introduced dynamic potential-based advice (DPBA) was proposed to tackle this challenge by predicting the potential function values as part of the learning process. However, this article demonstrates theoretically and empirically that, while DPBA can facilitate learning with good advice, it does in fact alter the optimal policy. We further show that when adding the correction term to “fix” DPBA it no longer shows effective shaping with good advice. We then present a simple method called policy invariant explicit shaping (PIES) and show theoretically and empirically that PIES can use arbitrary advice, speed-up learning, and leave the optimal policy unchanged.
Introduction
Reinforcement Learning (RL) is notoriously data-hungry. In environments with "sparse rewards"—where an agent only receives a success signal at the end of a long sequence of actions—learning can take millions of trials. To accelerate this process, researchers often employ reward shaping: the addition of artificial rewards to guide the agent toward the goal.
However, reward shaping carries a significant risk: if the shaping is poorly designed, the agent may find a "loophole" that allows it to maximize rewards without completing the task. While Potential-Based Reward Shaping (PBRS) was developed to ensure that the optimal policy remains unchanged (policy invariance), it requires advice to be formatted as a specific mathematical potential function. This is often impractical for human-provided advice. A newer method, Dynamic Potential-Based Advice (DPBA), claimed to allow arbitrary advice while maintaining safety. This paper proves that DPBA is not policy invariant and introduces Policy Invariant Explicit Shaping (PIES) as a robust alternative.
The Failure of Dynamic Potential-Based Advice
The authors provide theoretical proof and empirical evidence showing that DPBA is not policy invariant. The bias in DPBA depends on the current estimate of the potential function, which can lead the agent to converge on a sub-optimal policy. Furthermore, the authors demonstrate that adding a mathematical correction term to "fix" DPBA's invariance issues effectively cancels out the benefits of the advice, making it no more efficient than standard RL without shaping.
Policy Invariant Explicit Shaping (PIES)
To address these limitations, the authors propose PIES. Unlike traditional reward shaping, which modifies the environment's reward function, PIES modifies the agent's action selection process.
In PIES, the agent learns two functions in parallel:
- The standard value function ($Q$) derived from environment rewards.
- A secondary value function ($\Phi$) based on external advice.
During action selection, the agent considers $Q + \xi\Phi$. The hyperparameter $\xi$ (xi) is designed to decay over time. Early in training, the agent relies heavily on the advice ($\Phi$). As experience grows, $\xi$ drops to zero, ensuring the agent eventually relies solely on the true environment rewards ($Q$). This separation of concerns guarantees that the agent will eventually find the true optimal policy, regardless of the quality of the initial advice.
Experimental Evaluation
The researchers evaluated PIES against standard Sarsa and DPBA on several benchmarks:
- Grid-World: Navigation tasks (2x2 and 20x20) used to test theoretical flaws and scalability.
- Cart-Pole: A classic control task involving balancing a pole on a moving cart.
- Mountain Car: A task requiring momentum to drive a car up a steep hill.
Key Results and Insights
- Robustness to Bad Advice: In the Toy Grid-World, DPBA failed to find the goal when given misleading advice. PIES successfully ignored the bad advice over time and converged to the optimal path.
- Learning Acceleration: In Cart-Pole and Mountain Car, PIES significantly outperformed both standard Sarsa and the corrected version of DPBA, reaching peak performance faster than all baselines.
- Policy Invariance: PIES was the only method that consistently accepted arbitrary advice, accelerated learning, and guaranteed the preservation of the original optimal policy.
Conclusion and Future Work
PIES provides a simple yet effective framework for incorporating arbitrary advice into RL agents without the risk of policy corruption. While the current method requires manual tuning of the decay schedule for $\xi$, future work will focus on automatically learning optimal decay rates and testing PIES in Deep RL settings with high-dimensional inputs.
Summary updated