arXiv:2610.08246cs.AIOct 2026

Manuscript Offprint

arXiv:2610.08246

LeanPlan: Optimal Planning with LLM-Generated Heuristics and Admissibility Proofs

André G. Pereira, Augusto B. Corrêa, Felipe Meneguzzi, Jendrik Seipp

ABSTRACT

Frontier large language models (LLMs) can generate heuristic functions that guide search to achieve state-of-the-art performance in satisficing planning, where any plan is acceptable. However, these heuristics are not guaranteed to be admissible and can lead to suboptimal plans. We introduce LeanPlan, the first planning system that finds optimal plans with LLM-generated heuristics whose admissibility is machine-checked. Given a domain description and training tasks, an agentic loop uses planner feedback to iteratively improve a reusable domain-specific heuristic, its admissibility proof and the required domain assumptions. LeanPlan implements the heuristic, its proof and an efficient planner with machine-checked grounding and search in Lean 4. We evaluate LeanPlan on ten domains from the International Planning Competition and three new domains, using test tasks with up to 57 times as many objects as the training tasks. With GPT-5.6 Sol in the agentic loop, we successfully generate heuristics and admissibility proofs for all these domains. With the resulting heuristics, LeanPlan usually expands fewer states than the state-of-the-art Scorpion planner and solves more tasks overall.

1 INTRODUCTION

Classical planning asks for a sequence of actions that transforms an initial state into a state that satisfies a goal (Ghallab et al., 2004). Planning tasks come in domains, families of tasks with the same kinds of objects and actions, such as stacking blocks or moving a lift between floors. Domains and tasks are usually described in the Planning Domain Definition Language (PDDL) (Haslum et al., 2019). Heuristic search is one of the most successful approaches to classical planning (Bonet & Geffner, 2001; Hoffmann & Nebel, 2001). A heuristic estimates the cost of reaching a goal from a state, and the search uses these estimates to decide which states to explore next (Pearl, 1984). Domain-independent heuristics derive their estimates from the task description alone and therefore apply to any task. Domain-specific heuristics exploit knowledge about a particular domain and can be much more informative (Junghanns & Schaeffer, 2001), but a human expert usually has to design and implement each of them.

Large language models (LLMs) can now automate the design of such heuristics. Corrêa et al. (2025b) generate heuristic programs once per domain and select them on training tasks. With greedy best-first search, their strongest heuristics solve more unseen tasks in total than strong domain-independent heuristics. Other approaches repair candidate heuristics with counterexamples to a property checked on the training tasks (Pereira et al., 2026), generate heuristics for tasks given by successor generators and goal tests (Tuisov et al., 2026) or evolve domain-independent heuristic programs (Gestrin & Seipp, 2026). LLMs can also generate generalized plans, i.e., programs that produce plans for new tasks of a domain (Silver et al., 2024; Stein et al., 2026; Murray et al., 2026).

However, these approaches focus on satisficing planning, where any valid plan suffices. In optimal planning, we require a plan of minimum cost. A* search (Hart et al., 1968) provides this guarantee when its heuristic is admissible, meaning that it never overestimates the remaining plan cost. Admissibility is hard to establish, because it must hold in every state of every task of the domain, including tasks much larger than the training tasks. Neither testing on example tasks nor learning heuristic values from solved examples (Chen et al., 2024b) can establish this property. Futuhi &

Figure

Figure 1: Proof-guided heuristic development and reuse in LeanPlan. A deterministic generator translates the domain into a Lean module, and an agent revises a heuristic and its proof using feedback from Lean. At planning time, task checks enforce the proof assumptions.

Sturtevant (2026) study near-admissible neural heuristics with statistical generalization bounds, but these heuristics can still overestimate, so A* may return suboptimal plans. Phung et al. (2026) instead guarantee admissibility by construction: they evolve programs that choose task abstractions, from which pattern databases and cost partitioning derive admissible heuristics.

In this paper, we study a complementary approach: generating the heuristic program together with a proof of its admissibility. We introduce LeanPlan, the first planning system that finds optimal plans with LLM-generated heuristics whose admissibility is machine-checked. LeanPlan implements each domain heuristic and its proof in Lean 4 (de Moura & Ullrich, 2021), a programming language and proof assistant, so that Lean's kernel checks the proof. The heuristic can be any Lean program, for example one that combines domain-specific action counts, distance bounds and dead-end tests, as long as its admissibility can be proved. Because the proof is about the code that the planner actually runs, there is no separate implementation that could deviate from the verified one. Shared proofs, which apply to all domains, turn each admissibility proof into an optimality guarantee for the plans that the planner returns. Unlike a statistical generalization bound, the proof covers every task of the domain that satisfies its checked assumptions, however large, and not only the training tasks.

Figure 1 shows how LeanPlan develops and uses a heuristic. A deterministic generator first translates the PDDL domain into a Lean module, which fixes the vocabulary available to the heuristic and its proof. Given this module, the domain's training tasks and a shared proof library, an LLM coding agent writes the heuristic, its admissibility proof and Boolean checks of the domain assumptions that the proof relies on. The agent builds the code and runs the planner itself, uses failures as feedback and revises the artifacts until it judges that it cannot improve the heuristic further. Whether the proof is correct is decided by Lean's kernel, a small trusted proof checker, and not by the agent's own report of success. An accepted heuristic then serves A* on new tasks of the domain, without further LLM calls or new proofs.

We evaluate LeanPlan on 900 test tasks from ten domains of the Learning Track of the 2023 International Planning Competition (IPC) (Taitler et al., 2024) and on 270 test tasks from three new domains. The new domains were not publicly available before our experiments, which rules out exposure through public LLM training data. In IPC 2023, the hard test tasks have 2.5 to 57 times as many objects as the largest training task of their domain, compared with at most about twice as many in the new domains. With GPT-5.6 Sol as the coding agent, LeanPlan obtains an admissible heuristic with a machine-checked proof for all thirteen domains. With the generated heuristics, LeanPlan solves 281 IPC 2023 tasks and 67 new-domain tasks, 27.1% and 31.4% more than the state-of-the-art optimal planner Scorpion (Seipp, 2024), which solves 221 and 51 tasks. A planner with machine-checked optimality guarantees can thus outperform a state-of-the-art, domain-independent optimal planner that offers no such guarantees.