VOOZH about

URL: https://arxiv.org/abs/2310.17807

⇱ [2310.17807] Clover: Closed-Loop Verifiable Code Generation


Computer Science > Artificial Intelligence

arXiv:2310.17807 (cs)
[Submitted on 26 Oct 2023 (v1), last revised 16 Nov 2024 (this version, v4)]

Title:Clover: Closed-Loop Verifiable Code Generation

View PDF HTML (experimental)
Abstract:The use of large language models for code generation is a rapidly growing trend in software development. However, without effective methods for ensuring the correctness of generated code, this trend could lead to undesirable outcomes. In this paper, we introduce a new approach for addressing this challenge: the Clover paradigm, short for Closed-Loop Verifiable Code Generation, which uses consistency checking to provide a strong filter for incorrect code. Clover performs consistency checks among code, docstrings, and formal annotations. The checker is implemented using a novel integration of formal verification tools and large language models. We provide a theoretical analysis to support our thesis that Clover should be effective at consistency checking. We also empirically investigate its performance on a hand-designed dataset (CloverBench) featuring annotated Dafny programs at a textbook level of difficulty. Experimental results show that for this dataset: (i) LLMs are reasonably successful at automatically generating formal specifications; and (ii) our consistency checker achieves a promising acceptance rate (up to 87%) for correct instances while maintaining zero tolerance for adversarial incorrect ones (no false positives). Clover also discovered 6 incorrect programs in the existing human-written dataset MBPP-DFY-50.
Comments: add appendix
Subjects: Artificial Intelligence (cs.AI); Machine Learning (cs.LG); Software Engineering (cs.SE)
Cite as: arXiv:2310.17807 [cs.AI]
(or arXiv:2310.17807v4 [cs.AI] for this version)
https://doi.org/10.48550/arXiv.2310.17807
arXiv-issued DOI via DataCite

Submission history

From: Chuyue Sun [view email]
[v1] Thu, 26 Oct 2023 22:58:19 UTC (141 KB)
[v2] Tue, 30 Jan 2024 06:52:10 UTC (174 KB)
[v3] Mon, 3 Jun 2024 16:59:37 UTC (214 KB)
[v4] Sat, 16 Nov 2024 21:57:49 UTC (214 KB)
Full-text links:

Access Paper:

Current browse context:

cs.AI
< prev   |   next >
Change to browse by:

References & Citations

BibTeX formatted citation

Data provided by:

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.