Towards Large Language Model Aided Program Refinement
Not on the map. Why?
Abstract (arXiv)
Program refinement involves correctness-preserving transformations from formal high-level specification statements into executable programs. Traditional verification tool support for program refinement is highly interactive and lacks automation. On the other hand, the emergence of large language models (LLMs) enables automatic code generations from informal natural language specifications. However, code generated by LLMs is often unreliable. Moreover, the opaque procedure from specification to code provided by LLM is an uncontrolled black box. We propose LLM4PR, a tool that combines formal program refinement techniques with informal LLM-based methods to (1) transform the specification to preconditions and postconditions, (2) automatically build prompts based on refinement calculus, (3) interact with LLM to generate code, and finally, (4) verify that the generated code satisfies the conditions of refinement calculus, thus guaranteeing the correctness of the code. We have implemented our tool using GPT4, Coq, and Coqhammer, and evaluated it on the HumanEval and EvalPlus datasets.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 20 of its 45 references that are in the map. First posted on arXiv 26 Jun 2024.
Builds on
20 of 45 references.
References · 20
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023A Survey of Large Language Modelscited by 2,576
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 427
- 2020Generative Language Modeling for Automated Theorem Provingcited by 388
- 2022HyperTree Proof Search for Neural Theorem Provingcited by 197
- 2022Formal Mathematics Statement Curriculum Learningcited by 142
- 2021Proof Artifact Co-training for Theorem Proving with Language Modelscited by 132
- 2022Thor: Wielding Hammers to Integrate Language Models and Automated Theorem Proverscited by 98
- 2023Cumulative Reasoning with Large Language Modelscited by 94
8 more
- 2024From LLM to NMT: Advancing Low-Resource Machine Translation with Claudecited by 58
- 2023A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verificationcited by 42
- 2023Ranking LLM-Generated Loop Invariants for Program Verificationcited by 33
- 2023A Static Evaluation of Code Completion by Large Language Modelscited by 14
- 2019A Survey on Theorem Provers in Formal Methodscited by 8
- 2017The Refinement Calculus of Reactive Systems Toolsetcited by 2
- 2019Differential Hoare Logics and Refinement Calculi for Hybrid Systems with Isabelle/HOLcited by 2
- 2021An Executable Structural Operational Formal Semantics for Pythoncited by 1
Built on by
Citing papers per year: 2024: 1; 2025: 1.
2 papers.