about
Show HN: Verified Multi-Step Synthesis Using LLMs and MCTS (arxiv.org)
1 point by namin on Feb 23, 2024 | hide | past | pdf | discuss on HN

In plain words: It builds programs in a search tree, checking each partial program with a logic checker to steer the model toward provably correct code. On multi-step problems, this raised the average share solved within a 5,000-token budget by over 30 percentage points versus repeated sampling.

Abstract · VerMCTS: Synthesizing Multi-Step Programs using a Verifier, a Large Language Model, and Tree Search

Large Language Models (LLMs) can generate useful code, but often the code they generate cannot be trusted to be sound. In this paper, we present VerMCTS, an approach to begin to resolve this issue by generating verified programs in Dafny and Coq. VerMCTS uses a logical verifier in concert with an LLM to guide a modified Monte Carlo Tree Search (MCTS). This approach leverages the verifier to gain intermediate feedback inside the search algorithm by checking partial programs at each step to estimate an upper bound on the value function. To measure the performance of VerMCTS, we develop a new suite of multi-step verified programming problems in Dafny and Coq. In terms of pass@T, a new metric which computes the pass rate given a budget of T tokens sampled from the LLM, VerMCTS leads to more than a 30% absolute increase in average pass@5000 across the suite over repeated sampling from the base language model. Our code and benchmarks are available at https://github.com/namin/llm-verified-with-monte-carlo-tree-search .

David Brandfonbrener, Simon Henniger, Sibi Raja, Tarun Prasad, Chloe Loughridge, Federico Cassano, Sabrina Ruixin Hu, Jianang Yang, William E. Byrd, Robert Zinkov, Nada Amin
arXiv:2402.08147 · cs.SE, cs.AI, cs.LG, cs.LO, cs.PL · submitted Feb 13, 2024 · updated May 24, 2024
abstract · pdf · html

add comment on HN