AutoReSpec: A Framework for Generating Specification using Large Language Models
Ragib Shahariar Ayon, Shibbir Ahmed

TL;DR
AutoReSpec is a dynamic, collaborative framework that leverages multiple LLMs and adaptive prompting to generate verifiable software specifications more accurately and efficiently.
Contribution
It introduces a two-stage, adaptive approach combining open and closed-source LLMs with feedback mechanisms for improved specification generation.
Findings
Achieves 67 successful specifications out of 72 programs.
Outperforms prior methods like SpecGen and FormalBench in success rate and completeness.
Reduces evaluation time by 26.89% on average.
Abstract
Formal specification generation has recently drawn attention in software engineering as a way to improve program correctness without requiring manual annotations. Large Language Models (LLMs) have shown promise in this area, but early results reveal several limitations. Generated specifications often fail verification due to syntax errors, logical inaccuracies, or incomplete reasoning, especially in programs with loops or branching logic. Techniques like SpecGen and FormalBench attempt to address this through prompting and benchmarking, but they typically rely on static prompts and do not offer mechanisms for recovering from failure or adapting to different program structures. In this paper, we present AutoReSpec, a collaborative framework that combines open and closed-source LLMs for verifiable specification generation. AutoReSpec dynamically chooses an LLM pair and prompt…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
