Re:Form -- Reducing Human Priors in Scalable Formal Software Verification with RL in LLMs: A Preliminary Study on Dafny

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yan, Chuanhao, Che, Fengdi, Huang, Xuhan, Xu, Xu, Li, Xin, Li, Yizhi, Qu, Xingwei, Shi, Jingzhe, Lin, Chenghua, Yang, Yaodong, Yuan, Binhang, Zhao, Hang, Qiao, Yu, Zhou, Bowen, Fu, Jie
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915545415155712
author Yan, Chuanhao
Che, Fengdi
Huang, Xuhan
Xu, Xu
Li, Xin
Li, Yizhi
Qu, Xingwei
Shi, Jingzhe
Lin, Chenghua
Yang, Yaodong
Yuan, Binhang
Zhao, Hang
Qiao, Yu
Zhou, Bowen
Fu, Jie
author_facet Yan, Chuanhao
Che, Fengdi
Huang, Xuhan
Xu, Xu
Li, Xin
Li, Yizhi
Qu, Xingwei
Shi, Jingzhe
Lin, Chenghua
Yang, Yaodong
Yuan, Binhang
Zhao, Hang
Qiao, Yu
Zhou, Bowen
Fu, Jie
contents Existing informal language-based (e.g., human language) Large Language Models (LLMs) trained with Reinforcement Learning (RL) face a significant challenge: their verification processes, which provide crucial training signals, are neither reliable nor scalable. In fact, the prevalent large proprietary models could hardly generate verifiable programs. A promising yet largely uncharted alternative is formal language-based reasoning. Grounding LLMs in rigorous formal systems where generative models operate in formal language spaces (e.g., Dafny) enables the automatic and mathematically provable verification of their reasoning processes and outcomes. This capability is pivotal for achieving large-scale, reliable formal software verification. It is a common practice to employ human-annotated chain-of-thought and other human priors to induce the reasoning and coding capabilities of LLMs. Unfortunately, it becomes unacceptably all-consuming to provide such priors for supervising complex programming tasks. In this work, we systematically explore ways to reduce human priors with the formal language, Dafny, as the main environment for our pilot study. Our pipeline mainly relies on introducing an automatic and scalable data curation pipeline, and careful RL designs integrated with feedback from the formal language verifier. We introduce DafnyComp, a benchmark of compositional formal programs with auto-formalized specifications for specification reasoning. Our supervised fine-tuning (SFT) stage enables even small models (e.g., 0.5B) to generate syntactically valid and verifiable Dafny code, surpassing proprietary models. RL with regularization further improves performance, achieving stronger generalization to out-of-domain tasks and outperforming all strong baselines on the challenging DafnyComp benchmark.
format Preprint
id arxiv_https___arxiv_org_abs_2507_16331
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Re:Form -- Reducing Human Priors in Scalable Formal Software Verification with RL in LLMs: A Preliminary Study on Dafny
Yan, Chuanhao
Che, Fengdi
Huang, Xuhan
Xu, Xu
Li, Xin
Li, Yizhi
Qu, Xingwei
Shi, Jingzhe
Lin, Chenghua
Yang, Yaodong
Yuan, Binhang
Zhao, Hang
Qiao, Yu
Zhou, Bowen
Fu, Jie
Computation and Language
Existing informal language-based (e.g., human language) Large Language Models (LLMs) trained with Reinforcement Learning (RL) face a significant challenge: their verification processes, which provide crucial training signals, are neither reliable nor scalable. In fact, the prevalent large proprietary models could hardly generate verifiable programs. A promising yet largely uncharted alternative is formal language-based reasoning. Grounding LLMs in rigorous formal systems where generative models operate in formal language spaces (e.g., Dafny) enables the automatic and mathematically provable verification of their reasoning processes and outcomes. This capability is pivotal for achieving large-scale, reliable formal software verification. It is a common practice to employ human-annotated chain-of-thought and other human priors to induce the reasoning and coding capabilities of LLMs. Unfortunately, it becomes unacceptably all-consuming to provide such priors for supervising complex programming tasks. In this work, we systematically explore ways to reduce human priors with the formal language, Dafny, as the main environment for our pilot study. Our pipeline mainly relies on introducing an automatic and scalable data curation pipeline, and careful RL designs integrated with feedback from the formal language verifier. We introduce DafnyComp, a benchmark of compositional formal programs with auto-formalized specifications for specification reasoning. Our supervised fine-tuning (SFT) stage enables even small models (e.g., 0.5B) to generate syntactically valid and verifiable Dafny code, surpassing proprietary models. RL with regularization further improves performance, achieving stronger generalization to out-of-domain tasks and outperforming all strong baselines on the challenging DafnyComp benchmark.
title Re:Form -- Reducing Human Priors in Scalable Formal Software Verification with RL in LLMs: A Preliminary Study on Dafny
topic Computation and Language
url https://arxiv.org/abs/2507.16331