about
LLM Code Generation with Formal Specifications and Reactive Program Synthesis (arxiv.org)
1 point by sandwichsphinx on Oct 29, 2024 | hide | past | pdf | discuss on HN

In plain words: The system splits a coding task in two: a language model writes the ordinary part, while a formal tool builds the tricky reactive logic from a written spec so it provably matches the spec. On a test set, it solved problems language models could not handle.

Abstract · Combining LLM Code Generation with Formal Specifications and Reactive Program Synthesis

In the past few years, Large Language Models (LLMs) have exploded in usefulness and popularity for code generation tasks. However, LLMs still struggle with accuracy and are unsuitable for high-risk applications without additional oversight and verification. In particular, they perform poorly at generating code for highly complex systems, especially with unusual or out-of-sample logic. For such systems, verifying the code generated by the LLM may take longer than writing it by hand. We introduce a solution that divides the code generation into two parts; one to be handled by an LLM and one to be handled by formal methods-based program synthesis. We develop a benchmark to test our solution and show that our method allows the pipeline to solve problems previously intractable for LLM code generation.

William Murphy, Nikolaus Holzer, Feitong Qiao, Leyi Cui, Raven Rothkopf, Nathan Koenig, Mark Santolucito
arXiv:2410.19736 · cs.SE, cs.LG, cs.LO · submitted Sep 18, 2024
abstract · pdf · html

add comment on HN