Reinforcement Learning for Classical Planning: Viewing Heuristics as Dense Reward Generators

Clement Gehring, Masataro Asai, Rohan Chitnis, Tom Silver, Leslie Pack Kaelbling, Shirin Sohrabi, Michael Katz

TL;DR

Applying deep reinforcement learning (RL) directly to classical planning usually fails because long-horizon, goal-directed tasks produce severely sparse rewards. This paper overcomes that bottleneck by converting domain-independent planning heuristics into dense reward signals via potential-based reward shaping, allowing an RL agent to learn domain-specific value residuals. Implemented using Neural Logic Machines (NLMs), the resulting learned heuristics significantly speed up search algorithms and generalize seamlessly to much larger problems than seen during training.

What Problem Does This Paper Address?

Classical automated planning focuses on long-horizon, deterministic tasks formulated in symbolic languages like PDDL/STRIPS (e.g., logistics routing, block manipulation, satellite operations). While standard classical planners routinely solve problems spanning hundreds or thousands of steps, they rely on domain-independent heuristics—rules that work across all domains but are often weak within any specific one. Hand-crafting domain-specific heuristics yields far superior performance, but requires intensive domain engineering.

Deep RL offers a natural framework to learn domain-specific policies autonomously, but it struggles with classical planning due to:

  1. Extreme reward sparsity: RL agents receive no feedback until the goal is randomly reached.
  2. First-order logic representations: States vary in object counts and relational structures, which standard neural networks cannot consume natively.
  3. Mismatched objectives: Classical planning minimizes cumulative undiscounted costs, whereas standard RL maximizes discounted returns.

Methods

The authors build a bridge between symbolic planning and deep RL through three core components:

  • Discounted Potential-Based Reward Shaping: Potential-based reward shaping adds an auxiliary term $\gamma \phi(s') - \phi(s)$ to the environment reward without changing the optimal policy. The authors set the potential $\phi(s)$ using existing domain-independent heuristics (like $h^{\text{FF}}$ or $h^{\text{add}}$). To resolve the mathematical divergence between undiscounted cost-to-go $h(s)$ and discounted RL value functions $V_\gamma(s)$, they define the discounted heuristic: $$h_\gamma(s) = \sum_{t=1}^{h(s)} \gamma^t = \frac{1 - \gamma^{h(s)}}{1 - \gamma}$$ Setting $\phi(s) = -h_\gamma(s)$ guarantees that an oracle heuristic requires zero residual correction ($\hat{V}^*_\gamma = 0$) while bounding potential values in $[0, \frac{1}{1-\gamma}]$, preventing numeric overflow at dead-ends.

  • Classical RTDP with Experience Replay: An adapted on-policy Real-Time Dynamic Programming (RTDP) algorithm updates the value network. Crucially, the replay buffer is partitioned into buckets grouped by the number of objects. This prevents longer trajectories from larger problems from dominating the buffer and triggering catastrophic forgetting.

  • Neural Logic Machines (NLMs): Rather than using standard MLPs or Graph Neural Networks (GNNs), value functions are parameterized with NLMs. NLMs operate directly on multi-arity predicate tensors via differentiable logical operations (EXPAND, REDUCE, and COMPOSE), learning stratified first-order Horn rules that remain invariant to object permutations and problem sizes.
       [State s, Goal G] (STRIPS Relations)
                  │
                  ▼
         ┌──────────────────┐
         │       NLM        │  ──►  Learned Residual V̂(s, G)
         └──────────────────┘                   │
                  ▲                             │ (+)
                  │                             ▼
  Heuristic Guidance / Dense Reward:    Total Heuristic / Value:
      φ(s) = -h_γ(s)                 V(s, G) = V̂(s, G) - h_γ(s)

Datasets

The authors evaluated the method across 8 standard International Planning Competition (IPC) benchmark domains:

  • 4-ops Blocksworld, Ferry, Gripper, Logistics, Satellite, Miconic, Parking, and Visitall.

Training and test sets were created using standard parameterized problem generators:

  • Training set: 195 to 500 small instances per domain (e.g., 2–6 objects in Blocksworld).
  • Testing set: 250 to 700 larger instances per domain spanning realistic IPC scales (e.g., 10–50 objects in Blocksworld).

Key Insights and Ideas

  • Heuristics as dense exploratory stepping stones: Approaching a goal reduces the heuristic value $h(s)$, which immediately translates to a positive shaped reward $\gamma \phi(s') - \phi(s) > 0$. The agent receives constant feedback rather than wandering blindly until a terminal goal state.
  • Residual learning over heuristics: Instead of forcing the neural network to learn complex distance metrics from scratch, the network only learns the residual difference between the true cost-to-go and the classical heuristic.
  • Structural out-of-distribution generalization: Because NLMs learn lifted first-order rules, their weights are independent of object counts. The model trains exclusively on small, computationally cheap instances but transfers directly to large-scale test instances.

Key Results

Evaluated within Greedy Best-First Search (GBFS) under a limit of 100,000 node evaluations:

  • Massive exploration gains during training: Shaped agents reached goal states far more frequently during training than unshaped baselines (e.g., in Ferry, $976 \pm 19$ goals reached with $h^{\text{add}}$ shaping vs. $516 \pm 52$ for unshaped $h^{\text{bl}}$).
  • Improved coverage: Reward-shaped heuristics ($H^{\text{FF}}$ and $H^{\text{add}}$) significantly outperformed unshaped RL ($H^{\text{bl}}$) and raw base heuristics in complex domains like Blocks ($186.6$ coverage for $H^{\text{add}}$ vs. $126$ for baseline $h^{\text{add}}$) and Parking ($696.9$ for $H^{\text{FF}}$ vs. $607$ for baseline $h^{\text{add}}$).
  • Search efficiency: Where coverage was already saturated (e.g., Gripper, Visitall), node evaluation plots showed notable reductions in the number of states expanded to find a solution.
  • Outperforming GNN baselines: GBFS using $H^{\text{add}}$ and $H^{\text{FF}}$ outperformed the GNN-based RL baseline (GBFS-H) in 7 out of 8 domains.
  • Generalization to large instances: In Blocksworld, agents trained on problems with only 2–6 blocks maintained strong success rates on evaluation instances containing up to 50 blocks.

Limitations and Future Work

  • High variance across training seeds: RL performance remained sensitive to random seeds (e.g., Logistics saw gains only on its single best seed), indicating that multiple runs are currently required to obtain high-performing heuristics.
  • Plan quality vs. search speed: The heuristics were evaluated inside GBFS for satisficing planning (finding any plan quickly), sacrificing the plan-optimality guarantees typically targeted by admissible heuristics in $A^*$.
  • Domain restrictions: The current formulation assumes unit action costs and deterministic STRIPS domains; adapting it to non-unit costs or numeric/temporal planning remains an open challenge.

Summary updated

BibTeX
@inproceedings{gehring2022reinforcement,
  author = {Clement Gehring and Masataro Asai and Rohan Chitnis and Tom Silver and Leslie Pack Kaelbling and Shirin Sohrabi and Michael Katz},
  title = {{Reinforcement Learning for Classical Planning: Viewing Heuristics as Dense Reward Generators}},
  booktitle = {ICAPS},
  year = {2022},
  url = {https://openreview.net/forum?id=FtRMaOtCZ-},
}

Loading related content...

Figure