Abstract
This paper introduces the first theoretical framework for applying potential-based reward shaping (PBRS) to continuing reinforcement learning tasks, where the objective is to maximize average reward over an infinite horizon. By synthesizing shaping rewards from high-level Linear Temporal Logic (LTL) formulas, the proposed method enables agents to learn complex behaviors faster while remaining robust to imperfect human advice. Experimental results across multiple benchmarks demonstrate that this logic-based shaping significantly outperforms standard baselines and rigid "shielding" methods.
Introduction
Reinforcement learning (RL) often faces the "sparse reward" problem, where an agent receives feedback too infrequently to learn efficiently. While reward shaping—adding auxiliary rewards to guide the agent—is well-established for discounted-reward tasks, it has lacked a formal theoretical foundation for continuing tasks. Continuing tasks, such as climate control or perpetual facility cleaning, require maximizing the average reward over time rather than a discounted sum. This research bridges that gap, providing a mathematically sound way to incorporate human domain knowledge into average-reward RL.
Methodology: From Logic to Rewards
The core innovation lies in translating qualitative human advice into quantitative potential functions. The process follows four key steps:
- Theoretical Extension: The authors prove that PBRS preserves policy optimality in average-reward settings, ensuring that the added "hints" do not lead the agent to sub-optimal, exploitative behaviors.
- LTL Specification: Users provide advice using Linear Temporal Logic (LTL), a formal language capable of expressing temporal constraints like "Always keep the human in sight" ($\square \text{human\_visible}$).
- Automated Synthesis: The LTL formula is converted into a Deterministic Finite Automaton (DFA). By analyzing the product of the environment and this DFA, the algorithm identifies "winning regions" where the logic formula is satisfied.
- Potential Function Generation: A potential function is automatically generated to assign higher values to states within or approaching the winning region, effectively "pulling" the agent toward the desired behavior.
Experimental Evaluation
The approach was evaluated on three primary benchmarks:
- Continual Area Sweeping: A robot cleaning task in a Gazebo-simulated environment where trash appears stochastically.
- Continuing Cart Pole: A modified classic benchmark where the agent must indefinitely balance a pole, even after it falls.
- Continuing Grid World: A controlled environment used to test robustness against "imperfect" advice (e.g., advice that suggests staying in a low-reward area).
Key Results and Discussion
The experiments revealed two major advantages of logic-based shaping:
1. Faster Convergence
In the Area Sweeping task, the shaping agent reached peak performance significantly faster than the baseline Differential Q-learning agent. By providing a clear gradient toward the goal via the LTL-derived potential function, the agent avoids the aimless exploration typical of sparse-reward environments.
2. Robustness vs. Shielding
A common alternative to shaping is "shielding," which uses logic to physically block certain actions. However, the authors demonstrate that shielding is brittle; if the human's advice is slightly incorrect, a shielded agent is trapped and cannot find the true optimal policy. In contrast, the Shaping method treats advice as a suggestion. While it follows the advice initially to speed up learning, it can eventually "overrule" the shaping rewards if the environment's true rewards indicate a better path elsewhere.
Conclusion
This work provides a robust theoretical and practical framework for guiding RL agents in infinite-horizon tasks. By allowing non-experts to provide guidance through formal logic, the system bridges the gap between qualitative human knowledge and quantitative machine learning, ensuring both efficiency and safety in continuing autonomous systems.
Summary updated