AI
New Framework Tests Whether AI Models Can Write Reliable Formal Software Specifications
Researchers introduce Coins, an evaluation system that measures how well large language models generate formal program specifications—a critical bottleneck for formal verification adoption.
Large language models have recently made strides in theorem proving and verified code generation, but their actual capability to produce formal software specifications remains poorly understood. A new study from computer science researchers tackles this measurement problem head-on.
The Challenge: Evaluating Specification Quality#
Formal verification can guarantee software correctness, yet it rarely sees widespread adoption because writing precise formal specifications demands substantial expertise and effort. Prior attempts to measure whether AI systems can generate these specifications have relied on either confirming that implementations match their specs or proving semantic equivalence—approaches that are themselves so difficult they may confuse the complexity of verification with actual specification quality.
Introducing Coins: A Better Measurement Tool#
To overcome these limitations, researchers created Coins, a Rocq-based evaluation framework that takes a fundamentally different approach. Rather than attempting to verify full implementation-to-specification correctness, the system tests specification quality by applying them to trusted test cases and generating concrete proof obligations. This strategy reflects how formal reasoning actually works: when a proof succeeds, it provides solid evidence; when it fails, the results are ambiguous. By anchoring evaluation to test cases, the framework aligns with this asymmetry.
What the Research Found#
Using Coins to evaluate specifications for tasks from HumanEval alongside curated human-written Rocq specifications, the team conducted a large-scale assessment. The findings reveal that generating formal specifications remains genuinely difficult for language models, and that verification complexity can mask meaningful differences in specification quality.
Implications for Progress#
The research underscores an important insight: simply scaling up larger models may not be the path forward. Instead, developing more accurate methods for evaluating specifications—paired with test case-based formal reasoning—offers a clearer and more discriminative way to track real advances in AI-assisted specification synthesis.

