arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.15510cs.LG
收藏

并非所有不变式都同等重要:利用SLM通过精选训练数据加速程序验证

Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs

Hebrew University of Jerusalem, Israel(特拉维夫大学);Amherst College, USA(阿默斯特学院);VMware Research by Broadcom, USA(Broadcom VMware 研究)

Ido Pinto, Yizhak Yisrael Elboher, Haoze Wu, Nina Narodytska, Guy Katz

AI总结:

提出Wonda数据筛选流水线,通过AST归一化和LLM语义重写从原始验证器输出中提取高质量训练不变式,微调小语言模型(SLM)后,在多个模型上使不变式正确性和加速率翻倍甚至三倍,小模型性能媲美大模型。

摘要:

归纳循环不变式的合成仍然是自动程序验证中的关键瓶颈。虽然大型语言模型(LLM)在缓解这一问题上显示出潜力,但它们通常在复杂程序上失败,产生无效或计算效率低下的不变式。尽管微调是解决这些局限性的自然策略,但获取高质量训练数据仍然是一个开放的挑战。我们首先形式化了高质量训练不变式所需的属性,然后提出了Wonda,一个严格的数据筛选流水线,通过基于AST的归一化,随后进行LLM驱动的语义重写和具有可证明质量保证的增强,从原始验证器输出中提取此类不变式。在Wonda筛选的数据上微调小语言模型(SLM)在Qwen3、Llama-3.1和Mistral系列中取得了一致的提升:4B和8B的Qwen3模型几乎使不变式正确率翻倍,加速率翻倍,而Llama-3.1-8B则使两者都增加了两倍。在具有挑战性的InvBench基准测试中,相同的4B模型优于其20倍大小的现成模型,并匹配GPT-OSS-120B的端到端验证时间,而14B的Qwen3模型则匹配了前沿模型GPT-5.2的性能,所有这些都没有测试时的计算开销。我们的代码已在GitHub上公开。

英文摘要:

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 20x 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑