Non-Markovian Rewards Expressed in LTL: Guiding Search Via Reward Shaping

Alberto Camacho, Oscar Chen, Scott Sanner, Sheila A. McIlraith

Introduction

Automated planning often faces a significant hurdle when rewards are sparse or delayed. In many real-world scenarios, an agent's success depends on a complex sequence of actions rather than immediate state-action pairs. This paper, presented at SoCS 2017, addresses the challenge of solving decision-making problems with non-Markovian rewards—where the reward depends on the history of the agent's behavior.

Problem Formulation: The Sparse Reward Challenge

Standard Markov Decision Process (MDP) solvers rely on the "Markov property," assuming rewards depend only on the current state and action. However, tasks like "open the freezer, grab ice, and then close the freezer" require tracking history. This leads to two primary issues:

  1. Specification: Formally describing history-dependent rewards.
  2. Search Efficiency: In search-based planners like Monte Carlo Tree Search (MCTS), agents may wander aimlessly before encountering a reward sequence, a problem known as the "sparse reward" problem.

Proposed Methodology

The authors introduce a three-step pipeline to integrate complex temporal goals into efficient MDP planning:

1. Formal Specification with $LTL_f$

Linear Temporal Logic over finite traces ($LTL_f$) is used to define rewards. This allows for human-readable specifications of temporal constraints, such as "whenever a door is opened, it must eventually be closed."

2. Automata Compilation

Each $LTL_f$ formula is automatically translated into a Deterministic Finite Automaton (DFA). This DFA acts as a progress tracker, transitioning through states as the agent fulfills components of the temporal goal.

3. Potential-Based Reward Shaping

While adding a DFA makes the problem Markovian, it does not inherently solve the search problem. The authors apply Potential-Based Reward Shaping (PBRS). They assign a "potential" value to each DFA state based on its proximity to the accepting (goal) state. As the agent progresses through the DFA, it receives small, intermediate "shaping rewards." Crucially, PBRS guarantees that the optimal policy of the shaped MDP remains identical to that of the original problem.

Experimental Evaluation

The approach was tested on modified domains from the International Probabilistic Planning Competitions (IPPC):

  • Academic Advising: Agents must navigate complex course prerequisites.
  • Wildfire: Agents manage fire propagation across a grid.

Key Results and Discussion

The evaluation compared various configurations of the state-of-the-art PROST planner. The results demonstrate that reward shaping provides a critical "GPS" for search-based planners, overcoming myopia and improving memory efficiency.

Success Rates in Academic Advising

In the Academic Advising domain, standard planners often failed completely on complex problem instances. As shown in Figure 1, while standard MDP planners achieved zero successes on harder problems (p_4_3, p_4_4), the addition of reward shaping (MDP + RS) resulted in a 100% success rate (30 out of 30 trials) across all tested instances.

Success rates (out of 30) for various planners on Academic Advising instances, comparing standard MDP vs. MDP with Reward Shaping (RS).

Performance in the Wildfire Domain

In the Wildfire domain, standard planners frequently exceeded memory limits due to exhaustive exploration of irrelevant states. Reward shaping significantly improved average rewards. As seen in Figure 2, planners using RS achieved much higher average rewards compared to baselines. For instance, PROST IPPC-2011 reached a score of 637 with RS, whereas standard configurations struggled to complete the tasks effectively.

Average rewards in the Wildfire domain, comparing planners with and without reward shaping.

Conclusion

By using DFAs as heuristics, the authors effectively guide agents toward long-term goals. Reward shaping ensures that the search remains focused on useful states, making the planning process both more successful and more memory-efficient. Future work may explore more sophisticated distance metrics for DFA states and the application of this logic to infinite-horizon problems.

Summary updated

BibTeX
@inproceedings{camacho2017non,
  author = {Alberto Camacho and Oscar Chen and Scott Sanner and Sheila A. McIlraith},
  title = {{Non-Markovian Rewards Expressed in LTL: Guiding Search Via Reward Shaping}},
  booktitle = {SOCS},
  year = {2017},
  doi = {10.1609/socs.v8i1.18421},
}
Figure