EMNLP Findings2023
Ranking LLM-Generated Loop Invariants for Program Verification
Saikat Chakraborty, Shuvendu K. Lahiri, Sarah Fakhoury, Akash Lal, Madanlal Musuvathi, Aseem Rastogi, Aditya Senthilnathan, Rahul Sharma, Nikhil Swamy
摘要
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 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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 24 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Verified Code Transpilation with LLMs 引用了 Language Models are Few-Shot Learners
- Verified Code Transpilation with LLMs 引用了 Can Large Language Models Reason about Program Invariants?
- SpecGen: Automated Generation of Formal Program Specifications via Large Language Models 引用了 Language Models are Few-Shot Learners
- SpecGen: Automated Generation of Formal Program Specifications via Large Language Models 引用了 Can Large Language Models Reason about Program Invariants?
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference 引用了 Training language models to follow instructions with human feedback
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference 引用了 Can Large Language Models Reason about Program Invariants?
- LLMDFA: Analyzing Dataflow in Code with Large Language Models 引用了 Language Models are Few-Shot Learners
- LLMDFA: Analyzing Dataflow in Code with Large Language Models 引用了 Can Large Language Models Reason about Program Invariants?
- Laurel: Unblocking Automated Verification with Large Language Models 引用了 Dense Passage Retrieval for Open-Domain Question Answering
- Laurel: Unblocking Automated Verification with Large Language Models 引用了 Can Large Language Models Reason about Program Invariants?
- Large Language Models are Zero-Shot Reasoners 引用了 Language Models are Few-Shot Learners
- Large Language Models are Zero-Shot Reasoners 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper24
- LLMDFA: Analyzing Dataflow in Code with Large Language ModelsChengpeng Wang, Wuqi Zhang, Zian Su, Xiangzhe Xu 等NeurIPS 2024 · 51 次引用
- Verified Code Transpilation with LLMsSahil Bhatia, Jie Qiu, Niranjan Hasabnis, Sanjit A. Seshia 等NeurIPS 2024 · 36 次引用
- SpecGen: Automated Generation of Formal Program Specifications via Large Language ModelsLezhi Ma, Shangqing Liu, Yi Li, Xiaofei Xie 等ICSE 2025 · 25 次引用
- Laurel: Unblocking Automated Verification with Large Language ModelsEric Mugnier, Emmanuel Anaya Gonzalez, Nadia Polikarpova, Ranjit Jhala 等OOPSLA 2025 · 12 次引用
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant InferenceGuangyuan Wu, Weining Cao, Yuan Yao, Hengfeng Wei 等ASE 2024 · 9 次引用
它引用的 Paper6
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo 等NeurIPS 2022 · 8,168 次引用
- Dense Passage Retrieval for Open-Domain Question AnsweringVladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis 等EMNLP 2020 · 142 次引用
- Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton 等ICML 2023 · 128 次引用
相关 Paper
- Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMsIdo Pinto, Yizhak Elboher, Haoze Wu, Nina Narodytska 等ICML 2026 · 1 次引用
- Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program VerificationCheng Wen, Jialun Cao, Jie Su, Zhiwu Xu 等CAV 2024 · 60 次引用
- Towards AI-Assisted Synthesis of Verified Dafny MethodsMd Rakib Hossain Misu, Cristina V. Lopes, Iris Ma, James NobleFSE 2024 · 26 次引用
- HoarePrompt: Structural Reasoning About Program Correctness in Natural LanguageDimitrios Stamatios Bouras, Yihan Dai, Tairan Wang, Yingfei Xiong 等ICSE 2026
- Code Repair with LLMs gives an Exploration-Exploitation TradeoffHao Tang, Keya Hu, Jin Zhou, Sicheng Zhong 等NeurIPS 2024 · 85 次引用
