Planejamento Clássico com Heurísticas Geradas por LLM: Desafiando o Estado da Arte com Código Python
Classical Planning with LLM-Generated Heuristics: Challenging the State of the Art with Python Code
March 24, 2025
Autores: Augusto B. Corrêa, André G. Pereira, Jendrik Seipp
cs.AI
Resumo
Nos últimos anos, os grandes modelos de linguagem (LLMs) demonstraram capacidades notáveis em diversos problemas de inteligência artificial. No entanto, eles falham em planejar de forma confiável, mesmo quando instruídos com uma definição detalhada da tarefa de planejamento. Tentativas de melhorar suas capacidades de planejamento, como o prompting de cadeia de pensamento, fine-tuning e "raciocínio" explícito, ainda resultam em planos incorretos e geralmente falham em generalizar para tarefas maiores. Neste artigo, mostramos como usar LLMs para gerar planos corretos, mesmo para tarefas fora da distribuição e de tamanho crescente. Para um determinado domínio de planejamento, solicitamos que um LLM gere várias funções heurísticas dependentes do domínio na forma de código Python, as avalie em um conjunto de tarefas de treinamento dentro de uma busca gananciosa de melhor escolha e selecione a mais robusta. As heurísticas geradas pelo LLM resolvem muito mais tarefas de teste não vistas do que as heurísticas independentes de domínio de última geração para planejamento clássico. Elas são até mesmo competitivas com o algoritmo de aprendizado mais forte para planejamento dependente de domínio. Esses achados são especialmente notáveis considerando que nossa implementação de prova de conceito é baseada em um planejador Python não otimizado e as linhas de base são todas construídas sobre código C++ altamente otimizado. Em alguns domínios, as heurísticas geradas pelo LLM expandem menos estados do que as linhas de base, revelando que elas não são apenas eficientemente computáveis, mas às vezes até mais informativas do que as heurísticas de última geração. No geral, nossos resultados mostram que a amostragem de um conjunto de programas de funções heurísticas de planejamento pode melhorar significativamente as capacidades de planejamento dos LLMs.
English
In recent years, large language models (LLMs) have shown remarkable
capabilities in various artificial intelligence problems. However, they fail to
plan reliably, even when prompted with a detailed definition of the planning
task. Attempts to improve their planning capabilities, such as chain-of-thought
prompting, fine-tuning, and explicit "reasoning" still yield incorrect plans
and usually fail to generalize to larger tasks. In this paper, we show how to
use LLMs to generate correct plans, even for out-of-distribution tasks of
increasing size. For a given planning domain, we ask an LLM to generate several
domain-dependent heuristic functions in the form of Python code, evaluate them
on a set of training tasks within a greedy best-first search, and choose the
strongest one. The resulting LLM-generated heuristics solve many more unseen
test tasks than state-of-the-art domain-independent heuristics for classical
planning. They are even competitive with the strongest learning algorithm for
domain-dependent planning. These findings are especially remarkable given that
our proof-of-concept implementation is based on an unoptimized Python planner
and the baselines all build upon highly optimized C++ code. In some domains,
the LLM-generated heuristics expand fewer states than the baselines, revealing
that they are not only efficiently computable, but sometimes even more
informative than the state-of-the-art heuristics. Overall, our results show
that sampling a set of planning heuristic function programs can significantly
improve the planning capabilities of LLMs.Summary
AI-Generated Summary