mlsanityData to 7 Oct 2026

SpecGen: Automated Generation of Formal Program Specifications via Large Language Models

arXiv 2401.08807 ↗First posted 16 Jan 2024cs.SEcited by 51

Not on the map. Why?

Abstract (arXiv)

Formal program specifications play a crucial role in various stages of software development. However, manually crafting formal program specifications is rather difficult, making the job time-consuming and labor-intensive. It is even more challenging to write specifications that correctly and comprehensively describe the semantics of complex programs. To reduce the burden on software developers, automated specification generation methods have emerged. However, existing methods usually rely on predefined templates or grammar, making them struggle to accurately describe the behavior and functionality of complex real-world programs. To tackle this challenge, we introduce SpecGen, a novel technique for formal program specification generation based on Large Language Models. Our key insight is to overcome the limitations of existing methods by leveraging the code comprehension capability of LLMs. The process of SpecGen consists of two phases. The first phase employs a conversational approach that guides the LLM to generate appropriate specifications for a given program. The second phase, designed for where the LLM fails to generate correct specifications, applies four mutation operators to the model-generated specifications and selects verifiable specifications from the mutated ones through a novel heuristic selection strategy. We evaluate SpecGen on two datasets, including the SV-COMP Java category benchmark and a manually constructed dataset. Experimental results demonstrate that SpecGen succeeds in generating verifiable specifications for 279 out of 385 programs, outperforming the existing purely LLM-based approaches and conventional specification generation tools like Houdini and Daikon. Further investigations on the quality of generated specifications indicate that SpecGen can comprehensively articulate the behaviors of the input program.

Key facts. Cited by 51 papers in the map (data through 7 Oct 2026). First posted on arXiv 16 Jan 2024.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 6; 2025: 18; 2026: 27.

51 papers.

Sort:

By area:

  1. 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 173
  2. 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 85
  3. 2024SpecRover: Code Intent Extraction via LLMscited by 71
  4. 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
  5. 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
  6. 2024The Fusion of Large Language Models and Formal Methods for Trustworthy AI Agents: A Roadmapcited by 20
  7. 2025Autoformalization in the Era of Large Language Models: A Surveycited by 19
  8. 2025ClassInvGen: Class Invariant Synthesis using Large Language Modelscited by 11
  9. 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunitiescited by 7
  10. 2025Beyond Correctness: Exposing LLM-generated Logical Flaws in Reasoning via Multi-step Automated Theorem Provingcited by 6
  11. 2026Specification-Based Code-Text-Code Reengineering for LLM-Mediated Software Evolutioncited by 5
  12. 2025EditLord: Learning Code Transformation Rules for Code Editingcited by 4
38 more
  1. 2025Requirements Development and Formalization for Reliable Code Generation: A Multi-Agent Visioncited by 3
  2. 2025Agentic Specification Generator for Move Programscited by 3
  3. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  4. 2025FormalSpecCpp: A Dataset of C++ Formal Specifications created using LLMscited by 2
  5. 2025Formalising Software Requirements using Large Language Modelscited by 2
  6. 2025SysMoBench: Evaluating AI on Formally Modeling Complex Real-World Systemscited by 2
  7. 2025Evaluating Program Semantics Reasoning with Type Inference in System Fcited by 2
  8. 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
  9. 2026Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Inductioncited by 2
  10. 2026FormalJudge: A Neuro-Symbolic Paradigm for Agentic Oversightcited by 2
  11. 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specificationscited by 2
  12. 2026CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generationcited by 2
  13. 2025Goal2Story: A Multi-Agent Fleet based on Privately Enabled sLLMs for Impacting Mapping on Requirements Elicitationcited by 1
  14. 2025Proof2Silicon: Prompt Repair for Verified Code and Hardware Generation via Reinforcement Learningcited by 1
  15. 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Frameworkcited by 1
  16. 2026ModelWisdom: An Integrated Toolkit for TLA+ Model Visualization, Digest and Repaircited by 1
  17. 2026Can LLM Aid in Solving Constraints with Inductive Definitions?cited by 1
  18. 2026Intent-aligned Formal Specification Synthesis via Traceable Refinementcited by 1
  19. 2026Can LLMs Write Correct TLA+ Specifications? Evaluating Natural-Language-to-TLA+ Generationcited by 1
  20. 2026Brick-DICL: Dynamic In-Context Learning for Automated Brick Schema Classificationcited by 1
  21. 2025Working Document -- Formalising Software Requirements with Large Language Modelscited by 0
  22. 2025From Benchmark Data To Applicable Program Repair: An Experience Reportcited by 0
  23. 2025A Neurosymbolic Approach to Loop Invariant Generation via Weakest Precondition Reasoningcited by 0
  24. 2026AutoFlows++: Hierarchical Message Flow Mining for System on Chip Designscited by 0
  25. 2026LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generationcited by 0
  26. 2026Natural Language based Specification and Verificationcited by 0
  27. 2026BODHI: Precise OS Kernel Specification Inferencecited by 0
  28. 2026Agentic Separation Logic Specification Synthesiscited by 0
  29. 2026Code-Augur: Agentic Vulnerability Detection via Specification Inferencecited by 0
  30. 2026Analyzing the Narration Gap in LLM-Solver Loopscited by 0
  31. 2026AutoACSL: Synthesizing ACSL Specifications by Integrating LLMs with CPG-Based Static Analysiscited by 0
  32. 2026Diversifying to Verify: When Task-Equivalent Programs Differ in Verifiabilitycited by 0
  33. 2026Faithful Autoformalization of Natural Language Assertionscited by 0
  34. 2026How Well Can AI Generate Backlogs from App Mockups?cited by 0
  35. 2026Specula: Scaling formal specifications for autonomous model checking of system codecited by 0
  36. 2026SkillSpec: Intent-Masked Specification Reasoning for Agent Skill Correctnesscited by 0
  37. 2026OSFoundry: Building and Evolving Operating Systems with Specification-Guided Agentscited by 0
  38. 2026From Verification Failures to Reusable Guidance for Coding Agentscited by 0

50 most cited of 51 All 51 (JSON)