GlossaryAgents and tools
Planning
Definition: Planning is working out a sequence of actions that leads from the current situation to a goal, either before acting or while acting.
In classical AI planning, a program receives a formal description of the starting situation, the goal and the available actions. Each action lists its preconditions, which must be true before it can run, and its effects, which are the changes it makes. The program searches for a sequence of actions that reaches the goal, and because every action is described this way, automated tools can check whether a plan reaches the goal. In language-model agents, planning often means that the model writes out steps in text before or while it acts. Plan-and-Solve prompting took “Let’s think step by step”, an instruction that prompts a model to write out its reasoning, as the Chain of thought entry describes, and replaced it with an instruction to first devise a plan that divides the task into subtasks and then carry it out. On the 1,319 test problems of GSM8K, a set of grade-school math word problems, GPT-3 solved 56.4% with the step-by-step instruction and 59.3% with the most detailed plan-and-solve instruction. An agent also has to keep its plan where it can find it again: Anthropic’s multi-agent Research system saves its lead agent’s plan to an external memory because its context is cut off past 200,000 tokens.
A plan a model writes may not work. Valmeekam et al. (2023) gave language models planning problems, such as arranging a set of blocks into required stacks, and checked each plan with automated planning tools. On average, about 12% of the plans that GPT-4, the best of the models they tested, produced on its own could be carried out without errors and reached their goals. For example, an agent asked to move a portfolio to a target allocation may write a plan to sell one asset and buy another, and the plan alone does not show whether each order fits the account’s limits. Whether language models can plan is disputed. Wenlong Huang and co-authors (2022) reported that language models that are large enough and prompted appropriately can break a high-level task into a plan of smaller steps without further training. Kambhampati et al. (2024) argue that language models “cannot, by themselves, do planning or self-verification” and propose pairing them with external software that checks each plan.
An early program of the classical kind was STRIPS (STanford Research Institute Problem Solver), which Richard Fikes and Nils Nilsson described in STRIPS: A New Approach to the Application of Theorem Proving to Problem Solving at the Second International Joint Conference on Artificial Intelligence in London in 1971. STRIPS described the world as a collection of statements in formal logic and searched for a sequence of operators, which in robot problems correspond to the robot’s action routines, that changed the starting description into one in which the goal statement could be proven true. For language models, Wenlong Huang and co-authors asked in Language Models as Zero-Shot Planners (18 January 2022) whether a model could turn a high-level task such as “make breakfast” into concrete actions such as “open fridge”. Lei Wang and co-authors introduced Plan-and-Solve Prompting (6 May 2023), and Xu Huang and co-authors surveyed planning by agents built on large language models (LLMs) in Understanding the planning of LLM agents: A survey (5 February 2024).
