Skip to main content
QUICK REVIEW

[论文解读] Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs

Ido Pinto, Yizhak Yisrael Elboher|arXiv (Cornell University)|Mar 16, 2026
Logic, programming, and type systemsComputer Science被引用 0
一句话总结

论文提出 Wonda,这是一个数据整理管线,可将嘈杂的验证器生成的不变量转化为高质量的微调信号,显著提升小型语言模型在困难实例上的验证性能。

ABSTRACT

The synthesis of inductive loop invariants is a critical bottleneck in automated program verification. While Large Language Models (LLMs) show promise in mitigating this issue, they often fail on hard instances, generating invariants that are invalid or computationally ineffective. While fine-tuning is a natural route to mitigate this limitation, obtaining high-quality training data for invariant generation remains an open challenge. We present a rigorous data curation pipeline designed to extract high-quality training signals from raw verifier-generated invariants. First, we formalize the properties required for a high-quality training invariant. Second, we propose Wonda, a pipeline that refines noisy data via AST-based normalization, followed by LLM-driven semantic rewriting and augmentation with provable quality guarantees. We demonstrate that fine-tuning Small Language Models (SLMs) on this curated dataset result in consistent and significant performance gain. In particular, a fine-tuned 4B parameter model matches the utility of a GPT-OSS-120B baseline and approaches the state-of-the-art GPT-5.2, without incurring reasoning-time overhead. On challenging instances from the recent InvBench evaluation suite, our approach doubles the invariant correctness and speedup rates of base models; and improves their Virtual Best Performance (VBP) rates on the verification task by up to 14.2%.

研究动机与目标

  • 为程序验证中的高质量训练不变量 formalize 要求。
  • 设计并验证一个数据整理管线(Wonda),将嘈杂的验证输出转化为可学习的训练信号。
  • 证明在精选数据上对小型语言模型(SLMs)进行微调能提升不变量生成性能。
  • 在多种基础模型和基准套件上评估,以量化加速和正确性提升。

提出的方法

  • 将非退化、正确、有用、紧凑的不变量设为训练目标。
  • 以 UAutomizer 生成的验证器不变量为训练数据基础,并应用基于 AST 的归一化以规范化结构。
  • 通过一个由大语言模型驱动的语义重写步骤,产生紧凑、可解释的不变量候选项。
  • 用形式化验证工具验证变换后不变量的正确性和充分性。
  • 引入质量分级机制,对平行正确性和充分性检查的黄金样本进行筛选(Q ≥ 2)。
  • 在 V2 数据集(7,283 条样本)上对 SLM 微调进行评估,并通过组合/虚拟最佳性能(VBP)框架与大模型比较。

实验结果

研究问题

  • RQ1高质量的训练数据是否能在超越原始求解器输出的情况下改善 SLM 的不变量生成?
  • RQ2哪些数据整理方法(归一化和语义简化)最能提升不变量的可学习性与实用性?
  • RQ3在精选数据上微调的 SLM 是否在困难基准上与大型 LLMs 的验证性能相当?
  • RQ4在 LLM 与符号验证器并行运行时,虚拟最佳性能(VBP)指标如何揭示实际收益?

主要发现

  • 经过精心 curate 的数据管线(Wonda)可显著提升对不变量生成的微调 SLM 的性能。
  • 在 Wonda 数据上微调的 4B 参数 SLM 的效用与 GPT-OSS-120B 相当,并在验证任务中接近 GPT-5.2,且无额外推理时间开销。
  • 在 InvBench 的困难实例上,微调模型使不变量正确性和加速比相对于基线提升双倍。
  • VBP(基于组合的)结果显示显著的实际时间改进,在若干情形下减少了 12–20 秒的等待时间。
  • 在多种模型规模下,带有 V2 数据的 QL SLM 明显优于 V0/V1 对应版本(如 Qwen3-4B-V2:正确率 44.4% 对 22.8%;加速 24.7% 对 11.1%)。
  • 大型模型基线(GPT-5.2、GPT-OSS-120B)在 VBP 中仍具竞争力,但在考虑推理时延时后,V2 训练的 4B 模型呈现可比的端到端性能。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。