[Paper Review] Neuro Symbolic Reasoning for Planning: Counterexample Guided Inductive Synthesis using Large Language Models and Satisfiability Solving
This paper proposes a neuro-symbolic framework that combines large language models (LLMs) with satisfiability modulo theories (SMT) solvers to generate provably correct plans for block world problems. By iteratively using SMT solvers to detect and provide counterexamples for incorrect LLM-generated plans, the system guides the LLM through a feedback loop to produce correct solutions, significantly improving reliability in safety-critical planning tasks.
Generative large language models (LLMs) with instruct training such as GPT-4 can follow human-provided instruction prompts and generate human-like responses to these prompts. Apart from natural language responses, they have also been found to be effective at generating formal artifacts such as code, plans, and logical specifications from natural language prompts. Despite their remarkably improved accuracy, these models are still known to produce factually incorrect or contextually inappropriate results despite their syntactic coherence - a phenomenon often referred to as hallucination. This limitation makes it difficult to use these models to synthesize formal artifacts that are used in safety-critical applications. Unlike tasks such as text summarization and question-answering, bugs in code, plan, and other formal artifacts produced by LLMs can be catastrophic. We posit that we can use the satisfiability modulo theory (SMT) solvers as deductive reasoning engines to analyze the generated solutions from the LLMs, produce counterexamples when the solutions are incorrect, and provide that feedback to the LLMs exploiting the dialog capability of instruct-trained LLMs. This interaction between inductive LLMs and deductive SMT solvers can iteratively steer the LLM to generate the correct response. In our experiments, we use planning over the domain of blocks as our synthesis task for evaluating our approach. We use GPT-4, GPT3.5 Turbo, Davinci, Curie, Babbage, and Ada as the LLMs and Z3 as the SMT solver. Our method allows the user to communicate the planning problem in natural language; even the formulation of queries to SMT solvers is automatically generated from natural language. Thus, the proposed technique can enable non-expert users to describe their problems in natural language, and the combination of LLMs and SMT solvers can produce provably correct solutions.
Motivation & Objective
- Address the challenge of hallucinations in LLM-generated formal artifacts like plans and code, which can lead to catastrophic failures in safety-critical systems.
- Overcome the limitations of purely inductive LLMs that lack formal verification guarantees despite syntactic correctness.
- Enable non-expert users to specify planning problems in natural language while ensuring the generated solutions are formally correct.
- Integrate deductive reasoning via SMT solvers into an interactive loop with LLMs to correct erroneous outputs through counterexample feedback.
- Demonstrate the feasibility and effectiveness of combining inductive learning (LLMs) with deductive verification (SMT) for trustworthy program and plan synthesis.
Proposed method
- Use instruction-tuned LLMs (e.g., GPT-4, GPT-3.5 Turbo) to generate plans from natural language problem descriptions.
- Automatically translate LLM-generated plans into formal logical representations using natural language prompts.
- Employ an SMT solver (Z3) to verify the correctness of the generated plan against the problem’s initial state and goal conditions.
- When a plan is incorrect, the SMT solver identifies a minimal infeasible prefix and returns it as a counterexample to the LLM.
- Feed the counterexample back into the LLM’s context as part of a dialog, prompting it to revise the plan iteratively.
- Repeat the verification and refinement loop until a correct plan is produced, ensuring formal correctness.
Experimental results
Research questions
- RQ1Can LLMs reliably generate correct plans for block world problems when guided by formal verification via SMT solvers?
- RQ2How effective is the counterexample-guided feedback loop in correcting hallucinated or incorrect LLM-generated plans?
- RQ3What is the impact of different LLMs (e.g., GPT-4 vs. GPT-3.5 Turbo) on the success rate and number of iterations required to produce correct plans?
- RQ4To what extent does the integration of SMT verification reduce the failure rate of LLM-generated plans in increasingly complex planning problems?
- RQ5Can non-expert users effectively specify planning problems in natural language and still obtain formally correct solutions using this hybrid approach?
Key findings
- GPT-4 achieved a success rate of 19 out of 20 plans on 3-block problems, but only 2 out of 20 on 10-block problems, indicating scalability limitations.
- GPT-3.5 Turbo achieved 12 correct plans out of 20 on 3-block problems, with performance dropping to 4 correct plans on 5-block problems.
- The counterexample-guided feedback loop reduced the number of iterations needed for correct plan generation, with GPT-4 requiring an average of 2–3 iterations per problem.
- The SMT solver successfully identified infeasible prefixes in incorrect plans, such as invalid action sequences like unstacking a block not on top.
- The method enabled end-to-end synthesis from natural language to formally verified plans without requiring expert knowledge of formal logic or SMT syntax.
- The integration of SMT verification significantly improved the reliability of LLMs in generating correct plans, especially in complex or ambiguous scenarios.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.