[Paper Review] Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languages
This paper proposes symbolic verification as an automated metric to evaluate the quality of user-intent formalization in verification-aware languages like Dafny and F*. By testing formal specifications against hidden test cases using symbolic execution, the method achieves strong alignment with human-annotated labels on the MBPP-DFY benchmark, demonstrating feasibility for benchmarking specification generation. The approach addresses limitations of prior LLM-based code mutation techniques in static verification contexts.
Verification-aware programming languages such as Dafny and F* provide means to formally specify and prove properties of a program. Although the problem of checking an implementation against a specification can be defined mechanically, there is no algorithmic way of ensuring the correctness of the {\it user-intent formalization for programs}, expressed as a formal specification. This is because intent or requirement is expressed {\it informally} in natural language and the specification is a formal artefact. Despite, the advent of large language models (LLMs) has made tremendous strides bridging the gap between informal intent and formal program implementations recently, driven in large parts by benchmarks and automated metrics for evaluation. Recent work has proposed a framework for evaluating the {\it user-intent formalization} problem for mainstream programming languages~\cite{endres-fse24}. However, such an approach does not readily extend to verification-aware languages that support rich specifications (using quantifiers and ghost variables) that cannot be evaluated through dynamic execution. Previous work also required generating program mutants using LLMs to create the benchmark. We advocate an alternate, perhaps simpler approach of {\it symbolically testing specifications} to provide an intuitive metric for evaluating the quality of specifications for verification-aware languages. We demonstrate that our automated metric agrees closely on a human-labeled dataset of Dafny specifications for the popular MBPP code-generation benchmark, yet demonstrates cases where the human labeling is not perfect. We also outline formal verification challenges that need to be addressed to apply the technique more widely. We believe our work provides a stepping stone to enable the establishment of a benchmark and research agenda for the problem of user-intent formalization for programs.
Motivation & Objective
- To address the lack of automated evaluation metrics for user-intent formalization in verification-aware languages such as Dafny and F*.
- To overcome the limitations of prior benchmarks based on code mutation and dynamic testing, which do not apply to languages with rich static specifications.
- To establish a scalable, automated benchmarking framework for evaluating formal specifications derived from informal natural language intent.
- To enable future research in specification generation by providing a reliable, formal metric grounded in symbolic verification.
Proposed method
- Using symbolic execution to test formal specifications against a set of hidden validation test cases, treating verification as a form of symbolic testing.
- Applying the verification process as an automated metric to assess specification correctness and completeness, analogous to test-based evaluation in code generation.
- Leveraging existing test suites from the MBPP-DFY benchmark to evaluate Dafny specifications without requiring dynamic execution.
- Validating the metric by comparing its results against a human-labeled dataset of Dafny specifications, showing high agreement.
- Identifying and addressing challenges such as quantifier instantiation and ghost variable management in symbolic verification.
- Proposing a prototype implementation to demonstrate feasibility and scalability across a range of verification-aware language constructs.
Experimental results
Research questions
- RQ1Can symbolic verification serve as a reliable, automated metric for evaluating the quality of formal specifications generated from informal user intent in verification-aware languages?
- RQ2How well does the proposed symbolic verification metric align with human-annotated labels of specification quality on real-world benchmarks?
- RQ3Why do prior LLM-based code mutation and test-based evaluation techniques fail to generalize to verification-aware languages with rich specification logics?
- RQ4What are the key challenges in scaling symbolic verification for specification evaluation, particularly regarding quantifier instantiation and ghost state management?
- RQ5Can this approach form the foundation of a standardized benchmark for user-intent formalization in formal verification?
Key findings
- The symbolic verification metric shows strong agreement with human-annotated labels on the MBPP-DFY dataset, indicating high reliability for specification evaluation.
- The method successfully evaluates both correctness and completeness of specifications without relying on dynamic execution or code mutation.
- The approach identifies cases where human labeling is inconsistent, suggesting that symbolic verification can detect ambiguities in human-annotated specifications.
- Quantifier instantiation and ghost variable management emerge as critical challenges that require further automation to scale the method.
- The framework demonstrates feasibility for creating a standardized benchmark for specification generation in verification-aware languages.
- The results suggest that symbolic verification can serve as a scalable, formal alternative to test-based metrics in specification evaluation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.