Ranking LLM-Generated Loop Invariants for Program Verification
October 13, 2023 ยท Declared Dead ยท ๐ Conference on Empirical Methods in Natural Language Processing
Authors
Saikat Chakraborty, Shuvendu K. Lahiri, Sarah Fakhoury, Madanlal Musuvathi, Akash Lal, Aseem Rastogi, Aditya Senthilnathan, Rahul Sharma, Nikhil Swamy
arXiv ID
2310.09342
Category
cs.PL: Programming Languages
Cross-listed
cs.AI,
cs.CL,
cs.SE
Citations
57
Venue
Conference on Empirical Methods in Natural Language Processing
Repository
https://github.com/microsoft/NeuralInvariantRanker}
Last Checked
1 month ago
Abstract
Synthesizing inductive loop invariants is fundamental to automating program verification. In this work, we observe that Large Language Models (such as gpt-3.5 or gpt-4) are capable of synthesizing loop invariants for a class of programs in a 0-shot setting, yet require several samples to generate the correct invariants. This can lead to a large number of calls to a program verifier to establish an invariant. To address this issue, we propose a {\it re-ranking} approach for the generated results of LLMs. We have designed a ranker that can distinguish between correct inductive invariants and incorrect attempts based on the problem definition. The ranker is optimized as a contrastive ranker. Experimental results demonstrate that this re-ranking mechanism significantly improves the ranking of correct invariants among the generated candidates, leading to a notable reduction in the number of calls to a verifier. The source code and the experimental data for this paper are available in \url{https://github.com/microsoft/NeuralInvariantRanker}.
Community Contributions
Found the code? Know the venue? Think something is wrong? Let us know!
๐ Similar Papers
In the same crypt โ Programming Languages
R.I.P.
๐ป
Ghosted
R.I.P.
๐ป
Ghosted
Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
R.I.P.
๐ป
Ghosted
Glow: Graph Lowering Compiler Techniques for Neural Networks
R.I.P.
๐ป
Ghosted
Learnable Programming: Blocks and Beyond
R.I.P.
๐ป
Ghosted
Scenic: A Language for Scenario Specification and Scene Generation
R.I.P.
๐ป
Ghosted
Vandal: A Scalable Security Analysis Framework for Smart Contracts
Died the same way โ ๐ 404 Not Found
R.I.P.
๐
404 Not Found
Deep High-Resolution Representation Learning for Visual Recognition
R.I.P.
๐
404 Not Found
HuggingFace's Transformers: State-of-the-art Natural Language Processing
R.I.P.
๐
404 Not Found
CCNet: Criss-Cross Attention for Semantic Segmentation
R.I.P.
๐
404 Not Found