Metraipolis › archive › dc_52631f50a29c
Are LLM-Generated Formal Specifications Faithful to Their Requirements? A Study on Bimodal Formal Specification Generation — arXiv:2610.32053
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.32053
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-26T20:15:34.552Z
- SHA-256 of the archived text
76f608b1c97f997cb7aa3365acb55745d7d74c4cc8c13adfa4c5564e03ad8922- Stable URL of this page
https://metraipolis.com/documento/dc_52631f50a29c
How to cite
Are LLM-Generated Formal Specifications Faithful to Their Requirements? A Study on Bimodal Formal Specification Generation — arXiv:2610.32053 — arXiv (en), https://arxiv.org/abs/2610.32053 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_52631f50a29c (Metraipolis archive dc_52631f50a29c, sha256 76f608b1c97f997cb7aa3365acb55745d7d74c4cc8c13adfa4c5564e03ad8922)
BibTeX
@misc{dc52631f50a29c,
title = {Are LLM-Generated Formal Specifications Faithful to Their Requirements? A Study on Bimodal Formal Specification Generation — arXiv:2610.32053},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.32053},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_52631f50a29c; sha256 76f608b1c97f997cb7aa3365acb55745d7d74c4cc8c13adfa4c5564e03ad8922},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.32053. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Formal specification generation is a critical step towards formal verification and correctness assurance of software. Recently, large language models have been widely adopted in automatic generation of formal specifications. However, existing LLM-based specification generation approaches often assume that the input program is correct, which deviates from the real purpose of formal verification---to figure out whether the program meets its requirements when its correctness is unknown. Therefore, we conduct an empirical study of LLM-based specification generation under the bimodal setting: given both the natural language requirement and its corresponding code implementation, whose correctness is unknown. We construct a benchmark of 1,403 C programs and evaluate ACSL specification generation with Frama-C verification. Our study reaches several interesting findings: first, when the code implementation is correct, providing the natural language requirement does not further improve the pass rate of generated specifications. Second, when the code implementation is incorrect, LLM-based specification generation may erroneously pass verification by producing weak or implementation-misled specifications, and this cannot be fully alleviated by advanced prompting approaches. Compared with the non-formal HoarePrompt approach, LLM-generated formal specifications are less effective in predicting requirement-code consistency. Our study takes a first look at applying LLM-based formal specification generation to verifying program correctness against requirements, and points to requirement-faithful specification generation as a new direction for future LLM-based formal specification research. Tema degli esploratori: calcolo e infrastrutture (elenco arXiv cs.SE, nuovi lavori del giorno). Categorie arXiv: Software Engineering (cs.SE) ; Programming Languages (cs.PL). Pagina del lavoro: https://arxiv.org/abs/2610.32053 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-26T19:49:18.356Z dalla pagina https://arxiv.org/list/cs.SE/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).