Planning with language-model agents: who guarantees the plan?
语言模型智能体规划
Separate plan proposal, model translation and plan validation; run a scripted Blocksworld proposer, a verifier-repair loop and a sound search planner, and see which guarantee each part provides.
agent-planningA plausible plan is not yet a valid plan
Ask an assistant to rearrange four stacked boxes and it will usually reply with a confident list of steps: pick up A, put A on B, pick up B, put B on C. The list reads well. Whether it can be executed is a different question. If C is sitting on A, the first step is impossible; if A is already on B when we try to lift B, the third step is impossible. Planning is the problem of producing an action sequence that is executable from the actual starting state and ends in a goal state. Fluent text does not certify either property.
A language-model agent that “plans” can therefore play several roles. It can write the plan itself. It can translate a natural-language request into a formal model that a classical planner solves. It can propose a draft that an external verifier checks and sends back with an error message. These roles carry very different guarantees, and the most useful question to ask of any agent planning system is: which component is responsible for the plan being correct, and with respect to which model of the world?
Two studies from 2023 frame this article. LLM+P asks GPT-4 to write only the problem file in PDDL, the Planning Domain Definition Language, and hands it to an off-the-shelf classical planner; a human expert supplies the domain file. LLM+P method Valmeekam and colleagues generated hundreds of planning instances, checked every model-written plan mechanically, and also tested an “LLM-Modulo” mode where a sound planner or a plan validator stays in the loop. Autonomous and LLM-Modulo modes This article does not repeat chain-of-thought or tree-of-thoughts prompting, which are covered in their own entries; here the focus is the contract between a proposer, a model and a checker.
Planning problem, validity and where the guarantee lives
LLM+P adopts the classical definition. A planning problem is a tuple of a finite factored state set, an initial state, a set of goal states, a set of symbolic actions and a transition function: Background section
In the STRIPS-style encoding used by PDDL, a state is a set of true facts, and each action has a precondition set, an add list and a delete list. When the preconditions hold, the next state removes the deleted facts and adds the new ones:
A plan is valid when every precondition holds at the moment its action is applied and the final state satisfies the goal. With :
This definition is mechanical, which is the point. A validator does not need to understand the request; it replays the actions in the model and reports the first violated precondition or the unmet goal. Valmeekam et al. use the planning tool VAL in exactly this role, and they also score plans under relaxed models that ignore delete lists or preconditions. Even under the most lenient combined relaxation, about 39% of GPT-4’s Blocksworld plans in their figure still fail to reach the goal. Relaxed assessment, page 8
Three architectures differ in which function they assign to the language model:
- Model as planner. The model maps the text directly to . Nothing in the loop checks validity. In the autonomous mode of Valmeekam et al., the best model (GPT-4) produced executable, goal-reaching plans for roughly 12% of instances averaged across their domains; on 600 Blocksworld instances with three to five blocks, natural-language prompting gave 206 (one-shot) and 210 (zero-shot) correct plans. Tables 1–2 discussion, page 6
- Model as translator. The model maps the text to a problem file , and a sound planner returns for . LLM+P runs Fast Downward with an optimal configuration and a non-optimal LAMA fallback, each limited to 200 seconds, on seven planning-competition domains with 20 generated tasks each. Experiment setup, page 5
- Model as proposer inside a checker loop. The model drafts ; a validator returns a diagnosis ; the model revises:
Architecture 2 moves the correctness guarantee to the planner, but only relative to . If translation drops a fact, the planner can return an optimal plan for the wrong world. The paper shows a GPT-4 problem file written without an example that has correct PDDL syntax, invents a predicate and omits that one block rests on the table; with one in-context example the generated file became solvable. Section III-A example The method also assumes that a human expert writes the domain file once per domain, and the authors list recognizing when a request suits this pipeline as an open problem. Limitation paragraph and Section III-C
Architecture 3 keeps the guarantee in the validator: whatever is returned has passed the check. What it does not guarantee is termination within the budget or optimality. Valmeekam et al. backprompted GPT-4 with VAL’s error reports on 50 previously failed instances per domain, allowing up to 15 rounds. Blocksworld reached 41/50 correct with 3.68 rounds on average among the solved cases, Logistics 35/50 with 3.31, and the name-obfuscated Mystery Blocksworld only 5/50 with 7.0. Table 4, page 9
The obfuscation result matters for interpretation. Renaming actions and predicates (for example “pickup” becomes “attack”) leaves the planning problem identical for a classical planner, yet GPT-4’s zero-shot natural-language success in their Mystery Blocksworld fell to 1 of 600 instances. Obfuscation paragraph, page 7 Performance that depends on familiar names is evidence of pattern matching to common-sense vocabulary, not of search over the stated model.
LLM+P reports the opposite picture when the model only translates. In Blocksworld, the model planning directly with an in-context example produced 15% optimal plans (30% correct including suboptimal ones), a tree-of-thoughts breadth-first variant 0% optimal (5% correct), and LLM+P 90%. The pipeline is not uniformly strong: Floortile stayed at 0% for every method and Termes at 20% for LLM+P. Table I, page 5 These are GPT-4 results from 2023 on specific generated tasks, not a ranking of current systems.
A scripted proposer, a validator and a search planner
The program below reproduces the structure of the three architectures on a four-block Blocksworld, entirely without a language model. It contains:
- an exact STRIPS-style simulator for the four standard operators (pickup, putdown, stack, unstack) and a validator that reports the first failure;
- breadth-first search, which is sound, complete and returns a shortest plan in this unit-cost domain;
- a scripted proposer standing in for a model that writes plausible plans. For every goal fact “x on y” it writes “grab x, stack x on y”, reading supports from the initial state only and ignoring blockers and goal interactions. It is a deliberately simple, original heuristic, not a simulation of any particular model;
- a repair rule that sees only the validator’s first error: it unstacks a blocking block, replaces a grab that uses the wrong support, puts down a held block, or appends steps for unmet goal facts;
- a mistranslation experiment: the planner receives a copy of the initial state in which one “x on y” fact has been replaced by “x on the table”, then its plan is executed in the true state.
Two hundred instances are drawn with seed 0. Goals are random sets of “on” facts not already satisfied by the initial state.
"""Original synthetic Blocksworld study. No language model or network is called.
A scripted proposer stands in for an LLM that writes plausible plans; an exact
validator plays the role of a plan checker; breadth-first search is the sound planner.
"""
import random
from collections import deque
BLOCKS = 'ABCD'
def random_state(rng):
order = list(BLOCKS)
rng.shuffle(order)
towers, i = [], 0
while i < len(order):
size = rng.randint(1, len(order) - i)
towers.append(order[i:i + size])
i += size
facts = {('armempty',)}
for tower in towers:
facts.add(('ontable', tower[0]))
for low, high in zip(tower, tower[1:]):
facts.add(('on', high, low))
facts.add(('clear', tower[-1]))
return frozenset(facts)
def support(state, x):
for f in state:
if f[0] == 'on' and f[1] == x:
return f[2]
return 'table' if ('ontable', x) in state else None
def apply(state, action):
"""Return (next_state, None) or (None, reason) using STRIPS-style rules."""
name, x, y = action[0], action[1], (action[2] if len(action) > 2 else None)
s = set(state)
if name in ('pickup', 'unstack'):
if ('armempty',) not in s:
return None, ('arm-busy', x)
if ('clear', x) not in s:
top = next(f[1] for f in s if f[0] == 'on' and f[2] == x)
return None, ('not-clear', x, top)
place = ('ontable', x) if name == 'pickup' else ('on', x, y)
if place not in s:
return None, ('wrong-support', x, support(state, x))
s -= {place, ('clear', x), ('armempty',)}
s.add(('holding', x))
if name == 'unstack':
s.add(('clear', y))
else:
if ('holding', x) not in s:
return None, ('not-holding', x)
if name == 'stack' and ('clear', y) not in s:
top = next(f[1] for f in s if f[0] == 'on' and f[2] == y)
return None, ('not-clear', y, top)
s -= {('holding', x)}
s |= {('clear', x), ('armempty',)}
if name == 'stack':
s.discard(('clear', y))
s.add(('on', x, y))
else:
s.add(('ontable', x))
return frozenset(s), None
def validate(state, plan, goal):
for i, action in enumerate(plan):
nxt, reason = apply(state, action)
if reason:
return False, i, reason, state
state = nxt
return goal <= state, len(plan), None if goal <= state else ('goal-unmet',), state
def successors(state):
held = [f[1] for f in state if f[0] == 'holding']
if held:
x = held[0]
acts = [('putdown', x)] + [('stack', x, y) for y in BLOCKS if y != x]
else:
acts = [('pickup', x) for x in BLOCKS] + [('unstack', x, y) for x in BLOCKS for y in BLOCKS if x != y]
for a in acts:
nxt, reason = apply(state, a)
if not reason:
yield a, nxt
def bfs(init, goal):
frontier, parent = deque([init]), {init: None}
expanded = 0
while frontier:
s = frontier.popleft()
expanded += 1
if goal <= s:
plan = []
while parent[s]:
s, a = parent[s]
plan.append(a)
return plan[::-1], expanded
for a, nxt in successors(s):
if nxt not in parent:
parent[nxt] = (s, a)
frontier.append(nxt)
return None, expanded
def grab(state, x):
below = support(state, x)
return ('pickup', x) if below == 'table' else ('unstack', x, below)
def bottom_up(goal_atoms):
pending, ordered = list(goal_atoms), []
while pending:
for atom in pending:
if not any(other[1] == atom[2] for other in pending):
ordered.append(atom)
pending.remove(atom)
break
return ordered
def propose(init, goal_atoms):
"""Scripted 'plausible' plan: one grab+stack per goal atom, written from the initial state only."""
plan = []
for _, x, y in goal_atoms:
plan += [grab(init, x), ('stack', x, y)]
return plan
def repair(plan, index, reason, state, goal_atoms):
"""Local edit driven only by the validator's first error message."""
prefix, rest = plan[:index], plan[index:]
kind = reason[0]
if kind == 'not-clear':
blocker, under = reason[2], reason[1]
return prefix + [('unstack', blocker, under), ('putdown', blocker)] + rest
if kind == 'wrong-support':
return prefix + [grab(state, reason[1])] + rest[1:]
if kind == 'arm-busy':
held = next(f[1] for f in state if f[0] == 'holding')
return prefix + [('putdown', held)] + rest
if kind == 'not-holding':
return prefix + [grab(state, reason[1])] + rest
unmet = [a for a in goal_atoms if a not in state]
extra = []
for _, x, y in bottom_up(unmet):
extra += [('grab-later', x), ('stack', x, y)]
return prefix + extra
def materialize(plan, state):
out = []
for a in plan:
if a[0] == 'grab-later':
a = grab(state, a[1])
out.append(a)
nxt, reason = apply(state, a)
if reason:
out.extend(plan[len(out):])
return out
state = nxt
return out
def backprompt(init, goal, goal_atoms, rounds):
plan = propose(init, goal_atoms)
for r in range(rounds + 1):
plan = materialize(plan, init)
ok, index, reason, state = validate(init, plan, goal)
if ok:
return plan, r
if r == rounds:
return None, r
plan = repair(plan, index, reason, state, goal_atoms)
def mistranslate(init, rng):
stacked = sorted(f for f in init if f[0] == 'on')
if not stacked:
return init, False
_, x, y = rng.choice(stacked)
wrong = set(init) - {('on', x, y)}
wrong |= {('ontable', x), ('clear', y)}
return frozenset(wrong), True
def main(seed=0, n=200, rounds=15):
rng = random.Random(seed)
stats = dict(proposer_valid=0, repaired_valid=0, repair_rounds=[], excess=[], optimal=[],
expanded=[], translated=0, translated_fail=0)
for _ in range(n):
init = random_state(rng)
goal_atoms = []
while not goal_atoms or set(goal_atoms) <= init:
goal_atoms = sorted(f for f in random_state(rng) if f[0] == 'on')
rng.shuffle(goal_atoms)
goal = frozenset(goal_atoms)
best, expanded = bfs(init, goal)
stats['optimal'].append(len(best))
stats['expanded'].append(expanded)
if validate(init, propose(init, goal_atoms), goal)[0]:
stats['proposer_valid'] += 1
plan, used = backprompt(init, goal, goal_atoms, rounds)
if plan is not None:
stats['repaired_valid'] += 1
stats['repair_rounds'].append(used)
stats['excess'].append(len(plan) - len(best))
wrong, changed = mistranslate(init, rng)
if changed:
stats['translated'] += 1
wrong_plan, _ = bfs(wrong, goal)
if not validate(init, wrong_plan, goal)[0]:
stats['translated_fail'] += 1
mean = lambda xs: round(sum(xs) / len(xs), 3)
print('instances', n, 'blocks', len(BLOCKS), 'seed', seed)
print('bfs_valid', n, 'mean_optimal_length', mean(stats['optimal']), 'mean_expanded', mean(stats['expanded']))
print('proposer_valid', stats['proposer_valid'])
print('backprompt_valid', stats['repaired_valid'], 'round_budget', rounds)
print('mean_rounds_when_valid', mean(stats['repair_rounds']), 'max_rounds', max(stats['repair_rounds']))
print('valid_within_budget', {b: sum(r <= b for r in stats['repair_rounds']) for b in (0, 1, 2, 4, 8)})
print('mean_excess_steps', mean(stats['excess']), 'max_excess_steps', max(stats['excess']))
print('optimal_after_repair', sum(e == 0 for e in stats['excess']))
print('mistranslated', stats['translated'], 'plan_fails_in_true_world', stats['translated_fail'])
if __name__ == '__main__':
main()
The recorded output is:
instances 200 blocks 4 seed 0
bfs_valid 200 mean_optimal_length 6.38 mean_expanded 56.44
proposer_valid 25
backprompt_valid 200 round_budget 15
mean_rounds_when_valid 3.47 max_rounds 10
valid_within_budget {0: 25, 1: 50, 2: 80, 4: 133, 8: 197}
mean_excess_steps 3.51 max_excess_steps 14
optimal_after_repair 75
mistranslated 190 plan_fails_in_true_world 169
Reading the output line by line:
- Breadth-first search solves all 200 instances. Optimal plans average 6.38 actions and the search expands 56.44 states on average; with four blocks the reachable state space is tiny.
- The scripted proposer’s first draft is valid for only 25 of 200 instances. Its failures are of the kind that matter in practice: it lifts a block that has something on top of it, or it relies on a support that an earlier step changed.
- With the validator in the loop, every instance becomes valid within the 15-round budget. The budget matters, though: only 50 instances are valid after one repair round, 80 after two, 133 after four and 197 after eight; the slowest needed ten.
- Validity is not optimality. Repaired plans are on average 3.51 actions longer than the shortest plan, at most 14 longer, and only 75 of 200 are optimal.
- In 190 instances there was a stacked fact to drop. The planner’s plan, optimal for the mistranslated model, failed in the true world in 169 of them. The other 21 succeeded only because the omitted fact was irrelevant to the actions chosen.
A hand-checkable case is the Sussman anomaly with an extra block: C is on A, A, B and D are on the table, and the goal is “A on B and B on C”. The proposer writes pickup A, stack A on B, pickup B, stack B on C. The validator stops at step 1 because C is on A. The repair inserts unstack C from A and putdown C; on the next replay, picking up B fails because A is now on B; after that repair the plan executes but “A on B” no longer holds, so the rule appends another grab and stack. Three repair rounds yield a valid 10-action plan, while breadth-first search finds the 6-action plan: clear C, put B on C, then put A on B.
The search costs one unit per expanded state, and breadth-first search on a domain with branching factor b and solution depth d takes time and memory of order b to the power d in the worst case. That is why practical planners use heuristics, and why LLM+P uses Fast Downward instead of blind search.
What this toy cannot show
The proposer is a fixed rule, not a language model. Its 12.5% first-draft validity (25 of 200) happens to be close to the roughly 12% figure from Valmeekam et al., but that resemblance is a coincidence of how the rule was written, not a measurement of any model. A real model’s errors depend on names, prompts and examples, as the obfuscation experiment shows.
The repair rule reached a valid plan in all 200 instances here, but that is an observed outcome of this rule on these instances, not a proven property; it is helped by full access to the validator’s state at the failure point and by the domain’s reversible actions. A model reading a natural-language error message may misread it, repeat a mistake or oscillate; the 15-round cap in the Valmeekam study and the 5/50 Mystery result illustrate why a budget and a fallback are needed.
The validator is exact only because the world model is complete and correct. Real tasks rarely come with a full action model: effects can be stochastic, actions durative, the state partially observed, and constraints soft (preferences, costs, deadlines). A validator built on an incomplete model certifies plans relative to that model, which is the same trap as the mistranslation experiment, one level up.
Finally, four blocks keep search trivial. LLM+P’s own results show that a sound planner can time out on harder domains, which is why the paper reports a suboptimal LAMA fallback in parentheses. Experiment setup, page 5 Classical planning, PDDL and heuristic search have their own entries for the parts this article treats as black boxes.
Exercises
-
LLM+P returns an optimal plan from Fast Downward. Why is it still possible that the robot executing it fails to reach the user’s goal?
Answer: Optimality and validity hold relative to the problem file the model wrote. If translation omits or invents a fact, mis-states the goal, or the hand-written domain file is wrong, the planner solves a different problem. The program’s mistranslation experiment produced 169 failures out of 190 for exactly this reason. Checking the translation, for example by validating the generated initial state against sensors or asking the user to confirm the goal, is a separate requirement.
-
Initial state: C on A; A, B and D on the table. Goal: A on B and B on C. Write the scripted proposer’s draft, name the validator’s first error, and give the length of a shortest valid plan.
Answer: Draft: pickup A, stack A B, pickup B, stack B C. The first error is at step 1: A is not clear because C is on it. A shortest plan has 6 actions: unstack C A, putdown C, pickup B, stack B C, pickup A, stack A B. The verifier-repair loop in the program needs 3 rounds and returns a valid but 10-action plan.
-
Valmeekam et al. renamed Blocksworld’s actions and predicates without changing the structure. GPT-4’s zero-shot natural-language success fell from 210 of 600 to 1 of 600. A classical planner’s success is unchanged. What does that tell you about each component, and what does it not tell you?
Answer: A planner works on the formal structure, so renaming cannot matter to it. The language model’s drop shows that much of its success came from familiar vocabulary rather than from reasoning over the stated preconditions and effects. It does not show that the model is useless in a loop: in the same study, backprompting with a validator still solved 5 of 50 failed Mystery instances, and model drafts reduced search steps for a local-search planner in ordinary Blocksworld.
-
You must choose an architecture for two tasks: (a) a warehouse robot whose actions and preconditions are already specified in PDDL by engineers; (b) drafting a weekend itinerary where most constraints are soft preferences stated in free text. Which design fits each, and why?
Answer: For (a), use the model as translator (LLM+P style) or as an interface that only fills goals, with a sound planner and a validator against the engineered model; guarantees are available, so use them, and add a translation check. For (b), there is no complete formal model to validate against, so a model-written draft with explicit checks for the few hard constraints (opening hours, travel time) and human confirmation is more realistic. Calling (b)‘s output “verified” would overstate what any validator can know.
Open questions and how to read results
Both sources point to the same division of labor: language models are useful at turning text into candidate structures, and sound tools are useful at guaranteeing properties of those structures. LLM+P assumes the domain model is given and leaves automatic domain writing and deciding when to invoke the pipeline open. Method assumptions Valmeekam et al. find that model plans can serve as seeds for the local-search planner LPG, reducing search steps on ordinary Blocksworld and Logistics but not on the obfuscated domain. Section 5.1
When reading a claim that an agent “can plan”, check four things: who validates the plan and against which model; whether the domain names are familiar enough for pattern matching; whether success counts executable plans, goal-reaching plans or optimal plans; and the round or time budget. Related entries treat the agent loop around these components (ReAct agents, reflection and workflows) and the search ideas they borrow (tree of thoughts, heuristic search, hierarchical task networks).
Make a prediction, then check
In LLM+P the classical planner returned an optimal plan, yet execution failed. What is the most likely cause?
Learning objectives
- Distinguish model-as-planner, model-as-translator with a classical planner, and model-as-proposer with validator repair, stating relative to which model each correctness guarantee holds.
- Use an exact validator and a search planner to check validity, optimality and round budgets, and recognize failures from mistranslation and name obfuscation.
Prerequisites & connections
Explore related knowledge →References
- LLM+P: Empowering Large Language Models with Optimal Planning Proficiency — scoped arXiv v3
Bo Liu; Yuqian Jiang; Xiaohan Zhang; Qiang Liu; Shiqi Zhang; Joydeep Biswas; Peter Stone · 2023 - On the Planning Abilities of Large Language Models: A Critical Investigation — scoped arXiv v2 (NeurIPS 2023)
Karthik Valmeekam; Matthew Marquez; Sarath Sreedharan; Subbarao Kambhampati · 2023
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Claude · 2026-12-02 · Independent AI check (Claude subagent, not the author; not a human or expert review). Ran example.py with python3 3.12 and diffed it against example.stdout.txt (identical); confirmed the python block in en.mdx and zh.mdx is byte-identical to example.py and the four display equations match across languages. Re-ran the Sussman-with-extra-block hand example through the program's functions (first error at step 1, 3 repair rounds, 10-action repaired plan vs 6-action BFS plan) and re-derived the output accounting (25/200 = 12.5%, 190 - 169 = 21). Downloaded the LLM+P arXiv v3 PDF (8 pages) and the Valmeekam et al. arXiv v2 PDF (50 pages) with curl and read pdftotext output of LLM+P pp. 1-5 (tuple definition, Section III-A GPT-4 problem files, limitation paragraph, Section III-C assumptions, experiment setup and Table I) and Valmeekam pp. 1-2 and 6-9 (abstract ~12%, Table 2 and the 206/210 prose, 600 instances with 3-5 blocks, obfuscation 1/600, relaxation ~39%, LPG Table 3, VAL Table 4 41/50, 35/50, 5/50 with 3.68/3.31/7.0 rounds and the 15-round cap). Compared zh and en section by section and checked data.json IDs against src/data/catalogue.txt and relationships.ts for cycles. Did not read Valmeekam Table 1 or appendices, did not read LLM+P pages 6-8, and did not render the MDX.
- Code output matches the recording; both code blocks are byte-identical to example.py; every quoted number (25, 50/80/133/197, 3.51, 75, 190/169, etc.) matches the output.
- Re-ran the Sussman hand example through the program: error at step 1, 3 repair rounds giving a 10-action plan, BFS shortest 6 actions, matching the prose and exercise 2.
- LLM+P Table I (Blocksworld 15 (30), ToT 0 (5), LLM+P 90; Floortile 0 throughout; Termes 20) and Valmeekam's ~12%, 206/210, 600, 3-5 blocks, 1/600, ~39%, 41/50, 35/50, 5/50 all match the PDFs.
- The 12.5% vs ~12% resemblance is explicitly labelled a coincidence; zh and en correspond section by section; prerequisite/related IDs exist without cycles; quiz answer is correct.
Source locations checked:
- LLM+P: Empowering Large Language Models with Optimal Planning Proficiency — scoped arXiv v3 · arXiv v3 PDF pages 2–3: tuple <S,s_init,S_G,A,f>, plan validity, PDDL domain/problem split, GPT-4 problem file without context (made-up predicate, missing on-table fact) vs with context (solvable), assumption that an expert provides the domain PDDL, limitation on recognizing suitable prompts. Page 5: seven IPC-derived domains with 20 tasks each, GPT-4 temperature 0, Fast Downward seq-opt-fdss-1 and LAMA with 200 s, ToT BFS baseline, Table I (Blocksworld LLM 15 (30), ToT 0 (5), LLM+P 90; Floortile 0; Termes 20). Not read: related-work page 4 in full, later pages, appendix.
- On the Planning Abilities of Large Language Models: A Critical Investigation — scoped arXiv v2 (NeurIPS 2023) · arXiv v2 PDF pages 1–2 (abstract; ~12% average autonomous success for GPT-4; two modes), 6–7 (Table 2; Blocksworld 600 instances, 3–5 blocks, NL one-shot 206 and zero-shot 210; human baseline 39/50 valid, 35/39 optimal; obfuscation zero-shot NL 1/600), 8–9 (relaxations: ~39% still incorrect under delete+precondition relaxation; LPG seed Table 3; VAL backprompting Table 4: BW 41/50, 3.68 rounds; Logistics 35/50, 3.31; Mystery 5/50, 7.0; 15-round cap, 50 failed instances per domain). Not read: Table 1 in full, appendices, prompts.
Related topics