In reinforcement learning (RL), "sparse rewards" represent a significant hurdle to efficient training. When an agent only receives feedback upon completing a complex task, it often wanders aimlessly for millions of steps. While "Reward Shaping"—adding intermediate rewards—can mitigate this, it typically requires human experts to manually design these functions, a process that is often error-prone and labor-intensive.
This paper introduces ROSA (Reinforcement Learning Optimising Shaping Algorithm), a framework that automates reward shaping by framing it as a strategic game between two agents.
The ROSA Framework: A Game of Two Partners
ROSA treats the learning process as a two-player, non-zero-sum Markov Game involving a Controller and a Shaper. The Controller is the primary agent tasked with solving the environment, while the Shaper acts as a "teacher" that provides supplemental rewards to guide the Controller toward the goal.
The Switching Control Mechanism
A key innovation in ROSA is the use of switching controls. Instead of attempting to provide a reward at every timestep, the Shaper makes a binary decision at each state: whether or not to "switch on" a shaping reward. This approach offers several advantages:
- Efficiency: It reduces the Shaper's decision space to identifying critical "bottleneck" states or subgoals.
- Focus: An associated switching cost incentivizes the Shaper to be selective, focusing only on states that are truly instrumental to the Controller's success.
Theoretical Guarantees
The authors utilize Potential-Based Reward Shaping to ensure two critical properties:
- Policy Invariance: The addition of the Shaper does not alter the optimal policy of the original task, preventing the agent from "cheating" by maximizing artificial rewards.
- Convergence: The system is formally proven to reach a stable Markov Perfect Equilibrium.
Experimental Evaluation
The authors evaluated ROSA across a variety of environments, including didactic mazes, classic control tasks (Sparse Cartpole), and complex Atari games (Gravitar, Solaris, and Super Mario Brothers).
Key Findings
- Overcoming the 'TV Problem': In environments with 'red herrings'—novel but useless areas—curiosity-based methods like RND often get distracted. ROSA successfully ignores these distractions because they do not contribute to the Controller's goal.
- Subgoal Discovery: Analysis of the Shaper’s behavior shows it naturally learns to reward 'bottleneck' states, such as doorways, effectively decomposing complex tasks into manageable stages.
- Plug-and-Play Versatility: ROSA is algorithm-agnostic. The authors demonstrated significant performance gains when integrating ROSA with established algorithms like PPO and TRPO.
Discussion and Conclusion
ROSA represents a significant step toward autonomous reward shaping. By framing the problem as a game of switching controls, it provides a robust mechanism for discovering subgoals without the need for human intervention or the risk of policy distraction common in curiosity-based methods.
While ROSA shows superior performance and stability across diverse benchmarks, it does introduce some computational overhead by training two agents simultaneously. Additionally, performance can be sensitive to the 'switching cost' hyperparameter. Future work may involve developing methods to dynamically tune this cost during training to further enhance autonomy.
Summary updated