LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Xu, Dong, Cao, Jialun, Mo, Guozhao, Hu, Junjie, Wen, Cheng, Lin, Hongyu, Han, Xianpei, Qin, Shengchao, Tian, Cong, Cheung, Shing-Chi, Sun, Le, Lu, Yaojie
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917454362443776
author Xu, Dong
Cao, Jialun
Mo, Guozhao
Hu, Junjie
Wen, Cheng
Lin, Hongyu
Han, Xianpei
Qin, Shengchao
Tian, Cong
Cheung, Shing-Chi
Sun, Le
Lu, Yaojie
author_facet Xu, Dong
Cao, Jialun
Mo, Guozhao
Hu, Junjie
Wen, Cheng
Lin, Hongyu
Han, Xianpei
Qin, Shengchao
Tian, Cong
Cheung, Shing-Chi
Sun, Le
Lu, Yaojie
contents Formal specification is essential for rigorous program verification, yet writing correct specifications remains costly and difficult to automate. Although large language models (LLMs) and agents have shown promising progress, their true capabilities and failure modes remain unclear. We present the first systematic and contamination-aware study of LLM- and agent-based formal specification generation for C programs. We introduce LiveFMBench, a continuously evolving benchmark of 630 ACSL (ANSI/ISO C Specification Language)-annotated C programs, including 360 newly collected cases designed to mitigate data leakage. Using this benchmark, we evaluate direct prompting with different sampling sizes, reasoning-enabled (thinking mode) inference, the agentic pipeline, and perform a fine-grained failure analysis. Experimental results reveal that naive evaluation substantially overestimates performance because models under direct prompting may exhibit unfaithful behaviors, such as deceiving automated provers or ignoring code-context constraints; after excluding such cases, the true specification generation accuracy drops by approximately 20\%. We further find that both increased sampling and thinking mode significantly improve success rates, with smaller models benefiting more from thinking mode. Agentic pipelines are particularly effective under low sampling budgets and on harder datasets. Failure analysis further shows that incorrect loop invariants are the dominant error type, while agentic pipelines notably reduce assertion errors. These results expose fundamental limitations in current LLM-based approaches and suggest they remain far from replacing human-authored formal specifications. We release LiveFMBench at https://huggingface.co/datasets/fm-universe/Live-FM-Bench and all evaluation artifacts to support future research.
format Preprint
id arxiv_https___arxiv_org_abs_2605_01394
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation
Xu, Dong
Cao, Jialun
Mo, Guozhao
Hu, Junjie
Wen, Cheng
Lin, Hongyu
Han, Xianpei
Qin, Shengchao
Tian, Cong
Cheung, Shing-Chi
Sun, Le
Lu, Yaojie
Software Engineering
Artificial Intelligence
Formal specification is essential for rigorous program verification, yet writing correct specifications remains costly and difficult to automate. Although large language models (LLMs) and agents have shown promising progress, their true capabilities and failure modes remain unclear. We present the first systematic and contamination-aware study of LLM- and agent-based formal specification generation for C programs. We introduce LiveFMBench, a continuously evolving benchmark of 630 ACSL (ANSI/ISO C Specification Language)-annotated C programs, including 360 newly collected cases designed to mitigate data leakage. Using this benchmark, we evaluate direct prompting with different sampling sizes, reasoning-enabled (thinking mode) inference, the agentic pipeline, and perform a fine-grained failure analysis. Experimental results reveal that naive evaluation substantially overestimates performance because models under direct prompting may exhibit unfaithful behaviors, such as deceiving automated provers or ignoring code-context constraints; after excluding such cases, the true specification generation accuracy drops by approximately 20\%. We further find that both increased sampling and thinking mode significantly improve success rates, with smaller models benefiting more from thinking mode. Agentic pipelines are particularly effective under low sampling budgets and on harder datasets. Failure analysis further shows that incorrect loop invariants are the dominant error type, while agentic pipelines notably reduce assertion errors. These results expose fundamental limitations in current LLM-based approaches and suggest they remain far from replacing human-authored formal specifications. We release LiveFMBench at https://huggingface.co/datasets/fm-universe/Live-FM-Bench and all evaluation artifacts to support future research.
title LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2605.01394