Automated Proof Generation for Rust Code via Self-Evolution
Tianyu Chen, Shuai Lu, Shan Lu, Yeyun Gong, Chenyuan Yang, Xuheng Li, Md Rakib Hossain Misu, Hao Yu, Nan Duan, Peng Cheng, Fan Yang, Shuvendu K. Lahiri
Abstract
Ensuring correctness is crucial for code generation. Formal verification offers a definitive assurance of correctness, but demands substantial human effort in proof construction and hence raises a pressing need for automation. The primary obstacle lies in the severe lack of data-there is much fewer proofs than code snippets for Large Language Models (LLMs) to train upon. In this paper, we introduce SAFE, a framework that overcomes the lack of human-written proofs to enable automated proof generation of Rust code. SAFE establishes a self-evolving cycle where data synthesis and fine-tuning collaborate to enhance the model capability, leveraging the definitive power of a symbolic verifier in telling correct proofs from incorrect ones. SAFE also re-purposes the large number of synthesized incorrect proofs to train the self-debugging capability of the fine-tuned models, empowering them to fix incorrect proofs based on the verifier's feedback. SAFE demonstrates superior efficiency and precision compared to GPT-4o. Through tens of thousands of synthesized proofs and the self-debugging mechanism, we improve the capability of open-source models, initially unacquainted with formal verification, to automatically write proofs for Rust code. This advancement leads to a significant improvement in performance, achieving a 52.52% accuracy rate in a benchmark crafted by human experts, a significant leap over GPT-4o's performance of 14.39%. The training dataset produced by this work is available on HuggingFace 1 .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 878ac472-d7c8-42d0-9e21-a174955fe0bdCited by top-tier papers16
- VERINA: Benchmarking Verifiable Code GenerationZhe Ye, Zhengxu Yan, Jingxuan He, Timothe Kasriel et al.ICLR 2026 · 34 citations
- OSVBench: Benchmarking LLMs on Specification Generation Tasks for Operating System VerificationShangyu Li, Juyong Jiang, Tiancheng Zhao, Jiasi ShenAAAI 2026 · 10 citations
- AlgoVeri: An Aligned Benchmark for Verified Code Generation on Classical AlgorithmsHaoyu Zhao, Ziran Yang, Jiawei Li, Deyuan Mike He et al.ICML 2026 · 8 citations
- ExVerus: Verus Proof Repair via Counterexample ReasoningJun Yang, Yuechun Sun, Yi Wu, Rodrigo Caridad et al.ICML 2026 · 3 citations
- Agentic Specification Generator for Move ProgramsYu-Fu Fu, Meng Xu, Taesoo KimASE 2025 · 1 citation
Builds on13
- Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
- Llemma: An Open Language Model for MathematicsZhangir Azerbayev, Hailey Schoelkopf, Keiran Paster, Marco Dos Santos et al.ICLR 2024 · 433 citations
- Is Self-Repair a Silver Bullet for Code Generation?Theo X. Olausson, Jeevana Priya Inala, Chenglong Wang, Jianfeng Gao et al.ICLR 2024 · 195 citations
- Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton et al.ICML 2023 · 128 citations
- Baldur: Whole-Proof Generation and Repair with Large Language ModelsEmily First, Markus N. Rabe, Talia Ringer, Yuriy BrunFSE 2023 · 89 citations
Related papers
- HarnessLLM: Rust Verification Harness Generation with Large Language ModelsMinghua Wang, Yuwei Liu, Lin HuangICSE 2026
- AutoVerus: Automated Proof Generation for Rust CodeChenyuan Yang, Xuheng Li, Md Rakib Hossain Misu, Jianan Yao et al.OOPSLA 2025 · 11 citations
- KaPilot: LLM-Assisted Generation of Kani Specifications for Unsafe Rust VerificationMinghua Wang, Yuxi Ling, Mingzhi Gao, Yuwei Liu et al.ISSTA 2026
- Can LLMs Reason Like Automated Theorem Provers for Rust Verification? VCoT-Bench: Evaluating via Verification Chain of ThoughtZichen Xie, Wenxi WangICML 2026
- Selene: Pioneering Automated Proof in Software VerificationLichen Zhang, Shuai Lu, Nan DuanACL 2024
