Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs
Ido Pinto, Yizhak Elboher, Haoze Wu, Nina Narodytska, Guy Katz
摘要
The synthesis of inductive loop invariants remains a critical bottleneck in automated program verification. While Large Language Models (LLMs) show promise in mitigating this issue, they often fail on complex programs, producing invariants that are invalid or computationally ineffective. Although fine-tuning is a natural strategy to address these limitations, obtaining high-quality training data remains an open challenge. We first formalize the properties required for a high-quality training invariant, and then present Wonda, a rigorous data curation pipeline that extracts such invariants from raw verifier output via AST-based normalization followed by LLM-driven semantic rewriting and augmentation with provable quality guarantees. Fine-tuning Small Language Models (SLMs) on Wonda-curated data yields consistent gains across the Qwen3, Llama-3.1, and Mistral families: the 4B and 8B Qwen3 models nearly double invariant correctness and double speedup rates, while Llama-3.1-8B triples both. On the challenging InvBench suite, the same 4B model outperforms an off-the-shelf model 20 its size and matches the end-to-end verification time of GPT-OSS-120B, while a 14B Qwen3 model matches that of the frontier model GPT-5.2, all without test-time compute overhead. Our code is publicly available on GitHub.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Ranking LLM-Generated Loop Invariants for Program Verification 引用了 Can Large Language Models Reason about Program Invariants?
- Lemur: Integrating Large Language Models in Automated Program Verification 引用了 Can Large Language Models Reason about Program Invariants?
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference 引用了 Ranking LLM-Generated Loop Invariants for Program Verification
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference 引用了 Lemur: Integrating Large Language Models in Automated Program Verification
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference 引用了 Can Large Language Models Reason about Program Invariants?
它引用的 Paper4
- Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton 等ICML 2023 · 128 次引用
- Lemur: Integrating Large Language Models in Automated Program VerificationHaoze Wu, Clark W. Barrett, Nina NarodytskaICLR 2024 · 67 次引用
- Ranking LLM-Generated Loop Invariants for Program VerificationSaikat Chakraborty, Shuvendu K. Lahiri, Sarah Fakhoury, Akash Lal 等EMNLP Findings 2023 · 36 次引用
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant InferenceGuangyuan Wu, Weining Cao, Yuan Yao, Hengfeng Wei 等ASE 2024 · 9 次引用
相关 Paper
- 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 次引用
- CraftRTL: High-quality Synthetic Data Generation for Verilog Code Models with Correct-by-Construction Non-Textual Representations and Targeted Code RepairMingjie Liu, Yun-Da Tsai, Wenfei Zhou, Haoxing RenICLR 2025
- LLM-Generated Invariants for Bounded Model Checking Without Loop UnrollingMuhammad A. A. Pirzada, Giles Reger, Ahmed Bhayat, Lucas C. CordeiroASE 2024 · 7 次引用
- Training LLMs for Optimization Modeling via Iterative Data Synthesis and Structured ValidationYang Wu, Yifan Zhang, Yurong Wu, Yuran Wang 等EMNLP Findings 2025 · 1 次引用
